@erdoai/ui 0.1.27 → 0.1.30
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 +36 -19
- package/dist/index.cjs +12 -7
- package/dist/index.d.cts +35 -22
- package/dist/index.d.ts +35 -22
- package/dist/index.js +12 -7
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -785,27 +785,6 @@ interface ContentProps {
|
|
|
785
785
|
*/
|
|
786
786
|
components?: Record<string, React__default.ComponentType<any>>;
|
|
787
787
|
}
|
|
788
|
-
/**
|
|
789
|
-
* Routes content to the appropriate renderer based on content_type and ui_content_type.
|
|
790
|
-
*
|
|
791
|
-
* This is the main entry point for rendering content items from Erdo bot invocations.
|
|
792
|
-
* It checks for custom component overrides first, then falls back to built-in renderers.
|
|
793
|
-
*
|
|
794
|
-
* @example
|
|
795
|
-
* ```tsx
|
|
796
|
-
* // Basic usage - uses built-in renderers
|
|
797
|
-
* <Content content={contentItem} />
|
|
798
|
-
*
|
|
799
|
-
* // With custom overrides
|
|
800
|
-
* <Content
|
|
801
|
-
* content={contentItem}
|
|
802
|
-
* components={{
|
|
803
|
-
* 'bot_invocation': MyBotInvocation,
|
|
804
|
-
* 'authorize_integration': AuthorizeIntegration,
|
|
805
|
-
* }}
|
|
806
|
-
* />
|
|
807
|
-
* ```
|
|
808
|
-
*/
|
|
809
788
|
declare function Content({ content, className, components }: ContentProps): react_jsx_runtime.JSX.Element | null;
|
|
810
789
|
|
|
811
790
|
interface ErdoUIProps {
|
|
@@ -1395,6 +1374,40 @@ declare function formatValue(value: any, format?: string | null, valueType?: 'nu
|
|
|
1395
1374
|
*/
|
|
1396
1375
|
declare function parseToDate(value: any): Date | null;
|
|
1397
1376
|
|
|
1377
|
+
/**
|
|
1378
|
+
* Utilities for handling NullString wrapper types from the backend.
|
|
1379
|
+
*
|
|
1380
|
+
* The backend sends nullable strings in the format: { String: "value", Valid: true }
|
|
1381
|
+
* These utilities help unwrap them to plain strings.
|
|
1382
|
+
*/
|
|
1383
|
+
interface NullString {
|
|
1384
|
+
String: string;
|
|
1385
|
+
Valid: boolean;
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Check if a value is a NullString wrapper.
|
|
1389
|
+
*/
|
|
1390
|
+
declare function isNullString(value: unknown): value is NullString;
|
|
1391
|
+
/**
|
|
1392
|
+
* Unwrap a value that may be a NullString wrapper from the backend.
|
|
1393
|
+
* Returns the string value if valid, undefined otherwise.
|
|
1394
|
+
*
|
|
1395
|
+
* @example
|
|
1396
|
+
* unwrapNullString("hello") // "hello"
|
|
1397
|
+
* unwrapNullString({ String: "hello", Valid: true }) // "hello"
|
|
1398
|
+
* unwrapNullString({ String: "", Valid: false }) // undefined
|
|
1399
|
+
* unwrapNullString(undefined) // undefined
|
|
1400
|
+
*/
|
|
1401
|
+
declare function unwrapNullString(value: unknown): string | undefined;
|
|
1402
|
+
/**
|
|
1403
|
+
* Unwrap a NullString with a default value.
|
|
1404
|
+
*
|
|
1405
|
+
* @example
|
|
1406
|
+
* unwrapNullStringOr({ String: "", Valid: false }, "default") // "default"
|
|
1407
|
+
* unwrapNullStringOr({ String: "hello", Valid: true }, "default") // "hello"
|
|
1408
|
+
*/
|
|
1409
|
+
declare function unwrapNullStringOr(value: unknown, defaultValue: string): string;
|
|
1410
|
+
|
|
1398
1411
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1399
1412
|
|
|
1400
1413
|
/**
|
|
@@ -1482,4 +1495,4 @@ declare function handleIncrementalMixedJsonParsing(outputContent: MessageContent
|
|
|
1482
1495
|
*/
|
|
1483
1496
|
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;
|
|
1484
1497
|
|
|
1485
|
-
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, 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, 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, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, 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, StreamingLoader, TableContent, type TableContentProps, TextContent, type TextContentProps, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, cn, extractContentItems, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isParsingComplete, isParsingInProgress, isWhitespaceChar, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useMultipleDatasetContents, useThread };
|
|
1498
|
+
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, 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, 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, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, 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, StreamingLoader, TableContent, type TableContentProps, TextContent, type TextContentProps, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, cn, extractContentItems, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isNullString, isParsingComplete, isParsingInProgress, isWhitespaceChar, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, unwrapNullString, unwrapNullStringOr, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useMultipleDatasetContents, useThread };
|
package/dist/index.d.ts
CHANGED
|
@@ -785,27 +785,6 @@ interface ContentProps {
|
|
|
785
785
|
*/
|
|
786
786
|
components?: Record<string, React__default.ComponentType<any>>;
|
|
787
787
|
}
|
|
788
|
-
/**
|
|
789
|
-
* Routes content to the appropriate renderer based on content_type and ui_content_type.
|
|
790
|
-
*
|
|
791
|
-
* This is the main entry point for rendering content items from Erdo bot invocations.
|
|
792
|
-
* It checks for custom component overrides first, then falls back to built-in renderers.
|
|
793
|
-
*
|
|
794
|
-
* @example
|
|
795
|
-
* ```tsx
|
|
796
|
-
* // Basic usage - uses built-in renderers
|
|
797
|
-
* <Content content={contentItem} />
|
|
798
|
-
*
|
|
799
|
-
* // With custom overrides
|
|
800
|
-
* <Content
|
|
801
|
-
* content={contentItem}
|
|
802
|
-
* components={{
|
|
803
|
-
* 'bot_invocation': MyBotInvocation,
|
|
804
|
-
* 'authorize_integration': AuthorizeIntegration,
|
|
805
|
-
* }}
|
|
806
|
-
* />
|
|
807
|
-
* ```
|
|
808
|
-
*/
|
|
809
788
|
declare function Content({ content, className, components }: ContentProps): react_jsx_runtime.JSX.Element | null;
|
|
810
789
|
|
|
811
790
|
interface ErdoUIProps {
|
|
@@ -1395,6 +1374,40 @@ declare function formatValue(value: any, format?: string | null, valueType?: 'nu
|
|
|
1395
1374
|
*/
|
|
1396
1375
|
declare function parseToDate(value: any): Date | null;
|
|
1397
1376
|
|
|
1377
|
+
/**
|
|
1378
|
+
* Utilities for handling NullString wrapper types from the backend.
|
|
1379
|
+
*
|
|
1380
|
+
* The backend sends nullable strings in the format: { String: "value", Valid: true }
|
|
1381
|
+
* These utilities help unwrap them to plain strings.
|
|
1382
|
+
*/
|
|
1383
|
+
interface NullString {
|
|
1384
|
+
String: string;
|
|
1385
|
+
Valid: boolean;
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Check if a value is a NullString wrapper.
|
|
1389
|
+
*/
|
|
1390
|
+
declare function isNullString(value: unknown): value is NullString;
|
|
1391
|
+
/**
|
|
1392
|
+
* Unwrap a value that may be a NullString wrapper from the backend.
|
|
1393
|
+
* Returns the string value if valid, undefined otherwise.
|
|
1394
|
+
*
|
|
1395
|
+
* @example
|
|
1396
|
+
* unwrapNullString("hello") // "hello"
|
|
1397
|
+
* unwrapNullString({ String: "hello", Valid: true }) // "hello"
|
|
1398
|
+
* unwrapNullString({ String: "", Valid: false }) // undefined
|
|
1399
|
+
* unwrapNullString(undefined) // undefined
|
|
1400
|
+
*/
|
|
1401
|
+
declare function unwrapNullString(value: unknown): string | undefined;
|
|
1402
|
+
/**
|
|
1403
|
+
* Unwrap a NullString with a default value.
|
|
1404
|
+
*
|
|
1405
|
+
* @example
|
|
1406
|
+
* unwrapNullStringOr({ String: "", Valid: false }, "default") // "default"
|
|
1407
|
+
* unwrapNullStringOr({ String: "hello", Valid: true }, "default") // "hello"
|
|
1408
|
+
*/
|
|
1409
|
+
declare function unwrapNullStringOr(value: unknown, defaultValue: string): string;
|
|
1410
|
+
|
|
1398
1411
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1399
1412
|
|
|
1400
1413
|
/**
|
|
@@ -1482,4 +1495,4 @@ declare function handleIncrementalMixedJsonParsing(outputContent: MessageContent
|
|
|
1482
1495
|
*/
|
|
1483
1496
|
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;
|
|
1484
1497
|
|
|
1485
|
-
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, 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, 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, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, 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, StreamingLoader, TableContent, type TableContentProps, TextContent, type TextContentProps, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, cn, extractContentItems, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isParsingComplete, isParsingInProgress, isWhitespaceChar, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useMultipleDatasetContents, useThread };
|
|
1498
|
+
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, 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, 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, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, 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, StreamingLoader, TableContent, type TableContentProps, TextContent, type TextContentProps, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, cn, extractContentItems, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isNullString, isParsingComplete, isParsingInProgress, isWhitespaceChar, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, unwrapNullString, unwrapNullStringOr, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useMultipleDatasetContents, useThread };
|