@erdoai/ui 0.1.43 → 0.1.45
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/dist/index.cjs +8 -8
- package/dist/index.d.cts +25 -20
- package/dist/index.d.ts +25 -20
- package/dist/index.js +8 -8
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1218,50 +1218,55 @@ interface DownloadButtonNodeContent {
|
|
|
1218
1218
|
interface SuggestionsNodeContent {
|
|
1219
1219
|
suggestions?: string[];
|
|
1220
1220
|
}
|
|
1221
|
-
/**
|
|
1222
|
-
declare function
|
|
1223
|
-
/**
|
|
1224
|
-
declare function
|
|
1225
|
-
/**
|
|
1226
|
-
declare function
|
|
1227
|
-
/**
|
|
1228
|
-
declare function
|
|
1229
|
-
/**
|
|
1230
|
-
declare function
|
|
1231
|
-
/**
|
|
1232
|
-
declare const
|
|
1221
|
+
/** Chart node renderer - fetches data via DatasetChart */
|
|
1222
|
+
declare function ChartNode({ node, invocationId }: NodeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
1223
|
+
/** Table node renderer - fetches data via DatasetTable */
|
|
1224
|
+
declare function TableNode({ node, className, invocationId }: NodeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
1225
|
+
/** TextMarkdown node renderer */
|
|
1226
|
+
declare function TextMarkdownNode({ node, className }: NodeRendererProps): react_jsx_runtime.JSX.Element;
|
|
1227
|
+
/** DownloadButton node renderer */
|
|
1228
|
+
declare function DownloadButtonNode({ node, className, invocationId }: NodeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
1229
|
+
/** Suggestions node renderer */
|
|
1230
|
+
declare function SuggestionsNode({ node, onSuggestionClick }: NodeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
1231
|
+
/** Node components map */
|
|
1232
|
+
declare const nodeComponents: Record<string, React__default.ComponentType<NodeRendererProps>>;
|
|
1233
1233
|
interface UIGenerationNodesProps {
|
|
1234
1234
|
/** Array of UI nodes to render */
|
|
1235
1235
|
nodes: unknown[];
|
|
1236
1236
|
/** Optional class name for styling */
|
|
1237
1237
|
className?: string;
|
|
1238
|
-
/** Invocation ID for
|
|
1238
|
+
/** Invocation ID for data fetching - required for charts and tables to display data */
|
|
1239
1239
|
invocationId?: string;
|
|
1240
1240
|
/** Callback when a suggestion is clicked */
|
|
1241
1241
|
onSuggestionClick?: (suggestion: string) => void;
|
|
1242
|
-
/** Override
|
|
1243
|
-
|
|
1242
|
+
/** Override node renderers by type */
|
|
1243
|
+
customNodeComponents?: Record<string, React__default.ComponentType<NodeRendererProps>>;
|
|
1244
1244
|
}
|
|
1245
1245
|
/**
|
|
1246
1246
|
* Renders UI generation nodes with support for custom node renderers.
|
|
1247
1247
|
*
|
|
1248
|
+
* The default renderers use DatasetChart and DatasetTable which fetch data
|
|
1249
|
+
* automatically via the ErdoProvider. This requires:
|
|
1250
|
+
* 1. ErdoProvider to be set up with a dataFetcher
|
|
1251
|
+
* 2. invocationId to be provided
|
|
1252
|
+
*
|
|
1248
1253
|
* @example
|
|
1249
1254
|
* ```tsx
|
|
1250
|
-
* // Using default renderers
|
|
1255
|
+
* // Using default renderers (charts/tables fetch data automatically)
|
|
1251
1256
|
* <UIGenerationNodes nodes={content.children} invocationId={id} />
|
|
1252
1257
|
*
|
|
1253
|
-
* // With custom
|
|
1258
|
+
* // With custom renderers
|
|
1254
1259
|
* <UIGenerationNodes
|
|
1255
1260
|
* nodes={content.children}
|
|
1256
1261
|
* invocationId={id}
|
|
1257
|
-
*
|
|
1262
|
+
* customNodeComponents={{
|
|
1258
1263
|
* Chart: MyCustomChartNode,
|
|
1259
1264
|
* Table: MyCustomTableNode,
|
|
1260
1265
|
* }}
|
|
1261
1266
|
* />
|
|
1262
1267
|
* ```
|
|
1263
1268
|
*/
|
|
1264
|
-
declare function UIGenerationNodes({ nodes, className, invocationId, onSuggestionClick,
|
|
1269
|
+
declare function UIGenerationNodes({ nodes, className, invocationId, onSuggestionClick, customNodeComponents, }: UIGenerationNodesProps): react_jsx_runtime.JSX.Element | null;
|
|
1265
1270
|
|
|
1266
1271
|
interface ZoomState {
|
|
1267
1272
|
refAreaLeft: number | null;
|
|
@@ -1584,4 +1589,4 @@ declare function handleIncrementalMixedJsonParsing(outputContent: MessageContent
|
|
|
1584
1589
|
*/
|
|
1585
1590
|
declare function handleSSEEvent(eventType: string, event: SSEEventData, path: string[], threadID: string, activeMessagesByID: Record<string, MessageWithContents>, currentEntity?: Entity | null, parents?: Entity[], entityIds?: Record<string, string>): Entity | null;
|
|
1586
1591
|
|
|
1587
|
-
export { BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, type ChartNodeContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, type DatasetDetails, DatasetDownload, type DatasetDownloadProps, DatasetTable, type DatasetTableProps,
|
|
1592
|
+
export { BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, ChartNode, type ChartNodeContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, type DatasetDetails, DatasetDownload, type DatasetDownloadProps, DatasetTable, type DatasetTableProps, DownloadButtonNode, type DownloadButtonNodeContent, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErdoUI, type ErdoUIProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, HeatmapChart, InvocationEvent, type InvocationEventProps, InvocationEvents, type InvocationEventsProps, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Loader, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, type NodeRendererProps, type NullString, Output, type OutputContent, type OutputProps, type OutputWithContents, PieChart, type ResolvedBotInvocation, type ResultHandler, type SSEEventData, ScatterChart, type SpinnerStatus, SqlContent, type SqlContentProps, type Status, type StatusEvent, StatusSpinner, type StatusSpinnerProps, StderrText, StdoutText, StdwarnText, type Step, StepInvocation, type StepInvocationProps, StepInvocationStatus, type StepInvocationStatusProps, SuggestionsNode, type SuggestionsNodeContent, TableContent, type TableContentProps, TableNode, type TableNodeContent, TextContent, type TextContentProps, TextMarkdownNode, type TextMarkdownNodeContent, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, UIGenerationNodes, type UIGenerationNodesProps, type UINode, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, cn, extractContentItems, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isNullString, isParsingComplete, isParsingInProgress, isWhitespaceChar, nodeComponents, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, unwrapNullString, unwrapNullStringOr, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useMultipleDatasetContents, useThread };
|
package/dist/index.d.ts
CHANGED
|
@@ -1218,50 +1218,55 @@ interface DownloadButtonNodeContent {
|
|
|
1218
1218
|
interface SuggestionsNodeContent {
|
|
1219
1219
|
suggestions?: string[];
|
|
1220
1220
|
}
|
|
1221
|
-
/**
|
|
1222
|
-
declare function
|
|
1223
|
-
/**
|
|
1224
|
-
declare function
|
|
1225
|
-
/**
|
|
1226
|
-
declare function
|
|
1227
|
-
/**
|
|
1228
|
-
declare function
|
|
1229
|
-
/**
|
|
1230
|
-
declare function
|
|
1231
|
-
/**
|
|
1232
|
-
declare const
|
|
1221
|
+
/** Chart node renderer - fetches data via DatasetChart */
|
|
1222
|
+
declare function ChartNode({ node, invocationId }: NodeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
1223
|
+
/** Table node renderer - fetches data via DatasetTable */
|
|
1224
|
+
declare function TableNode({ node, className, invocationId }: NodeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
1225
|
+
/** TextMarkdown node renderer */
|
|
1226
|
+
declare function TextMarkdownNode({ node, className }: NodeRendererProps): react_jsx_runtime.JSX.Element;
|
|
1227
|
+
/** DownloadButton node renderer */
|
|
1228
|
+
declare function DownloadButtonNode({ node, className, invocationId }: NodeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
1229
|
+
/** Suggestions node renderer */
|
|
1230
|
+
declare function SuggestionsNode({ node, onSuggestionClick }: NodeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
1231
|
+
/** Node components map */
|
|
1232
|
+
declare const nodeComponents: Record<string, React__default.ComponentType<NodeRendererProps>>;
|
|
1233
1233
|
interface UIGenerationNodesProps {
|
|
1234
1234
|
/** Array of UI nodes to render */
|
|
1235
1235
|
nodes: unknown[];
|
|
1236
1236
|
/** Optional class name for styling */
|
|
1237
1237
|
className?: string;
|
|
1238
|
-
/** Invocation ID for
|
|
1238
|
+
/** Invocation ID for data fetching - required for charts and tables to display data */
|
|
1239
1239
|
invocationId?: string;
|
|
1240
1240
|
/** Callback when a suggestion is clicked */
|
|
1241
1241
|
onSuggestionClick?: (suggestion: string) => void;
|
|
1242
|
-
/** Override
|
|
1243
|
-
|
|
1242
|
+
/** Override node renderers by type */
|
|
1243
|
+
customNodeComponents?: Record<string, React__default.ComponentType<NodeRendererProps>>;
|
|
1244
1244
|
}
|
|
1245
1245
|
/**
|
|
1246
1246
|
* Renders UI generation nodes with support for custom node renderers.
|
|
1247
1247
|
*
|
|
1248
|
+
* The default renderers use DatasetChart and DatasetTable which fetch data
|
|
1249
|
+
* automatically via the ErdoProvider. This requires:
|
|
1250
|
+
* 1. ErdoProvider to be set up with a dataFetcher
|
|
1251
|
+
* 2. invocationId to be provided
|
|
1252
|
+
*
|
|
1248
1253
|
* @example
|
|
1249
1254
|
* ```tsx
|
|
1250
|
-
* // Using default renderers
|
|
1255
|
+
* // Using default renderers (charts/tables fetch data automatically)
|
|
1251
1256
|
* <UIGenerationNodes nodes={content.children} invocationId={id} />
|
|
1252
1257
|
*
|
|
1253
|
-
* // With custom
|
|
1258
|
+
* // With custom renderers
|
|
1254
1259
|
* <UIGenerationNodes
|
|
1255
1260
|
* nodes={content.children}
|
|
1256
1261
|
* invocationId={id}
|
|
1257
|
-
*
|
|
1262
|
+
* customNodeComponents={{
|
|
1258
1263
|
* Chart: MyCustomChartNode,
|
|
1259
1264
|
* Table: MyCustomTableNode,
|
|
1260
1265
|
* }}
|
|
1261
1266
|
* />
|
|
1262
1267
|
* ```
|
|
1263
1268
|
*/
|
|
1264
|
-
declare function UIGenerationNodes({ nodes, className, invocationId, onSuggestionClick,
|
|
1269
|
+
declare function UIGenerationNodes({ nodes, className, invocationId, onSuggestionClick, customNodeComponents, }: UIGenerationNodesProps): react_jsx_runtime.JSX.Element | null;
|
|
1265
1270
|
|
|
1266
1271
|
interface ZoomState {
|
|
1267
1272
|
refAreaLeft: number | null;
|
|
@@ -1584,4 +1589,4 @@ declare function handleIncrementalMixedJsonParsing(outputContent: MessageContent
|
|
|
1584
1589
|
*/
|
|
1585
1590
|
declare function handleSSEEvent(eventType: string, event: SSEEventData, path: string[], threadID: string, activeMessagesByID: Record<string, MessageWithContents>, currentEntity?: Entity | null, parents?: Entity[], entityIds?: Record<string, string>): Entity | null;
|
|
1586
1591
|
|
|
1587
|
-
export { BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, type ChartNodeContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, type DatasetDetails, DatasetDownload, type DatasetDownloadProps, DatasetTable, type DatasetTableProps,
|
|
1592
|
+
export { BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, ChartNode, type ChartNodeContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, type DatasetDetails, DatasetDownload, type DatasetDownloadProps, DatasetTable, type DatasetTableProps, DownloadButtonNode, type DownloadButtonNodeContent, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErdoUI, type ErdoUIProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, HeatmapChart, InvocationEvent, type InvocationEventProps, InvocationEvents, type InvocationEventsProps, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Loader, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, type NodeRendererProps, type NullString, Output, type OutputContent, type OutputProps, type OutputWithContents, PieChart, type ResolvedBotInvocation, type ResultHandler, type SSEEventData, ScatterChart, type SpinnerStatus, SqlContent, type SqlContentProps, type Status, type StatusEvent, StatusSpinner, type StatusSpinnerProps, StderrText, StdoutText, StdwarnText, type Step, StepInvocation, type StepInvocationProps, StepInvocationStatus, type StepInvocationStatusProps, SuggestionsNode, type SuggestionsNodeContent, TableContent, type TableContentProps, TableNode, type TableNodeContent, TextContent, type TextContentProps, TextMarkdownNode, type TextMarkdownNodeContent, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, UIGenerationNodes, type UIGenerationNodesProps, type UINode, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, cn, extractContentItems, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isNullString, isParsingComplete, isParsingInProgress, isWhitespaceChar, nodeComponents, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, unwrapNullString, unwrapNullStringOr, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useMultipleDatasetContents, useThread };
|