@updog/data-editor-wc 0.1.96 → 0.1.98

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 +24 -23
  3. package/index.js +7889 -7866
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -566,11 +566,16 @@ declare var export_default = {
566
566
  },
567
567
  },
568
568
  chat: {
569
- emptyTitle: "What would you like to fix?",
570
- header: "Chat with AI",
569
+ cancelRequest: "Cancel request",
570
+ groupColumns: "Columns",
571
571
  inputLabel: "Ask AI about your data",
572
572
  placeholder: "Ask AI...",
573
+ requestCancelled: "Cancelled",
574
+ requestDone: "Applied",
575
+ requestFailed: "Failed",
573
576
  send: "Send",
577
+ toggle: "AI",
578
+ toggleLabel: "Toggle AI assistant",
574
579
  },
575
580
  common: {
576
581
  cancel: "Cancel",
@@ -1111,10 +1116,17 @@ type ChatErrorSummary = {
1111
1116
  examples: string[];
1112
1117
  };
1113
1118
  /**
1114
- * Context about the current dataset, passed to `loadSuggestions` and extended
1115
- * into `ChatContext` for `onMessage`.
1119
+ * The full context passed to `DataEditorChat.onMessage` when the user sends
1120
+ * a prompt. Includes the prompt itself and all dataset context.
1116
1121
  */
1117
- type ChatDataContext<TRow extends DataEditorRow = DataEditorRow> = {
1122
+ type ChatContext<TRow extends DataEditorRow = DataEditorRow> = {
1123
+ /** The user's chat prompt. */
1124
+ message: string;
1125
+ /**
1126
+ * Aborted when the user cancels the request. Pass it to `fetch` so the
1127
+ * in-flight call stops; the SDK stops reading the stream on its own.
1128
+ */
1129
+ signal: AbortSignal;
1118
1130
  /** Full column definitions. */
1119
1131
  columns: DataEditorColumn[];
1120
1132
  /** Row identifier field, or the list of fields that identify a row together. */
@@ -1130,19 +1142,11 @@ type ChatDataContext<TRow extends DataEditorRow = DataEditorRow> = {
1130
1142
  /** Access all rows. Use for full-dataset operations. */
1131
1143
  getRows: () => ChatRow<TRow>[];
1132
1144
  };
1133
- /**
1134
- * The full context passed to `DataEditorChat.onMessage` when the user sends
1135
- * a prompt. Includes the prompt itself and all dataset context.
1136
- */
1137
- type ChatContext<TRow extends DataEditorRow = DataEditorRow> = ChatDataContext<TRow> & {
1138
- /** The user's chat prompt. */
1139
- message: string;
1140
- };
1141
1145
  /**
1142
1146
  * Bring-your-own-AI chat configuration. When provided via the `chat` prop,
1143
- * the editor shows a chat panel alongside the grid. You own the AI
1144
- * integration; the SDK hands you dataset context and renders the streamed
1145
- * response.
1147
+ * the editor footer gains an AI button that opens the assistant over the grid.
1148
+ * You own the AI integration; the SDK hands you dataset context, applies the
1149
+ * streamed row changes and shows each request with its status.
1146
1150
  *
1147
1151
  * @example
1148
1152
  * ```ts
@@ -1172,19 +1176,16 @@ type DataEditorChat<TRow extends DataEditorRow = DataEditorRow> = {
1172
1176
  * representative slice including rows with errors. When omitted, the SDK decides.
1173
1177
  */
1174
1178
  sampleSize?: number;
1175
- /** Title shown above the suggestion list when the chat is empty. */
1176
- emptyTitle?: string;
1177
- /** How many suggestions to request from `loadSuggestions`. */
1178
- suggestionsCount?: number;
1179
- /** Optional prompt generator for the empty-state suggestion chips. */
1180
- loadSuggestions?: (context: ChatDataContext<TRow>) => Promise<string[]>;
1181
1179
  /**
1182
1180
  * Called when the user sends a message. Receives full dataset context.
1183
1181
  * Returns an async iterable of response chunks — the SDK streams them
1184
1182
  * into the UI.
1185
1183
  */
1186
1184
  onMessage: (context: ChatContext<TRow>) => AsyncIterable<ChatResponseChunk<TRow>>;
1187
- /** Called when the user cancels a pending request. Use to abort your API call. */
1185
+ /**
1186
+ * Called when the user cancels a pending request, after `context.signal`
1187
+ * is aborted. Use for cleanup the signal cannot reach.
1188
+ */
1188
1189
  onCancel?: () => void;
1189
1190
  };
1190
1191