@aleph-alpha/chat-kit 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CkHistory.vue_vue_type_script_setup_true_lang-Bp9hXdH6.js → CkHistory.vue_vue_type_script_setup_true_lang-CtQUc3m3.js} +1 -1
- package/dist/components/base/CkCitationCard/CkCitationCard.stories.d.ts +5 -2
- package/dist/components/base/CkCitationCard/CkCitationCard.stories.d.ts.map +1 -1
- package/dist/components/base/CkCitationCard/CkCitationCard.vue.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/base/CkCitationCard/CkCitationCard.spec.ts +9 -0
- package/src/components/base/CkCitationCard/CkCitationCard.stories.ts +6 -3
- package/src/components/base/CkCitationCard/CkCitationCard.vue +3 -1
|
@@ -184,7 +184,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
184
184
|
const _hoisted_1$d = { 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" };
|
|
185
185
|
const _hoisted_2$8 = { class: "flex items-center gap-2" };
|
|
186
186
|
const _hoisted_3$7 = ["title"];
|
|
187
|
-
const _hoisted_4$6 = { class: "break-words text-sm leading-5 text-content-on-surface-secondary" };
|
|
187
|
+
const _hoisted_4$6 = { class: "line-clamp-6 break-words text-sm leading-5 text-content-on-surface-secondary" };
|
|
188
188
|
const _hoisted_5$4 = {
|
|
189
189
|
key: 0,
|
|
190
190
|
class: "text-sm leading-5 text-content-on-surface-muted"
|
|
@@ -40,8 +40,11 @@ export declare const MinimalSnippetOnly: Story;
|
|
|
40
40
|
*/
|
|
41
41
|
export declare const LongFileName: Story;
|
|
42
42
|
/**
|
|
43
|
-
* A
|
|
44
|
-
*
|
|
43
|
+
* A whole-document-length excerpt is clamped to a bounded number of lines
|
|
44
|
+
* (`line-clamp-6`) with a trailing ellipsis, so the card stays a compact preview
|
|
45
|
+
* and its height does not grow with the excerpt length — no matter how large a
|
|
46
|
+
* chunk `file_search` returns (it can be as large as the entire source file). The
|
|
47
|
+
* full text remains reachable via the external-link action.
|
|
45
48
|
*/
|
|
46
49
|
export declare const LongSnippet: Story;
|
|
47
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkCitationCard.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/CkCitationCard.stories.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAK3D;;;;;;;GAOG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAuBrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqBnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAEhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"CkCitationCard.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/CkCitationCard.stories.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAK3D;;;;;;;GAOG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAuBrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqBnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAEhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAuB9B,CAAC"}
|
|
@@ -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":"AAuFA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA4KnD,QAAA,MAAM,YAAY;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _, a, C, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y } from "../CkHistory.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _, a, C, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y } from "../CkHistory.vue_vue_type_script_setup_true_lang-CtQUc3m3.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-N50Yj-NU.js";
|
|
2
2
|
import { C, d, p, u as u2, a } from "./useChatKitLabels-zMFV7aEz.js";
|
|
3
3
|
import { S, c, d as d2, a as a2, u as u3, b, e, f } from "./index-CyrVnbS9.js";
|
|
4
|
-
import { _, a as a3, C as C2, b as b2, 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 } from "./CkHistory.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _, a as a3, C as C2, b as b2, 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 } from "./CkHistory.vue_vue_type_script_setup_true_lang-CtQUc3m3.js";
|
|
5
5
|
export {
|
|
6
6
|
C as CHAT_KIT_LABELS,
|
|
7
7
|
_ as CkAgentMessage,
|
package/package.json
CHANGED
|
@@ -60,6 +60,15 @@ describe('CkCitationCard', () => {
|
|
|
60
60
|
expect(screen.getByText(snippet).className).toContain('break-words');
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
+
it('clamps a long snippet to a bounded number of lines so card height does not grow with excerpt length', () => {
|
|
64
|
+
const snippet = Array(40)
|
|
65
|
+
.fill('A long sentence of citation excerpt text.')
|
|
66
|
+
.join(' ');
|
|
67
|
+
render(CkCitationCard, { props: { ...base, snippet } });
|
|
68
|
+
|
|
69
|
+
expect(screen.getByText(snippet).className).toContain('line-clamp-6');
|
|
70
|
+
});
|
|
71
|
+
|
|
63
72
|
it('uses the injected citationOpenSource label via provideChatKitLabels', () => {
|
|
64
73
|
const Wrapper = defineComponent({
|
|
65
74
|
setup() {
|
|
@@ -106,12 +106,15 @@ export const LongFileName: Story = {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* A
|
|
110
|
-
*
|
|
109
|
+
* A whole-document-length excerpt is clamped to a bounded number of lines
|
|
110
|
+
* (`line-clamp-6`) with a trailing ellipsis, so the card stays a compact preview
|
|
111
|
+
* and its height does not grow with the excerpt length — no matter how large a
|
|
112
|
+
* chunk `file_search` returns (it can be as large as the entire source file). The
|
|
113
|
+
* full text remains reachable via the external-link action.
|
|
111
114
|
*/
|
|
112
115
|
export const LongSnippet: Story = {
|
|
113
116
|
args: {
|
|
114
|
-
snippet: `${LOREM} ${LOREM}`,
|
|
117
|
+
snippet: `${LOREM} ${LOREM} ${LOREM} ${LOREM} ${LOREM}`,
|
|
115
118
|
},
|
|
116
119
|
};
|
|
117
120
|
|
|
@@ -62,7 +62,9 @@ function handleOpen(): void {
|
|
|
62
62
|
</UiButton>
|
|
63
63
|
</div>
|
|
64
64
|
|
|
65
|
-
<p
|
|
65
|
+
<p
|
|
66
|
+
class="line-clamp-6 break-words text-sm leading-5 text-content-on-surface-secondary"
|
|
67
|
+
>
|
|
66
68
|
{{ snippet }}
|
|
67
69
|
</p>
|
|
68
70
|
|