@erdoai/ui 0.1.25 → 0.1.28

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.d.cts CHANGED
@@ -4,7 +4,6 @@ import React__default from 'react';
4
4
  import { ErdoClient, ContentItem, InvokeResult, LogEntry, ToolGroup, InvocationStatus as InvocationStatus$1, SSEEvent, Thread } from '@erdoai/types';
5
5
  export { ContentItem } from '@erdoai/types';
6
6
  import * as RechartsPrimitive from 'recharts';
7
- import { UseQueryResult } from '@tanstack/react-query';
8
7
  import { ClassValue } from 'clsx';
9
8
 
10
9
  /**
@@ -786,27 +785,6 @@ interface ContentProps {
786
785
  */
787
786
  components?: Record<string, React__default.ComponentType<any>>;
788
787
  }
789
- /**
790
- * Routes content to the appropriate renderer based on content_type and ui_content_type.
791
- *
792
- * This is the main entry point for rendering content items from Erdo bot invocations.
793
- * It checks for custom component overrides first, then falls back to built-in renderers.
794
- *
795
- * @example
796
- * ```tsx
797
- * // Basic usage - uses built-in renderers
798
- * <Content content={contentItem} />
799
- *
800
- * // With custom overrides
801
- * <Content
802
- * content={contentItem}
803
- * components={{
804
- * 'bot_invocation': MyBotInvocation,
805
- * 'authorize_integration': AuthorizeIntegration,
806
- * }}
807
- * />
808
- * ```
809
- */
810
788
  declare function Content({ content, className, components }: ContentProps): react_jsx_runtime.JSX.Element | null;
811
789
 
812
790
  interface ErdoUIProps {
@@ -1230,25 +1208,40 @@ declare function useChartZoom({ onZoomChange }?: UseChartZoomProps): {
1230
1208
  };
1231
1209
  };
1232
1210
 
1211
+ /**
1212
+ * Result type for dataset content hooks.
1213
+ * Mirrors common data-fetching patterns without requiring React Query.
1214
+ */
1215
+ interface UseDatasetContentsResult {
1216
+ data: any[] | undefined;
1217
+ isLoading: boolean;
1218
+ error: Error | null;
1219
+ refetch: () => void;
1220
+ }
1233
1221
  /**
1234
1222
  * Hook to fetch contents of a single dataset.
1223
+ * Uses the DataFetcher from ErdoProvider if available, otherwise falls back to REST API.
1235
1224
  *
1236
1225
  * @param datasetSlug - The slug/identifier of the dataset
1237
1226
  * @param invocationId - The invocation ID context
1238
- * @returns React Query result with dataset contents
1227
+ * @returns Object with data, isLoading, error, and refetch function
1239
1228
  *
1240
1229
  * @example
1241
1230
  * ```tsx
1242
1231
  * const { data, isLoading, error } = useDatasetContents('my-dataset', invocationId);
1232
+ * if (isLoading) return <Loading />;
1233
+ * if (error) return <Error message={error.message} />;
1234
+ * return <Chart data={data} />;
1243
1235
  * ```
1244
1236
  */
1245
- declare function useDatasetContents(datasetSlug: string, invocationId: string): UseQueryResult<any[], Error>;
1237
+ declare function useDatasetContents(datasetSlug: string, invocationId: string): UseDatasetContentsResult;
1246
1238
  /**
1247
1239
  * Hook to fetch contents of multiple datasets in parallel.
1240
+ * Uses the DataFetcher from ErdoProvider if available, otherwise falls back to REST API.
1248
1241
  *
1249
1242
  * @param datasetSlugs - Array of dataset slugs/identifiers
1250
1243
  * @param invocationId - The invocation ID context
1251
- * @returns Array of React Query results, one per dataset
1244
+ * @returns Array of result objects, one per dataset
1252
1245
  *
1253
1246
  * @example
1254
1247
  * ```tsx
@@ -1257,7 +1250,7 @@ declare function useDatasetContents(datasetSlug: string, invocationId: string):
1257
1250
  * const allData = results.map(r => r.data || []);
1258
1251
  * ```
1259
1252
  */
1260
- declare function useMultipleDatasetContents(datasetSlugs: string[], invocationId: string): UseQueryResult<any[], Error>[];
1253
+ declare function useMultipleDatasetContents(datasetSlugs: string[], invocationId: string): UseDatasetContentsResult[];
1261
1254
 
1262
1255
  interface UseThreadOptions {
1263
1256
  /** Initial thread ID to use (if resuming an existing thread) */
package/dist/index.d.ts CHANGED
@@ -4,7 +4,6 @@ import React__default from 'react';
4
4
  import { ErdoClient, ContentItem, InvokeResult, LogEntry, ToolGroup, InvocationStatus as InvocationStatus$1, SSEEvent, Thread } from '@erdoai/types';
5
5
  export { ContentItem } from '@erdoai/types';
6
6
  import * as RechartsPrimitive from 'recharts';
7
- import { UseQueryResult } from '@tanstack/react-query';
8
7
  import { ClassValue } from 'clsx';
9
8
 
10
9
  /**
@@ -786,27 +785,6 @@ interface ContentProps {
786
785
  */
787
786
  components?: Record<string, React__default.ComponentType<any>>;
788
787
  }
789
- /**
790
- * Routes content to the appropriate renderer based on content_type and ui_content_type.
791
- *
792
- * This is the main entry point for rendering content items from Erdo bot invocations.
793
- * It checks for custom component overrides first, then falls back to built-in renderers.
794
- *
795
- * @example
796
- * ```tsx
797
- * // Basic usage - uses built-in renderers
798
- * <Content content={contentItem} />
799
- *
800
- * // With custom overrides
801
- * <Content
802
- * content={contentItem}
803
- * components={{
804
- * 'bot_invocation': MyBotInvocation,
805
- * 'authorize_integration': AuthorizeIntegration,
806
- * }}
807
- * />
808
- * ```
809
- */
810
788
  declare function Content({ content, className, components }: ContentProps): react_jsx_runtime.JSX.Element | null;
811
789
 
812
790
  interface ErdoUIProps {
@@ -1230,25 +1208,40 @@ declare function useChartZoom({ onZoomChange }?: UseChartZoomProps): {
1230
1208
  };
1231
1209
  };
1232
1210
 
1211
+ /**
1212
+ * Result type for dataset content hooks.
1213
+ * Mirrors common data-fetching patterns without requiring React Query.
1214
+ */
1215
+ interface UseDatasetContentsResult {
1216
+ data: any[] | undefined;
1217
+ isLoading: boolean;
1218
+ error: Error | null;
1219
+ refetch: () => void;
1220
+ }
1233
1221
  /**
1234
1222
  * Hook to fetch contents of a single dataset.
1223
+ * Uses the DataFetcher from ErdoProvider if available, otherwise falls back to REST API.
1235
1224
  *
1236
1225
  * @param datasetSlug - The slug/identifier of the dataset
1237
1226
  * @param invocationId - The invocation ID context
1238
- * @returns React Query result with dataset contents
1227
+ * @returns Object with data, isLoading, error, and refetch function
1239
1228
  *
1240
1229
  * @example
1241
1230
  * ```tsx
1242
1231
  * const { data, isLoading, error } = useDatasetContents('my-dataset', invocationId);
1232
+ * if (isLoading) return <Loading />;
1233
+ * if (error) return <Error message={error.message} />;
1234
+ * return <Chart data={data} />;
1243
1235
  * ```
1244
1236
  */
1245
- declare function useDatasetContents(datasetSlug: string, invocationId: string): UseQueryResult<any[], Error>;
1237
+ declare function useDatasetContents(datasetSlug: string, invocationId: string): UseDatasetContentsResult;
1246
1238
  /**
1247
1239
  * Hook to fetch contents of multiple datasets in parallel.
1240
+ * Uses the DataFetcher from ErdoProvider if available, otherwise falls back to REST API.
1248
1241
  *
1249
1242
  * @param datasetSlugs - Array of dataset slugs/identifiers
1250
1243
  * @param invocationId - The invocation ID context
1251
- * @returns Array of React Query results, one per dataset
1244
+ * @returns Array of result objects, one per dataset
1252
1245
  *
1253
1246
  * @example
1254
1247
  * ```tsx
@@ -1257,7 +1250,7 @@ declare function useDatasetContents(datasetSlug: string, invocationId: string):
1257
1250
  * const allData = results.map(r => r.data || []);
1258
1251
  * ```
1259
1252
  */
1260
- declare function useMultipleDatasetContents(datasetSlugs: string[], invocationId: string): UseQueryResult<any[], Error>[];
1253
+ declare function useMultipleDatasetContents(datasetSlugs: string[], invocationId: string): UseDatasetContentsResult[];
1261
1254
 
1262
1255
  interface UseThreadOptions {
1263
1256
  /** Initial thread ID to use (if resuming an existing thread) */