@aleph-alpha/chat-kit 1.17.3 → 2.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/{CkInput.vue_vue_type_script_setup_true_lang-DYBCJPBn.js → CkInput.vue_vue_type_script_setup_true_lang-DPZedAQS.js} +219 -104
- package/dist/chat-kit.css +5 -5
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.d.ts +1 -1
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.vue.d.ts.map +1 -1
- package/dist/components/base/CkFeedbackDialog/types.d.ts +14 -9
- package/dist/components/base/CkFeedbackDialog/types.d.ts.map +1 -1
- package/dist/components/base/CkModelSelector/CkModelSelector.stories.d.ts +20 -0
- package/dist/components/base/CkModelSelector/CkModelSelector.stories.d.ts.map +1 -0
- package/dist/components/base/CkModelSelector/CkModelSelector.vue.d.ts +16 -0
- package/dist/components/base/CkModelSelector/CkModelSelector.vue.d.ts.map +1 -0
- package/dist/components/base/CkModelSelector/index.d.ts +3 -0
- package/dist/components/base/CkModelSelector/index.d.ts.map +1 -0
- package/dist/components/base/CkModelSelector/types.d.ts +54 -0
- package/dist/components/base/CkModelSelector/types.d.ts.map +1 -0
- package/dist/components/base/index.d.ts +2 -0
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +9 -8
- package/dist/handlers/index.js +1 -1
- package/dist/handlers/useChatKitLabels.d.ts +6 -0
- package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -10
- package/dist/{useChatKitLabels-BC6ItJc6.js → useChatKitLabels-ZutacPad.js} +3 -0
- package/package.json +1 -1
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.spec.ts +53 -10
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.ts +1 -1
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue +10 -6
- package/src/components/base/CkFeedbackDialog/types.ts +14 -9
- package/src/components/base/CkModelSelector/CkModelSelector.spec.ts +60 -0
- package/src/components/base/CkModelSelector/CkModelSelector.stories.ts +101 -0
- package/src/components/base/CkModelSelector/CkModelSelector.vue +109 -0
- package/src/components/base/CkModelSelector/index.ts +6 -0
- package/src/components/base/CkModelSelector/types.ts +55 -0
- package/src/components/base/index.ts +6 -0
- package/src/components/index.ts +4 -0
- package/src/handlers/useChatKitLabels.spec.ts +5 -28
- package/src/handlers/useChatKitLabels.ts +9 -0
- package/src/index.ts +4 -0
package/dist/chat-kit.css
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.ck-feedback-dialog__chip[data-v-
|
|
26
|
+
.ck-feedback-dialog__chip[data-v-4d1d9c59] {
|
|
27
27
|
width: 100%;
|
|
28
28
|
min-height: 36px;
|
|
29
29
|
height: auto;
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
text-align: center;
|
|
32
32
|
line-height: 1rem;
|
|
33
33
|
}
|
|
34
|
-
.ck-feedback-dialog__response[data-v-
|
|
35
|
-
.ck-feedback-dialog__response[data-v-
|
|
34
|
+
.ck-feedback-dialog__response[data-v-4d1d9c59] p,
|
|
35
|
+
.ck-feedback-dialog__response[data-v-4d1d9c59] li {
|
|
36
36
|
line-height: 1.5rem;
|
|
37
37
|
}
|
|
38
|
-
.ck-feedback-dialog__response[data-v-
|
|
38
|
+
.ck-feedback-dialog__response[data-v-4d1d9c59] p {
|
|
39
39
|
margin: 0 0 0.5rem 0;
|
|
40
40
|
}
|
|
41
|
-
.ck-feedback-dialog__response[data-v-
|
|
41
|
+
.ck-feedback-dialog__response[data-v-4d1d9c59] p:last-child {
|
|
42
42
|
margin-bottom: 0;
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -4,7 +4,7 @@ declare const meta: Meta<typeof CkFeedbackDialog>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
/**
|
|
7
|
-
* Positive variant.
|
|
7
|
+
* Positive variant. Multi-select reason chips on the right, the response on
|
|
8
8
|
* the left, optional free text underneath.
|
|
9
9
|
*/
|
|
10
10
|
export declare const Positive: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkFeedbackDialog.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkFeedbackDialog.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue"],"names":[],"mappings":"AA4SA,OAAO,KAAK,EACV,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AA6gBjB,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Modal dialog for collecting qualitative feedback on an assistant response.
|
|
3
3
|
* Opened after a binary thumbs-up / thumbs-down click (see `CkFeedbackButton`),
|
|
4
|
-
* it lets the user pick
|
|
5
|
-
* comment, then submit
|
|
4
|
+
* it lets the user pick one or more reason codes and add an optional free-text
|
|
5
|
+
* comment, then submit them alongside the original sentiment.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Multiple reasons per submission: the backend (feedback-kit) stores a list of
|
|
8
|
+
* reason codes per response (each becomes its own categorical score), so the
|
|
9
|
+
* chips are multi-select.
|
|
9
10
|
*
|
|
10
11
|
* Fully prop-driven: the host application owns `open`, the list of reasons to
|
|
11
12
|
* show (fetched from `GET /feedback/config`), the response text to display, and
|
|
12
13
|
* the submission handler. The component only manages transient form state (the
|
|
13
|
-
* selected
|
|
14
|
+
* selected reasons and free-text value) until the user submits or cancels.
|
|
14
15
|
*
|
|
15
16
|
* @category Feedback
|
|
16
17
|
* @useCases collect qualitative feedback, gather a reason code for a response,
|
|
@@ -34,8 +35,12 @@ export interface CkFeedbackReason {
|
|
|
34
35
|
export interface CkFeedbackDialogSubmitPayload {
|
|
35
36
|
/** The sentiment the dialog was opened for. */
|
|
36
37
|
sentiment: CkFeedbackSentiment;
|
|
37
|
-
/**
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* The selected reason `code`s. Empty array when the user submitted with
|
|
40
|
+
* only free text and no reason chips selected. Order follows the order in
|
|
41
|
+
* which the user toggled the chips on.
|
|
42
|
+
*/
|
|
43
|
+
reasons: string[];
|
|
39
44
|
/** Free-text comment, trimmed. Empty string when the user typed nothing. */
|
|
40
45
|
reasonText: string;
|
|
41
46
|
}
|
|
@@ -60,9 +65,9 @@ export interface CkFeedbackDialogProps {
|
|
|
60
65
|
*/
|
|
61
66
|
responseText?: string;
|
|
62
67
|
/**
|
|
63
|
-
* Available reasons to render as
|
|
68
|
+
* Available reasons to render as multi-select chips. The host fetches the
|
|
64
69
|
* appropriate per-sentiment list from `GET /feedback/config` and passes it
|
|
65
|
-
* here. The chip shows `label`; the selected `code`
|
|
70
|
+
* here. The chip shows `label`; the selected `code`s are emitted on submit.
|
|
66
71
|
*/
|
|
67
72
|
reasons: CkFeedbackReason[];
|
|
68
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackDialog/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackDialog/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,UAAU,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI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E,OAAO,EAAE,6BAA6B,GAAG,IAAI,CAAC;IAC5D;;;OAGG;IACH,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACrB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import CkModelSelector from './CkModelSelector.vue';
|
|
3
|
+
declare const meta: Meta<typeof CkModelSelector>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof CkModelSelector>;
|
|
6
|
+
/**
|
|
7
|
+
* Default picker with a current selection. Opens upward and aligns to the
|
|
8
|
+
* end, matching its intended spot next to a send button.
|
|
9
|
+
*/
|
|
10
|
+
export declare const Default: Story;
|
|
11
|
+
/**
|
|
12
|
+
* No selection yet — the trigger shows the placeholder label until the user
|
|
13
|
+
* picks a model.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Placeholder: Story;
|
|
16
|
+
/**
|
|
17
|
+
* Disabled trigger — e.g. while the model list is still loading.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Disabled: Story;
|
|
20
|
+
//# sourceMappingURL=CkModelSelector.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CkModelSelector.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/CkModelSelector.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,eAAe,MAAM,uBAAuB,CAAC;AASpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAyBtC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAC;AAoC9C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAGzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAGtB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CkModelSelectorProps } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<CkModelSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
"update:selectedModelId": (id: string) => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<CkModelSelectorProps> & Readonly<{
|
|
5
|
+
"onUpdate:selectedModelId"?: ((id: string) => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
side: "top" | "right" | "bottom" | "left";
|
|
9
|
+
sideOffset: number;
|
|
10
|
+
align: "start" | "center" | "end";
|
|
11
|
+
models: readonly import("./types").CkModelOption[];
|
|
12
|
+
selectedModelId: string | null;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=CkModelSelector.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CkModelSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/CkModelSelector.vue"],"names":[],"mappings":"AA4HA,OAAO,KAAK,EAAwB,oBAAoB,EAAE,MAAM,SAAS,CAAC;AA6Q1E,QAAA,MAAM,YAAY;;;;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compact dropdown for choosing the active model, sized to sit inline in a
|
|
3
|
+
* prompt field next to the send button. Controlled component: pass the
|
|
4
|
+
* available `models` and the `selectedModelId`, and react to
|
|
5
|
+
* `update:selectedModelId` (so it works with `v-model:selected-model-id`).
|
|
6
|
+
* Purely presentational — fetching the list and persisting the choice are the
|
|
7
|
+
* consumer's responsibility.
|
|
8
|
+
*
|
|
9
|
+
* @category Actions
|
|
10
|
+
* @useCases select model, choose LLM, model picker in prompt field, switch model mid-conversation
|
|
11
|
+
* @keywords model, selector, picker, dropdown, llm, prompt, choose, switch
|
|
12
|
+
* @related CkPromptInput, CkPromptActionButton
|
|
13
|
+
*/
|
|
14
|
+
export interface CkModelOption {
|
|
15
|
+
/**
|
|
16
|
+
* Stable identifier for the model. Emitted on selection and compared
|
|
17
|
+
* against `selectedModelId` to mark the active row.
|
|
18
|
+
*/
|
|
19
|
+
id: string;
|
|
20
|
+
/** Display name shown in the trigger and the option row. */
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CkModelSelectorProps {
|
|
24
|
+
/** Models to choose from. The dropdown trigger is still rendered when empty. */
|
|
25
|
+
models?: readonly CkModelOption[];
|
|
26
|
+
/** Id of the currently selected model. */
|
|
27
|
+
selectedModelId?: string | null;
|
|
28
|
+
/** Disable the trigger (e.g. while a model list is loading). */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Which side of the trigger the dropdown opens on.
|
|
32
|
+
* @default 'top'
|
|
33
|
+
*/
|
|
34
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
35
|
+
/**
|
|
36
|
+
* Alignment of the dropdown relative to the trigger.
|
|
37
|
+
* @default 'end'
|
|
38
|
+
*/
|
|
39
|
+
align?: 'start' | 'center' | 'end';
|
|
40
|
+
/**
|
|
41
|
+
* Gap in pixels between the trigger and the dropdown.
|
|
42
|
+
* @default 8
|
|
43
|
+
*/
|
|
44
|
+
sideOffset?: number;
|
|
45
|
+
}
|
|
46
|
+
/** Emitted events for `CkModelSelector`. */
|
|
47
|
+
export interface CkModelSelectorEmits {
|
|
48
|
+
/**
|
|
49
|
+
* Fired with the chosen model id when the selection changes. Pairs with
|
|
50
|
+
* `v-model:selected-model-id`.
|
|
51
|
+
*/
|
|
52
|
+
'update:selectedModelId': [id: string];
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,gFAAgF;IAChF,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC,0CAA0C;IAC1C,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,wBAAwB,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;CACxC"}
|
|
@@ -16,6 +16,8 @@ export type { CkHistoryWrapperProps } from './CkHistoryWrapper';
|
|
|
16
16
|
export { CkMarkdownRenderer } from './CkMarkdownRenderer';
|
|
17
17
|
export type { CkMarkdownRendererProps, CkMarkdownElementClasses, } from './CkMarkdownRenderer';
|
|
18
18
|
export { CkMessageActionButton } from './CkMessageActionButton';
|
|
19
|
+
export { CkModelSelector } from './CkModelSelector';
|
|
20
|
+
export type { CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, } from './CkModelSelector';
|
|
19
21
|
export { CkPromptActionButton } from './CkPromptActionButton';
|
|
20
22
|
export { CkPromptStopButton } from './CkPromptStopButton';
|
|
21
23
|
export { CkPromptInput } from './CkPromptInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,WAAW,EACX,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAA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;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,WAAW,EACX,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CkAgentMessage, CkConversationLayout, CkCopyMessageActionButton, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageActionButton, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './base';
|
|
2
|
-
export type { CkConversationLayoutProps, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkUserMessageProps, } from './base';
|
|
1
|
+
export { CkAgentMessage, CkConversationLayout, CkCopyMessageActionButton, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageActionButton, CkModelSelector, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './base';
|
|
2
|
+
export type { CkConversationLayoutProps, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkUserMessageProps, } from './base';
|
|
3
3
|
export { CkConversation, CkHistory, CkInput } from './composed';
|
|
4
4
|
export type { CkConversationProps, CkHistoryEmits, CkHistoryProps, } from './composed';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,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 } from "../CkInput.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 } from "../CkInput.vue_vue_type_script_setup_true_lang-DPZedAQS.js";
|
|
2
2
|
export {
|
|
3
3
|
_ as CkAgentMessage,
|
|
4
4
|
a as CkConversation,
|
|
@@ -13,11 +13,12 @@ export {
|
|
|
13
13
|
i as CkInput,
|
|
14
14
|
j as CkMarkdownRenderer,
|
|
15
15
|
k as CkMessageActionButton,
|
|
16
|
-
l as
|
|
17
|
-
m as
|
|
18
|
-
n as
|
|
19
|
-
o as
|
|
20
|
-
p as
|
|
21
|
-
q as
|
|
22
|
-
r as
|
|
16
|
+
l as CkModelSelector,
|
|
17
|
+
m as CkPromptActionButton,
|
|
18
|
+
n as CkPromptInput,
|
|
19
|
+
o as CkPromptInputDisclaimer,
|
|
20
|
+
p as CkPromptStopButton,
|
|
21
|
+
q as CkSendIcon,
|
|
22
|
+
r as CkStopIcon,
|
|
23
|
+
s as CkUserMessage
|
|
23
24
|
};
|
package/dist/handlers/index.js
CHANGED
|
@@ -67,6 +67,12 @@ export type ChatKitLabels = {
|
|
|
67
67
|
userMessageShowMore?: string;
|
|
68
68
|
/** Label for the `CkUserMessage` toggle when the message is expanded. */
|
|
69
69
|
userMessageShowLess?: string;
|
|
70
|
+
/** Accessible label for the `CkModelSelector` trigger button. */
|
|
71
|
+
modelSelectorAriaLabel?: string;
|
|
72
|
+
/** Accessible label for the `CkModelSelector` options list. */
|
|
73
|
+
modelSelectorListAriaLabel?: string;
|
|
74
|
+
/** Trigger text shown by `CkModelSelector` when no model is selected. */
|
|
75
|
+
modelSelectorPlaceholder?: string;
|
|
70
76
|
/** Fallback title used by `CkHistory` when a conversation has no `title`. */
|
|
71
77
|
historyItemUntitled: string;
|
|
72
78
|
/** Accessible name for the trailing kebab trigger on each `CkHistory` row. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatKitLabels.d.ts","sourceRoot":"","sources":["../../src/handlers/useChatKitLabels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gDAAgD;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,sFAAsF;IACtF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,4FAA4F;IAC5F,uBAAuB,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,+DAA+D;IAC/D,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,gEAAgE;IAChE,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,kFAAkF;IAClF,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,qEAAqE;IACrE,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qEAAqE;IACrE,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,iEAAiE;IACjE,iCAAiC,CAAC,EAAE,MAAM,CAAC;IAC3C,iDAAiD;IACjD,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,iDAAiD;IACjD,yBAAyB,CAAC,EAAE,MAAM,C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AG,IAAI,CAKjE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAAC,aAAa,CAAC,CAK7D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { useChat, useConversationSessions, useConversations, } from './composabl
|
|
|
5
5
|
export type { ChatActions, ChatState, ConversationSession, CreateConversationInput, MessageHandler, MutationOptions, UseChatReturn, UseConversationSessionsReturn, UseConversationsOptions, UseConversationsReturn, } from './composables';
|
|
6
6
|
export { SdkError, createDocumentUploadProvider, defaultDocumentUploadConfig, defaultEndpoints, useDocumentUploadWithDefaultConfig, } from './composables/fileUpload';
|
|
7
7
|
export type { DocumentUploadConfig, DocumentUploadProvider, FileEntry, FileStatus, } from './composables/fileUpload';
|
|
8
|
-
export { CkAgentMessage, CkConversation, CkConversationLayout, CkCopyMessageActionButton, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistory, CkHistoryItem, CkHistoryWrapper, CkInput, CkMarkdownRenderer, CkMessageActionButton, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './components';
|
|
9
|
-
export type { CkConversationLayoutProps, CkConversationProps, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryEmits, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkUserMessageProps, } from './components';
|
|
8
|
+
export { CkAgentMessage, CkConversation, CkConversationLayout, CkCopyMessageActionButton, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistory, CkHistoryItem, CkHistoryWrapper, CkInput, CkMarkdownRenderer, CkMessageActionButton, CkModelSelector, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './components';
|
|
9
|
+
export type { CkConversationLayoutProps, CkConversationProps, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryEmits, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkUserMessageProps, } from './components';
|
|
10
10
|
export { formatRelativeTime } from './helpers';
|
|
11
11
|
export type { BaseMessage, Conversation, ConversationTree, MessageContent, MessageContentStatus, MessageMetadata, MessageReasoningContent, MessageRole, MessageStatus, MessageTextContent, MessageToolContent, TreeMessage, } from './types';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AASpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EACL,OAAO,EACP,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,UAAU,GACX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK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B,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { u } from "./useMessageHandler-CMdy-lm0.js";
|
|
2
|
-
import { C, d, p, u as u2, a } from "./useChatKitLabels-
|
|
2
|
+
import { C, d, p, u as u2, a } from "./useChatKitLabels-ZutacPad.js";
|
|
3
3
|
import { S, c, d as d2, a as a2, u as u3, b, e, f } from "./index-Ct5hD214.js";
|
|
4
|
-
import { _, a as a3, b as b2, 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 } from "./CkInput.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _, a as a3, b as b2, 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 } from "./CkInput.vue_vue_type_script_setup_true_lang-DPZedAQS.js";
|
|
5
5
|
export {
|
|
6
6
|
C as CHAT_KIT_LABELS,
|
|
7
7
|
_ as CkAgentMessage,
|
|
@@ -17,19 +17,20 @@ export {
|
|
|
17
17
|
i as CkInput,
|
|
18
18
|
j as CkMarkdownRenderer,
|
|
19
19
|
k as CkMessageActionButton,
|
|
20
|
-
l as
|
|
21
|
-
m as
|
|
22
|
-
n as
|
|
23
|
-
o as
|
|
24
|
-
p2 as
|
|
25
|
-
q as
|
|
26
|
-
r as
|
|
20
|
+
l as CkModelSelector,
|
|
21
|
+
m as CkPromptActionButton,
|
|
22
|
+
n as CkPromptInput,
|
|
23
|
+
o as CkPromptInputDisclaimer,
|
|
24
|
+
p2 as CkPromptStopButton,
|
|
25
|
+
q as CkSendIcon,
|
|
26
|
+
r as CkStopIcon,
|
|
27
|
+
s as CkUserMessage,
|
|
27
28
|
S as SdkError,
|
|
28
29
|
c as createDocumentUploadProvider,
|
|
29
30
|
d as defaultChatKitLabels,
|
|
30
31
|
d2 as defaultDocumentUploadConfig,
|
|
31
32
|
a2 as defaultEndpoints,
|
|
32
|
-
|
|
33
|
+
t as formatRelativeTime,
|
|
33
34
|
p as provideChatKitLabels,
|
|
34
35
|
u3 as useChat,
|
|
35
36
|
u2 as useChatKitLabels,
|
|
@@ -12719,6 +12719,9 @@ const defaultChatKitLabels = {
|
|
|
12719
12719
|
feedbackDialogSubmitLabel: "Submit",
|
|
12720
12720
|
userMessageShowMore: "Show more",
|
|
12721
12721
|
userMessageShowLess: "Show less",
|
|
12722
|
+
modelSelectorAriaLabel: "Select model",
|
|
12723
|
+
modelSelectorListAriaLabel: "Models",
|
|
12724
|
+
modelSelectorPlaceholder: "Select model",
|
|
12722
12725
|
historyItemUntitled: "Untitled conversation",
|
|
12723
12726
|
historyItemActionAriaLabel: "Conversation options",
|
|
12724
12727
|
historyItemEditAction: "Edit",
|
package/package.json
CHANGED
|
@@ -60,8 +60,8 @@ describe('CkFeedbackDialog', () => {
|
|
|
60
60
|
expect(await screen.findByText(TITLE_NEGATIVE)).toBeInTheDocument();
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
// AC: "Submitting sends sentiment +
|
|
64
|
-
// The dialog emits the selected reason CODE (not the label) and
|
|
63
|
+
// AC: "Submitting sends sentiment + reasons + reason_text to the backend."
|
|
64
|
+
// The dialog emits the selected reason CODE(s) (not the label) and sentiment.
|
|
65
65
|
it('emits submit with the selected reason code and sentiment', async () => {
|
|
66
66
|
const user = userEvent.setup();
|
|
67
67
|
const { emitted } = renderDialog({ sentiment: 'negative' });
|
|
@@ -75,25 +75,48 @@ describe('CkFeedbackDialog', () => {
|
|
|
75
75
|
expect(submitEvents).toHaveLength(1);
|
|
76
76
|
expect(submitEvents[0][0]).toEqual({
|
|
77
77
|
sentiment: 'negative',
|
|
78
|
-
|
|
78
|
+
reasons: [REASONS[0].code],
|
|
79
79
|
reasonText: '',
|
|
80
80
|
});
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
it('
|
|
83
|
+
// Multi-select: choosing several reasons emits all selected codes, in the
|
|
84
|
+
// order the user toggled them on.
|
|
85
|
+
it('emits all selected reason codes (multi-select)', async () => {
|
|
86
86
|
const user = userEvent.setup();
|
|
87
87
|
const { emitted } = renderDialog();
|
|
88
88
|
|
|
89
89
|
await user.click(
|
|
90
90
|
await screen.findByRole('button', { name: REASONS[0].label }),
|
|
91
91
|
);
|
|
92
|
-
await user.click(screen.getByRole('button', { name: REASONS[
|
|
92
|
+
await user.click(screen.getByRole('button', { name: REASONS[2].label }));
|
|
93
93
|
await user.click(screen.getByRole('button', { name: SUBMIT }));
|
|
94
94
|
|
|
95
95
|
const submitEvents = emitted('submit') as [CkFeedbackDialogSubmitPayload][];
|
|
96
|
-
expect(submitEvents
|
|
96
|
+
expect(submitEvents).toHaveLength(1);
|
|
97
|
+
expect(submitEvents[0][0].reasons).toEqual([
|
|
98
|
+
REASONS[0].code,
|
|
99
|
+
REASONS[2].code,
|
|
100
|
+
]);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// Edge case: toggling a selected reason off again removes it from the
|
|
104
|
+
// payload. If it was the only signal, submit becomes disabled again.
|
|
105
|
+
it('deselects a reason when toggled twice and re-gates submit', async () => {
|
|
106
|
+
const user = userEvent.setup();
|
|
107
|
+
const { emitted } = renderDialog();
|
|
108
|
+
|
|
109
|
+
const chip = await screen.findByRole('button', { name: REASONS[0].label });
|
|
110
|
+
const submit = screen.getByRole('button', { name: SUBMIT });
|
|
111
|
+
|
|
112
|
+
await user.click(chip); // select
|
|
113
|
+
await waitFor(() => expect(submit).not.toBeDisabled());
|
|
114
|
+
|
|
115
|
+
await user.click(chip); // deselect
|
|
116
|
+
await waitFor(() => expect(submit).toBeDisabled());
|
|
117
|
+
|
|
118
|
+
// Never submitted, so no payload was emitted.
|
|
119
|
+
expect(emitted('submit')).toBeUndefined();
|
|
97
120
|
});
|
|
98
121
|
|
|
99
122
|
// Submit is gated until the user provides at least one signal (a reason or
|
|
@@ -109,7 +132,7 @@ describe('CkFeedbackDialog', () => {
|
|
|
109
132
|
await waitFor(() => expect(submit).not.toBeDisabled());
|
|
110
133
|
});
|
|
111
134
|
|
|
112
|
-
// Free text alone (no reason) is a valid submission;
|
|
135
|
+
// Free text alone (no reason) is a valid submission; reasons is empty.
|
|
113
136
|
it('allows submitting with only free text', async () => {
|
|
114
137
|
const user = userEvent.setup();
|
|
115
138
|
const { emitted } = renderDialog();
|
|
@@ -120,11 +143,31 @@ describe('CkFeedbackDialog', () => {
|
|
|
120
143
|
const submitEvents = emitted('submit') as [CkFeedbackDialogSubmitPayload][];
|
|
121
144
|
expect(submitEvents).toHaveLength(1);
|
|
122
145
|
expect(submitEvents[0][0]).toMatchObject({
|
|
123
|
-
|
|
146
|
+
reasons: [],
|
|
124
147
|
reasonText: 'Needs more detail',
|
|
125
148
|
});
|
|
126
149
|
});
|
|
127
150
|
|
|
151
|
+
// Edge case: reasons + free text combine into one payload, free text trimmed.
|
|
152
|
+
it('emits both reasons and free text when given', async () => {
|
|
153
|
+
const user = userEvent.setup();
|
|
154
|
+
const { emitted } = renderDialog({ sentiment: 'negative' });
|
|
155
|
+
|
|
156
|
+
await user.click(
|
|
157
|
+
await screen.findByRole('button', { name: REASONS[0].label }),
|
|
158
|
+
);
|
|
159
|
+
await user.click(screen.getByRole('button', { name: REASONS[1].label }));
|
|
160
|
+
await user.type(screen.getByRole('textbox'), ' extra context ');
|
|
161
|
+
await user.click(screen.getByRole('button', { name: SUBMIT }));
|
|
162
|
+
|
|
163
|
+
const submitEvents = emitted('submit') as [CkFeedbackDialogSubmitPayload][];
|
|
164
|
+
expect(submitEvents[0][0]).toEqual({
|
|
165
|
+
sentiment: 'negative',
|
|
166
|
+
reasons: [REASONS[0].code, REASONS[1].code],
|
|
167
|
+
reasonText: 'extra context',
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
128
171
|
// AC: "After clicking Cancel ... the user can click again" — cancel emits
|
|
129
172
|
// both `cancel` and `update:open(false)` without a `submit`.
|
|
130
173
|
it('emits cancel and closes without submitting', async () => {
|
|
@@ -152,7 +152,7 @@ function onCancel() {
|
|
|
152
152
|
</template>`;
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
|
-
* Positive variant.
|
|
155
|
+
* Positive variant. Multi-select reason chips on the right, the response on
|
|
156
156
|
* the left, optional free text underneath.
|
|
157
157
|
*/
|
|
158
158
|
export const Positive: Story = {
|
|
@@ -109,7 +109,9 @@ const submitLabel = computed(
|
|
|
109
109
|
defaultChatKitLabels.feedbackDialogSubmitLabel!,
|
|
110
110
|
);
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
// Multi-select: the user may pick zero or more reason codes. Backed by an
|
|
113
|
+
// array so `UiToggleGroup type="multiple"` can two-way bind directly.
|
|
114
|
+
const selectedReasons = ref<string[]>([]);
|
|
113
115
|
const freeText = ref('');
|
|
114
116
|
|
|
115
117
|
// Per-instance id so the label/textarea association stays correct even when
|
|
@@ -120,7 +122,7 @@ watch(
|
|
|
120
122
|
() => open,
|
|
121
123
|
(isOpen, wasOpen) => {
|
|
122
124
|
if (isOpen && !wasOpen) {
|
|
123
|
-
|
|
125
|
+
selectedReasons.value = [];
|
|
124
126
|
freeText.value = '';
|
|
125
127
|
}
|
|
126
128
|
},
|
|
@@ -134,7 +136,7 @@ const canSubmit = computed(
|
|
|
134
136
|
() =>
|
|
135
137
|
!disabled &&
|
|
136
138
|
!submitting &&
|
|
137
|
-
(
|
|
139
|
+
(selectedReasons.value.length > 0 || freeText.value.trim() !== ''),
|
|
138
140
|
);
|
|
139
141
|
|
|
140
142
|
function handleOpenChange(next: boolean): void {
|
|
@@ -166,7 +168,9 @@ function handleSubmit(): void {
|
|
|
166
168
|
}
|
|
167
169
|
emit('submit', {
|
|
168
170
|
sentiment,
|
|
169
|
-
|
|
171
|
+
// Copy so the host can't mutate our internal reactive array, and so the
|
|
172
|
+
// payload is a plain snapshot at submit time.
|
|
173
|
+
reasons: [...selectedReasons.value],
|
|
170
174
|
reasonText: freeText.value.trim(),
|
|
171
175
|
});
|
|
172
176
|
}
|
|
@@ -200,8 +204,8 @@ function handleSubmit(): void {
|
|
|
200
204
|
|
|
201
205
|
<section class="flex min-h-0 flex-col gap-4">
|
|
202
206
|
<UiToggleGroup
|
|
203
|
-
v-model="
|
|
204
|
-
type="
|
|
207
|
+
v-model="selectedReasons"
|
|
208
|
+
type="multiple"
|
|
205
209
|
variant="outline"
|
|
206
210
|
:disabled="disabled || submitting"
|
|
207
211
|
class="grid grid-cols-2 gap-4"
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Modal dialog for collecting qualitative feedback on an assistant response.
|
|
3
3
|
* Opened after a binary thumbs-up / thumbs-down click (see `CkFeedbackButton`),
|
|
4
|
-
* it lets the user pick
|
|
5
|
-
* comment, then submit
|
|
4
|
+
* it lets the user pick one or more reason codes and add an optional free-text
|
|
5
|
+
* comment, then submit them alongside the original sentiment.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Multiple reasons per submission: the backend (feedback-kit) stores a list of
|
|
8
|
+
* reason codes per response (each becomes its own categorical score), so the
|
|
9
|
+
* chips are multi-select.
|
|
9
10
|
*
|
|
10
11
|
* Fully prop-driven: the host application owns `open`, the list of reasons to
|
|
11
12
|
* show (fetched from `GET /feedback/config`), the response text to display, and
|
|
12
13
|
* the submission handler. The component only manages transient form state (the
|
|
13
|
-
* selected
|
|
14
|
+
* selected reasons and free-text value) until the user submits or cancels.
|
|
14
15
|
*
|
|
15
16
|
* @category Feedback
|
|
16
17
|
* @useCases collect qualitative feedback, gather a reason code for a response,
|
|
@@ -36,8 +37,12 @@ export interface CkFeedbackReason {
|
|
|
36
37
|
export interface CkFeedbackDialogSubmitPayload {
|
|
37
38
|
/** The sentiment the dialog was opened for. */
|
|
38
39
|
sentiment: CkFeedbackSentiment;
|
|
39
|
-
/**
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* The selected reason `code`s. Empty array when the user submitted with
|
|
42
|
+
* only free text and no reason chips selected. Order follows the order in
|
|
43
|
+
* which the user toggled the chips on.
|
|
44
|
+
*/
|
|
45
|
+
reasons: string[];
|
|
41
46
|
/** Free-text comment, trimmed. Empty string when the user typed nothing. */
|
|
42
47
|
reasonText: string;
|
|
43
48
|
}
|
|
@@ -63,9 +68,9 @@ export interface CkFeedbackDialogProps {
|
|
|
63
68
|
*/
|
|
64
69
|
responseText?: string;
|
|
65
70
|
/**
|
|
66
|
-
* Available reasons to render as
|
|
71
|
+
* Available reasons to render as multi-select chips. The host fetches the
|
|
67
72
|
* appropriate per-sentiment list from `GET /feedback/config` and passes it
|
|
68
|
-
* here. The chip shows `label`; the selected `code`
|
|
73
|
+
* here. The chip shows `label`; the selected `code`s are emitted on submit.
|
|
69
74
|
*/
|
|
70
75
|
reasons: CkFeedbackReason[];
|
|
71
76
|
/**
|