@constructor-io/constructorio-ui-asa 1.5.0 → 1.6.1
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/constructorio-ui-asa-bundled.js +26 -11
- package/lib/cjs/components/Chat/Chat.js +4 -3
- package/lib/cjs/components/Chat/ChatInput.css +11 -0
- package/lib/cjs/components/Chat/ChatInput.js +8 -3
- package/lib/cjs/components/CioAsa/CioAsa.js +23 -0
- package/lib/cjs/components/icons/StopIcon.js +9 -0
- package/lib/cjs/components/icons/index.js +3 -1
- package/lib/cjs/hooks/useAsaResults.js +58 -13
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/utils/translate.js +1 -0
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/components/Chat/Chat.js +4 -3
- package/lib/mjs/components/Chat/ChatInput.css +11 -0
- package/lib/mjs/components/Chat/ChatInput.js +9 -4
- package/lib/mjs/components/CioAsa/CioAsa.js +20 -0
- package/lib/mjs/components/icons/StopIcon.js +5 -0
- package/lib/mjs/components/icons/index.js +1 -0
- package/lib/mjs/hooks/useAsaResults.js +57 -13
- package/lib/mjs/index.js +1 -0
- package/lib/mjs/utils/translate.js +1 -0
- package/lib/mjs/version.js +1 -1
- package/lib/types/components/Chat/Chat.d.ts +14 -1
- package/lib/types/components/Chat/ChatInput.d.ts +11 -1
- package/lib/types/components/CioAsa/CioAsa.d.ts +14 -0
- package/lib/types/components/icons/StopIcon.d.ts +2 -0
- package/lib/types/components/icons/index.d.ts +1 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/types/types.d.ts +15 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/types/types.d.ts
CHANGED
|
@@ -134,6 +134,12 @@ export interface UseChatReturn {
|
|
|
134
134
|
messages: ChatMessage[];
|
|
135
135
|
sendMessage: (text: string, source?: AssistantSubmitSource) => void;
|
|
136
136
|
isStreaming: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Cancel the in-flight request, keeping the conversation. The partial reply is settled
|
|
139
|
+
* as `done` and the thread id is kept, so the next message continues the same
|
|
140
|
+
* conversation. No-op when nothing is streaming. Use `clearHistory` to reset instead.
|
|
141
|
+
*/
|
|
142
|
+
abort: () => void;
|
|
137
143
|
clearHistory: () => void;
|
|
138
144
|
}
|
|
139
145
|
export interface UseAsaResultsOptions {
|
|
@@ -205,6 +211,7 @@ export type Translations = {
|
|
|
205
211
|
'CioAsa.input.placeholder'?: string;
|
|
206
212
|
'CioAsa.input.ariaLabel'?: string;
|
|
207
213
|
'CioAsa.input.sendAriaLabel'?: string;
|
|
214
|
+
'CioAsa.input.stopAriaLabel'?: string;
|
|
208
215
|
'CioAsa.welcome.title'?: string;
|
|
209
216
|
'CioAsa.welcome.placeholder'?: string;
|
|
210
217
|
'CioAsa.welcome.sendButton'?: string;
|
|
@@ -232,6 +239,14 @@ export interface ChatInputRenderProps {
|
|
|
232
239
|
onSubmit: () => void;
|
|
233
240
|
placeholder: string;
|
|
234
241
|
isDisabled: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Whether a reply is currently streaming. Pair it with `onAbort` to offer a cancel
|
|
244
|
+
* control while it is true — the built-in stop button is off by default, so an override
|
|
245
|
+
* is often the only way a user can cancel.
|
|
246
|
+
*/
|
|
247
|
+
isStreaming: boolean;
|
|
248
|
+
/** Cancel the in-flight reply. Keeps the conversation and the thread. */
|
|
249
|
+
onAbort: () => void;
|
|
235
250
|
}
|
|
236
251
|
export interface WelcomeScreenTitleRenderProps {
|
|
237
252
|
text: string;
|
package/lib/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.
|
|
1
|
+
declare const _default: "1.6.1";
|
|
2
2
|
export default _default;
|