@aleph-alpha/chat-kit 6.4.3 → 6.6.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-Bv3FuKT4.js → CkHistory.vue_vue_type_script_setup_true_lang-BnUMeeto.js} +21 -10
- package/dist/chat-kit.css +8 -8
- package/dist/components/base/CkCitation/CkCitation.vue.d.ts +1 -0
- package/dist/components/base/CkCitation/CkCitation.vue.d.ts.map +1 -1
- package/dist/components/base/CkCitation/types.d.ts +6 -0
- package/dist/components/base/CkCitation/types.d.ts.map +1 -1
- package/dist/components/base/CkCitationCard/CkCitationCard.vue.d.ts +1 -0
- package/dist/components/base/CkCitationCard/CkCitationCard.vue.d.ts.map +1 -1
- package/dist/components/base/CkCitationCard/types.d.ts +6 -0
- package/dist/components/base/CkCitationCard/types.d.ts.map +1 -1
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.d.ts +5 -0
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.d.ts.map +1 -1
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.vue.d.ts +14 -1
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.vue.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/base/CkCitation/CkCitation.vue +2 -0
- package/src/components/base/CkCitation/types.ts +6 -0
- package/src/components/base/CkCitationCard/CkCitationCard.spec.ts +15 -0
- package/src/components/base/CkCitationCard/CkCitationCard.vue +2 -1
- package/src/components/base/CkCitationCard/types.ts +6 -0
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.spec.ts +27 -0
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.ts +23 -0
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue +15 -0
|
@@ -227,7 +227,7 @@ const _hoisted_4$8 = {
|
|
|
227
227
|
key: 0,
|
|
228
228
|
class: "flex items-center gap-1.5 text-sm leading-5 text-content-on-surface-muted"
|
|
229
229
|
};
|
|
230
|
-
const _hoisted_5$
|
|
230
|
+
const _hoisted_5$5 = {
|
|
231
231
|
key: 1,
|
|
232
232
|
"aria-hidden": "true",
|
|
233
233
|
class: "shrink-0 text-border-input-strong"
|
|
@@ -243,6 +243,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
243
243
|
__name: "CkCitationCard",
|
|
244
244
|
props: {
|
|
245
245
|
fileName: {},
|
|
246
|
+
icon: { default: void 0 },
|
|
246
247
|
snippet: {},
|
|
247
248
|
locationLabel: { default: void 0 },
|
|
248
249
|
collectionName: { default: void 0 },
|
|
@@ -274,8 +275,9 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
274
275
|
createElementVNode("div", _hoisted_2$9, [
|
|
275
276
|
createVNode(unref(UiFileType), {
|
|
276
277
|
filename: __props.fileName,
|
|
278
|
+
icon: __props.icon,
|
|
277
279
|
class: "shrink-0"
|
|
278
|
-
}, null, 8, ["filename"]),
|
|
280
|
+
}, null, 8, ["filename", "icon"]),
|
|
279
281
|
createVNode(unref(UiTooltip), {
|
|
280
282
|
content: __props.fileName,
|
|
281
283
|
disabled: !unref(isFileNameTruncated),
|
|
@@ -325,7 +327,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
325
327
|
]),
|
|
326
328
|
_: 1
|
|
327
329
|
}, 8, ["content", "disabled"])) : createCommentVNode("", true),
|
|
328
|
-
__props.collectionName && __props.locationLabel ? (openBlock(), createElementBlock("span", _hoisted_5$
|
|
330
|
+
__props.collectionName && __props.locationLabel ? (openBlock(), createElementBlock("span", _hoisted_5$5, " | ")) : createCommentVNode("", true),
|
|
329
331
|
__props.locationLabel ? (openBlock(), createElementBlock("span", _hoisted_6$4, toDisplayString(__props.locationLabel), 1)) : createCommentVNode("", true)
|
|
330
332
|
])) : createCommentVNode("", true)
|
|
331
333
|
]);
|
|
@@ -393,6 +395,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
393
395
|
openSourceLabel: { default: void 0 },
|
|
394
396
|
index: {},
|
|
395
397
|
fileName: {},
|
|
398
|
+
icon: { default: void 0 },
|
|
396
399
|
snippet: {},
|
|
397
400
|
locationLabel: { default: void 0 },
|
|
398
401
|
collectionName: {},
|
|
@@ -480,13 +483,14 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
480
483
|
default: withCtx(() => [
|
|
481
484
|
createVNode(unref(_sfc_main$r), {
|
|
482
485
|
"file-name": __props.fileName,
|
|
486
|
+
icon: __props.icon,
|
|
483
487
|
snippet: __props.snippet,
|
|
484
488
|
"location-label": __props.locationLabel,
|
|
485
489
|
"collection-name": __props.collectionName,
|
|
486
490
|
url: __props.url,
|
|
487
491
|
"open-source-label": __props.openSourceLabel,
|
|
488
492
|
onOpenSource: _cache[0] || (_cache[0] = (u) => emit("open-source", u))
|
|
489
|
-
}, null, 8, ["file-name", "snippet", "location-label", "collection-name", "url", "open-source-label"])
|
|
493
|
+
}, null, 8, ["file-name", "icon", "snippet", "location-label", "collection-name", "url", "open-source-label"])
|
|
490
494
|
]),
|
|
491
495
|
_: 1
|
|
492
496
|
})
|
|
@@ -854,7 +858,7 @@ const _hoisted_1$b = ["aria-label"];
|
|
|
854
858
|
const _hoisted_2$7 = { class: "pointer-events-none flex h-full w-full flex-col items-center justify-center gap-4 text-content-on-surface-primary" };
|
|
855
859
|
const _hoisted_3$6 = { class: "flex flex-col items-center gap-1 text-center" };
|
|
856
860
|
const _hoisted_4$6 = { class: "body-16-bold" };
|
|
857
|
-
const _hoisted_5$
|
|
861
|
+
const _hoisted_5$4 = {
|
|
858
862
|
key: 0,
|
|
859
863
|
class: "body-16-regular"
|
|
860
864
|
};
|
|
@@ -1030,7 +1034,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
1030
1034
|
createVNode(_sfc_main$l, { class: "h-36 w-52" }),
|
|
1031
1035
|
createElementVNode("div", _hoisted_3$6, [
|
|
1032
1036
|
createElementVNode("p", _hoisted_4$6, toDisplayString(resolvedHeading.value), 1),
|
|
1033
|
-
__props.hint ? (openBlock(), createElementBlock("p", _hoisted_5$
|
|
1037
|
+
__props.hint ? (openBlock(), createElementBlock("p", _hoisted_5$4, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
|
|
1034
1038
|
])
|
|
1035
1039
|
], true)
|
|
1036
1040
|
])
|
|
@@ -1322,6 +1326,10 @@ const _hoisted_4$5 = {
|
|
|
1322
1326
|
class: "self-end text-sm text-content-on-surface-muted tabular-nums",
|
|
1323
1327
|
"aria-live": "polite"
|
|
1324
1328
|
};
|
|
1329
|
+
const _hoisted_5$3 = {
|
|
1330
|
+
key: 0,
|
|
1331
|
+
class: "ck-feedback-dialog__footer flex items-center gap-2 text-sm text-content-on-surface-muted"
|
|
1332
|
+
};
|
|
1325
1333
|
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
1326
1334
|
...{
|
|
1327
1335
|
name: "CkFeedbackDialog"
|
|
@@ -1554,17 +1562,20 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
1554
1562
|
_: 1
|
|
1555
1563
|
})
|
|
1556
1564
|
])
|
|
1557
|
-
], 2)
|
|
1565
|
+
], 2),
|
|
1566
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5$3, [
|
|
1567
|
+
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
1568
|
+
])) : createCommentVNode("", true)
|
|
1558
1569
|
]),
|
|
1559
|
-
_:
|
|
1570
|
+
_: 3
|
|
1560
1571
|
}, 8, ["title", "show-close-button"])
|
|
1561
1572
|
]),
|
|
1562
|
-
_:
|
|
1573
|
+
_: 3
|
|
1563
1574
|
}, 8, ["open"]);
|
|
1564
1575
|
};
|
|
1565
1576
|
}
|
|
1566
1577
|
});
|
|
1567
|
-
const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
1578
|
+
const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-8d78ea5d"]]);
|
|
1568
1579
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1569
1580
|
...{
|
|
1570
1581
|
name: "CkFileItemRow",
|
package/dist/chat-kit.css
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.ck-feedback-dialog__chip[data-v-
|
|
48
|
+
.ck-feedback-dialog__chip[data-v-8d78ea5d] {
|
|
49
49
|
width: 100%;
|
|
50
50
|
min-height: 36px;
|
|
51
51
|
height: auto;
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
* emitted by the consumer's UnoCSS build. The :hover selector holds the
|
|
60
60
|
* styling when hovering a selected chip (the outline variant ships a
|
|
61
61
|
* data-[state=on]:hover override of equal specificity otherwise). */
|
|
62
|
-
.ck-feedback-dialog__chip[data-state='on'][data-v-
|
|
63
|
-
.ck-feedback-dialog__chip[data-state='on'][data-v-
|
|
62
|
+
.ck-feedback-dialog__chip[data-state='on'][data-v-8d78ea5d],
|
|
63
|
+
.ck-feedback-dialog__chip[data-state='on'][data-v-8d78ea5d]:hover {
|
|
64
64
|
border-color: oklch(var(--accent-default));
|
|
65
65
|
background-color: oklch(var(--background-accent-soft));
|
|
66
66
|
color: oklch(var(--content-on-accent-soft));
|
|
@@ -70,17 +70,17 @@
|
|
|
70
70
|
* The free-text field stays vertically resizable, but cap its height so
|
|
71
71
|
* dragging the resize handle can't push it past the dialog bounds.
|
|
72
72
|
*/
|
|
73
|
-
.ck-feedback-dialog__freetext[data-v-
|
|
73
|
+
.ck-feedback-dialog__freetext[data-v-8d78ea5d] {
|
|
74
74
|
max-height: 11rem;
|
|
75
75
|
}
|
|
76
|
-
.ck-feedback-dialog__response[data-v-
|
|
77
|
-
.ck-feedback-dialog__response[data-v-
|
|
76
|
+
.ck-feedback-dialog__response[data-v-8d78ea5d] p,
|
|
77
|
+
.ck-feedback-dialog__response[data-v-8d78ea5d] li {
|
|
78
78
|
line-height: 1.5rem;
|
|
79
79
|
}
|
|
80
|
-
.ck-feedback-dialog__response[data-v-
|
|
80
|
+
.ck-feedback-dialog__response[data-v-8d78ea5d] p {
|
|
81
81
|
margin: 0 0 0.5rem 0;
|
|
82
82
|
}
|
|
83
|
-
.ck-feedback-dialog__response[data-v-
|
|
83
|
+
.ck-feedback-dialog__response[data-v-8d78ea5d] p:last-child {
|
|
84
84
|
margin-bottom: 0;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -4,6 +4,7 @@ declare const __VLS_export: import("vue").DefineComponent<CkCitationProps, {}, {
|
|
|
4
4
|
}, string, import("vue").PublicProps, Readonly<CkCitationProps> & Readonly<{
|
|
5
5
|
"onOpen-source"?: ((url: string) => any) | undefined;
|
|
6
6
|
}>, {
|
|
7
|
+
icon: string;
|
|
7
8
|
ariaLabel: string;
|
|
8
9
|
locationLabel: string;
|
|
9
10
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkCitation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitation/CkCitation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkCitation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitation/CkCitation.vue"],"names":[],"mappings":"AAgKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAqS/C,QAAA,MAAM,YAAY;;;;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -20,6 +20,12 @@ export interface CkCitationSource {
|
|
|
20
20
|
* (pass the original name with its extension).
|
|
21
21
|
*/
|
|
22
22
|
fileName: string;
|
|
23
|
+
/**
|
|
24
|
+
* Explicit Lucide icon for the file-type badge, overriding the one derived
|
|
25
|
+
* from `fileName`. Use for a source that has no meaningful file type, e.g.
|
|
26
|
+
* `"globe"` for a web result.
|
|
27
|
+
*/
|
|
28
|
+
icon?: string;
|
|
23
29
|
/** The cited chunk text, shown in the card body. */
|
|
24
30
|
snippet: string;
|
|
25
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC"}
|
|
@@ -4,6 +4,7 @@ declare const __VLS_export: import("vue").DefineComponent<CkCitationCardProps, {
|
|
|
4
4
|
}, string, import("vue").PublicProps, Readonly<CkCitationCardProps> & Readonly<{
|
|
5
5
|
"onOpen-source"?: ((url: string) => any) | undefined;
|
|
6
6
|
}>, {
|
|
7
|
+
icon: string;
|
|
7
8
|
locationLabel: string;
|
|
8
9
|
collectionName: string;
|
|
9
10
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkCitationCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/CkCitationCard.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkCitationCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/CkCitationCard.vue"],"names":[],"mappings":"AAwIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAmQnD,QAAA,MAAM,YAAY;;;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -20,6 +20,12 @@ export interface CkCitationCardProps {
|
|
|
20
20
|
* e.g. `q3-report.pdf`).
|
|
21
21
|
*/
|
|
22
22
|
fileName: string;
|
|
23
|
+
/**
|
|
24
|
+
* Explicit Lucide icon for the file-type badge, overriding the one derived
|
|
25
|
+
* from `fileName`. Use for a source that has no meaningful file type, e.g.
|
|
26
|
+
* `"globe"` for a web result.
|
|
27
|
+
*/
|
|
28
|
+
icon?: string;
|
|
23
29
|
/** The cited chunk text, shown in the card body. */
|
|
24
30
|
snippet: string;
|
|
25
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC"}
|
|
@@ -40,6 +40,11 @@ export declare const Submitting: Story;
|
|
|
40
40
|
* actions remain reachable.
|
|
41
41
|
*/
|
|
42
42
|
export declare const LongResponse: Story;
|
|
43
|
+
/**
|
|
44
|
+
* The optional `footer` slot renders a row below the columns, e.g. a reference
|
|
45
|
+
* id the user can copy when reporting the answer.
|
|
46
|
+
*/
|
|
47
|
+
export declare const WithFooter: Story;
|
|
43
48
|
/**
|
|
44
49
|
* Realistic end-to-end flow wired to `CkFeedbackButton`. Click a thumb to open
|
|
45
50
|
* the dialog; submit or cancel; the button locks only on submit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkFeedbackDialog.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AAOtD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAoF3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAkBvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAoEnC;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAO9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAO1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAqEhC,CAAC"}
|
|
1
|
+
{"version":3,"file":"CkFeedbackDialog.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AAOtD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAoF3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAkBvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAoEnC;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAO9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAO1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAiBxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAqEhC,CAAC"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload } from './types';
|
|
2
|
-
|
|
2
|
+
type __VLS_Slots = {
|
|
3
|
+
/**
|
|
4
|
+
* Optional row below the reasons and response columns, e.g. a reference id
|
|
5
|
+
* the user can copy. Not rendered when empty.
|
|
6
|
+
*/
|
|
7
|
+
footer?: () => unknown;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<CkFeedbackDialogProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
10
|
cancel: () => any;
|
|
4
11
|
submit: (payload: CkFeedbackDialogSubmitPayload) => any;
|
|
5
12
|
"update:open": (open: boolean) => any;
|
|
@@ -8,6 +15,12 @@ declare const __VLS_export: import("vue").DefineComponent<CkFeedbackDialogProps,
|
|
|
8
15
|
onSubmit?: ((payload: CkFeedbackDialogSubmitPayload) => any) | undefined;
|
|
9
16
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
10
17
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
19
|
declare const _default: typeof __VLS_export;
|
|
12
20
|
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
13
26
|
//# sourceMappingURL=CkFeedbackDialog.vue.d.ts.map
|
|
@@ -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":"AAgWA,OAAO,KAAK,EACV,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAyCjB,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC;CACxB,CAAC;AAuhBF,QAAA,MAAM,UAAU;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,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, B, D, E } 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, B, D, E } from "../CkHistory.vue_vue_type_script_setup_true_lang-BnUMeeto.js";
|
|
2
2
|
export {
|
|
3
3
|
_ as CkAgentMessage,
|
|
4
4
|
a as CkAgentMessageHeader,
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { u } from "./useMessageHandler-Bkzrdgfj.js";
|
|
2
2
|
import { C, d, p, u as u2, b } from "./useChatKitLabels-DxW0N5U-.js";
|
|
3
3
|
import { S, c, d as d2, f, u as u3, a, b as b2, e } from "./index-D0DQjdsq.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, D, F, E } from "./CkHistory.vue_vue_type_script_setup_true_lang-
|
|
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, D, F, E } from "./CkHistory.vue_vue_type_script_setup_true_lang-BnUMeeto.js";
|
|
5
5
|
import { m as m2 } from "./markdownToPlainText-DN_G-I6g.js";
|
|
6
6
|
export {
|
|
7
7
|
C as CHAT_KIT_LABELS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleph-alpha/chat-kit",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "Chat kit package for building chat interfaces with Vue",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -115,8 +115,8 @@
|
|
|
115
115
|
"vue": "^3.5.27",
|
|
116
116
|
"vue-tsc": "^3.2.4",
|
|
117
117
|
"wait-on": "9.0.3",
|
|
118
|
-
"@aleph-alpha/prettier-config-frontend": "2.1.1",
|
|
119
118
|
"@aleph-alpha/eslint-config-frontend": "0.7.1",
|
|
119
|
+
"@aleph-alpha/prettier-config-frontend": "2.1.1",
|
|
120
120
|
"@aleph-alpha/tsconfig-frontend": "0.7.3"
|
|
121
121
|
},
|
|
122
122
|
"scripts": {
|
|
@@ -15,6 +15,7 @@ defineOptions({
|
|
|
15
15
|
|
|
16
16
|
withDefaults(defineProps<CkCitationProps>(), {
|
|
17
17
|
selected: false,
|
|
18
|
+
icon: undefined,
|
|
18
19
|
locationLabel: undefined,
|
|
19
20
|
url: undefined,
|
|
20
21
|
ariaLabel: undefined,
|
|
@@ -135,6 +136,7 @@ onBeforeUnmount(() => {
|
|
|
135
136
|
>
|
|
136
137
|
<CkCitationCard
|
|
137
138
|
:file-name="fileName"
|
|
139
|
+
:icon="icon"
|
|
138
140
|
:snippet="snippet"
|
|
139
141
|
:location-label="locationLabel"
|
|
140
142
|
:collection-name="collectionName"
|
|
@@ -20,6 +20,12 @@ export interface CkCitationSource {
|
|
|
20
20
|
* (pass the original name with its extension).
|
|
21
21
|
*/
|
|
22
22
|
fileName: string;
|
|
23
|
+
/**
|
|
24
|
+
* Explicit Lucide icon for the file-type badge, overriding the one derived
|
|
25
|
+
* from `fileName`. Use for a source that has no meaningful file type, e.g.
|
|
26
|
+
* `"globe"` for a web result.
|
|
27
|
+
*/
|
|
28
|
+
icon?: string;
|
|
23
29
|
/** The cited chunk text, shown in the card body. */
|
|
24
30
|
snippet: string;
|
|
25
31
|
/**
|
|
@@ -18,6 +18,21 @@ describe('CkCitationCard', () => {
|
|
|
18
18
|
expect(screen.getByText('Page 3')).toBeInTheDocument();
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
+
it('derives the badge icon from the file name by default', () => {
|
|
22
|
+
const { container } = render(CkCitationCard, { props: base });
|
|
23
|
+
|
|
24
|
+
expect(container.querySelector('.lucide-file')).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('lets an explicit icon override the one derived from the file name', () => {
|
|
28
|
+
const { container } = render(CkCitationCard, {
|
|
29
|
+
props: { ...base, fileName: 'Weather in Berlin', icon: 'globe' },
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
expect(container.querySelector('.lucide-globe')).toBeInTheDocument();
|
|
33
|
+
expect(container.querySelector('.lucide-file')).not.toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
|
|
21
36
|
it('hides the location footer when no locationLabel is given', () => {
|
|
22
37
|
render(CkCitationCard, { props: base });
|
|
23
38
|
|
|
@@ -18,6 +18,7 @@ defineOptions({
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
const props = withDefaults(defineProps<CkCitationCardProps>(), {
|
|
21
|
+
icon: undefined,
|
|
21
22
|
locationLabel: undefined,
|
|
22
23
|
collectionName: undefined,
|
|
23
24
|
url: undefined,
|
|
@@ -60,7 +61,7 @@ function handleOpen(): void {
|
|
|
60
61
|
class="ck-citation-card flex w-[22.5rem] max-w-[90vw] flex-col gap-2 rounded-md bg-background-surface-floating px-6 pb-6 pt-4 shadow-md"
|
|
61
62
|
>
|
|
62
63
|
<div class="flex min-w-0 items-center gap-3 py-0.5">
|
|
63
|
-
<UiFileType :filename="fileName" class="shrink-0" />
|
|
64
|
+
<UiFileType :filename="fileName" :icon="icon" class="shrink-0" />
|
|
64
65
|
<UiTooltip
|
|
65
66
|
:content="fileName"
|
|
66
67
|
:disabled="!isFileNameTruncated"
|
|
@@ -20,6 +20,12 @@ export interface CkCitationCardProps {
|
|
|
20
20
|
* e.g. `q3-report.pdf`).
|
|
21
21
|
*/
|
|
22
22
|
fileName: string;
|
|
23
|
+
/**
|
|
24
|
+
* Explicit Lucide icon for the file-type badge, overriding the one derived
|
|
25
|
+
* from `fileName`. Use for a source that has no meaningful file type, e.g.
|
|
26
|
+
* `"globe"` for a web result.
|
|
27
|
+
*/
|
|
28
|
+
icon?: string;
|
|
23
29
|
/** The cited chunk text, shown in the card body. */
|
|
24
30
|
snippet: string;
|
|
25
31
|
/**
|
|
@@ -284,4 +284,31 @@ describe('CkFeedbackDialog', () => {
|
|
|
284
284
|
await screen.findByRole('button', { name: SUBMIT });
|
|
285
285
|
expect(screen.queryByText(RESPONSE_HEADING)).not.toBeInTheDocument();
|
|
286
286
|
});
|
|
287
|
+
|
|
288
|
+
it('renders footer slot content below the columns', async () => {
|
|
289
|
+
render(CkFeedbackDialog, {
|
|
290
|
+
props: {
|
|
291
|
+
open: true,
|
|
292
|
+
sentiment: 'positive',
|
|
293
|
+
reasons: REASONS,
|
|
294
|
+
responseText: 'A sample assistant response.',
|
|
295
|
+
} as CkFeedbackDialogProps,
|
|
296
|
+
slots: {
|
|
297
|
+
footer: '<span>Trace ID: 4bf92f3577b34da6a3ce929d0e0e4736</span>',
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
expect(
|
|
302
|
+
await screen.findByText('Trace ID: 4bf92f3577b34da6a3ce929d0e0e4736'),
|
|
303
|
+
).toBeInTheDocument();
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
it('renders no footer row without footer slot content', async () => {
|
|
307
|
+
renderDialog();
|
|
308
|
+
|
|
309
|
+
await screen.findByRole('button', { name: SUBMIT });
|
|
310
|
+
expect(
|
|
311
|
+
document.querySelector('.ck-feedback-dialog__footer'),
|
|
312
|
+
).not.toBeInTheDocument();
|
|
313
|
+
});
|
|
287
314
|
});
|
|
@@ -274,6 +274,29 @@ export const LongResponse: Story = {
|
|
|
274
274
|
},
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
+
/**
|
|
278
|
+
* The optional `footer` slot renders a row below the columns, e.g. a reference
|
|
279
|
+
* id the user can copy when reporting the answer.
|
|
280
|
+
*/
|
|
281
|
+
export const WithFooter: Story = {
|
|
282
|
+
args: {
|
|
283
|
+
open: true,
|
|
284
|
+
sentiment: 'negative',
|
|
285
|
+
reasons: NEGATIVE_REASONS,
|
|
286
|
+
responseText: SAMPLE_RESPONSE,
|
|
287
|
+
},
|
|
288
|
+
render: (args) => ({
|
|
289
|
+
components: { CkFeedbackDialog },
|
|
290
|
+
setup: () => ({ args }),
|
|
291
|
+
template: `<CkFeedbackDialog v-bind="args">
|
|
292
|
+
<template #footer>
|
|
293
|
+
<span>Trace ID</span>
|
|
294
|
+
<code>4bf92f3577b34da6a3ce929d0e0e4736</code>
|
|
295
|
+
</template>
|
|
296
|
+
</CkFeedbackDialog>`,
|
|
297
|
+
}),
|
|
298
|
+
};
|
|
299
|
+
|
|
277
300
|
/**
|
|
278
301
|
* Realistic end-to-end flow wired to `CkFeedbackButton`. Click a thumb to open
|
|
279
302
|
* the dialog; submit or cancel; the button locks only on submit.
|
|
@@ -48,6 +48,14 @@ const {
|
|
|
48
48
|
submitLabel: submitLabelProp,
|
|
49
49
|
} = defineProps<CkFeedbackDialogProps>();
|
|
50
50
|
|
|
51
|
+
defineSlots<{
|
|
52
|
+
/**
|
|
53
|
+
* Optional row below the reasons and response columns, e.g. a reference id
|
|
54
|
+
* the user can copy. Not rendered when empty.
|
|
55
|
+
*/
|
|
56
|
+
footer?: () => unknown;
|
|
57
|
+
}>();
|
|
58
|
+
|
|
51
59
|
const emit = defineEmits<{
|
|
52
60
|
'update:open': [open: boolean];
|
|
53
61
|
submit: [payload: CkFeedbackDialogSubmitPayload];
|
|
@@ -259,6 +267,13 @@ function handleSubmit(): void {
|
|
|
259
267
|
</section>
|
|
260
268
|
</div>
|
|
261
269
|
|
|
270
|
+
<div
|
|
271
|
+
v-if="$slots.footer"
|
|
272
|
+
class="ck-feedback-dialog__footer flex items-center gap-2 text-sm text-content-on-surface-muted"
|
|
273
|
+
>
|
|
274
|
+
<slot name="footer" />
|
|
275
|
+
</div>
|
|
276
|
+
|
|
262
277
|
<template #actions>
|
|
263
278
|
<UiButton
|
|
264
279
|
type="button"
|