@aleph-alpha/chat-kit 2.3.0 → 3.1.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.
Files changed (98) hide show
  1. package/dist/{CkInput.vue_vue_type_script_setup_true_lang-DYTizPsB.js → CkInput.vue_vue_type_script_setup_true_lang-DKzc21Yp.js} +239 -154
  2. package/dist/chat-kit.css +33 -6
  3. package/dist/components/base/CkAgentMessage/CkAgentMessage.vue.d.ts.map +1 -1
  4. package/dist/components/base/CkConversationLayout/CkConversationLayout.vue.d.ts.map +1 -1
  5. package/dist/components/base/CkDropZoneOverlay/CkDropZoneOverlay.vue.d.ts.map +1 -1
  6. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue.d.ts.map +1 -1
  7. package/dist/components/base/CkMarkdownRenderer/defaultMarkdownClasses.d.ts.map +1 -1
  8. package/dist/components/base/CkModelSelector/CkModelSelector.vue.d.ts.map +1 -1
  9. package/dist/components/base/CkModelSelector/types.d.ts +1 -1
  10. package/dist/components/base/CkPromptInput/CkPromptInput.stories.d.ts +48 -5
  11. package/dist/components/base/CkPromptInput/CkPromptInput.stories.d.ts.map +1 -1
  12. package/dist/components/base/CkPromptInput/CkPromptInput.vue.d.ts +7 -6
  13. package/dist/components/base/CkPromptInput/CkPromptInput.vue.d.ts.map +1 -1
  14. package/dist/components/base/CkPromptInput/types.d.ts +11 -12
  15. package/dist/components/base/CkPromptInput/types.d.ts.map +1 -1
  16. package/dist/components/base/CkPromptMenuButton/CkPromptMenuButton.stories.d.ts +18 -0
  17. package/dist/components/base/CkPromptMenuButton/CkPromptMenuButton.stories.d.ts.map +1 -0
  18. package/dist/components/base/CkPromptMenuButton/CkPromptMenuButton.vue.d.ts +18 -0
  19. package/dist/components/base/CkPromptMenuButton/CkPromptMenuButton.vue.d.ts.map +1 -0
  20. package/dist/components/base/CkPromptMenuButton/index.d.ts +3 -0
  21. package/dist/components/base/CkPromptMenuButton/index.d.ts.map +1 -0
  22. package/dist/components/base/CkPromptMenuButton/types.d.ts +30 -0
  23. package/dist/components/base/CkPromptMenuButton/types.d.ts.map +1 -0
  24. package/dist/components/base/{CkPromptActionButton/CkPromptActionButton.stories.d.ts → CkPromptSendButton/CkPromptSendButton.stories.d.ts} +5 -5
  25. package/dist/components/base/CkPromptSendButton/CkPromptSendButton.stories.d.ts.map +1 -0
  26. package/dist/components/base/{CkPromptActionButton/CkPromptActionButton.vue.d.ts → CkPromptSendButton/CkPromptSendButton.vue.d.ts} +3 -3
  27. package/dist/components/base/CkPromptSendButton/CkPromptSendButton.vue.d.ts.map +1 -0
  28. package/dist/components/base/CkPromptSendButton/index.d.ts +3 -0
  29. package/dist/components/base/CkPromptSendButton/index.d.ts.map +1 -0
  30. package/dist/components/base/CkPromptSendButton/types.d.ts +34 -0
  31. package/dist/components/base/CkPromptSendButton/types.d.ts.map +1 -0
  32. package/dist/components/base/CkPromptStopButton/CkPromptStopButton.stories.d.ts +1 -1
  33. package/dist/components/base/CkPromptStopButton/CkPromptStopButton.vue.d.ts.map +1 -1
  34. package/dist/components/base/CkPromptStopButton/types.d.ts +6 -4
  35. package/dist/components/base/CkPromptStopButton/types.d.ts.map +1 -1
  36. package/dist/components/base/icons/CkSendIcon.vue.d.ts.map +1 -1
  37. package/dist/components/base/index.d.ts +3 -1
  38. package/dist/components/base/index.d.ts.map +1 -1
  39. package/dist/components/composed/CkHistory/CkHistory.vue.d.ts +1 -1
  40. package/dist/components/composed/CkInput/CkInput.stories.d.ts.map +1 -1
  41. package/dist/components/composed/CkInput/CkInput.vue.d.ts +9 -8
  42. package/dist/components/composed/CkInput/CkInput.vue.d.ts.map +1 -1
  43. package/dist/components/composed/CkInput/types.d.ts +2 -7
  44. package/dist/components/composed/CkInput/types.d.ts.map +1 -1
  45. package/dist/components/index.d.ts +2 -2
  46. package/dist/components/index.d.ts.map +1 -1
  47. package/dist/components/index.js +9 -8
  48. package/dist/handlers/index.js +1 -1
  49. package/dist/handlers/useChatKitLabels.d.ts +6 -0
  50. package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
  51. package/dist/index.d.ts +2 -2
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +11 -10
  54. package/dist/{useChatKitLabels-ZutacPad.js → useChatKitLabels-CLsWWwgG.js} +1 -0
  55. package/package.json +1 -1
  56. package/src/components/base/CkAgentMessage/CkAgentMessage.vue +2 -2
  57. package/src/components/base/CkConversationLayout/CkConversationLayout.vue +3 -2
  58. package/src/components/base/CkDropZoneOverlay/CkDropZoneOverlay.vue +2 -7
  59. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue +36 -4
  60. package/src/components/base/CkMarkdownRenderer/defaultMarkdownClasses.ts +2 -1
  61. package/src/components/base/CkModelSelector/CkModelSelector.vue +8 -3
  62. package/src/components/base/CkModelSelector/types.ts +1 -1
  63. package/src/components/base/CkPromptInput/CkPromptInput.spec.ts +206 -11
  64. package/src/components/base/CkPromptInput/CkPromptInput.stories.ts +1068 -43
  65. package/src/components/base/CkPromptInput/CkPromptInput.vue +137 -28
  66. package/src/components/base/CkPromptInput/types.ts +11 -12
  67. package/src/components/base/CkPromptMenuButton/CkPromptMenuButton.spec.ts +62 -0
  68. package/src/components/base/CkPromptMenuButton/CkPromptMenuButton.stories.ts +75 -0
  69. package/src/components/base/CkPromptMenuButton/CkPromptMenuButton.vue +26 -0
  70. package/src/components/base/CkPromptMenuButton/index.ts +2 -0
  71. package/src/components/base/CkPromptMenuButton/types.ts +29 -0
  72. package/src/components/base/{CkPromptActionButton/CkPromptActionButton.spec.ts → CkPromptSendButton/CkPromptSendButton.spec.ts} +11 -11
  73. package/src/components/base/CkPromptSendButton/CkPromptSendButton.stories.ts +117 -0
  74. package/src/components/base/{CkPromptActionButton/CkPromptActionButton.vue → CkPromptSendButton/CkPromptSendButton.vue} +4 -4
  75. package/src/components/base/CkPromptSendButton/index.ts +2 -0
  76. package/src/components/base/CkPromptSendButton/types.ts +33 -0
  77. package/src/components/base/CkPromptStopButton/CkPromptStopButton.spec.ts +5 -5
  78. package/src/components/base/CkPromptStopButton/CkPromptStopButton.stories.ts +1 -1
  79. package/src/components/base/CkPromptStopButton/CkPromptStopButton.vue +3 -2
  80. package/src/components/base/CkPromptStopButton/types.ts +6 -4
  81. package/src/components/base/icons/CkSendIcon.vue +3 -16
  82. package/src/components/base/icons/CkStopIcon.vue +1 -1
  83. package/src/components/base/index.ts +3 -1
  84. package/src/components/composed/CkInput/CkInput.stories.ts +0 -4
  85. package/src/components/composed/CkInput/CkInput.vue +7 -5
  86. package/src/components/composed/CkInput/types.ts +2 -7
  87. package/src/components/index.ts +3 -1
  88. package/src/handlers/useChatKitLabels.ts +7 -0
  89. package/src/index.ts +3 -1
  90. package/dist/components/base/CkPromptActionButton/CkPromptActionButton.stories.d.ts.map +0 -1
  91. package/dist/components/base/CkPromptActionButton/CkPromptActionButton.vue.d.ts.map +0 -1
  92. package/dist/components/base/CkPromptActionButton/index.d.ts +0 -3
  93. package/dist/components/base/CkPromptActionButton/index.d.ts.map +0 -1
  94. package/dist/components/base/CkPromptActionButton/types.d.ts +0 -33
  95. package/dist/components/base/CkPromptActionButton/types.d.ts.map +0 -1
  96. package/src/components/base/CkPromptActionButton/CkPromptActionButton.stories.ts +0 -126
  97. package/src/components/base/CkPromptActionButton/index.ts +0 -2
  98. package/src/components/base/CkPromptActionButton/types.ts +0 -32
@@ -1,6 +1,6 @@
1
- import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, createStaticVNode, computed, onBeforeUnmount, Teleport, withModifiers, normalizeClass, toRefs, h, useId, createTextVNode, useAttrs, useSlots, resolveDynamicComponent, useTemplateRef, createSlots, normalizeProps, guardReactiveProps } from "vue";
2
- import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-ZutacPad.js";
3
- import { UiButton, UiTooltip, UiIcon, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiPopover, UiPopoverTrigger, UiFileType, UiProgress, UiPopoverContent, Primitive, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
1
+ import { defineComponent, openBlock, createBlock, unref, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, mergeProps, withCtx, createVNode, Transition, toDisplayString, createStaticVNode, computed, onBeforeUnmount, Teleport, withModifiers, normalizeClass, toRefs, h, useId, createTextVNode, useAttrs, useSlots, resolveDynamicComponent, useTemplateRef, onUpdated, createSlots, normalizeProps, guardReactiveProps } from "vue";
2
+ import { UiIcon, UiButton, UiTooltip, formatFileSize, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiPopover, UiPopoverTrigger, UiFileType, UiProgress, UiPopoverContent, Primitive, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
3
+ import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-CLsWWwgG.js";
4
4
  const MINUTE = 60;
5
5
  const HOUR = 60 * MINUTE;
6
6
  const DAY = 24 * HOUR;
@@ -36,26 +36,12 @@ function formatRelativeTime(unixSeconds, nowSeconds = Math.floor(Date.now() / 1e
36
36
  const years = Math.floor(delta / YEAR);
37
37
  return years === 1 ? "1 year ago" : `${years} years ago`;
38
38
  }
39
- const _hoisted_1$e = {
40
- xmlns: "http://www.w3.org/2000/svg",
41
- width: "16",
42
- height: "16",
43
- viewBox: "0 0 24 24",
44
- fill: "none",
45
- stroke: "currentColor",
46
- "stroke-width": "2",
47
- "stroke-linecap": "round",
48
- "stroke-linejoin": "round"
49
- };
50
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
39
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
51
40
  ...{ name: "CkSendIcon" },
52
41
  __name: "CkSendIcon",
53
42
  setup(__props) {
54
43
  return (_ctx, _cache) => {
55
- return openBlock(), createElementBlock("svg", _hoisted_1$e, [..._cache[0] || (_cache[0] = [
56
- createElementVNode("path", { d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z" }, null, -1),
57
- createElementVNode("path", { d: "M6 12h16" }, null, -1)
58
- ])]);
44
+ return openBlock(), createBlock(unref(UiIcon), { name: "arrow-up-right" });
59
45
  };
60
46
  }
61
47
  });
@@ -66,7 +52,7 @@ const _hoisted_1$d = {
66
52
  viewBox: "0 0 16 16",
67
53
  fill: "none"
68
54
  };
69
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
55
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
70
56
  ...{ name: "CkStopIcon" },
71
57
  __name: "CkStopIcon",
72
58
  setup(__props) {
@@ -74,13 +60,13 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
74
60
  return openBlock(), createElementBlock("svg", _hoisted_1$d, [..._cache[0] || (_cache[0] = [
75
61
  createElementVNode("path", {
76
62
  d: "M13.3335 3.33301C13.3335 2.96482 13.035 2.66634 12.6668 2.66634H3.3335C2.96531 2.66634 2.66683 2.96482 2.66683 3.33301V12.6663C2.66683 13.0345 2.96531 13.333 3.3335 13.333H12.6668C13.035 13.333 13.3335 13.0345 13.3335 12.6663V3.33301ZM14.6668 12.6663C14.6668 13.7709 13.7714 14.6663 12.6668 14.6663H3.3335C2.22893 14.6663 1.3335 13.7709 1.3335 12.6663V3.33301C1.3335 2.22844 2.22893 1.33301 3.3335 1.33301H12.6668C13.7714 1.33301 14.6668 2.22844 14.6668 3.33301V12.6663Z",
77
- fill: "#1D1D1B"
63
+ fill: "currentColor"
78
64
  }, null, -1)
79
65
  ])]);
80
66
  };
81
67
  }
82
68
  });
83
- const _hoisted_1$c = { class: "flex w-full flex-col gap-6 pb-6" };
69
+ const _hoisted_1$c = { class: "flex w-full min-w-0 flex-col gap-6 pb-6" };
84
70
  const _hoisted_2$8 = {
85
71
  key: 0,
86
72
  class: "flex items-start gap-3"
@@ -95,12 +81,12 @@ const _hoisted_4$6 = {
95
81
  "data-testid": "ck-agent-message-header",
96
82
  class: "body-14-regular text-content-on-surface-muted min-w-0 flex-1 [word-break:break-word]"
97
83
  };
98
- const _hoisted_5$5 = { class: "text-content-on-surface-primary text-base leading-7" };
99
- const _hoisted_6$4 = {
84
+ const _hoisted_5$4 = { class: "text-content-on-surface-primary min-w-0 text-base leading-7" };
85
+ const _hoisted_6$3 = {
100
86
  key: 1,
101
87
  class: "flex items-center gap-4"
102
88
  };
103
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
89
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
104
90
  ...{ name: "CkAgentMessage" },
105
91
  __name: "CkAgentMessage",
106
92
  setup(__props) {
@@ -114,10 +100,10 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
114
100
  renderSlot(_ctx.$slots, "header")
115
101
  ])) : createCommentVNode("", true)
116
102
  ])) : createCommentVNode("", true),
117
- createElementVNode("div", _hoisted_5$5, [
103
+ createElementVNode("div", _hoisted_5$4, [
118
104
  renderSlot(_ctx.$slots, "default")
119
105
  ]),
120
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$4, [
106
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$3, [
121
107
  renderSlot(_ctx.$slots, "footer")
122
108
  ])) : createCommentVNode("", true)
123
109
  ]);
@@ -127,13 +113,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
127
113
  const _hoisted_1$b = ["data-message-row"];
128
114
  const _hoisted_2$7 = {
129
115
  key: 0,
130
- class: "flex justify-end"
116
+ class: "flex min-w-0 justify-end"
131
117
  };
132
118
  const _hoisted_3$6 = {
133
119
  key: 1,
134
- class: "flex justify-start"
120
+ class: "flex min-w-0 justify-start"
135
121
  };
136
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
122
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
137
123
  ...{ name: "CkConversationLayout" },
138
124
  __name: "CkConversationLayout",
139
125
  props: {
@@ -271,7 +257,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
271
257
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.messages, (message) => {
272
258
  return openBlock(), createElementBlock("div", {
273
259
  key: message.id,
274
- "data-message-row": message.role
260
+ "data-message-row": message.role,
261
+ class: "min-w-0"
275
262
  }, [
276
263
  message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
277
264
  renderSlot(_ctx.$slots, "user-message", { message })
@@ -289,7 +276,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
289
276
  };
290
277
  }
291
278
  });
292
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
279
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
293
280
  ...{
294
281
  name: "CkMessageActionButton"
295
282
  },
@@ -317,7 +304,7 @@ const _hoisted_1$a = {
317
304
  class: "sr-only",
318
305
  "aria-live": "polite"
319
306
  };
320
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
307
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
321
308
  ...{
322
309
  name: "CkCopyMessageActionButton"
323
310
  },
@@ -374,7 +361,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
374
361
  "delay-duration": 0
375
362
  }, {
376
363
  default: withCtx(() => [
377
- createVNode(unref(_sfc_main$j), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
364
+ createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
378
365
  disabled: __props.disabled,
379
366
  onClick: handleClick
380
367
  }), {
@@ -415,7 +402,7 @@ const _export_sfc = (sfc, props) => {
415
402
  }
416
403
  return target;
417
404
  };
418
- const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-f77a1193"]]);
405
+ const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-f77a1193"]]);
419
406
  const _hoisted_1$9 = {
420
407
  width: "208",
421
408
  height: "144",
@@ -425,7 +412,7 @@ const _hoisted_1$9 = {
425
412
  "aria-hidden": "true",
426
413
  focusable: "false"
427
414
  };
428
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
415
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
429
416
  ...{ name: "CkDropZoneIllustration" },
430
417
  __name: "CkDropZoneIllustration",
431
418
  setup(__props) {
@@ -440,17 +427,17 @@ const _hoisted_1$8 = ["aria-label"];
440
427
  const _hoisted_2$6 = { class: "pointer-events-none flex h-full w-full flex-col items-center justify-center gap-4 text-content-on-surface-primary" };
441
428
  const _hoisted_3$5 = { class: "flex flex-col items-center gap-1 text-center" };
442
429
  const _hoisted_4$5 = { class: "body-16-bold" };
443
- const _hoisted_5$4 = {
430
+ const _hoisted_5$3 = {
444
431
  key: 0,
445
432
  class: "body-16-regular"
446
433
  };
447
- const _hoisted_6$3 = {
434
+ const _hoisted_6$2 = {
448
435
  key: 0,
449
436
  "data-slot": "drop-zone-errors",
450
437
  class: "pointer-events-none fixed bottom-6 left-1/2 z-50 max-w-[36rem] -translate-x-1/2 flex list-inside list-disc flex-col gap-1 rounded-md border border-border-surface-default bg-background-surface-default p-3 text-sm text-content-on-surface-secondary",
451
438
  role: "alert"
452
439
  };
453
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
440
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
454
441
  ...{
455
442
  name: "CkDropZoneOverlay"
456
443
  },
@@ -501,11 +488,6 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
501
488
  if (type && wildcards.some((w) => type.startsWith(w))) return true;
502
489
  return false;
503
490
  }
504
- function formatBytes(bytes) {
505
- const mb = bytes / (1024 * 1024);
506
- if (mb >= 1) return `${mb.toFixed(0)} MB`;
507
- return `${Math.max(1, Math.round(bytes / 1024))} KB`;
508
- }
509
491
  const isSingle = computed(() => props.maxFiles === 1);
510
492
  const resolvedHeading = computed(
511
493
  () => props.heading ?? (isSingle.value ? "Drop a file here to add to chat" : "Drop files here to add to chat")
@@ -561,7 +543,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
561
543
  rejected.push({
562
544
  file,
563
545
  reason: "too-large",
564
- message: `"${file.name}" — exceeds ${formatBytes(props.maxFileSizeBytes)} limit`
546
+ message: `"${file.name}" — exceeds ${formatFileSize(props.maxFileSizeBytes)} limit`
565
547
  });
566
548
  continue;
567
549
  }
@@ -618,10 +600,10 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
618
600
  }, [
619
601
  createElementVNode("div", _hoisted_2$6, [
620
602
  renderSlot(_ctx.$slots, "default", {}, () => [
621
- createVNode(_sfc_main$h, { class: "h-36 w-52" }),
603
+ createVNode(_sfc_main$i, { class: "h-36 w-52" }),
622
604
  createElementVNode("div", _hoisted_3$5, [
623
605
  createElementVNode("p", _hoisted_4$5, toDisplayString(resolvedHeading.value), 1),
624
- __props.hint ? (openBlock(), createElementBlock("p", _hoisted_5$4, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
606
+ __props.hint ? (openBlock(), createElementBlock("p", _hoisted_5$3, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
625
607
  ])
626
608
  ], true)
627
609
  ])
@@ -631,7 +613,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
631
613
  }),
632
614
  createVNode(Transition, { name: "ck-drop-overlay" }, {
633
615
  default: withCtx(() => [
634
- __props.showErrors && errors.value.length ? (openBlock(), createElementBlock("ul", _hoisted_6$3, [
616
+ __props.showErrors && errors.value.length ? (openBlock(), createElementBlock("ul", _hoisted_6$2, [
635
617
  (openBlock(true), createElementBlock(Fragment, null, renderList(errors.value, (msg, i) => {
636
618
  return openBlock(), createElementBlock("li", { key: i }, toDisplayString(msg), 1);
637
619
  }), 128))
@@ -643,9 +625,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
643
625
  };
644
626
  }
645
627
  });
646
- const CkDropZoneOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-ede88d0d"]]);
628
+ const CkDropZoneOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-54119668"]]);
647
629
  const _hoisted_1$7 = ["aria-label"];
648
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
630
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
649
631
  ...{
650
632
  name: "CkFeedbackButton"
651
633
  },
@@ -700,7 +682,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
700
682
  "delay-duration": 0
701
683
  }, {
702
684
  default: withCtx(() => [
703
- createVNode(unref(_sfc_main$j), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
685
+ createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
704
686
  "aria-pressed": isUpSelected.value,
705
687
  "aria-disabled": __props.locked || void 0,
706
688
  disabled: isUpDisabled.value,
@@ -730,7 +712,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
730
712
  "delay-duration": 0
731
713
  }, {
732
714
  default: withCtx(() => [
733
- createVNode(unref(_sfc_main$j), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
715
+ createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
734
716
  "aria-pressed": isDownSelected.value,
735
717
  "aria-disabled": __props.locked || void 0,
736
718
  disabled: isDownDisabled.value,
@@ -757,17 +739,18 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
757
739
  };
758
740
  }
759
741
  });
760
- const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-245705b8"]]);
742
+ const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-245705b8"]]);
761
743
  const defaultMarkdownClasses = {
762
744
  p: "my-1 leading-7",
763
745
  a: "underline underline-offset-4",
746
+ img: "max-w-full h-auto",
764
747
  h1: "mt-4 mb-2 text-2xl font-bold",
765
748
  h2: "mt-3 mb-2 text-xl font-semibold",
766
749
  h3: "mt-3 mb-1 text-lg font-semibold",
767
750
  ul: "my-1 ml-6 list-disc",
768
751
  ol: "my-1 ml-6 list-decimal",
769
752
  li: "my-0.5",
770
- pre: "my-2 overflow-x-auto rounded-lg p-4",
753
+ pre: "my-2 max-w-full overflow-x-auto rounded-lg p-4",
771
754
  code: "rounded px-1.5 py-0.5",
772
755
  blockquote: "my-2 border-l-2 pl-4 italic",
773
756
  table: "my-2 w-full border-collapse",
@@ -775,7 +758,8 @@ const defaultMarkdownClasses = {
775
758
  td: "border p-2",
776
759
  hr: "my-4"
777
760
  };
778
- function domToVNode(node, slots, classes) {
761
+ const TABLE_WRAPPER_CLASS = "max-w-full overflow-x-auto";
762
+ function domToVNode(node, slots, classes, tableLabel) {
779
763
  if (node.nodeType === Node.TEXT_NODE) return node.textContent;
780
764
  if (node.nodeType !== Node.ELEMENT_NODE) return null;
781
765
  const el = node;
@@ -787,7 +771,7 @@ function domToVNode(node, slots, classes) {
787
771
  return slots["code-block"]({ code, language });
788
772
  }
789
773
  }
790
- const children = Array.from(node.childNodes).map((child) => domToVNode(child, slots, classes)).filter((c) => c != null);
774
+ const children = Array.from(node.childNodes).map((child) => domToVNode(child, slots, classes, tableLabel)).filter((c) => c != null);
791
775
  const attrs = {};
792
776
  for (const attr of el.attributes) {
793
777
  attrs[attr.name] = attr.value;
@@ -797,9 +781,22 @@ function domToVNode(node, slots, classes) {
797
781
  if (customClass) {
798
782
  attrs.class = attrs.class ? `${attrs.class} ${customClass}` : customClass;
799
783
  }
800
- return h(tag, attrs, children);
784
+ const vnode = h(tag, attrs, children);
785
+ if (tag === "table") {
786
+ return h(
787
+ "div",
788
+ {
789
+ class: TABLE_WRAPPER_CLASS,
790
+ tabindex: "0",
791
+ role: "region",
792
+ "aria-label": tableLabel
793
+ },
794
+ [vnode]
795
+ );
796
+ }
797
+ return vnode;
801
798
  }
802
- const _sfc_main$e = defineComponent({
799
+ const _sfc_main$f = defineComponent({
803
800
  name: "CkMarkdownRenderer",
804
801
  props: {
805
802
  content: { type: String, required: true },
@@ -812,6 +809,7 @@ const _sfc_main$e = defineComponent({
812
809
  setup(props, { slots }) {
813
810
  const { content, plugins } = toRefs(props);
814
811
  const { html } = useMarkdownParser(content, plugins);
812
+ const labels = useChatKitLabels();
815
813
  const parsedNodes = computed(() => {
816
814
  const raw = html.value;
817
815
  if (!raw) return [];
@@ -824,8 +822,13 @@ const _sfc_main$e = defineComponent({
824
822
  }));
825
823
  return () => {
826
824
  const elementClasses = mergedClasses.value;
827
- const children = parsedNodes.value.map((node) => domToVNode(node, slots, elementClasses)).filter((c) => c != null);
828
- return h("div", { class: "markdown-renderer" }, children);
825
+ const tableLabel = labels.value.markdownTableLabel ?? defaultChatKitLabels.markdownTableLabel;
826
+ const children = parsedNodes.value.map((node) => domToVNode(node, slots, elementClasses, tableLabel)).filter((c) => c != null);
827
+ return h(
828
+ "div",
829
+ { class: "markdown-renderer min-w-0 break-words" },
830
+ children
831
+ );
829
832
  };
830
833
  }
831
834
  });
@@ -839,7 +842,7 @@ const _hoisted_4$4 = {
839
842
  class: "self-end text-sm text-content-on-surface-muted tabular-nums",
840
843
  "aria-live": "polite"
841
844
  };
842
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
845
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
843
846
  ...{
844
847
  name: "CkFeedbackDialog"
845
848
  },
@@ -1000,7 +1003,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1000
1003
  _: 1
1001
1004
  }),
1002
1005
  createElementVNode("div", _hoisted_2$5, [
1003
- createVNode(unref(_sfc_main$e), { content: __props.responseText }, null, 8, ["content"])
1006
+ createVNode(unref(_sfc_main$f), { content: __props.responseText }, null, 8, ["content"])
1004
1007
  ])
1005
1008
  ])) : createCommentVNode("", true),
1006
1009
  createElementVNode("section", _hoisted_3$4, [
@@ -1066,8 +1069,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1066
1069
  };
1067
1070
  }
1068
1071
  });
1069
- const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-12dfee8a"]]);
1070
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
1072
+ const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-12dfee8a"]]);
1073
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1071
1074
  ...{
1072
1075
  name: "CkFileItemRow",
1073
1076
  inheritAttrs: false
@@ -1117,17 +1120,17 @@ const _hoisted_4$3 = {
1117
1120
  key: 3,
1118
1121
  class: "flex min-w-0 flex-1 flex-col items-start gap-0.5"
1119
1122
  };
1120
- const _hoisted_5$3 = {
1123
+ const _hoisted_5$2 = {
1121
1124
  key: 1,
1122
1125
  class: "label-12-medium w-full truncate text-content-on-status-error-inverse"
1123
1126
  };
1124
- const _hoisted_6$2 = {
1127
+ const _hoisted_6$1 = {
1125
1128
  key: 2,
1126
1129
  class: "label-12-medium w-full truncate text-content-on-surface-muted"
1127
1130
  };
1128
- const _hoisted_7$2 = ["aria-label"];
1131
+ const _hoisted_7$1 = ["aria-label"];
1129
1132
  const _hoisted_8$1 = ["onClick"];
1130
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
1133
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1131
1134
  ...{
1132
1135
  name: "CkFileItemsList"
1133
1136
  },
@@ -1216,7 +1219,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1216
1219
  class: "min-w-0 max-w-64 flex-1 basis-0",
1217
1220
  onClick: ($event) => handleRowClick(file, $event)
1218
1221
  }, [
1219
- createVNode(_sfc_main$c, {
1222
+ createVNode(_sfc_main$d, {
1220
1223
  file,
1221
1224
  size: __props.size,
1222
1225
  "is-removable": __props.isRemovable,
@@ -1266,7 +1269,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1266
1269
  "model-value": aggregateProgress.value,
1267
1270
  class: "h-1 w-full",
1268
1271
  "aria-label": `${resolvedTriggerLabel.value} upload progress`
1269
- }, null, 8, ["model-value", "aria-label"])) : hasFailures.value ? (openBlock(), createElementBlock("span", _hoisted_5$3, toDisplayString(failedStatusLabel.value), 1)) : __props.triggerLabel ? (openBlock(), createElementBlock("span", _hoisted_6$2, toDisplayString(countStatusLabel.value), 1)) : createCommentVNode("", true)
1272
+ }, null, 8, ["model-value", "aria-label"])) : hasFailures.value ? (openBlock(), createElementBlock("span", _hoisted_5$2, toDisplayString(failedStatusLabel.value), 1)) : __props.triggerLabel ? (openBlock(), createElementBlock("span", _hoisted_6$1, toDisplayString(countStatusLabel.value), 1)) : createCommentVNode("", true)
1270
1273
  ])),
1271
1274
  createVNode(unref(UiIcon), {
1272
1275
  name: "chevron-down",
@@ -1295,7 +1298,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1295
1298
  class: "min-w-0 max-w-64",
1296
1299
  onClick: ($event) => handleRowClick(file, $event)
1297
1300
  }, [
1298
- createVNode(_sfc_main$c, {
1301
+ createVNode(_sfc_main$d, {
1299
1302
  file,
1300
1303
  size: __props.size,
1301
1304
  "is-removable": __props.isRemovable,
@@ -1310,7 +1313,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1310
1313
  }, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
1311
1314
  ], 8, _hoisted_8$1);
1312
1315
  }), 128))
1313
- ], 8, _hoisted_7$2)
1316
+ ], 8, _hoisted_7$1)
1314
1317
  ]),
1315
1318
  _: 3
1316
1319
  }, 8, ["class"])
@@ -1328,22 +1331,22 @@ const _hoisted_4$2 = {
1328
1331
  key: 0,
1329
1332
  class: "mt-0.5 flex min-w-0 items-center gap-1 label-12-medium text-content-on-surface-muted"
1330
1333
  };
1331
- const _hoisted_5$2 = {
1334
+ const _hoisted_5$1 = {
1332
1335
  key: 0,
1333
1336
  class: "truncate"
1334
1337
  };
1335
- const _hoisted_6$1 = {
1338
+ const _hoisted_6 = {
1336
1339
  key: 1,
1337
1340
  "aria-hidden": "true"
1338
1341
  };
1339
- const _hoisted_7$1 = {
1342
+ const _hoisted_7 = {
1340
1343
  key: 2,
1341
1344
  class: "truncate"
1342
1345
  };
1343
1346
  const _hoisted_8 = ["aria-label"];
1344
1347
  const _hoisted_9 = ["aria-label"];
1345
1348
  const _hoisted_10 = ["aria-label"];
1346
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
1349
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1347
1350
  ...{
1348
1351
  name: "CkHistoryItem",
1349
1352
  inheritAttrs: false
@@ -1476,9 +1479,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1476
1479
  createElementVNode("div", _hoisted_3$2, toDisplayString(props.title), 1),
1477
1480
  props.metaStart || props.metaEnd || _ctx.$slots.meta ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
1478
1481
  renderSlot(_ctx.$slots, "meta", {}, () => [
1479
- props.metaStart ? (openBlock(), createElementBlock("span", _hoisted_5$2, toDisplayString(props.metaStart), 1)) : createCommentVNode("", true),
1480
- props.metaStart && props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_6$1, "|")) : createCommentVNode("", true),
1481
- props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(props.metaEnd), 1)) : createCommentVNode("", true)
1482
+ props.metaStart ? (openBlock(), createElementBlock("span", _hoisted_5$1, toDisplayString(props.metaStart), 1)) : createCommentVNode("", true),
1483
+ props.metaStart && props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_6, "|")) : createCommentVNode("", true),
1484
+ props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(props.metaEnd), 1)) : createCommentVNode("", true)
1482
1485
  ])
1483
1486
  ])) : createCommentVNode("", true)
1484
1487
  ])
@@ -1584,7 +1587,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1584
1587
  }
1585
1588
  });
1586
1589
  const baseClass = "flex w-full min-w-0 flex-col p-2";
1587
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1590
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1588
1591
  ...{
1589
1592
  name: "CkHistoryWrapper",
1590
1593
  inheritAttrs: false
@@ -1615,11 +1618,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1615
1618
  }
1616
1619
  });
1617
1620
  const _hoisted_1$3 = ["disabled", "aria-expanded", "aria-label"];
1618
- const _hoisted_2$2 = { class: "max-w-[10rem] truncate" };
1621
+ const _hoisted_2$2 = { class: "min-w-0 max-w-[10rem] truncate" };
1619
1622
  const _hoisted_3$1 = ["aria-label"];
1620
1623
  const _hoisted_4$1 = ["aria-selected", "onClick"];
1621
- const _hoisted_5$1 = { class: "min-w-0 flex-1 truncate" };
1622
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1624
+ const _hoisted_5 = { class: "min-w-0 flex-1 truncate" };
1625
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1623
1626
  ...{ name: "CkModelSelector" },
1624
1627
  __name: "CkModelSelector",
1625
1628
  props: {
@@ -1663,7 +1666,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1663
1666
  default: withCtx(() => [
1664
1667
  createElementVNode("button", {
1665
1668
  type: "button",
1666
- class: "ck-model-selector__trigger inline-flex h-9 shrink-0 items-center gap-1 rounded-3xl px-3 label-14-medium text-content-on-surface-primary outline-none transition-colors hover:bg-background-surface-muted focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1669
+ class: "ck-model-selector__trigger inline-flex h-9 min-w-0 items-center gap-1 rounded-3xl px-3 label-14-medium text-content-on-surface-primary outline-none transition-colors hover:bg-background-surface-muted focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1667
1670
  disabled: __props.disabled,
1668
1671
  "aria-haspopup": "listbox",
1669
1672
  "aria-expanded": open.value,
@@ -1673,6 +1676,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1673
1676
  createVNode(unref(UiIcon), {
1674
1677
  name: "chevron-down",
1675
1678
  size: 16,
1679
+ class: "shrink-0",
1676
1680
  "aria-hidden": "true"
1677
1681
  })
1678
1682
  ], 8, _hoisted_1$3)
@@ -1705,7 +1709,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1705
1709
  class: "relative flex w-full items-center gap-2 rounded-sm py-2 pr-8 pl-3 text-left body-14-regular text-content-on-surface-primary outline-none hover:bg-background-surface-muted-subtle focus-visible:ring-2 focus-visible:ring-ring",
1706
1710
  onClick: ($event) => select(model.id)
1707
1711
  }, [
1708
- createElementVNode("span", _hoisted_5$1, toDisplayString(model.label), 1),
1712
+ createElementVNode("span", _hoisted_5, toDisplayString(model.label), 1),
1709
1713
  model.id === __props.selectedModelId ? (openBlock(), createBlock(unref(UiIcon), {
1710
1714
  key: 0,
1711
1715
  name: "check",
@@ -1726,9 +1730,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1726
1730
  };
1727
1731
  }
1728
1732
  });
1729
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1730
- ...{ name: "CkPromptActionButton" },
1731
- __name: "CkPromptActionButton",
1733
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1734
+ ...{ name: "CkPromptSendButton" },
1735
+ __name: "CkPromptSendButton",
1732
1736
  props: {
1733
1737
  ariaLabel: {},
1734
1738
  disabled: { type: Boolean, default: false },
@@ -1742,7 +1746,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1742
1746
  type: __props.type,
1743
1747
  disabled: __props.disabled,
1744
1748
  loading: __props.loading,
1745
- class: "!bg-brand-bg-brand hover:!bg-brand-bg-brand-hover !text-brand-content-default !rounded-md"
1749
+ class: "!rounded-full"
1746
1750
  }), {
1747
1751
  default: withCtx(() => [
1748
1752
  renderSlot(_ctx.$slots, "default")
@@ -1752,6 +1756,36 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1752
1756
  };
1753
1757
  }
1754
1758
  });
1759
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1760
+ ...{ name: "CkPromptMenuButton" },
1761
+ __name: "CkPromptMenuButton",
1762
+ props: {
1763
+ ariaLabel: {},
1764
+ disabled: { type: Boolean, default: false },
1765
+ type: { default: "button" }
1766
+ },
1767
+ setup(__props) {
1768
+ return (_ctx, _cache) => {
1769
+ return openBlock(), createBlock(unref(UiButton), mergeProps({ ariaLabel: __props.ariaLabel }, {
1770
+ variant: "ghost",
1771
+ size: "icon",
1772
+ type: __props.type,
1773
+ disabled: __props.disabled,
1774
+ class: "!rounded-full"
1775
+ }), {
1776
+ default: withCtx(() => [
1777
+ renderSlot(_ctx.$slots, "default", {}, () => [
1778
+ createVNode(unref(UiIcon), {
1779
+ name: "plus",
1780
+ size: 20
1781
+ })
1782
+ ])
1783
+ ]),
1784
+ _: 3
1785
+ }, 16, ["type", "disabled"]);
1786
+ };
1787
+ }
1788
+ });
1755
1789
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1756
1790
  ...{ name: "CkPromptStopButton" },
1757
1791
  __name: "CkPromptStopButton",
@@ -1764,9 +1798,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1764
1798
  const props = __props;
1765
1799
  return (_ctx, _cache) => {
1766
1800
  return openBlock(), createBlock(unref(UiButton), mergeProps({ ariaLabel: __props.ariaLabel }, {
1767
- size: "icon-sm",
1801
+ variant: "secondary",
1802
+ size: "icon",
1768
1803
  disabled: props.disabled,
1769
- class: "!bg-brand-bg-brand hover:!bg-brand-bg-brand-hover !text-brand-content-default !rounded-md",
1804
+ class: "!rounded-full",
1770
1805
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
1771
1806
  }), {
1772
1807
  default: withCtx(() => [
@@ -1778,12 +1813,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1778
1813
  }
1779
1814
  });
1780
1815
  const _hoisted_1$2 = { class: "flex flex-col gap-2" };
1781
- const _hoisted_2$1 = ["for"];
1782
- const _hoisted_3 = ["id", "value", "placeholder", "disabled"];
1783
- const _hoisted_4 = { class: "flex items-center justify-between" };
1784
- const _hoisted_5 = { key: 0 };
1785
- const _hoisted_6 = { key: 1 };
1786
- const _hoisted_7 = { class: "ml-auto" };
1816
+ const _hoisted_2$1 = {
1817
+ key: 0,
1818
+ style: { "grid-area": "top" }
1819
+ };
1820
+ const _hoisted_3 = ["for"];
1821
+ const _hoisted_4 = ["id", "value", "placeholder", "disabled"];
1822
+ const LINE_HEIGHT = 24;
1823
+ const MAX_LINES = 6;
1787
1824
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1788
1825
  ...{ name: "CkPromptInput" },
1789
1826
  __name: "CkPromptInput",
@@ -1791,27 +1828,51 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1791
1828
  modelValue: { default: "" },
1792
1829
  placeholder: { default: void 0 },
1793
1830
  disabled: { type: Boolean, default: false },
1794
- maxHeight: { default: 200 },
1795
1831
  ariaLabel: { default: void 0 }
1796
1832
  },
1797
1833
  emits: ["update:modelValue", "submit"],
1798
1834
  setup(__props, { expose: __expose, emit: __emit }) {
1835
+ const MAX_HEIGHT = LINE_HEIGHT * MAX_LINES;
1799
1836
  const props = __props;
1800
1837
  const emit = __emit;
1801
1838
  const textareaId = useId();
1802
1839
  const textareaRef = useTemplateRef("textareaRef");
1840
+ const slots = useSlots();
1841
+ const isMultiLine = ref(false);
1803
1842
  const isEmpty = computed(() => props.modelValue.trim() === "");
1804
1843
  const isSubmitDisabled = computed(() => props.disabled || isEmpty.value);
1844
+ const hasToolbarTop = ref(typeof slots["toolbar-top"] === "function");
1845
+ function syncSlotState() {
1846
+ const next = typeof slots["toolbar-top"] === "function";
1847
+ if (next !== hasToolbarTop.value) hasToolbarTop.value = next;
1848
+ }
1849
+ onMounted(syncSlotState);
1850
+ onUpdated(syncSlotState);
1851
+ const hasMultipleRows = computed(
1852
+ () => isMultiLine.value || hasToolbarTop.value
1853
+ );
1854
+ const gridAreas = computed(() => {
1855
+ const top = hasToolbarTop.value ? '"top top top" ' : "";
1856
+ return isMultiLine.value ? `${top}"input input input" "left . right"` : `${top}"left input right"`;
1857
+ });
1805
1858
  function adjustHeight() {
1806
1859
  const el = textareaRef.value;
1807
1860
  if (!el) return;
1861
+ if (props.modelValue === "") {
1862
+ isMultiLine.value = false;
1863
+ el.style.height = "";
1864
+ return;
1865
+ }
1808
1866
  el.style.height = "auto";
1809
- el.style.height = `${Math.min(el.scrollHeight, props.maxHeight)}px`;
1867
+ const measured = el.scrollHeight;
1868
+ el.style.height = `${Math.min(measured, MAX_HEIGHT)}px`;
1869
+ const hasExplicitNewline = props.modelValue.includes("\n");
1870
+ if (!isMultiLine.value && (hasExplicitNewline || measured >= LINE_HEIGHT * 2)) {
1871
+ isMultiLine.value = true;
1872
+ }
1810
1873
  }
1811
1874
  function onInput(event) {
1812
- const value = event.target.value;
1813
- emit("update:modelValue", value);
1814
- adjustHeight();
1875
+ emit("update:modelValue", event.target.value);
1815
1876
  }
1816
1877
  function submit() {
1817
1878
  if (isSubmitDisabled.value) return;
@@ -1830,52 +1891,70 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1830
1891
  }
1831
1892
  watch(
1832
1893
  () => props.modelValue,
1833
- () => {
1834
- nextTick(adjustHeight);
1835
- }
1894
+ () => nextTick(adjustHeight)
1836
1895
  );
1896
+ onMounted(adjustHeight);
1837
1897
  __expose({ focus, submit });
1838
1898
  return (_ctx, _cache) => {
1839
1899
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
1840
1900
  createElementVNode("form", {
1841
- class: "border-core-border-default bg-core-bg-primary [&:has(textarea:focus)]:ring-core-border-focus flex flex-col gap-3 rounded-xl border px-4 pt-3 pb-3 shadow-sm [&:has(textarea:focus)]:ring-2",
1901
+ class: normalizeClass([
1902
+ "ck-prompt-form border-border-surface-default bg-background-input-strong [&:has(textarea:focus)]:border-border-surface-focus-ring [&:has(textarea:focus)]:ring-border-surface-focus-ring/40 min-h-17 grid items-center gap-x-0 gap-y-5 border p-4 transition-[border-radius] duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] [&:has(textarea:focus)]:ring-2",
1903
+ hasMultipleRows.value ? "rounded-2xl" : "rounded-3xl"
1904
+ ]),
1905
+ style: normalizeStyle({
1906
+ gridTemplateColumns: "auto 1fr auto",
1907
+ gridTemplateAreas: gridAreas.value
1908
+ }),
1842
1909
  onSubmit: withModifiers(submit, ["prevent"])
1843
1910
  }, [
1911
+ hasToolbarTop.value ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
1912
+ renderSlot(_ctx.$slots, "toolbar-top", {}, void 0, true)
1913
+ ])) : createCommentVNode("", true),
1844
1914
  __props.ariaLabel ? (openBlock(), createElementBlock("label", {
1845
- key: 0,
1915
+ key: 1,
1846
1916
  for: unref(textareaId),
1847
1917
  class: "sr-only"
1848
- }, toDisplayString(__props.ariaLabel), 9, _hoisted_2$1)) : createCommentVNode("", true),
1918
+ }, toDisplayString(__props.ariaLabel), 9, _hoisted_3)) : createCommentVNode("", true),
1919
+ createElementVNode("div", {
1920
+ class: normalizeClass([!isMultiLine.value && "pr-2"]),
1921
+ style: { "grid-area": "left" }
1922
+ }, [
1923
+ renderSlot(_ctx.$slots, "toolbar-left", {}, void 0, true)
1924
+ ], 2),
1849
1925
  createElementVNode("textarea", {
1850
1926
  id: unref(textareaId),
1851
1927
  ref_key: "textareaRef",
1852
1928
  ref: textareaRef,
1853
- rows: "2",
1929
+ rows: "1",
1854
1930
  value: __props.modelValue,
1855
1931
  placeholder: __props.placeholder,
1856
1932
  disabled: __props.disabled,
1857
- class: "text-core-content-primary placeholder-core-content-placeholder min-h-10 w-full resize-none bg-transparent text-sm leading-5 focus:outline-none",
1933
+ style: { "grid-area": "input" },
1934
+ class: normalizeClass([
1935
+ "ck-prompt-textarea text-content-on-surface-primary placeholder-content-on-surface-muted w-full min-w-0 resize-none overflow-y-auto bg-transparent py-0 font-sans text-base font-normal leading-6 max-h-36 focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",
1936
+ isMultiLine.value ? "pl-3 pr-3" : "px-0"
1937
+ ]),
1858
1938
  onInput,
1859
1939
  onKeydown
1860
- }, null, 40, _hoisted_3),
1861
- createElementVNode("div", _hoisted_4, [
1862
- _ctx.$slots["toolbar-left"] ? (openBlock(), createElementBlock("div", _hoisted_5, [
1863
- renderSlot(_ctx.$slots, "toolbar-left")
1864
- ])) : (openBlock(), createElementBlock("div", _hoisted_6)),
1865
- createElementVNode("div", _hoisted_7, [
1866
- renderSlot(_ctx.$slots, "toolbar-right", {
1867
- submit,
1868
- disabled: isSubmitDisabled.value,
1869
- isEmpty: isEmpty.value
1870
- })
1871
- ])
1872
- ])
1873
- ], 32),
1874
- renderSlot(_ctx.$slots, "footer")
1940
+ }, null, 42, _hoisted_4),
1941
+ createElementVNode("div", {
1942
+ class: normalizeClass([!isMultiLine.value && "pl-4"]),
1943
+ style: { "grid-area": "right" }
1944
+ }, [
1945
+ renderSlot(_ctx.$slots, "toolbar-right", {
1946
+ submit,
1947
+ disabled: isSubmitDisabled.value,
1948
+ isEmpty: isEmpty.value
1949
+ }, void 0, true)
1950
+ ], 2)
1951
+ ], 38),
1952
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
1875
1953
  ]);
1876
1954
  };
1877
1955
  }
1878
1956
  });
1957
+ const CkPromptInput = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-92b05731"]]);
1879
1958
  const _hoisted_1$1 = {
1880
1959
  key: 0,
1881
1960
  class: "text-core-content-tertiary text-center text-xs leading-3.5"
@@ -1990,7 +2069,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1990
2069
  return message.content.filter((c) => c.type === "text").map((c) => c.text).join("");
1991
2070
  }
1992
2071
  return (_ctx, _cache) => {
1993
- return openBlock(), createBlock(_sfc_main$k, { messages: __props.messages }, {
2072
+ return openBlock(), createBlock(_sfc_main$l, { messages: __props.messages }, {
1994
2073
  "user-message": withCtx(({ message }) => [
1995
2074
  createElementVNode("div", {
1996
2075
  class: normalizeClass({ "ml-8": hasIcon.value })
@@ -2009,7 +2088,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2009
2088
  ]),
2010
2089
  "agent-message": withCtx(({ message }) => [
2011
2090
  renderSlot(_ctx.$slots, "agent-message", { message }, () => [
2012
- createVNode(_sfc_main$l, null, createSlots({
2091
+ createVNode(_sfc_main$m, null, createSlots({
2013
2092
  footer: withCtx(() => [
2014
2093
  renderSlot(_ctx.$slots, "agent-message-footer", { message }, () => [
2015
2094
  getMessageText(message) && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageActionButton, {
@@ -2022,7 +2101,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2022
2101
  ]),
2023
2102
  default: withCtx(() => [
2024
2103
  renderSlot(_ctx.$slots, "agent-message-content", { message }, () => [
2025
- createVNode(_sfc_main$e, {
2104
+ createVNode(_sfc_main$f, {
2026
2105
  content: getMessageText(message),
2027
2106
  classes: __props.agentMarkdownClasses
2028
2107
  }, createSlots({ _: 2 }, [
@@ -2148,7 +2227,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2148
2227
  }
2149
2228
  return (_ctx, _cache) => {
2150
2229
  return openBlock(), createElementBlock("div", null, [
2151
- createVNode(_sfc_main$9, {
2230
+ createVNode(_sfc_main$a, {
2152
2231
  class: normalizeClass(isExpanded.value && props.maxHeight ? "overflow-y-auto" : void 0),
2153
2232
  style: normalizeStyle(
2154
2233
  isExpanded.value && props.maxHeight ? { maxHeight: props.maxHeight } : void 0
@@ -2167,7 +2246,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2167
2246
  edit: () => emit("edit", conversation),
2168
2247
  delete: () => emit("delete", conversation)
2169
2248
  }, () => [
2170
- createVNode(_sfc_main$a, {
2249
+ createVNode(_sfc_main$b, {
2171
2250
  as: "a",
2172
2251
  href: hrefFor(conversation),
2173
2252
  "is-active": conversation.id === props.activeId,
@@ -2241,7 +2320,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2241
2320
  placeholder: { default: "Ask me anything" },
2242
2321
  disabled: { type: Boolean, default: false },
2243
2322
  loading: { type: Boolean, default: false },
2244
- maxHeight: { default: 200 },
2245
2323
  ariaLabel: { default: "Chat message input" },
2246
2324
  stopAriaLabel: { default: "Stop generating" },
2247
2325
  disclaimer: { default: void 0 }
@@ -2269,13 +2347,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2269
2347
  }
2270
2348
  __expose({ focus, submit });
2271
2349
  return (_ctx, _cache) => {
2272
- return openBlock(), createBlock(_sfc_main$5, {
2350
+ return openBlock(), createBlock(CkPromptInput, {
2273
2351
  ref_key: "promptInputRef",
2274
2352
  ref: promptInputRef,
2275
2353
  "model-value": __props.modelValue,
2276
2354
  placeholder: __props.placeholder,
2277
2355
  disabled: isDisabled.value,
2278
- "max-height": __props.maxHeight,
2279
2356
  "aria-label": __props.ariaLabel,
2280
2357
  "onUpdate:modelValue": onUpdateModelValue,
2281
2358
  onSubmit
@@ -2290,17 +2367,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2290
2367
  }, {
2291
2368
  default: withCtx(() => [
2292
2369
  renderSlot(_ctx.$slots, "stop-icon", {}, () => [
2293
- createVNode(_sfc_main$m)
2370
+ createVNode(_sfc_main$n)
2294
2371
  ])
2295
2372
  ]),
2296
2373
  _: 3
2297
- }, 8, ["aria-label", "disabled"])) : (openBlock(), createBlock(_sfc_main$7, mergeProps({ key: 1 }, { ariaLabel: "Send message" }, {
2374
+ }, 8, ["aria-label", "disabled"])) : (openBlock(), createBlock(_sfc_main$8, mergeProps({ key: 1 }, { ariaLabel: "Send message" }, {
2298
2375
  type: "submit",
2299
2376
  disabled: scope.disabled
2300
2377
  }), {
2301
2378
  default: withCtx(() => [
2302
2379
  renderSlot(_ctx.$slots, "send-icon", {}, () => [
2303
- createVNode(_sfc_main$n)
2380
+ createVNode(_sfc_main$o)
2304
2381
  ])
2305
2382
  ]),
2306
2383
  _: 3
@@ -2317,39 +2394,47 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2317
2394
  ]),
2318
2395
  _: 2
2319
2396
  }, [
2397
+ _ctx.$slots["toolbar-top"] ? {
2398
+ name: "toolbar-top",
2399
+ fn: withCtx(() => [
2400
+ renderSlot(_ctx.$slots, "toolbar-top")
2401
+ ]),
2402
+ key: "0"
2403
+ } : void 0,
2320
2404
  _ctx.$slots["toolbar-left"] ? {
2321
2405
  name: "toolbar-left",
2322
2406
  fn: withCtx(() => [
2323
2407
  renderSlot(_ctx.$slots, "toolbar-left")
2324
2408
  ]),
2325
- key: "0"
2409
+ key: "1"
2326
2410
  } : void 0
2327
- ]), 1032, ["model-value", "placeholder", "disabled", "max-height", "aria-label"]);
2411
+ ]), 1032, ["model-value", "placeholder", "disabled", "aria-label"]);
2328
2412
  };
2329
2413
  }
2330
2414
  });
2331
2415
  export {
2332
2416
  CkCopyMessageActionButton as C,
2333
- _sfc_main$l as _,
2417
+ _sfc_main$m as _,
2334
2418
  _sfc_main$2 as a,
2335
- _sfc_main$k as b,
2419
+ _sfc_main$l as b,
2336
2420
  CkDropZoneOverlay as c,
2337
2421
  CkFeedbackButton as d,
2338
2422
  CkFeedbackDialog as e,
2339
- _sfc_main$b as f,
2423
+ _sfc_main$c as f,
2340
2424
  _sfc_main$1 as g,
2341
- _sfc_main$a as h,
2342
- _sfc_main$9 as i,
2425
+ _sfc_main$b as h,
2426
+ _sfc_main$a as i,
2343
2427
  _sfc_main as j,
2344
- _sfc_main$e as k,
2345
- _sfc_main$j as l,
2346
- _sfc_main$8 as m,
2347
- _sfc_main$7 as n,
2348
- _sfc_main$5 as o,
2349
- _sfc_main$4 as p,
2350
- _sfc_main$6 as q,
2351
- _sfc_main$n as r,
2352
- _sfc_main$m as s,
2353
- CkUserMessage as t,
2354
- formatRelativeTime as u
2428
+ _sfc_main$f as k,
2429
+ _sfc_main$k as l,
2430
+ _sfc_main$9 as m,
2431
+ CkPromptInput as n,
2432
+ _sfc_main$4 as o,
2433
+ _sfc_main$7 as p,
2434
+ _sfc_main$8 as q,
2435
+ _sfc_main$6 as r,
2436
+ _sfc_main$o as s,
2437
+ _sfc_main$n as t,
2438
+ CkUserMessage as u,
2439
+ formatRelativeTime as v
2355
2440
  };