@aleph-alpha/chat-kit 5.13.0 → 6.0.0
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/{CkHistory.vue_vue_type_script_setup_true_lang-BNcJURkq.js → CkHistory.vue_vue_type_script_setup_true_lang-D9Ph9eYp.js} +11 -12
- package/dist/adapters/responses-api.d.ts +1 -1
- package/dist/adapters/responses-api.d.ts.map +1 -1
- package/dist/adapters/responses-api.js +9 -7
- package/dist/chat-kit.css +12 -12
- package/dist/components/base/CkHistoryItem/CkHistoryItem.vue.d.ts.map +1 -1
- package/dist/components/base/CkHistoryWrapper/CkHistoryWrapper.vue.d.ts.map +1 -1
- package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/composables/fileUpload/useFileUpload.d.ts.map +1 -1
- package/dist/composables/index.js +1 -1
- package/dist/composables/useChat.d.ts.map +1 -1
- package/dist/composables/useConversations.d.ts.map +1 -1
- package/dist/handlers/index.js +1 -1
- package/dist/handlers/useChatKitLabels.d.ts +35 -1
- package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
- package/dist/{index-Dn4ctxk8.js → index-C72e57-5.js} +48 -24
- package/dist/index.js +3 -3
- package/dist/test-utils/createTextPlugin.d.ts +7 -1
- package/dist/test-utils/createTextPlugin.d.ts.map +1 -1
- package/dist/{useChatKitLabels-CMOr3Kjq.js → useChatKitLabels-368lodS5.js} +1 -1
- package/package.json +3 -3
- package/src/adapters/responses-api.spec.ts +86 -0
- package/src/adapters/responses-api.ts +13 -9
- package/src/components/base/CkCitationCard/CkCitationCard.vue +1 -1
- package/src/components/base/CkCitationLabel/CkCitationLabel.vue +1 -1
- package/src/components/base/CkConversationLayout/CkConversationLayout.spec.ts +1 -5
- package/src/components/base/CkCopyMessageButton/CkCopyMessageButton.spec.ts +1 -1
- package/src/components/base/CkFeedbackButton/CkFeedbackButton.vue +3 -3
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue +9 -9
- package/src/components/base/CkHistoryItem/CkHistoryItem.vue +5 -7
- package/src/components/base/CkHistoryWrapper/CkHistoryWrapper.vue +2 -1
- package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts +9 -4
- package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue +1 -1
- package/src/components/base/CkModelSelector/CkModelSelector.vue +3 -3
- package/src/composables/fileUpload/useFileUpload.ts +45 -30
- package/src/composables/fileUpload/useFileUploadWrapper.spec.ts +1 -1
- package/src/composables/fileUpload/useFileUploadWrapper.ts +3 -3
- package/src/composables/useChat.ts +3 -1
- package/src/composables/useConversations.ts +8 -5
- package/src/handlers/useChatKitLabels.spec.ts +0 -1
- package/src/handlers/useChatKitLabels.ts +2 -2
- package/src/handlers/useMarkdownParser.ts +1 -1
- package/src/test-setup.ts +3 -3
- package/src/test-utils/createTextPlugin.ts +11 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkHistoryItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryItem/CkHistoryItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkHistoryItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryItem/CkHistoryItem.vue"],"names":[],"mappings":"AAuSA,OAAO,KAAK,EAAsB,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAudzE,QAAA,IAAI,OAAO,IAAU,EAAE,QAAQ,IAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACzC;IAAE,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKzD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkHistoryWrapper.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryWrapper/CkHistoryWrapper.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkHistoryWrapper.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryWrapper/CkHistoryWrapper.vue"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA2DrD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU;;6EAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkMarkdownRenderer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAkBzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqHnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAsB5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KA+BrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAwC7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KA0C/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KA4BzB,CAAC;AAsBF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KAuB7B,CAAC;
|
|
1
|
+
{"version":3,"file":"CkMarkdownRenderer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAkBzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqHnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAsB5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KA+BrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAwC7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KA0C/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KA4BzB,CAAC;AAsBF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KAuB7B,CAAC;AAoBF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAkB9B,CAAC;AAiEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,KAwB3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,EAAE,KAc3C,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _, a, b, c, C, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A } from "../CkHistory.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _, a, b, c, C, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A } from "../CkHistory.vue_vue_type_script_setup_true_lang-D9Ph9eYp.js";
|
|
2
2
|
export {
|
|
3
3
|
_ as CkAgentMessage,
|
|
4
4
|
a as CkAgentMessageHeader,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../../src/composables/fileUpload/useFileUpload.ts"],"names":[],"mappings":"AACA,OAAO,EAkBL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAKzB,MAAM,SAAS,CAAC;AAEjB,cAAc,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../../src/composables/fileUpload/useFileUpload.ts"],"names":[],"mappings":"AACA,OAAO,EAkBL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAKzB,MAAM,SAAS,CAAC;AAEjB,cAAc,SAAS,CAAC;AAqcxB,wBAAgB,aAAa,CAC3B,OAAO,EAAE,oBAAoB,GAC5B,mBAAmB,CAszBrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/composables/useChat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,
|
|
1
|
+
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/composables/useChat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,SAEtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversations.d.ts","sourceRoot":"","sources":["../../src/composables/useConversations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE9E,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EAGX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAuC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAcpE,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,UAAU,CAAC;IACvB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC;2EACuE;IACvE,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAC7D;;;;OAIG;IACH,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAClC,qEAAqE;IACrE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,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M,CACJ,KAAK,CAAC,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,+DAA+D;IAC/D,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,qDAAqD;IACrD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,qEAAqE;IACrE,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAC;IACrD;;;;;;;OAOG;IACH,cAAc,CACZ,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,GACnC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAC9B;AAID;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,uBAAuB,GAC/B,sBAAsB,CAsNxB"}
|
package/dist/handlers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u } from "../useMessageHandler-Tellov3w.js";
|
|
2
|
-
import { C, d, n, p, r, a, u as u2, b } from "../useChatKitLabels-
|
|
2
|
+
import { C, d, n, p, r, a, u as u2, b } from "../useChatKitLabels-368lodS5.js";
|
|
3
3
|
export {
|
|
4
4
|
C as CHAT_KIT_LABELS,
|
|
5
5
|
d as defaultChatKitLabels,
|
|
@@ -111,7 +111,41 @@ export type ChatKitLabels = {
|
|
|
111
111
|
historyShowAll?: string;
|
|
112
112
|
};
|
|
113
113
|
/** English defaults used when no labels are provided by the consumer. */
|
|
114
|
-
export declare const defaultChatKitLabels:
|
|
114
|
+
export declare const defaultChatKitLabels: {
|
|
115
|
+
agentAvatarAlt: string;
|
|
116
|
+
agentLoadingAvatarAlt: string;
|
|
117
|
+
inputPlaceholder: string;
|
|
118
|
+
copyMessageAction: string;
|
|
119
|
+
copyMessageActionCopied: string;
|
|
120
|
+
regenerateMessageAction: string;
|
|
121
|
+
feedbackThumbsUp: string;
|
|
122
|
+
feedbackThumbsDown: string;
|
|
123
|
+
feedbackGroup: string;
|
|
124
|
+
feedbackDialogTitlePositive: string;
|
|
125
|
+
feedbackDialogTitleNegative: string;
|
|
126
|
+
feedbackDialogResponseHeading: string;
|
|
127
|
+
feedbackDialogDescription: string;
|
|
128
|
+
feedbackDialogOtherLabel: string;
|
|
129
|
+
feedbackDialogOtherTooltip: string;
|
|
130
|
+
feedbackDialogFreeTextPlaceholder: string;
|
|
131
|
+
feedbackDialogCancelLabel: string;
|
|
132
|
+
feedbackDialogSubmitLabel: string;
|
|
133
|
+
userMessageShowMore: string;
|
|
134
|
+
userMessageShowLess: string;
|
|
135
|
+
userMessageActions: string;
|
|
136
|
+
userMessageEditAction: string;
|
|
137
|
+
modelSelectorAriaLabel: string;
|
|
138
|
+
modelSelectorListAriaLabel: string;
|
|
139
|
+
modelSelectorPlaceholder: string;
|
|
140
|
+
markdownTableLabel: string;
|
|
141
|
+
citationOpenSource: string;
|
|
142
|
+
citationSourceLabel: string;
|
|
143
|
+
historyItemUntitled: string;
|
|
144
|
+
historyItemActionAriaLabel: string;
|
|
145
|
+
historyItemEditAction: string;
|
|
146
|
+
historyItemDeleteAction: string;
|
|
147
|
+
historyShowAll: string;
|
|
148
|
+
};
|
|
115
149
|
/** Vue injection key for ChatKit labels. */
|
|
116
150
|
export declare const CHAT_KIT_LABELS: InjectionKey<ComputedRef<ChatKitLabels>>;
|
|
117
151
|
type PartialLabels = Partial<ChatKitLabels>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatKitLabels.d.ts","sourceRoot":"","sources":["../../src/handlers/useChatKitLabels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAA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MAAM,CAAC;IAC9B,yEAAyE;IACzE,uBAAuB,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCE,CAAC;AAEpC,4CAA4C;AAC5C,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAAC,aAAa,CAAC,CAC1C,CAAC;AAE5B,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5C,yFAAyF;AACzF,KAAK,cAAc,GACf,GAAG,CAAC,aAAa,CAAC,GAClB,WAAW,CAAC,aAAa,CAAC,GAC1B,CAAC,MAAM,aAAa,CAAC,CAAC;AAE1B;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAKjE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAAC,aAAa,CAAC,CAK7D"}
|
|
@@ -9,6 +9,7 @@ function toError(value) {
|
|
|
9
9
|
return value instanceof Error ? value : new Error(String(value));
|
|
10
10
|
}
|
|
11
11
|
function useChat() {
|
|
12
|
+
throw new Error("useChat is not implemented yet.");
|
|
12
13
|
}
|
|
13
14
|
const DEFAULT_PAGE_SIZE = 20;
|
|
14
15
|
function useConversations(options) {
|
|
@@ -95,9 +96,14 @@ function useConversations(options) {
|
|
|
95
96
|
try {
|
|
96
97
|
const raw = await http.post(path, body);
|
|
97
98
|
const created = mapConversation(raw);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
if (placeholder) {
|
|
100
|
+
const placeholderId = placeholder.id;
|
|
101
|
+
conversations.value = conversations.value.map(
|
|
102
|
+
(c) => c.id === placeholderId ? created : c
|
|
103
|
+
);
|
|
104
|
+
} else {
|
|
105
|
+
conversations.value = [created, ...conversations.value];
|
|
106
|
+
}
|
|
101
107
|
return created;
|
|
102
108
|
} catch (e) {
|
|
103
109
|
if (placeholder) conversations.value = previous;
|
|
@@ -356,8 +362,9 @@ class Semaphore {
|
|
|
356
362
|
});
|
|
357
363
|
}
|
|
358
364
|
release() {
|
|
359
|
-
|
|
360
|
-
|
|
365
|
+
const next = this.queue.shift();
|
|
366
|
+
if (next) {
|
|
367
|
+
next();
|
|
361
368
|
} else {
|
|
362
369
|
this.permits++;
|
|
363
370
|
}
|
|
@@ -391,6 +398,11 @@ function generateCanvasThumbnail(file, maxW = 128, maxH = 128) {
|
|
|
391
398
|
canvas.width = w;
|
|
392
399
|
canvas.height = h;
|
|
393
400
|
const ctx = canvas.getContext("2d");
|
|
401
|
+
if (!ctx) {
|
|
402
|
+
URL.revokeObjectURL(url);
|
|
403
|
+
reject(new Error("Canvas 2D context is not available"));
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
394
406
|
ctx.drawImage(img, 0, 0, w, h);
|
|
395
407
|
const dataUrl = canvas.toDataURL("image/png");
|
|
396
408
|
URL.revokeObjectURL(url);
|
|
@@ -457,9 +469,13 @@ async function runCustomValidators(file, constraints, validators) {
|
|
|
457
469
|
}
|
|
458
470
|
return null;
|
|
459
471
|
}
|
|
472
|
+
function extractHttpStatus(err) {
|
|
473
|
+
const e = err;
|
|
474
|
+
return e?.httpStatus ?? e?.status ?? e?.response?.status;
|
|
475
|
+
}
|
|
460
476
|
function isRetryable(err, policy) {
|
|
461
477
|
if (!policy.retryableStatusCodes?.length) return true;
|
|
462
|
-
const status = err
|
|
478
|
+
const status = extractHttpStatus(err);
|
|
463
479
|
return status != null && policy.retryableStatusCodes.includes(status);
|
|
464
480
|
}
|
|
465
481
|
async function withRetry(fn, policy, signal) {
|
|
@@ -691,7 +707,9 @@ function useFileUpload(options) {
|
|
|
691
707
|
for (let i = 0; i < uploadReady.length; i++) {
|
|
692
708
|
const { stateKey } = uploadReady[i];
|
|
693
709
|
const entry = files.value.get(stateKey);
|
|
694
|
-
|
|
710
|
+
if (!entry) continue;
|
|
711
|
+
const startedAt = entry.uploadStartedAt ?? completedAt;
|
|
712
|
+
const durationMs = new Date(completedAt).getTime() - new Date(startedAt).getTime();
|
|
695
713
|
const remoteResult = results[i];
|
|
696
714
|
const remoteFileId = remoteResult?.id ?? null;
|
|
697
715
|
const documentId = remoteResult?.documentId ?? null;
|
|
@@ -749,11 +767,12 @@ function useFileUpload(options) {
|
|
|
749
767
|
const uploadErr = {
|
|
750
768
|
code: "UPLOAD_FAILED",
|
|
751
769
|
message: err.message ?? "Upload failed.",
|
|
752
|
-
httpStatus: err
|
|
770
|
+
httpStatus: extractHttpStatus(err),
|
|
753
771
|
occurredAt: completedAt
|
|
754
772
|
};
|
|
755
773
|
for (const { stateKey } of uploadReady) {
|
|
756
774
|
const entry = files.value.get(stateKey);
|
|
775
|
+
if (!entry) continue;
|
|
757
776
|
const durationMs = entry.uploadStartedAt ? new Date(completedAt).getTime() - new Date(entry.uploadStartedAt).getTime() : null;
|
|
758
777
|
updateEntry(stateKey, {
|
|
759
778
|
status: "failed",
|
|
@@ -808,16 +827,17 @@ function useFileUpload(options) {
|
|
|
808
827
|
const mergedSignal = params.signal ? AbortSignal.any([controller.signal, params.signal]) : controller.signal;
|
|
809
828
|
const uploadStarted = now();
|
|
810
829
|
for (const { stateKey } of uploadReady) {
|
|
830
|
+
const attemptCount = (files.value.get(stateKey)?.attemptCount ?? 0) + 1;
|
|
811
831
|
updateEntry(stateKey, {
|
|
812
832
|
status: "uploading",
|
|
813
833
|
uploadStartedAt: uploadStarted,
|
|
814
|
-
attemptCount
|
|
834
|
+
attemptCount,
|
|
815
835
|
lastAttemptAt: uploadStarted
|
|
816
836
|
});
|
|
817
837
|
emit({
|
|
818
838
|
type: "file:uploading",
|
|
819
839
|
fileId: stateKey,
|
|
820
|
-
attemptCount
|
|
840
|
+
attemptCount
|
|
821
841
|
});
|
|
822
842
|
}
|
|
823
843
|
const totalBytes = uploadReady.reduce(
|
|
@@ -888,17 +908,20 @@ function useFileUpload(options) {
|
|
|
888
908
|
function buildUploadResult(groupId, batch) {
|
|
889
909
|
return {
|
|
890
910
|
id: groupId,
|
|
891
|
-
results: batch.
|
|
911
|
+
results: batch.flatMap(({ stateKey }) => {
|
|
892
912
|
const entry = files.value.get(stateKey);
|
|
893
|
-
return
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
913
|
+
if (!entry) return [];
|
|
914
|
+
return [
|
|
915
|
+
{
|
|
916
|
+
fileId: stateKey,
|
|
917
|
+
success: entry.status === "success",
|
|
918
|
+
status: entry.status,
|
|
919
|
+
remoteFileId: entry.remoteFileId ?? void 0,
|
|
920
|
+
error: entry.error ?? void 0,
|
|
921
|
+
uploadDate: entry.uploadCompletedAt ?? entry.queuedAt,
|
|
922
|
+
metadata: entry.metadata
|
|
923
|
+
}
|
|
924
|
+
];
|
|
902
925
|
})
|
|
903
926
|
};
|
|
904
927
|
}
|
|
@@ -938,7 +961,7 @@ function useFileUpload(options) {
|
|
|
938
961
|
try {
|
|
939
962
|
await client.delete(endpoints.file(storeId, entry.remoteFileId));
|
|
940
963
|
} catch (err) {
|
|
941
|
-
const status = err
|
|
964
|
+
const status = extractHttpStatus(err);
|
|
942
965
|
if (status === 404) ;
|
|
943
966
|
else {
|
|
944
967
|
const removeErr = {
|
|
@@ -1013,8 +1036,7 @@ function useFileUpload(options) {
|
|
|
1013
1036
|
files.value.delete(entry.id);
|
|
1014
1037
|
if (db) {
|
|
1015
1038
|
deletePersistedEntry(db, persistStoreName, entry.id).catch(
|
|
1016
|
-
() =>
|
|
1017
|
-
}
|
|
1039
|
+
() => void 0
|
|
1018
1040
|
);
|
|
1019
1041
|
}
|
|
1020
1042
|
}
|
|
@@ -1498,7 +1520,9 @@ function createDocumentUploadProvider(config) {
|
|
|
1498
1520
|
});
|
|
1499
1521
|
}
|
|
1500
1522
|
}
|
|
1501
|
-
const successFileIds = result.results.
|
|
1523
|
+
const successFileIds = result.results.flatMap(
|
|
1524
|
+
(r) => r.success && r.remoteFileId ? [r.remoteFileId] : []
|
|
1525
|
+
);
|
|
1502
1526
|
if (successFileIds.length > 0) {
|
|
1503
1527
|
await upload.runWorkflow(successFileIds);
|
|
1504
1528
|
purgeCompletedFiles();
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { u } from "./useMessageHandler-Tellov3w.js";
|
|
2
|
-
import { C, d, p, u as u2, b } from "./useChatKitLabels-
|
|
3
|
-
import { S, c, d as d2, f, u as u3, a, b as b2, e } from "./index-
|
|
4
|
-
import { _, a as a2, b as b3, c as c2, C as C2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t, u as u4, v, w, x, y, z, A, B } from "./CkHistory.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { C, d, p, u as u2, b } from "./useChatKitLabels-368lodS5.js";
|
|
3
|
+
import { S, c, d as d2, f, u as u3, a, b as b2, e } from "./index-C72e57-5.js";
|
|
4
|
+
import { _, a as a2, b as b3, c as c2, C as C2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t, u as u4, v, w, x, y, z, A, B } from "./CkHistory.vue_vue_type_script_setup_true_lang-D9Ph9eYp.js";
|
|
5
5
|
export {
|
|
6
6
|
C as CHAT_KIT_LABELS,
|
|
7
7
|
_ as CkAgentMessage,
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
type TextPluginNode = {
|
|
2
|
+
type: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
children?: TextPluginNode[];
|
|
5
|
+
};
|
|
6
|
+
export declare function createTextPlugin(transform: (text: string) => string): () => (tree: TextPluginNode) => void;
|
|
7
|
+
export {};
|
|
2
8
|
//# sourceMappingURL=createTextPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTextPlugin.d.ts","sourceRoot":"","sources":["../../src/test-utils/createTextPlugin.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,UACpD,MAAM,
|
|
1
|
+
{"version":3,"file":"createTextPlugin.d.ts","sourceRoot":"","sources":["../../src/test-utils/createTextPlugin.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,UACpD,MAAM,cAAc,UASnC"}
|
|
@@ -28631,7 +28631,7 @@ function useMarkdownParser(source, plugins) {
|
|
|
28631
28631
|
let cachedPlugins;
|
|
28632
28632
|
let cachedProcessor;
|
|
28633
28633
|
function getProcessor(list2) {
|
|
28634
|
-
if (list2 === cachedPlugins) return cachedProcessor;
|
|
28634
|
+
if (list2 === cachedPlugins && cachedProcessor) return cachedProcessor;
|
|
28635
28635
|
cachedPlugins = list2;
|
|
28636
28636
|
cachedProcessor = buildProcessor(list2);
|
|
28637
28637
|
return cachedProcessor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleph-alpha/chat-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Chat kit package for building chat interfaces with Vue",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"author": "Pharia AI",
|
|
52
52
|
"license": "MIT",
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
54
|
+
"node": ">=22.13.0"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"remark-parse": "^11.0.0",
|
|
78
78
|
"remark-rehype": "^11.1.2",
|
|
79
79
|
"unified": "^11.0.5",
|
|
80
|
-
"@aleph-alpha/ui-library": "
|
|
80
|
+
"@aleph-alpha/ui-library": "6.0.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@storybook/addon-a11y": "10.2.17",
|
|
@@ -299,6 +299,92 @@ describe('responsesToTree', () => {
|
|
|
299
299
|
expect(assistant.content[2].type).toBe('text');
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
+
it('converts hosted native calls into tool parts without rewriting their type', () => {
|
|
303
|
+
const tree = responsesToTree([
|
|
304
|
+
makeResponse({
|
|
305
|
+
id: 'r1',
|
|
306
|
+
request_input: [userInput('What does the contract say?')],
|
|
307
|
+
output: [
|
|
308
|
+
toolOutput({
|
|
309
|
+
id: 'ws-1',
|
|
310
|
+
type: 'web_search_call',
|
|
311
|
+
display: {
|
|
312
|
+
text: 'Searched the internet for "EU AI Act"',
|
|
313
|
+
icon: 'globe',
|
|
314
|
+
phase: 'done',
|
|
315
|
+
},
|
|
316
|
+
}),
|
|
317
|
+
toolOutput({
|
|
318
|
+
id: 'fs-1',
|
|
319
|
+
type: 'file_search_call',
|
|
320
|
+
display: {
|
|
321
|
+
text: 'Searched documents for "contract terms"',
|
|
322
|
+
icon: 'file-search',
|
|
323
|
+
phase: 'done',
|
|
324
|
+
},
|
|
325
|
+
}),
|
|
326
|
+
toolOutput({
|
|
327
|
+
id: 'sh-1',
|
|
328
|
+
type: 'shell_call',
|
|
329
|
+
name: 'pirate-speak',
|
|
330
|
+
display: {
|
|
331
|
+
text: 'Read skill `pirate-speak`',
|
|
332
|
+
icon: 'sparkles',
|
|
333
|
+
phase: 'done',
|
|
334
|
+
},
|
|
335
|
+
}),
|
|
336
|
+
toolOutput({
|
|
337
|
+
id: 'fu-1',
|
|
338
|
+
type: 'fetch_url',
|
|
339
|
+
display: {
|
|
340
|
+
text: 'Searched google.com',
|
|
341
|
+
icon: 'globe',
|
|
342
|
+
phase: 'done',
|
|
343
|
+
},
|
|
344
|
+
}),
|
|
345
|
+
assistantOutput('msg-a1', 'The contract requires compliance.'),
|
|
346
|
+
],
|
|
347
|
+
}),
|
|
348
|
+
]);
|
|
349
|
+
|
|
350
|
+
const assistant = tree.nodes['msg-a1']!;
|
|
351
|
+
expect(assistant.content).toEqual([
|
|
352
|
+
expect.objectContaining({
|
|
353
|
+
type: 'tool',
|
|
354
|
+
id: 'ws-1',
|
|
355
|
+
name: 'web_search_call',
|
|
356
|
+
text: 'Searched the internet for "EU AI Act"',
|
|
357
|
+
icon: 'globe',
|
|
358
|
+
}),
|
|
359
|
+
expect.objectContaining({
|
|
360
|
+
type: 'tool',
|
|
361
|
+
id: 'fs-1',
|
|
362
|
+
name: 'file_search_call',
|
|
363
|
+
text: 'Searched documents for "contract terms"',
|
|
364
|
+
icon: 'file-search',
|
|
365
|
+
}),
|
|
366
|
+
expect.objectContaining({
|
|
367
|
+
type: 'tool',
|
|
368
|
+
id: 'sh-1',
|
|
369
|
+
name: 'pirate-speak',
|
|
370
|
+
text: 'Read skill `pirate-speak`',
|
|
371
|
+
icon: 'sparkles',
|
|
372
|
+
}),
|
|
373
|
+
expect.objectContaining({
|
|
374
|
+
type: 'tool',
|
|
375
|
+
id: 'fu-1',
|
|
376
|
+
name: 'fetch_url',
|
|
377
|
+
text: 'Searched google.com',
|
|
378
|
+
icon: 'globe',
|
|
379
|
+
}),
|
|
380
|
+
expect.objectContaining({
|
|
381
|
+
type: 'text',
|
|
382
|
+
id: 'msg-a1',
|
|
383
|
+
text: 'The contract requires compliance.',
|
|
384
|
+
}),
|
|
385
|
+
]);
|
|
386
|
+
});
|
|
387
|
+
|
|
302
388
|
it('forwards `display.text` and `display.icon` from a tool output onto the resulting tool content', () => {
|
|
303
389
|
const tree = responsesToTree([
|
|
304
390
|
makeResponse({
|
|
@@ -141,7 +141,11 @@ export type ResponseOutputToolType =
|
|
|
141
141
|
| 'file_search_call'
|
|
142
142
|
| 'code_interpreter_call'
|
|
143
143
|
| 'image_generation_call'
|
|
144
|
-
| 'local_shell_call'
|
|
144
|
+
| 'local_shell_call'
|
|
145
|
+
// Hosted Aleph Alpha extras. `shell_call` is the stored skill-fetch
|
|
146
|
+
// wrapper; `fetch_url` is the page-read behind hosted web search.
|
|
147
|
+
| 'shell_call'
|
|
148
|
+
| 'fetch_url';
|
|
145
149
|
|
|
146
150
|
/**
|
|
147
151
|
* Server-provided rendering hints for a tool invocation. The server emits a
|
|
@@ -377,16 +381,16 @@ function toAssistantParts(resp: StoredResponse): MessageContent[] {
|
|
|
377
381
|
parts.push(textPart(text, out.id || undefined));
|
|
378
382
|
break;
|
|
379
383
|
}
|
|
380
|
-
//
|
|
381
|
-
|
|
382
|
-
// a call the assistant made, so it is intentionally skipped.
|
|
383
|
-
case 'mcp_call':
|
|
384
|
-
case 'function_call':
|
|
385
|
-
case 'tool_call': {
|
|
386
|
-
parts.push(toolPart(out));
|
|
384
|
+
// Discovery catalog, not a call the assistant made.
|
|
385
|
+
case 'mcp_list_tools':
|
|
387
386
|
break;
|
|
388
|
-
|
|
387
|
+
// Every other `ResponseOutputTool` is an invocation — function /
|
|
388
|
+
// MCP / hosted builtins (`web_search_call`, `file_search_call`,
|
|
389
|
+
// `shell_call`, …). Hosts used to coerce those to `tool_call`
|
|
390
|
+
// before calling this adapter; converting them here keeps the
|
|
391
|
+
// stored item type intact for citations.
|
|
389
392
|
default:
|
|
393
|
+
parts.push(toolPart(out));
|
|
390
394
|
break;
|
|
391
395
|
}
|
|
392
396
|
}
|
|
@@ -35,7 +35,7 @@ const openSourceAriaLabel = computed(
|
|
|
35
35
|
() =>
|
|
36
36
|
props.openSourceLabel ??
|
|
37
37
|
labels.value.citationOpenSource ??
|
|
38
|
-
defaultChatKitLabels.citationOpenSource
|
|
38
|
+
defaultChatKitLabels.citationOpenSource,
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
// Both labels are clipped to the card width, so each gets the same tooltip
|
|
@@ -25,7 +25,7 @@ const isButton = computed(() => props.as === 'button');
|
|
|
25
25
|
const resolvedAriaLabel = computed(
|
|
26
26
|
() =>
|
|
27
27
|
props.ariaLabel ??
|
|
28
|
-
`${labels.value.citationSourceLabel ?? defaultChatKitLabels.citationSourceLabel
|
|
28
|
+
`${labels.value.citationSourceLabel ?? defaultChatKitLabels.citationSourceLabel} ${props.index}`,
|
|
29
29
|
);
|
|
30
30
|
</script>
|
|
31
31
|
|
|
@@ -26,7 +26,6 @@ const messages = [
|
|
|
26
26
|
function renderLayout(
|
|
27
27
|
msgs: Array<{ role: string; content: string }> = messages,
|
|
28
28
|
) {
|
|
29
|
-
// eslint-disable-next-line vue/one-component-per-file
|
|
30
29
|
const Wrapper = defineComponent({
|
|
31
30
|
setup() {
|
|
32
31
|
return () =>
|
|
@@ -55,7 +54,7 @@ function renderWithInstance(
|
|
|
55
54
|
{ withFooter = false }: { withFooter?: boolean } = {},
|
|
56
55
|
) {
|
|
57
56
|
let instance: LayoutInstance | undefined;
|
|
58
|
-
|
|
57
|
+
|
|
59
58
|
const Wrapper = defineComponent({
|
|
60
59
|
setup() {
|
|
61
60
|
const layoutRef = ref<LayoutInstance>();
|
|
@@ -167,7 +166,6 @@ describe('CkConversationLayout', () => {
|
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
it('provides the full message object including custom fields to scoped slots', () => {
|
|
170
|
-
// eslint-disable-next-line vue/one-component-per-file
|
|
171
169
|
const Wrapper = defineComponent({ setup: () => renderCustomSlotWrapper });
|
|
172
170
|
|
|
173
171
|
render(Wrapper);
|
|
@@ -206,7 +204,6 @@ describe('CkConversationLayout', () => {
|
|
|
206
204
|
});
|
|
207
205
|
|
|
208
206
|
it('gives the thread-footer the larger top margin when messages exist', () => {
|
|
209
|
-
// eslint-disable-next-line vue/one-component-per-file
|
|
210
207
|
const Wrapper = defineComponent({
|
|
211
208
|
setup() {
|
|
212
209
|
return () =>
|
|
@@ -233,7 +230,6 @@ describe('CkConversationLayout', () => {
|
|
|
233
230
|
});
|
|
234
231
|
|
|
235
232
|
it('gives the thread-footer the smaller top margin when there are no messages', () => {
|
|
236
|
-
// eslint-disable-next-line vue/one-component-per-file
|
|
237
233
|
const Wrapper = defineComponent({
|
|
238
234
|
setup() {
|
|
239
235
|
return () =>
|
|
@@ -5,7 +5,7 @@ import { flushPromises } from '@vue/test-utils';
|
|
|
5
5
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
6
6
|
|
|
7
7
|
describe('CkCopyMessageButton', () => {
|
|
8
|
-
const writeText = vi.fn((
|
|
8
|
+
const writeText = vi.fn(() => Promise.resolve());
|
|
9
9
|
|
|
10
10
|
beforeEach(() => {
|
|
11
11
|
writeText.mockReset();
|
|
@@ -32,19 +32,19 @@ const thumbsUpLabel = computed(
|
|
|
32
32
|
() =>
|
|
33
33
|
props.ariaLabelThumbsUp ??
|
|
34
34
|
labels.value.feedbackThumbsUp ??
|
|
35
|
-
defaultChatKitLabels.feedbackThumbsUp
|
|
35
|
+
defaultChatKitLabels.feedbackThumbsUp,
|
|
36
36
|
);
|
|
37
37
|
const thumbsDownLabel = computed(
|
|
38
38
|
() =>
|
|
39
39
|
props.ariaLabelThumbsDown ??
|
|
40
40
|
labels.value.feedbackThumbsDown ??
|
|
41
|
-
defaultChatKitLabels.feedbackThumbsDown
|
|
41
|
+
defaultChatKitLabels.feedbackThumbsDown,
|
|
42
42
|
);
|
|
43
43
|
const groupLabel = computed(
|
|
44
44
|
() =>
|
|
45
45
|
props.ariaLabelGroup ??
|
|
46
46
|
labels.value.feedbackGroup ??
|
|
47
|
-
defaultChatKitLabels.feedbackGroup
|
|
47
|
+
defaultChatKitLabels.feedbackGroup,
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
const isUpSelected = computed(() => props.value === 'up');
|
|
@@ -61,56 +61,56 @@ const title = computed(() => {
|
|
|
61
61
|
return (
|
|
62
62
|
titlePositive ??
|
|
63
63
|
labels.value.feedbackDialogTitlePositive ??
|
|
64
|
-
defaultChatKitLabels.feedbackDialogTitlePositive
|
|
64
|
+
defaultChatKitLabels.feedbackDialogTitlePositive
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
return (
|
|
68
68
|
titleNegative ??
|
|
69
69
|
labels.value.feedbackDialogTitleNegative ??
|
|
70
|
-
defaultChatKitLabels.feedbackDialogTitleNegative
|
|
70
|
+
defaultChatKitLabels.feedbackDialogTitleNegative
|
|
71
71
|
);
|
|
72
72
|
});
|
|
73
73
|
const responseHeading = computed(
|
|
74
74
|
() =>
|
|
75
75
|
responseHeadingProp ??
|
|
76
76
|
labels.value.feedbackDialogResponseHeading ??
|
|
77
|
-
defaultChatKitLabels.feedbackDialogResponseHeading
|
|
77
|
+
defaultChatKitLabels.feedbackDialogResponseHeading,
|
|
78
78
|
);
|
|
79
79
|
const description = computed(
|
|
80
80
|
() =>
|
|
81
81
|
descriptionProp ??
|
|
82
82
|
labels.value.feedbackDialogDescription ??
|
|
83
|
-
defaultChatKitLabels.feedbackDialogDescription
|
|
83
|
+
defaultChatKitLabels.feedbackDialogDescription,
|
|
84
84
|
);
|
|
85
85
|
const otherLabel = computed(
|
|
86
86
|
() =>
|
|
87
87
|
otherLabelProp ??
|
|
88
88
|
labels.value.feedbackDialogOtherLabel ??
|
|
89
|
-
defaultChatKitLabels.feedbackDialogOtherLabel
|
|
89
|
+
defaultChatKitLabels.feedbackDialogOtherLabel,
|
|
90
90
|
);
|
|
91
91
|
const otherTooltip = computed(
|
|
92
92
|
() =>
|
|
93
93
|
otherTooltipProp ??
|
|
94
94
|
labels.value.feedbackDialogOtherTooltip ??
|
|
95
|
-
defaultChatKitLabels.feedbackDialogOtherTooltip
|
|
95
|
+
defaultChatKitLabels.feedbackDialogOtherTooltip,
|
|
96
96
|
);
|
|
97
97
|
const freeTextPlaceholder = computed(
|
|
98
98
|
() =>
|
|
99
99
|
freeTextPlaceholderProp ??
|
|
100
100
|
labels.value.feedbackDialogFreeTextPlaceholder ??
|
|
101
|
-
defaultChatKitLabels.feedbackDialogFreeTextPlaceholder
|
|
101
|
+
defaultChatKitLabels.feedbackDialogFreeTextPlaceholder,
|
|
102
102
|
);
|
|
103
103
|
const cancelLabel = computed(
|
|
104
104
|
() =>
|
|
105
105
|
cancelLabelProp ??
|
|
106
106
|
labels.value.feedbackDialogCancelLabel ??
|
|
107
|
-
defaultChatKitLabels.feedbackDialogCancelLabel
|
|
107
|
+
defaultChatKitLabels.feedbackDialogCancelLabel,
|
|
108
108
|
);
|
|
109
109
|
const submitLabel = computed(
|
|
110
110
|
() =>
|
|
111
111
|
submitLabelProp ??
|
|
112
112
|
labels.value.feedbackDialogSubmitLabel ??
|
|
113
|
-
defaultChatKitLabels.feedbackDialogSubmitLabel
|
|
113
|
+
defaultChatKitLabels.feedbackDialogSubmitLabel,
|
|
114
114
|
);
|
|
115
115
|
|
|
116
116
|
// Multi-select: the user may pick zero or more reason codes. Backed by an
|