@updog/data-editor 0.1.96 → 0.1.97

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.
Files changed (4) hide show
  1. package/index.css +1 -1
  2. package/index.d.ts +23 -23
  3. package/index.js +4842 -4852
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -568,11 +568,15 @@ declare var export_default = {
568
568
  },
569
569
  },
570
570
  chat: {
571
- emptyTitle: "What would you like to fix?",
572
- header: "Chat with AI",
571
+ cancelRequest: "Cancel request",
573
572
  inputLabel: "Ask AI about your data",
574
573
  placeholder: "Ask AI...",
574
+ requestCancelled: "Cancelled",
575
+ requestDone: "Applied",
576
+ requestFailed: "Failed",
575
577
  send: "Send",
578
+ toggle: "AI",
579
+ toggleLabel: "Toggle AI assistant",
576
580
  },
577
581
  common: {
578
582
  cancel: "Cancel",
@@ -1258,10 +1262,17 @@ type ChatErrorSummary = {
1258
1262
  examples: string[];
1259
1263
  };
1260
1264
  /**
1261
- * Context about the current dataset, passed to `loadSuggestions` and extended
1262
- * into `ChatContext` for `onMessage`.
1265
+ * The full context passed to `DataEditorChat.onMessage` when the user sends
1266
+ * a prompt. Includes the prompt itself and all dataset context.
1263
1267
  */
1264
- type ChatDataContext<TRow extends DataEditorRow = DataEditorRow> = {
1268
+ type ChatContext<TRow extends DataEditorRow = DataEditorRow> = {
1269
+ /** The user's chat prompt. */
1270
+ message: string;
1271
+ /**
1272
+ * Aborted when the user cancels the request. Pass it to `fetch` so the
1273
+ * in-flight call stops; the SDK stops reading the stream on its own.
1274
+ */
1275
+ signal: AbortSignal;
1265
1276
  /** Full column definitions. */
1266
1277
  columns: DataEditorColumn[];
1267
1278
  /** Row identifier field, or the list of fields that identify a row together. */
@@ -1277,19 +1288,11 @@ type ChatDataContext<TRow extends DataEditorRow = DataEditorRow> = {
1277
1288
  /** Access all rows. Use for full-dataset operations. */
1278
1289
  getRows: () => ChatRow<TRow>[];
1279
1290
  };
1280
- /**
1281
- * The full context passed to `DataEditorChat.onMessage` when the user sends
1282
- * a prompt. Includes the prompt itself and all dataset context.
1283
- */
1284
- type ChatContext<TRow extends DataEditorRow = DataEditorRow> = ChatDataContext<TRow> & {
1285
- /** The user's chat prompt. */
1286
- message: string;
1287
- };
1288
1291
  /**
1289
1292
  * Bring-your-own-AI chat configuration. When provided via the `chat` prop,
1290
- * the editor shows a chat panel alongside the grid. You own the AI
1291
- * integration; the SDK hands you dataset context and renders the streamed
1292
- * response.
1293
+ * the editor footer gains an AI button that opens the assistant over the grid.
1294
+ * You own the AI integration; the SDK hands you dataset context, applies the
1295
+ * streamed row changes and shows each request with its status.
1293
1296
  *
1294
1297
  * @example
1295
1298
  * ```ts
@@ -1319,19 +1322,16 @@ type DataEditorChat<TRow extends DataEditorRow = DataEditorRow> = {
1319
1322
  * representative slice including rows with errors. When omitted, the SDK decides.
1320
1323
  */
1321
1324
  sampleSize?: number;
1322
- /** Title shown above the suggestion list when the chat is empty. */
1323
- emptyTitle?: string;
1324
- /** How many suggestions to request from `loadSuggestions`. */
1325
- suggestionsCount?: number;
1326
- /** Optional prompt generator for the empty-state suggestion chips. */
1327
- loadSuggestions?: (context: ChatDataContext<TRow>) => Promise<string[]>;
1328
1325
  /**
1329
1326
  * Called when the user sends a message. Receives full dataset context.
1330
1327
  * Returns an async iterable of response chunks — the SDK streams them
1331
1328
  * into the UI.
1332
1329
  */
1333
1330
  onMessage: (context: ChatContext<TRow>) => AsyncIterable<ChatResponseChunk<TRow>>;
1334
- /** Called when the user cancels a pending request. Use to abort your API call. */
1331
+ /**
1332
+ * Called when the user cancels a pending request, after `context.signal`
1333
+ * is aborted. Use for cleanup the signal cannot reach.
1334
+ */
1335
1335
  onCancel?: () => void;
1336
1336
  };
1337
1337