@updog/data-editor-wc 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 +7808 -7804
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -566,11 +566,15 @@ 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",
571
570
  inputLabel: "Ask AI about your data",
572
571
  placeholder: "Ask AI...",
572
+ requestCancelled: "Cancelled",
573
+ requestDone: "Applied",
574
+ requestFailed: "Failed",
573
575
  send: "Send",
576
+ toggle: "AI",
577
+ toggleLabel: "Toggle AI assistant",
574
578
  },
575
579
  common: {
576
580
  cancel: "Cancel",
@@ -1111,10 +1115,17 @@ type ChatErrorSummary = {
1111
1115
  examples: string[];
1112
1116
  };
1113
1117
  /**
1114
- * Context about the current dataset, passed to `loadSuggestions` and extended
1115
- * into `ChatContext` for `onMessage`.
1118
+ * The full context passed to `DataEditorChat.onMessage` when the user sends
1119
+ * a prompt. Includes the prompt itself and all dataset context.
1116
1120
  */
1117
- type ChatDataContext<TRow extends DataEditorRow = DataEditorRow> = {
1121
+ type ChatContext<TRow extends DataEditorRow = DataEditorRow> = {
1122
+ /** The user's chat prompt. */
1123
+ message: string;
1124
+ /**
1125
+ * Aborted when the user cancels the request. Pass it to `fetch` so the
1126
+ * in-flight call stops; the SDK stops reading the stream on its own.
1127
+ */
1128
+ signal: AbortSignal;
1118
1129
  /** Full column definitions. */
1119
1130
  columns: DataEditorColumn[];
1120
1131
  /** Row identifier field, or the list of fields that identify a row together. */
@@ -1130,19 +1141,11 @@ type ChatDataContext<TRow extends DataEditorRow = DataEditorRow> = {
1130
1141
  /** Access all rows. Use for full-dataset operations. */
1131
1142
  getRows: () => ChatRow<TRow>[];
1132
1143
  };
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
1144
  /**
1142
1145
  * 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.
1146
+ * the editor footer gains an AI button that opens the assistant over the grid.
1147
+ * You own the AI integration; the SDK hands you dataset context, applies the
1148
+ * streamed row changes and shows each request with its status.
1146
1149
  *
1147
1150
  * @example
1148
1151
  * ```ts
@@ -1172,19 +1175,16 @@ type DataEditorChat<TRow extends DataEditorRow = DataEditorRow> = {
1172
1175
  * representative slice including rows with errors. When omitted, the SDK decides.
1173
1176
  */
1174
1177
  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
1178
  /**
1182
1179
  * Called when the user sends a message. Receives full dataset context.
1183
1180
  * Returns an async iterable of response chunks — the SDK streams them
1184
1181
  * into the UI.
1185
1182
  */
1186
1183
  onMessage: (context: ChatContext<TRow>) => AsyncIterable<ChatResponseChunk<TRow>>;
1187
- /** Called when the user cancels a pending request. Use to abort your API call. */
1184
+ /**
1185
+ * Called when the user cancels a pending request, after `context.signal`
1186
+ * is aborted. Use for cleanup the signal cannot reach.
1187
+ */
1188
1188
  onCancel?: () => void;
1189
1189
  };
1190
1190