diff --git a/packages/plugin-charts/src/index.tsx b/packages/plugin-charts/src/index.tsx index a0e62a22e6..31a8d01f2b 100644 --- a/packages/plugin-charts/src/index.tsx +++ b/packages/plugin-charts/src/index.tsx @@ -9,6 +9,7 @@ import React, { Suspense } from 'react'; import { ComponentRegistry } from '@object-ui/core'; import { Skeleton } from '@object-ui/components'; +import type { ChartConfig } from './ChartContainerImpl'; // Export types for external use export type { BarChartSchema } from './types'; @@ -124,10 +125,11 @@ export const ChartRenderer: React.FC = ({ schema }) => { // 3. Auto-generate config/colors if missing if (!config && series) { const colors = (schema as any).colors || ['hsl(var(--chart-1))', 'hsl(var(--chart-2))', 'hsl(var(--chart-3))']; - config = {}; + const newConfig: ChartConfig = {}; series.forEach((s: any, idx: number) => { - config[s.dataKey] = { label: s.dataKey, color: colors[idx % colors.length] }; + newConfig[s.dataKey] = { label: s.dataKey, color: colors[idx % colors.length] }; }); + config = newConfig; } return { diff --git a/packages/plugin-chatbot/src/renderer.tsx b/packages/plugin-chatbot/src/renderer.tsx index 989725ce67..8583d97865 100644 --- a/packages/plugin-chatbot/src/renderer.tsx +++ b/packages/plugin-chatbot/src/renderer.tsx @@ -24,7 +24,7 @@ import { useState } from 'react'; * - Use case: Connect to backend API or trigger custom actions on message send */ ComponentRegistry.register('chatbot', - ({ schema, className, ...props }) => { + ({ schema, className, ...props }: { schema: ChatbotSchema; className?: string; [key: string]: any }) => { // Initialize messages from schema or use empty array const [messages, setMessages] = useState( schema.messages?.map((msg: any, idx: number) => ({ diff --git a/packages/plugin-dashboard/src/DashboardRenderer.tsx b/packages/plugin-dashboard/src/DashboardRenderer.tsx index aa58c4ae38..80e5a64453 100644 --- a/packages/plugin-dashboard/src/DashboardRenderer.tsx +++ b/packages/plugin-dashboard/src/DashboardRenderer.tsx @@ -7,7 +7,7 @@ */ import { ComponentRegistry } from '@object-ui/core'; -import type { DashboardSchema } from '@object-ui/types'; +import type { DashboardSchema, DashboardWidgetSchema } from '@object-ui/types'; import { SchemaRenderer } from '@object-ui/react'; import { cn } from '@object-ui/components'; import { forwardRef } from 'react'; @@ -30,7 +30,7 @@ export const DashboardRenderer = forwardRef - {schema.widgets?.map((widget) => ( + {schema.widgets?.map((widget: DashboardWidgetSchema) => (