@aleph-alpha/chat-kit 6.5.0 → 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.
@@ -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$4 = {
230
+ const _hoisted_5$5 = {
231
231
  key: 1,
232
232
  "aria-hidden": "true",
233
233
  class: "shrink-0 text-border-input-strong"
@@ -327,7 +327,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
327
327
  ]),
328
328
  _: 1
329
329
  }, 8, ["content", "disabled"])) : createCommentVNode("", true),
330
- __props.collectionName && __props.locationLabel ? (openBlock(), createElementBlock("span", _hoisted_5$4, " | ")) : createCommentVNode("", true),
330
+ __props.collectionName && __props.locationLabel ? (openBlock(), createElementBlock("span", _hoisted_5$5, " | ")) : createCommentVNode("", true),
331
331
  __props.locationLabel ? (openBlock(), createElementBlock("span", _hoisted_6$4, toDisplayString(__props.locationLabel), 1)) : createCommentVNode("", true)
332
332
  ])) : createCommentVNode("", true)
333
333
  ]);
@@ -858,7 +858,7 @@ const _hoisted_1$b = ["aria-label"];
858
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" };
859
859
  const _hoisted_3$6 = { class: "flex flex-col items-center gap-1 text-center" };
860
860
  const _hoisted_4$6 = { class: "body-16-bold" };
861
- const _hoisted_5$3 = {
861
+ const _hoisted_5$4 = {
862
862
  key: 0,
863
863
  class: "body-16-regular"
864
864
  };
@@ -1034,7 +1034,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1034
1034
  createVNode(_sfc_main$l, { class: "h-36 w-52" }),
1035
1035
  createElementVNode("div", _hoisted_3$6, [
1036
1036
  createElementVNode("p", _hoisted_4$6, toDisplayString(resolvedHeading.value), 1),
1037
- __props.hint ? (openBlock(), createElementBlock("p", _hoisted_5$3, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
1037
+ __props.hint ? (openBlock(), createElementBlock("p", _hoisted_5$4, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
1038
1038
  ])
1039
1039
  ], true)
1040
1040
  ])
@@ -1326,6 +1326,10 @@ const _hoisted_4$5 = {
1326
1326
  class: "self-end text-sm text-content-on-surface-muted tabular-nums",
1327
1327
  "aria-live": "polite"
1328
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
+ };
1329
1333
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
1330
1334
  ...{
1331
1335
  name: "CkFeedbackDialog"
@@ -1558,17 +1562,20 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1558
1562
  _: 1
1559
1563
  })
1560
1564
  ])
1561
- ], 2)
1565
+ ], 2),
1566
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5$3, [
1567
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
1568
+ ])) : createCommentVNode("", true)
1562
1569
  ]),
1563
- _: 1
1570
+ _: 3
1564
1571
  }, 8, ["title", "show-close-button"])
1565
1572
  ]),
1566
- _: 1
1573
+ _: 3
1567
1574
  }, 8, ["open"]);
1568
1575
  };
1569
1576
  }
1570
1577
  });
1571
- const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-fce18e3e"]]);
1578
+ const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-8d78ea5d"]]);
1572
1579
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
1573
1580
  ...{
1574
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-fce18e3e] {
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-fce18e3e],
63
- .ck-feedback-dialog__chip[data-state='on'][data-v-fce18e3e]:hover {
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-fce18e3e] {
73
+ .ck-feedback-dialog__freetext[data-v-8d78ea5d] {
74
74
  max-height: 11rem;
75
75
  }
76
- .ck-feedback-dialog__response[data-v-fce18e3e] p,
77
- .ck-feedback-dialog__response[data-v-fce18e3e] li {
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-fce18e3e] p {
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-fce18e3e] p:last-child {
83
+ .ck-feedback-dialog__response[data-v-8d78ea5d] p:last-child {
84
84
  margin-bottom: 0;
85
85
  }
86
86
 
@@ -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
- declare const __VLS_export: import("vue").DefineComponent<CkFeedbackDialogProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
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":"AAiVA,OAAO,KAAK,EACV,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAgjBjB,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
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"}
@@ -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-C4XS2QQI.js";
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-C4XS2QQI.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-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.5.0",
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,9 +115,9 @@
115
115
  "vue": "^3.5.27",
116
116
  "vue-tsc": "^3.2.4",
117
117
  "wait-on": "9.0.3",
118
+ "@aleph-alpha/eslint-config-frontend": "0.7.1",
118
119
  "@aleph-alpha/prettier-config-frontend": "2.1.1",
119
- "@aleph-alpha/tsconfig-frontend": "0.7.3",
120
- "@aleph-alpha/eslint-config-frontend": "0.7.1"
120
+ "@aleph-alpha/tsconfig-frontend": "0.7.3"
121
121
  },
122
122
  "scripts": {
123
123
  "build": "vite build && vue-tsc --project tsconfig.build.json --declaration --emitDeclarationOnly --outDir dist",
@@ -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"