@aleph-alpha/chat-kit 6.4.3 → 6.5.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-C4XS2QQI.js} +6 -2
- 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/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- 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
|
@@ -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),
|
|
@@ -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
|
})
|
|
@@ -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"}
|
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-C4XS2QQI.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-C4XS2QQI.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.5.0",
|
|
4
4
|
"description": "Chat kit package for building chat interfaces with Vue",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -116,8 +116,8 @@
|
|
|
116
116
|
"vue-tsc": "^3.2.4",
|
|
117
117
|
"wait-on": "9.0.3",
|
|
118
118
|
"@aleph-alpha/prettier-config-frontend": "2.1.1",
|
|
119
|
-
"@aleph-alpha/
|
|
120
|
-
"@aleph-alpha/
|
|
119
|
+
"@aleph-alpha/tsconfig-frontend": "0.7.3",
|
|
120
|
+
"@aleph-alpha/eslint-config-frontend": "0.7.1"
|
|
121
121
|
},
|
|
122
122
|
"scripts": {
|
|
123
123
|
"build": "vite build && vue-tsc --project tsconfig.build.json --declaration --emitDeclarationOnly --outDir dist",
|
|
@@ -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
|
/**
|