@aleph-alpha/chat-kit 1.12.0 → 1.14.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/{CkInput.vue_vue_type_script_setup_true_lang-C1Jnn1fK.js → CkInput.vue_vue_type_script_setup_true_lang-BVZ7FG88.js} +430 -142
- package/dist/chat-kit.css +47 -0
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.d.ts +30 -0
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.d.ts.map +1 -0
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.vue.d.ts +13 -0
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.vue.d.ts.map +1 -0
- package/dist/components/base/CkFeedbackDialog/index.d.ts +3 -0
- package/dist/components/base/CkFeedbackDialog/index.d.ts.map +1 -0
- package/dist/components/base/CkFeedbackDialog/types.d.ts +152 -0
- package/dist/components/base/CkFeedbackDialog/types.d.ts.map +1 -0
- package/dist/components/base/CkUserMessage/CkUserMessage.stories.d.ts +6 -0
- package/dist/components/base/CkUserMessage/CkUserMessage.stories.d.ts.map +1 -1
- package/dist/components/base/CkUserMessage/CkUserMessage.vue.d.ts +4 -1
- package/dist/components/base/CkUserMessage/CkUserMessage.vue.d.ts.map +1 -1
- package/dist/components/base/CkUserMessage/types.d.ts +14 -5
- package/dist/components/base/CkUserMessage/types.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +2 -0
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +16 -15
- package/dist/handlers/index.js +1 -1
- package/dist/handlers/useChatKitLabels.d.ts +22 -0
- package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -16
- package/dist/{useChatKitLabels-ftC52m7f.js → useChatKitLabels-BxNkTzr2.js} +11 -0
- package/package.json +5 -5
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.spec.ts +177 -0
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.ts +258 -0
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue +288 -0
- package/src/components/base/CkFeedbackDialog/index.ts +2 -0
- package/src/components/base/CkFeedbackDialog/types.ts +155 -0
- package/src/components/base/CkUserMessage/CkUserMessage.spec.ts +25 -0
- package/src/components/base/CkUserMessage/CkUserMessage.stories.ts +34 -0
- package/src/components/base/CkUserMessage/CkUserMessage.vue +115 -5
- package/src/components/base/CkUserMessage/types.ts +14 -5
- package/src/components/base/index.ts +8 -0
- package/src/components/index.ts +6 -0
- package/src/handlers/useChatKitLabels.spec.ts +13 -0
- package/src/handlers/useChatKitLabels.ts +35 -0
- package/src/index.ts +6 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, computed, normalizeClass,
|
|
2
|
-
import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-
|
|
3
|
-
import { UiButton, UiTooltip, UiIcon, UiFileItem, UiPopover, UiPopoverTrigger, UiFileType, UiPopoverContent, Primitive, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
|
|
4
|
-
const _hoisted_1$
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, computed, normalizeClass, toRefs, h, useId, createTextVNode, useAttrs, useSlots, withModifiers, resolveDynamicComponent, useTemplateRef, onBeforeUnmount, createSlots, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-BxNkTzr2.js";
|
|
3
|
+
import { UiButton, UiTooltip, UiIcon, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiPopover, UiPopoverTrigger, UiFileType, UiPopoverContent, Primitive, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
|
|
4
|
+
const _hoisted_1$b = {
|
|
5
5
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6
6
|
width: "16",
|
|
7
7
|
height: "16",
|
|
@@ -12,31 +12,31 @@ const _hoisted_1$a = {
|
|
|
12
12
|
"stroke-linecap": "round",
|
|
13
13
|
"stroke-linejoin": "round"
|
|
14
14
|
};
|
|
15
|
-
const _sfc_main$
|
|
15
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
16
16
|
...{ name: "CkSendIcon" },
|
|
17
17
|
__name: "CkSendIcon",
|
|
18
18
|
setup(__props) {
|
|
19
19
|
return (_ctx, _cache) => {
|
|
20
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
20
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$b, [..._cache[0] || (_cache[0] = [
|
|
21
21
|
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),
|
|
22
22
|
createElementVNode("path", { d: "M6 12h16" }, null, -1)
|
|
23
23
|
])]);
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
const _hoisted_1$
|
|
27
|
+
const _hoisted_1$a = {
|
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
|
29
29
|
width: "16",
|
|
30
30
|
height: "16",
|
|
31
31
|
viewBox: "0 0 16 16",
|
|
32
32
|
fill: "none"
|
|
33
33
|
};
|
|
34
|
-
const _sfc_main$
|
|
34
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
35
35
|
...{ name: "CkStopIcon" },
|
|
36
36
|
__name: "CkStopIcon",
|
|
37
37
|
setup(__props) {
|
|
38
38
|
return (_ctx, _cache) => {
|
|
39
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
39
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$a, [..._cache[0] || (_cache[0] = [
|
|
40
40
|
createElementVNode("path", {
|
|
41
41
|
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",
|
|
42
42
|
fill: "#1D1D1B"
|
|
@@ -45,13 +45,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
const _hoisted_1$
|
|
49
|
-
const _hoisted_2$
|
|
48
|
+
const _hoisted_1$9 = { class: "flex w-full items-start gap-2" };
|
|
49
|
+
const _hoisted_2$6 = {
|
|
50
50
|
key: 0,
|
|
51
51
|
class: "flex flex-shrink-0 items-center justify-center"
|
|
52
52
|
};
|
|
53
|
-
const _hoisted_3$
|
|
54
|
-
const _hoisted_4$
|
|
53
|
+
const _hoisted_3$5 = { class: "text-core-content-primary flex min-w-0 flex-1 flex-col gap-2" };
|
|
54
|
+
const _hoisted_4$4 = {
|
|
55
55
|
key: 0,
|
|
56
56
|
class: "text-sm font-bold"
|
|
57
57
|
};
|
|
@@ -59,17 +59,17 @@ const _hoisted_5$3 = {
|
|
|
59
59
|
key: 1,
|
|
60
60
|
class: "flex items-center"
|
|
61
61
|
};
|
|
62
|
-
const _sfc_main$
|
|
62
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
63
63
|
...{ name: "CkAgentMessage" },
|
|
64
64
|
__name: "CkAgentMessage",
|
|
65
65
|
setup(__props) {
|
|
66
66
|
return (_ctx, _cache) => {
|
|
67
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
68
|
-
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
67
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
68
|
+
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
69
69
|
renderSlot(_ctx.$slots, "icon")
|
|
70
70
|
])) : createCommentVNode("", true),
|
|
71
|
-
createElementVNode("div", _hoisted_3$
|
|
72
|
-
_ctx.$slots.header ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
71
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
72
|
+
_ctx.$slots.header ? (openBlock(), createElementBlock("span", _hoisted_4$4, [
|
|
73
73
|
renderSlot(_ctx.$slots, "header")
|
|
74
74
|
])) : createCommentVNode("", true),
|
|
75
75
|
createElementVNode("div", null, [
|
|
@@ -83,16 +83,16 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
const _hoisted_1$
|
|
87
|
-
const _hoisted_2$
|
|
86
|
+
const _hoisted_1$8 = ["data-message-row"];
|
|
87
|
+
const _hoisted_2$5 = {
|
|
88
88
|
key: 0,
|
|
89
89
|
class: "flex justify-end"
|
|
90
90
|
};
|
|
91
|
-
const _hoisted_3$
|
|
91
|
+
const _hoisted_3$4 = {
|
|
92
92
|
key: 1,
|
|
93
93
|
class: "flex justify-start"
|
|
94
94
|
};
|
|
95
|
-
const _sfc_main$
|
|
95
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
96
96
|
...{ name: "CkConversationLayout" },
|
|
97
97
|
__name: "CkConversationLayout",
|
|
98
98
|
props: {
|
|
@@ -232,12 +232,12 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
232
232
|
key: message.id,
|
|
233
233
|
"data-message-row": message.role
|
|
234
234
|
}, [
|
|
235
|
-
message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
235
|
+
message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
|
|
236
236
|
renderSlot(_ctx.$slots, "user-message", { message })
|
|
237
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_3$
|
|
237
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_3$4, [
|
|
238
238
|
renderSlot(_ctx.$slots, "agent-message", { message })
|
|
239
239
|
]))
|
|
240
|
-
], 8, _hoisted_1$
|
|
240
|
+
], 8, _hoisted_1$8);
|
|
241
241
|
}), 128)),
|
|
242
242
|
hasBottomSpacer.value ? (openBlock(), createElementBlock("div", {
|
|
243
243
|
key: 0,
|
|
@@ -248,7 +248,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
});
|
|
251
|
-
const _sfc_main$
|
|
251
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
252
252
|
...{
|
|
253
253
|
name: "CkMessageActionButton"
|
|
254
254
|
},
|
|
@@ -272,11 +272,11 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
});
|
|
275
|
-
const _hoisted_1$
|
|
275
|
+
const _hoisted_1$7 = {
|
|
276
276
|
class: "sr-only",
|
|
277
277
|
"aria-live": "polite"
|
|
278
278
|
};
|
|
279
|
-
const _sfc_main$
|
|
279
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
280
280
|
...{
|
|
281
281
|
name: "CkCopyMessageActionButton"
|
|
282
282
|
},
|
|
@@ -333,7 +333,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
333
333
|
"delay-duration": 0
|
|
334
334
|
}, {
|
|
335
335
|
default: withCtx(() => [
|
|
336
|
-
createVNode(unref(_sfc_main$
|
|
336
|
+
createVNode(unref(_sfc_main$g), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
|
|
337
337
|
disabled: __props.disabled,
|
|
338
338
|
onClick: handleClick
|
|
339
339
|
}), {
|
|
@@ -360,7 +360,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
360
360
|
]),
|
|
361
361
|
_: 1
|
|
362
362
|
}, 16, ["disabled"]),
|
|
363
|
-
createElementVNode("span", _hoisted_1$
|
|
363
|
+
createElementVNode("span", _hoisted_1$7, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
|
|
364
364
|
]),
|
|
365
365
|
_: 1
|
|
366
366
|
}, 8, ["open", "content"]);
|
|
@@ -374,9 +374,9 @@ const _export_sfc = (sfc, props) => {
|
|
|
374
374
|
}
|
|
375
375
|
return target;
|
|
376
376
|
};
|
|
377
|
-
const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
378
|
-
const _hoisted_1$
|
|
379
|
-
const _sfc_main$
|
|
377
|
+
const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-f77a1193"]]);
|
|
378
|
+
const _hoisted_1$6 = ["aria-label"];
|
|
379
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
380
380
|
...{
|
|
381
381
|
name: "CkFeedbackButton"
|
|
382
382
|
},
|
|
@@ -431,7 +431,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
431
431
|
"delay-duration": 0
|
|
432
432
|
}, {
|
|
433
433
|
default: withCtx(() => [
|
|
434
|
-
createVNode(unref(_sfc_main$
|
|
434
|
+
createVNode(unref(_sfc_main$g), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
|
|
435
435
|
"aria-pressed": isUpSelected.value,
|
|
436
436
|
"aria-disabled": __props.locked || void 0,
|
|
437
437
|
disabled: isUpDisabled.value,
|
|
@@ -461,7 +461,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
461
461
|
"delay-duration": 0
|
|
462
462
|
}, {
|
|
463
463
|
default: withCtx(() => [
|
|
464
|
-
createVNode(unref(_sfc_main$
|
|
464
|
+
createVNode(unref(_sfc_main$g), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
|
|
465
465
|
"aria-pressed": isDownSelected.value,
|
|
466
466
|
"aria-disabled": __props.locked || void 0,
|
|
467
467
|
disabled: isDownDisabled.value,
|
|
@@ -484,12 +484,318 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
484
484
|
]),
|
|
485
485
|
_: 1
|
|
486
486
|
}, 8, ["content"])
|
|
487
|
-
], 8, _hoisted_1$
|
|
487
|
+
], 8, _hoisted_1$6);
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
490
|
});
|
|
491
|
-
const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
491
|
+
const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-245705b8"]]);
|
|
492
|
+
const defaultMarkdownClasses = {
|
|
493
|
+
p: "my-1 leading-7",
|
|
494
|
+
a: "underline underline-offset-4",
|
|
495
|
+
h1: "mt-4 mb-2 text-2xl font-bold",
|
|
496
|
+
h2: "mt-3 mb-2 text-xl font-semibold",
|
|
497
|
+
h3: "mt-3 mb-1 text-lg font-semibold",
|
|
498
|
+
ul: "my-1 ml-6 list-disc",
|
|
499
|
+
ol: "my-1 ml-6 list-decimal",
|
|
500
|
+
li: "my-0.5",
|
|
501
|
+
pre: "my-2 overflow-x-auto rounded-lg p-4",
|
|
502
|
+
code: "rounded px-1.5 py-0.5",
|
|
503
|
+
blockquote: "my-2 border-l-2 pl-4 italic",
|
|
504
|
+
table: "my-2 w-full border-collapse",
|
|
505
|
+
th: "border p-2 text-left font-semibold",
|
|
506
|
+
td: "border p-2",
|
|
507
|
+
hr: "my-4"
|
|
508
|
+
};
|
|
509
|
+
function domToVNode(node, slots, classes) {
|
|
510
|
+
if (node.nodeType === Node.TEXT_NODE) return node.textContent;
|
|
511
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return null;
|
|
512
|
+
const el = node;
|
|
513
|
+
if (el.tagName === "PRE" && el.firstElementChild?.tagName === "CODE") {
|
|
514
|
+
const codeEl = el.firstElementChild;
|
|
515
|
+
const language = codeEl.className?.match(/language-(\S+)/)?.[1] ?? "";
|
|
516
|
+
const code = codeEl.textContent ?? "";
|
|
517
|
+
if (slots["code-block"]) {
|
|
518
|
+
return slots["code-block"]({ code, language });
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
const children = Array.from(node.childNodes).map((child) => domToVNode(child, slots, classes)).filter((c) => c != null);
|
|
522
|
+
const attrs = {};
|
|
523
|
+
for (const attr of el.attributes) {
|
|
524
|
+
attrs[attr.name] = attr.value;
|
|
525
|
+
}
|
|
526
|
+
const tag = el.tagName.toLowerCase();
|
|
527
|
+
const customClass = classes[tag];
|
|
528
|
+
if (customClass) {
|
|
529
|
+
attrs.class = attrs.class ? `${attrs.class} ${customClass}` : customClass;
|
|
530
|
+
}
|
|
531
|
+
return h(tag, attrs, children);
|
|
532
|
+
}
|
|
533
|
+
const _sfc_main$d = defineComponent({
|
|
534
|
+
name: "CkMarkdownRenderer",
|
|
535
|
+
props: {
|
|
536
|
+
content: { type: String, required: true },
|
|
537
|
+
classes: {
|
|
538
|
+
type: Object,
|
|
539
|
+
default: () => ({})
|
|
540
|
+
},
|
|
541
|
+
plugins: { type: Array, default: void 0 }
|
|
542
|
+
},
|
|
543
|
+
setup(props, { slots }) {
|
|
544
|
+
const { content, plugins } = toRefs(props);
|
|
545
|
+
const { html } = useMarkdownParser(content, plugins);
|
|
546
|
+
const parsedNodes = computed(() => {
|
|
547
|
+
const raw = html.value;
|
|
548
|
+
if (!raw) return [];
|
|
549
|
+
const doc = new DOMParser().parseFromString(raw, "text/html");
|
|
550
|
+
return Array.from(doc.body.childNodes);
|
|
551
|
+
});
|
|
552
|
+
const mergedClasses = computed(() => ({
|
|
553
|
+
...defaultMarkdownClasses,
|
|
554
|
+
...props.classes
|
|
555
|
+
}));
|
|
556
|
+
return () => {
|
|
557
|
+
const elementClasses = mergedClasses.value;
|
|
558
|
+
const children = parsedNodes.value.map((node) => domToVNode(node, slots, elementClasses)).filter((c) => c != null);
|
|
559
|
+
return h("div", { class: "markdown-renderer" }, children);
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
const _hoisted_1$5 = {
|
|
564
|
+
key: 0,
|
|
565
|
+
class: "flex min-h-0 flex-col gap-2"
|
|
566
|
+
};
|
|
567
|
+
const _hoisted_2$4 = { class: "ck-feedback-dialog__response min-h-0 flex-1 overflow-y-auto rounded-md border border-input bg-background-input-default px-3 py-2 shadow-xs" };
|
|
568
|
+
const _hoisted_3$3 = { class: "flex min-h-0 flex-col gap-4" };
|
|
569
|
+
const _hoisted_4$3 = {
|
|
570
|
+
class: "self-end text-sm text-content-on-surface-muted tabular-nums",
|
|
571
|
+
"aria-live": "polite"
|
|
572
|
+
};
|
|
492
573
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
574
|
+
...{
|
|
575
|
+
name: "CkFeedbackDialog"
|
|
576
|
+
},
|
|
577
|
+
__name: "CkFeedbackDialog",
|
|
578
|
+
props: {
|
|
579
|
+
open: { type: Boolean, default: false },
|
|
580
|
+
sentiment: {},
|
|
581
|
+
responseText: { default: "" },
|
|
582
|
+
reasons: {},
|
|
583
|
+
maxFreeTextLength: { default: 250 },
|
|
584
|
+
submitting: { type: Boolean, default: false },
|
|
585
|
+
disabled: { type: Boolean, default: false },
|
|
586
|
+
titlePositive: {},
|
|
587
|
+
titleNegative: {},
|
|
588
|
+
responseHeading: {},
|
|
589
|
+
description: {},
|
|
590
|
+
otherLabel: {},
|
|
591
|
+
otherTooltip: {},
|
|
592
|
+
freeTextPlaceholder: {},
|
|
593
|
+
cancelLabel: {},
|
|
594
|
+
submitLabel: {}
|
|
595
|
+
},
|
|
596
|
+
emits: ["update:open", "submit", "cancel"],
|
|
597
|
+
setup(__props, { emit: __emit }) {
|
|
598
|
+
const emit = __emit;
|
|
599
|
+
const labels = useChatKitLabels();
|
|
600
|
+
const title = computed(() => {
|
|
601
|
+
if (__props.sentiment === "positive") {
|
|
602
|
+
return __props.titlePositive ?? labels.value.feedbackDialogTitlePositive ?? defaultChatKitLabels.feedbackDialogTitlePositive;
|
|
603
|
+
}
|
|
604
|
+
return __props.titleNegative ?? labels.value.feedbackDialogTitleNegative ?? defaultChatKitLabels.feedbackDialogTitleNegative;
|
|
605
|
+
});
|
|
606
|
+
const responseHeading = computed(
|
|
607
|
+
() => __props.responseHeading ?? labels.value.feedbackDialogResponseHeading ?? defaultChatKitLabels.feedbackDialogResponseHeading
|
|
608
|
+
);
|
|
609
|
+
const description = computed(
|
|
610
|
+
() => __props.description ?? labels.value.feedbackDialogDescription ?? defaultChatKitLabels.feedbackDialogDescription
|
|
611
|
+
);
|
|
612
|
+
const otherLabel = computed(
|
|
613
|
+
() => __props.otherLabel ?? labels.value.feedbackDialogOtherLabel ?? defaultChatKitLabels.feedbackDialogOtherLabel
|
|
614
|
+
);
|
|
615
|
+
const otherTooltip = computed(
|
|
616
|
+
() => __props.otherTooltip ?? labels.value.feedbackDialogOtherTooltip ?? defaultChatKitLabels.feedbackDialogOtherTooltip
|
|
617
|
+
);
|
|
618
|
+
const freeTextPlaceholder = computed(
|
|
619
|
+
() => __props.freeTextPlaceholder ?? labels.value.feedbackDialogFreeTextPlaceholder ?? defaultChatKitLabels.feedbackDialogFreeTextPlaceholder
|
|
620
|
+
);
|
|
621
|
+
const cancelLabel = computed(
|
|
622
|
+
() => __props.cancelLabel ?? labels.value.feedbackDialogCancelLabel ?? defaultChatKitLabels.feedbackDialogCancelLabel
|
|
623
|
+
);
|
|
624
|
+
const submitLabel = computed(
|
|
625
|
+
() => __props.submitLabel ?? labels.value.feedbackDialogSubmitLabel ?? defaultChatKitLabels.feedbackDialogSubmitLabel
|
|
626
|
+
);
|
|
627
|
+
const selectedReason = ref("");
|
|
628
|
+
const freeText = ref("");
|
|
629
|
+
const freeTextId = useId();
|
|
630
|
+
watch(
|
|
631
|
+
() => __props.open,
|
|
632
|
+
(isOpen, wasOpen) => {
|
|
633
|
+
if (isOpen && !wasOpen) {
|
|
634
|
+
selectedReason.value = "";
|
|
635
|
+
freeText.value = "";
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
);
|
|
639
|
+
const showResponseColumn = computed(
|
|
640
|
+
() => typeof __props.responseText === "string" && __props.responseText !== ""
|
|
641
|
+
);
|
|
642
|
+
const characterCount = computed(() => freeText.value.length);
|
|
643
|
+
const canSubmit = computed(
|
|
644
|
+
() => !__props.disabled && !__props.submitting && (selectedReason.value !== "" || freeText.value.trim() !== "")
|
|
645
|
+
);
|
|
646
|
+
function handleOpenChange(next) {
|
|
647
|
+
if (!next && (__props.submitting || __props.disabled)) {
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
emit("update:open", next);
|
|
651
|
+
if (!next && __props.open) {
|
|
652
|
+
emit("cancel");
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
function handleCancel() {
|
|
656
|
+
if (__props.disabled || __props.submitting) {
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
emit("cancel");
|
|
660
|
+
emit("update:open", false);
|
|
661
|
+
}
|
|
662
|
+
function handleSubmit() {
|
|
663
|
+
if (!canSubmit.value) {
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
emit("submit", {
|
|
667
|
+
sentiment: __props.sentiment,
|
|
668
|
+
reason: selectedReason.value === "" ? null : selectedReason.value,
|
|
669
|
+
reasonText: freeText.value.trim()
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
return (_ctx, _cache) => {
|
|
673
|
+
return openBlock(), createBlock(unref(UiDialog), {
|
|
674
|
+
open: __props.open,
|
|
675
|
+
"onUpdate:open": handleOpenChange
|
|
676
|
+
}, {
|
|
677
|
+
default: withCtx(() => [
|
|
678
|
+
createVNode(unref(UiDialogContent), {
|
|
679
|
+
title: title.value,
|
|
680
|
+
"max-width": "max-w-4xl",
|
|
681
|
+
class: "ck-feedback-dialog",
|
|
682
|
+
"show-close-button": !(__props.submitting || __props.disabled)
|
|
683
|
+
}, {
|
|
684
|
+
actions: withCtx(() => [
|
|
685
|
+
createVNode(unref(UiButton), {
|
|
686
|
+
type: "button",
|
|
687
|
+
variant: "outline",
|
|
688
|
+
"aria-label": cancelLabel.value,
|
|
689
|
+
disabled: __props.disabled || __props.submitting,
|
|
690
|
+
onClick: handleCancel
|
|
691
|
+
}, {
|
|
692
|
+
default: withCtx(() => [
|
|
693
|
+
createTextVNode(toDisplayString(cancelLabel.value), 1)
|
|
694
|
+
]),
|
|
695
|
+
_: 1
|
|
696
|
+
}, 8, ["aria-label", "disabled"]),
|
|
697
|
+
createVNode(unref(UiButton), {
|
|
698
|
+
type: "button",
|
|
699
|
+
variant: "default",
|
|
700
|
+
"aria-label": submitLabel.value,
|
|
701
|
+
loading: __props.submitting,
|
|
702
|
+
disabled: !canSubmit.value,
|
|
703
|
+
onClick: handleSubmit
|
|
704
|
+
}, {
|
|
705
|
+
default: withCtx(() => [
|
|
706
|
+
createTextVNode(toDisplayString(submitLabel.value), 1)
|
|
707
|
+
]),
|
|
708
|
+
_: 1
|
|
709
|
+
}, 8, ["aria-label", "loading", "disabled"])
|
|
710
|
+
]),
|
|
711
|
+
default: withCtx(() => [
|
|
712
|
+
createVNode(unref(UiDialogDescription), { class: "sr-only" }, {
|
|
713
|
+
default: withCtx(() => [
|
|
714
|
+
createTextVNode(toDisplayString(description.value), 1)
|
|
715
|
+
]),
|
|
716
|
+
_: 1
|
|
717
|
+
}),
|
|
718
|
+
createElementVNode("div", {
|
|
719
|
+
class: normalizeClass([
|
|
720
|
+
"grid gap-12",
|
|
721
|
+
showResponseColumn.value ? "grid-cols-2" : "grid-cols-1"
|
|
722
|
+
])
|
|
723
|
+
}, [
|
|
724
|
+
showResponseColumn.value ? (openBlock(), createElementBlock("section", _hoisted_1$5, [
|
|
725
|
+
createVNode(unref(UiFieldLabel), null, {
|
|
726
|
+
default: withCtx(() => [
|
|
727
|
+
createTextVNode(toDisplayString(responseHeading.value), 1)
|
|
728
|
+
]),
|
|
729
|
+
_: 1
|
|
730
|
+
}),
|
|
731
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
732
|
+
createVNode(unref(_sfc_main$d), { content: __props.responseText }, null, 8, ["content"])
|
|
733
|
+
])
|
|
734
|
+
])) : createCommentVNode("", true),
|
|
735
|
+
createElementVNode("section", _hoisted_3$3, [
|
|
736
|
+
createVNode(unref(UiToggleGroup), {
|
|
737
|
+
modelValue: selectedReason.value,
|
|
738
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedReason.value = $event),
|
|
739
|
+
type: "single",
|
|
740
|
+
variant: "outline",
|
|
741
|
+
disabled: __props.disabled || __props.submitting,
|
|
742
|
+
class: "grid grid-cols-2 gap-4",
|
|
743
|
+
"aria-label": title.value
|
|
744
|
+
}, {
|
|
745
|
+
default: withCtx(() => [
|
|
746
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.reasons, (reason) => {
|
|
747
|
+
return openBlock(), createBlock(unref(UiToggleGroupItem), {
|
|
748
|
+
key: reason.code,
|
|
749
|
+
value: reason.code,
|
|
750
|
+
class: "ck-feedback-dialog__chip"
|
|
751
|
+
}, {
|
|
752
|
+
default: withCtx(() => [
|
|
753
|
+
createTextVNode(toDisplayString(reason.label), 1)
|
|
754
|
+
]),
|
|
755
|
+
_: 2
|
|
756
|
+
}, 1032, ["value"]);
|
|
757
|
+
}), 128))
|
|
758
|
+
]),
|
|
759
|
+
_: 1
|
|
760
|
+
}, 8, ["modelValue", "disabled", "aria-label"]),
|
|
761
|
+
createVNode(unref(UiField), null, {
|
|
762
|
+
default: withCtx(() => [
|
|
763
|
+
createVNode(unref(UiFieldLabel), {
|
|
764
|
+
for: unref(freeTextId),
|
|
765
|
+
tooltip: otherTooltip.value
|
|
766
|
+
}, {
|
|
767
|
+
default: withCtx(() => [
|
|
768
|
+
createTextVNode(toDisplayString(otherLabel.value), 1)
|
|
769
|
+
]),
|
|
770
|
+
_: 1
|
|
771
|
+
}, 8, ["for", "tooltip"]),
|
|
772
|
+
createVNode(unref(UiTextarea), {
|
|
773
|
+
id: unref(freeTextId),
|
|
774
|
+
modelValue: freeText.value,
|
|
775
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => freeText.value = $event),
|
|
776
|
+
name: "ck-feedback-dialog-free-text",
|
|
777
|
+
placeholder: freeTextPlaceholder.value,
|
|
778
|
+
disabled: __props.disabled || __props.submitting,
|
|
779
|
+
maxlength: __props.maxFreeTextLength,
|
|
780
|
+
rows: "3"
|
|
781
|
+
}, null, 8, ["id", "modelValue", "placeholder", "disabled", "maxlength"]),
|
|
782
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(characterCount.value) + "/" + toDisplayString(__props.maxFreeTextLength), 1)
|
|
783
|
+
]),
|
|
784
|
+
_: 1
|
|
785
|
+
})
|
|
786
|
+
])
|
|
787
|
+
], 2)
|
|
788
|
+
]),
|
|
789
|
+
_: 1
|
|
790
|
+
}, 8, ["title", "show-close-button"])
|
|
791
|
+
]),
|
|
792
|
+
_: 1
|
|
793
|
+
}, 8, ["open"]);
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-eaffd2d5"]]);
|
|
798
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
493
799
|
...{
|
|
494
800
|
name: "CkFileItemRow",
|
|
495
801
|
inheritAttrs: false
|
|
@@ -537,7 +843,7 @@ const _hoisted_2$3 = ["onClick"];
|
|
|
537
843
|
const _hoisted_3$2 = ["disabled", "aria-label"];
|
|
538
844
|
const _hoisted_4$2 = ["aria-label"];
|
|
539
845
|
const _hoisted_5$2 = ["onClick"];
|
|
540
|
-
const _sfc_main$
|
|
846
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
541
847
|
...{
|
|
542
848
|
name: "CkFileItemsList"
|
|
543
849
|
},
|
|
@@ -594,7 +900,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
594
900
|
class: "min-w-0 max-w-64 flex-1 basis-0",
|
|
595
901
|
onClick: ($event) => handleRowClick(file, $event)
|
|
596
902
|
}, [
|
|
597
|
-
createVNode(_sfc_main$
|
|
903
|
+
createVNode(_sfc_main$b, {
|
|
598
904
|
file,
|
|
599
905
|
size: __props.size,
|
|
600
906
|
"is-removable": __props.isRemovable,
|
|
@@ -658,7 +964,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
658
964
|
class: "min-w-0 max-w-64",
|
|
659
965
|
onClick: ($event) => handleRowClick(file, $event)
|
|
660
966
|
}, [
|
|
661
|
-
createVNode(_sfc_main$
|
|
967
|
+
createVNode(_sfc_main$b, {
|
|
662
968
|
file,
|
|
663
969
|
size: __props.size,
|
|
664
970
|
"is-removable": __props.isRemovable,
|
|
@@ -706,7 +1012,7 @@ const _hoisted_7$1 = {
|
|
|
706
1012
|
const _hoisted_8 = ["aria-label"];
|
|
707
1013
|
const _hoisted_9 = ["aria-label"];
|
|
708
1014
|
const _hoisted_10 = ["aria-label"];
|
|
709
|
-
const _sfc_main$
|
|
1015
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
710
1016
|
...{
|
|
711
1017
|
name: "CkHistoryItem",
|
|
712
1018
|
inheritAttrs: false
|
|
@@ -947,7 +1253,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
947
1253
|
}
|
|
948
1254
|
});
|
|
949
1255
|
const baseClass = "flex w-full min-w-0 flex-col p-2";
|
|
950
|
-
const _sfc_main$
|
|
1256
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
951
1257
|
...{
|
|
952
1258
|
name: "CkHistoryWrapper",
|
|
953
1259
|
inheritAttrs: false
|
|
@@ -977,77 +1283,6 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
977
1283
|
};
|
|
978
1284
|
}
|
|
979
1285
|
});
|
|
980
|
-
const defaultMarkdownClasses = {
|
|
981
|
-
p: "my-1 leading-7",
|
|
982
|
-
a: "underline underline-offset-4",
|
|
983
|
-
h1: "mt-4 mb-2 text-2xl font-bold",
|
|
984
|
-
h2: "mt-3 mb-2 text-xl font-semibold",
|
|
985
|
-
h3: "mt-3 mb-1 text-lg font-semibold",
|
|
986
|
-
ul: "my-1 ml-6 list-disc",
|
|
987
|
-
ol: "my-1 ml-6 list-decimal",
|
|
988
|
-
li: "my-0.5",
|
|
989
|
-
pre: "my-2 overflow-x-auto rounded-lg p-4",
|
|
990
|
-
code: "rounded px-1.5 py-0.5",
|
|
991
|
-
blockquote: "my-2 border-l-2 pl-4 italic",
|
|
992
|
-
table: "my-2 w-full border-collapse",
|
|
993
|
-
th: "border p-2 text-left font-semibold",
|
|
994
|
-
td: "border p-2",
|
|
995
|
-
hr: "my-4"
|
|
996
|
-
};
|
|
997
|
-
function domToVNode(node, slots, classes) {
|
|
998
|
-
if (node.nodeType === Node.TEXT_NODE) return node.textContent;
|
|
999
|
-
if (node.nodeType !== Node.ELEMENT_NODE) return null;
|
|
1000
|
-
const el = node;
|
|
1001
|
-
if (el.tagName === "PRE" && el.firstElementChild?.tagName === "CODE") {
|
|
1002
|
-
const codeEl = el.firstElementChild;
|
|
1003
|
-
const language = codeEl.className?.match(/language-(\S+)/)?.[1] ?? "";
|
|
1004
|
-
const code = codeEl.textContent ?? "";
|
|
1005
|
-
if (slots["code-block"]) {
|
|
1006
|
-
return slots["code-block"]({ code, language });
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
const children = Array.from(node.childNodes).map((child) => domToVNode(child, slots, classes)).filter((c) => c != null);
|
|
1010
|
-
const attrs = {};
|
|
1011
|
-
for (const attr of el.attributes) {
|
|
1012
|
-
attrs[attr.name] = attr.value;
|
|
1013
|
-
}
|
|
1014
|
-
const tag = el.tagName.toLowerCase();
|
|
1015
|
-
const customClass = classes[tag];
|
|
1016
|
-
if (customClass) {
|
|
1017
|
-
attrs.class = attrs.class ? `${attrs.class} ${customClass}` : customClass;
|
|
1018
|
-
}
|
|
1019
|
-
return h(tag, attrs, children);
|
|
1020
|
-
}
|
|
1021
|
-
const _sfc_main$8 = defineComponent({
|
|
1022
|
-
name: "CkMarkdownRenderer",
|
|
1023
|
-
props: {
|
|
1024
|
-
content: { type: String, required: true },
|
|
1025
|
-
classes: {
|
|
1026
|
-
type: Object,
|
|
1027
|
-
default: () => ({})
|
|
1028
|
-
},
|
|
1029
|
-
plugins: { type: Array, default: void 0 }
|
|
1030
|
-
},
|
|
1031
|
-
setup(props, { slots }) {
|
|
1032
|
-
const { content, plugins } = toRefs(props);
|
|
1033
|
-
const { html } = useMarkdownParser(content, plugins);
|
|
1034
|
-
const parsedNodes = computed(() => {
|
|
1035
|
-
const raw = html.value;
|
|
1036
|
-
if (!raw) return [];
|
|
1037
|
-
const doc = new DOMParser().parseFromString(raw, "text/html");
|
|
1038
|
-
return Array.from(doc.body.childNodes);
|
|
1039
|
-
});
|
|
1040
|
-
const mergedClasses = computed(() => ({
|
|
1041
|
-
...defaultMarkdownClasses,
|
|
1042
|
-
...props.classes
|
|
1043
|
-
}));
|
|
1044
|
-
return () => {
|
|
1045
|
-
const elementClasses = mergedClasses.value;
|
|
1046
|
-
const children = parsedNodes.value.map((node) => domToVNode(node, slots, elementClasses)).filter((c) => c != null);
|
|
1047
|
-
return h("div", { class: "markdown-renderer" }, children);
|
|
1048
|
-
};
|
|
1049
|
-
}
|
|
1050
|
-
});
|
|
1051
1286
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1052
1287
|
...{ name: "CkPromptActionButton" },
|
|
1053
1288
|
__name: "CkPromptActionButton",
|
|
@@ -1218,26 +1453,78 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1218
1453
|
};
|
|
1219
1454
|
}
|
|
1220
1455
|
});
|
|
1221
|
-
const _hoisted_1 = { class: "
|
|
1222
|
-
const _hoisted_2 =
|
|
1456
|
+
const _hoisted_1 = { class: "inline-flex max-w-[536px] flex-col items-end justify-start gap-1" };
|
|
1457
|
+
const _hoisted_2 = ["aria-expanded"];
|
|
1223
1458
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1224
1459
|
...{ name: "CkUserMessage" },
|
|
1225
1460
|
__name: "CkUserMessage",
|
|
1226
1461
|
props: {
|
|
1227
|
-
message: {}
|
|
1462
|
+
message: { default: void 0 },
|
|
1463
|
+
collapsedLines: { default: 0 }
|
|
1228
1464
|
},
|
|
1229
1465
|
setup(__props) {
|
|
1466
|
+
const props = __props;
|
|
1467
|
+
const labels = useChatKitLabels();
|
|
1468
|
+
const showMoreLabel = computed(
|
|
1469
|
+
() => labels.value.userMessageShowMore ?? defaultChatKitLabels.userMessageShowMore
|
|
1470
|
+
);
|
|
1471
|
+
const showLessLabel = computed(
|
|
1472
|
+
() => labels.value.userMessageShowLess ?? defaultChatKitLabels.userMessageShowLess
|
|
1473
|
+
);
|
|
1474
|
+
const clampEnabled = computed(() => (props.collapsedLines ?? 0) > 0);
|
|
1475
|
+
const contentRef = ref(null);
|
|
1476
|
+
const expanded = ref(false);
|
|
1477
|
+
const isOverflowing = ref(false);
|
|
1478
|
+
function measure() {
|
|
1479
|
+
const el = contentRef.value;
|
|
1480
|
+
if (!el || !clampEnabled.value || expanded.value) return;
|
|
1481
|
+
isOverflowing.value = el.scrollHeight - el.clientHeight > 1;
|
|
1482
|
+
}
|
|
1483
|
+
function toggle() {
|
|
1484
|
+
expanded.value = !expanded.value;
|
|
1485
|
+
}
|
|
1486
|
+
let resizeObserver;
|
|
1487
|
+
onMounted(() => {
|
|
1488
|
+
nextTick(measure);
|
|
1489
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
1490
|
+
resizeObserver = new ResizeObserver(() => measure());
|
|
1491
|
+
if (contentRef.value) resizeObserver.observe(contentRef.value);
|
|
1492
|
+
}
|
|
1493
|
+
});
|
|
1494
|
+
onBeforeUnmount(() => resizeObserver?.disconnect());
|
|
1495
|
+
watch([() => props.message, () => props.collapsedLines], () => {
|
|
1496
|
+
expanded.value = false;
|
|
1497
|
+
nextTick(measure);
|
|
1498
|
+
});
|
|
1230
1499
|
return (_ctx, _cache) => {
|
|
1231
1500
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1232
|
-
createElementVNode("div",
|
|
1501
|
+
createElementVNode("div", {
|
|
1502
|
+
ref_key: "contentRef",
|
|
1503
|
+
ref: contentRef,
|
|
1504
|
+
class: normalizeClass(["ck-user-message__content text-content-on-surface-muted min-w-0 max-w-full self-stretch text-lg leading-7 font-medium break-words whitespace-pre-wrap [overflow-wrap:anywhere]", {
|
|
1505
|
+
"ck-user-message__content--clamped": clampEnabled.value && !expanded.value,
|
|
1506
|
+
"ck-user-message__content--faded": clampEnabled.value && !expanded.value && isOverflowing.value
|
|
1507
|
+
}]),
|
|
1508
|
+
style: normalizeStyle(
|
|
1509
|
+
clampEnabled.value ? { "--ck-collapsed-lines": __props.collapsedLines } : void 0
|
|
1510
|
+
)
|
|
1511
|
+
}, [
|
|
1233
1512
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1234
1513
|
createTextVNode(toDisplayString(__props.message), 1)
|
|
1235
|
-
])
|
|
1236
|
-
])
|
|
1514
|
+
], true)
|
|
1515
|
+
], 6),
|
|
1516
|
+
clampEnabled.value && isOverflowing.value ? (openBlock(), createElementBlock("button", {
|
|
1517
|
+
key: 0,
|
|
1518
|
+
type: "button",
|
|
1519
|
+
"aria-expanded": expanded.value,
|
|
1520
|
+
class: "ck-user-message__toggle label-12-medium text-content-on-surface-primary bg-background-surface-floating focus-visible:ring-ring self-center rounded-3xl px-3 py-2 focus-visible:ring-2 focus-visible:outline-none",
|
|
1521
|
+
onClick: toggle
|
|
1522
|
+
}, toDisplayString(expanded.value ? showLessLabel.value : showMoreLabel.value), 9, _hoisted_2)) : createCommentVNode("", true)
|
|
1237
1523
|
]);
|
|
1238
1524
|
};
|
|
1239
1525
|
}
|
|
1240
1526
|
});
|
|
1527
|
+
const CkUserMessage = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-c759a863"]]);
|
|
1241
1528
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1242
1529
|
...{ name: "CkConversation" },
|
|
1243
1530
|
__name: "CkConversation",
|
|
@@ -1260,13 +1547,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1260
1547
|
return message.content.filter((c) => c.type === "text").map((c) => c.text).join("");
|
|
1261
1548
|
}
|
|
1262
1549
|
return (_ctx, _cache) => {
|
|
1263
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1550
|
+
return openBlock(), createBlock(_sfc_main$h, { messages: __props.messages }, {
|
|
1264
1551
|
"user-message": withCtx(({ message }) => [
|
|
1265
1552
|
createElementVNode("div", {
|
|
1266
1553
|
class: normalizeClass({ "ml-8": hasIcon.value })
|
|
1267
1554
|
}, [
|
|
1268
1555
|
renderSlot(_ctx.$slots, "user-message", { message }, () => [
|
|
1269
|
-
createVNode(
|
|
1556
|
+
createVNode(CkUserMessage, null, {
|
|
1270
1557
|
default: withCtx(() => [
|
|
1271
1558
|
renderSlot(_ctx.$slots, "user-message-content", { message }, () => [
|
|
1272
1559
|
createTextVNode(toDisplayString(getMessageText(message)), 1)
|
|
@@ -1279,7 +1566,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1279
1566
|
]),
|
|
1280
1567
|
"agent-message": withCtx(({ message }) => [
|
|
1281
1568
|
renderSlot(_ctx.$slots, "agent-message", { message }, () => [
|
|
1282
|
-
createVNode(_sfc_main$
|
|
1569
|
+
createVNode(_sfc_main$i, null, createSlots({
|
|
1283
1570
|
footer: withCtx(() => [
|
|
1284
1571
|
renderSlot(_ctx.$slots, "agent-message-footer", { message }, () => [
|
|
1285
1572
|
getMessageText(message) && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageActionButton, {
|
|
@@ -1292,7 +1579,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1292
1579
|
]),
|
|
1293
1580
|
default: withCtx(() => [
|
|
1294
1581
|
renderSlot(_ctx.$slots, "agent-message-content", { message }, () => [
|
|
1295
|
-
createVNode(_sfc_main$
|
|
1582
|
+
createVNode(_sfc_main$d, {
|
|
1296
1583
|
content: getMessageText(message),
|
|
1297
1584
|
classes: __props.agentMarkdownClasses
|
|
1298
1585
|
}, createSlots({ _: 2 }, [
|
|
@@ -1400,7 +1687,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1400
1687
|
emit("select", c, event);
|
|
1401
1688
|
}
|
|
1402
1689
|
return (_ctx, _cache) => {
|
|
1403
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1690
|
+
return openBlock(), createBlock(_sfc_main$8, null, {
|
|
1404
1691
|
default: withCtx(() => [
|
|
1405
1692
|
(openBlock(true), createElementBlock(Fragment, null, renderList(props.conversations, (conversation) => {
|
|
1406
1693
|
return renderSlot(_ctx.$slots, "item", {
|
|
@@ -1413,7 +1700,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1413
1700
|
edit: () => emit("edit", conversation),
|
|
1414
1701
|
delete: () => emit("delete", conversation)
|
|
1415
1702
|
}, () => [
|
|
1416
|
-
createVNode(_sfc_main$
|
|
1703
|
+
createVNode(_sfc_main$9, {
|
|
1417
1704
|
as: "a",
|
|
1418
1705
|
href: hrefFor(conversation),
|
|
1419
1706
|
"is-active": conversation.id === props.activeId,
|
|
@@ -1522,7 +1809,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1522
1809
|
}, {
|
|
1523
1810
|
default: withCtx(() => [
|
|
1524
1811
|
renderSlot(_ctx.$slots, "stop-icon", {}, () => [
|
|
1525
|
-
createVNode(_sfc_main$
|
|
1812
|
+
createVNode(_sfc_main$j)
|
|
1526
1813
|
])
|
|
1527
1814
|
]),
|
|
1528
1815
|
_: 3
|
|
@@ -1532,7 +1819,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1532
1819
|
}), {
|
|
1533
1820
|
default: withCtx(() => [
|
|
1534
1821
|
renderSlot(_ctx.$slots, "send-icon", {}, () => [
|
|
1535
|
-
createVNode(_sfc_main$
|
|
1822
|
+
createVNode(_sfc_main$k)
|
|
1536
1823
|
])
|
|
1537
1824
|
]),
|
|
1538
1825
|
_: 3
|
|
@@ -1562,22 +1849,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1562
1849
|
});
|
|
1563
1850
|
export {
|
|
1564
1851
|
CkCopyMessageActionButton as C,
|
|
1565
|
-
_sfc_main$
|
|
1852
|
+
_sfc_main$i as _,
|
|
1566
1853
|
_sfc_main$2 as a,
|
|
1567
|
-
_sfc_main$
|
|
1854
|
+
_sfc_main$h as b,
|
|
1568
1855
|
CkFeedbackButton as c,
|
|
1569
|
-
|
|
1570
|
-
_sfc_main$
|
|
1571
|
-
_sfc_main$
|
|
1856
|
+
CkFeedbackDialog as d,
|
|
1857
|
+
_sfc_main$a as e,
|
|
1858
|
+
_sfc_main$1 as f,
|
|
1572
1859
|
_sfc_main$9 as g,
|
|
1573
|
-
_sfc_main as h,
|
|
1574
|
-
_sfc_main
|
|
1575
|
-
_sfc_main$
|
|
1576
|
-
_sfc_main$
|
|
1577
|
-
_sfc_main$
|
|
1578
|
-
_sfc_main$
|
|
1579
|
-
_sfc_main$
|
|
1580
|
-
_sfc_main$
|
|
1581
|
-
_sfc_main$
|
|
1582
|
-
_sfc_main$
|
|
1860
|
+
_sfc_main$8 as h,
|
|
1861
|
+
_sfc_main as i,
|
|
1862
|
+
_sfc_main$d as j,
|
|
1863
|
+
_sfc_main$g as k,
|
|
1864
|
+
_sfc_main$7 as l,
|
|
1865
|
+
_sfc_main$5 as m,
|
|
1866
|
+
_sfc_main$4 as n,
|
|
1867
|
+
_sfc_main$6 as o,
|
|
1868
|
+
_sfc_main$k as p,
|
|
1869
|
+
_sfc_main$j as q,
|
|
1870
|
+
CkUserMessage as r
|
|
1583
1871
|
};
|