@aleph-alpha/chat-kit 4.0.0 → 5.0.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-DJN-nZ2-.js → CkHistory.vue_vue_type_script_setup_true_lang-Bp9hXdH6.js} +434 -377
- package/dist/chat-kit.css +28 -6
- package/dist/components/base/CkAgentMessage/CkAgentMessage.stories.d.ts +14 -13
- package/dist/components/base/CkAgentMessage/CkAgentMessage.stories.d.ts.map +1 -1
- package/dist/components/base/CkAgentMessage/CkAgentMessage.vue.d.ts +8 -7
- package/dist/components/base/CkAgentMessage/CkAgentMessage.vue.d.ts.map +1 -1
- package/dist/components/base/CkAgentMessage/types.d.ts +16 -5
- package/dist/components/base/CkAgentMessage/types.d.ts.map +1 -1
- package/dist/components/base/CkAgentMessageHeader/CkAgentMessageHeader.stories.d.ts +16 -0
- package/dist/components/base/CkAgentMessageHeader/CkAgentMessageHeader.stories.d.ts.map +1 -0
- package/dist/components/base/CkAgentMessageHeader/CkAgentMessageHeader.vue.d.ts +21 -0
- package/dist/components/base/CkAgentMessageHeader/CkAgentMessageHeader.vue.d.ts.map +1 -0
- package/dist/components/base/CkAgentMessageHeader/index.d.ts +3 -0
- package/dist/components/base/CkAgentMessageHeader/index.d.ts.map +1 -0
- package/dist/components/base/CkAgentMessageHeader/types.d.ts +22 -0
- package/dist/components/base/CkAgentMessageHeader/types.d.ts.map +1 -0
- package/dist/components/base/CkCitation/CkCitation.stories.d.ts +6 -0
- package/dist/components/base/CkCitation/CkCitation.stories.d.ts.map +1 -1
- package/dist/components/base/CkCitation/CkCitation.vue.d.ts.map +1 -1
- package/dist/components/base/CkCitationCard/CkCitationCard.stories.d.ts +5 -4
- package/dist/components/base/CkCitationCard/CkCitationCard.stories.d.ts.map +1 -1
- package/dist/components/base/CkCitationCard/CkCitationCard.vue.d.ts.map +1 -1
- package/dist/components/base/CkFileItemsList/CkFileItemsList.stories.d.ts +15 -4
- package/dist/components/base/CkFileItemsList/CkFileItemsList.stories.d.ts.map +1 -1
- package/dist/components/base/CkFileItemsList/CkFileItemsList.vue.d.ts +2 -1
- package/dist/components/base/CkFileItemsList/CkFileItemsList.vue.d.ts.map +1 -1
- package/dist/components/base/CkFileItemsList/types.d.ts +17 -4
- package/dist/components/base/CkFileItemsList/types.d.ts.map +1 -1
- package/dist/components/base/CkHeaderActivityButton/CkHeaderActivityButton.stories.d.ts +19 -0
- package/dist/components/base/CkHeaderActivityButton/CkHeaderActivityButton.stories.d.ts.map +1 -0
- package/dist/components/base/CkHeaderActivityButton/CkHeaderActivityButton.vue.d.ts +22 -0
- package/dist/components/base/CkHeaderActivityButton/CkHeaderActivityButton.vue.d.ts.map +1 -0
- package/dist/components/base/CkHeaderActivityButton/index.d.ts +3 -0
- package/dist/components/base/CkHeaderActivityButton/index.d.ts.map +1 -0
- package/dist/components/base/CkHeaderActivityButton/types.d.ts +36 -0
- package/dist/components/base/CkHeaderActivityButton/types.d.ts.map +1 -0
- package/dist/components/base/CkPromptInput/CkPromptInput.stories.d.ts +6 -6
- package/dist/components/base/CkPromptInput/CkPromptInput.vue.d.ts.map +1 -1
- package/dist/components/base/CkPromptInput/types.d.ts +4 -4
- package/dist/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.vue.d.ts.map +1 -1
- package/dist/components/base/CkPromptInputDisclaimer/types.d.ts +1 -1
- package/dist/components/base/CkPromptSendButton/CkPromptSendButton.vue.d.ts +1 -1
- package/dist/components/base/CkPromptSendButton/types.d.ts +1 -1
- package/dist/components/base/CkPromptStopButton/types.d.ts +1 -1
- package/dist/components/base/index.d.ts +4 -0
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/composed/CkConversation/CkConversation.vue.d.ts +13 -1
- package/dist/components/composed/CkConversation/CkConversation.vue.d.ts.map +1 -1
- package/dist/components/composed/CkConversation/types.d.ts +1 -1
- package/dist/components/composed/index.d.ts +0 -1
- package/dist/components/composed/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +26 -25
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -26
- package/package.json +1 -1
- package/src/components/base/CkAgentMessage/CkAgentMessage.spec.ts +12 -17
- package/src/components/base/CkAgentMessage/CkAgentMessage.stories.ts +124 -113
- package/src/components/base/CkAgentMessage/CkAgentMessage.vue +18 -16
- package/src/components/base/CkAgentMessage/types.ts +16 -5
- package/src/components/base/CkAgentMessageHeader/CkAgentMessageHeader.spec.ts +64 -0
- package/src/components/base/CkAgentMessageHeader/CkAgentMessageHeader.stories.ts +90 -0
- package/src/components/base/CkAgentMessageHeader/CkAgentMessageHeader.vue +47 -0
- package/src/components/base/CkAgentMessageHeader/index.ts +2 -0
- package/src/components/base/CkAgentMessageHeader/types.ts +21 -0
- package/src/components/base/CkCitation/CkCitation.stories.ts +12 -0
- package/src/components/base/CkCitation/CkCitation.vue +34 -9
- package/src/components/base/CkCitationCard/CkCitationCard.stories.ts +5 -4
- package/src/components/base/CkCitationCard/CkCitationCard.vue +2 -2
- package/src/components/base/CkConversationLayout/CkConversationLayout.vue +1 -1
- package/src/components/base/CkFileItemsList/CkFileItemsList.spec.ts +88 -13
- package/src/components/base/CkFileItemsList/CkFileItemsList.stories.ts +61 -13
- package/src/components/base/CkFileItemsList/CkFileItemsList.vue +153 -110
- package/src/components/base/CkFileItemsList/types.ts +17 -4
- package/src/components/base/CkHeaderActivityButton/CkHeaderActivityButton.spec.ts +50 -0
- package/src/components/base/CkHeaderActivityButton/CkHeaderActivityButton.stories.ts +102 -0
- package/src/components/base/CkHeaderActivityButton/CkHeaderActivityButton.vue +39 -0
- package/src/components/base/CkHeaderActivityButton/index.ts +2 -0
- package/src/components/base/CkHeaderActivityButton/types.ts +36 -0
- package/src/components/base/CkPromptInput/CkPromptInput.spec.ts +88 -0
- package/src/components/base/CkPromptInput/CkPromptInput.stories.ts +6 -6
- package/src/components/base/CkPromptInput/CkPromptInput.vue +63 -12
- package/src/components/base/CkPromptInput/types.ts +4 -4
- package/src/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.spec.ts +1 -1
- package/src/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.vue +1 -1
- package/src/components/base/CkPromptInputDisclaimer/types.ts +1 -1
- package/src/components/base/CkPromptSendButton/types.ts +1 -1
- package/src/components/base/CkPromptStopButton/types.ts +1 -1
- package/src/components/base/index.ts +7 -0
- package/src/components/composed/CkConversation/CkConversation.spec.ts +81 -6
- package/src/components/composed/CkConversation/CkConversation.vue +78 -35
- package/src/components/composed/CkConversation/types.ts +1 -1
- package/src/components/composed/index.ts +0 -1
- package/src/components/index.ts +6 -1
- package/src/index.ts +5 -1
- package/dist/components/composed/CkInput/CkInput.stories.d.ts +0 -43
- package/dist/components/composed/CkInput/CkInput.stories.d.ts.map +0 -1
- package/dist/components/composed/CkInput/CkInput.vue.d.ts +0 -50
- package/dist/components/composed/CkInput/CkInput.vue.d.ts.map +0 -1
- package/dist/components/composed/CkInput/index.d.ts +0 -3
- package/dist/components/composed/CkInput/index.d.ts.map +0 -1
- package/dist/components/composed/CkInput/types.d.ts +0 -55
- package/dist/components/composed/CkInput/types.d.ts.map +0 -1
- package/src/components/composed/CkInput/CkInput.spec.ts +0 -191
- package/src/components/composed/CkInput/CkInput.stories.ts +0 -434
- package/src/components/composed/CkInput/CkInput.vue +0 -106
- package/src/components/composed/CkInput/index.ts +0 -2
- package/src/components/composed/CkInput/types.ts +0 -55
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createBlock, unref, createElementBlock, createElementVNode, renderSlot, createCommentVNode, computed, createVNode, toDisplayString,
|
|
2
|
-
import { UiIcon,
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, createElementBlock, createElementVNode, normalizeClass, renderSlot, createCommentVNode, mergeProps, withCtx, computed, createVNode, toDisplayString, ref, onBeforeUnmount, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, Transition, createStaticVNode, Teleport, withModifiers, toValue, h, toRefs, useId, createTextVNode, useAttrs, useSlots, resolveDynamicComponent, useTemplateRef, onUpdated, createSlots, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { UiIcon, UiButton, UiFileType, UiPopover, UiPopoverTrigger, UiPopoverContent, UiTooltip, formatFileSize, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiProgress, Primitive, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
|
|
3
3
|
import { u as useChatKitLabels, d as defaultChatKitLabels, r as remarkCitations, a as useMarkdownParser } from "./useChatKitLabels-zMFV7aEz.js";
|
|
4
4
|
const MINUTE = 60;
|
|
5
5
|
const HOUR = 60 * MINUTE;
|
|
@@ -36,7 +36,7 @@ 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 _sfc_main$
|
|
39
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
40
40
|
...{ name: "CkSendIcon" },
|
|
41
41
|
__name: "CkSendIcon",
|
|
42
42
|
setup(__props) {
|
|
@@ -45,19 +45,19 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
const _hoisted_1$
|
|
48
|
+
const _hoisted_1$g = {
|
|
49
49
|
xmlns: "http://www.w3.org/2000/svg",
|
|
50
50
|
width: "16",
|
|
51
51
|
height: "16",
|
|
52
52
|
viewBox: "0 0 16 16",
|
|
53
53
|
fill: "none"
|
|
54
54
|
};
|
|
55
|
-
const _sfc_main$
|
|
55
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
56
56
|
...{ name: "CkStopIcon" },
|
|
57
57
|
__name: "CkStopIcon",
|
|
58
58
|
setup(__props) {
|
|
59
59
|
return (_ctx, _cache) => {
|
|
60
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
60
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$g, [..._cache[0] || (_cache[0] = [
|
|
61
61
|
createElementVNode("path", {
|
|
62
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",
|
|
63
63
|
fill: "currentColor"
|
|
@@ -66,59 +66,130 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
const _hoisted_1$
|
|
70
|
-
const _hoisted_2$9 = {
|
|
71
|
-
key: 0,
|
|
72
|
-
class: "flex items-start gap-3"
|
|
73
|
-
};
|
|
74
|
-
const _hoisted_3$8 = {
|
|
69
|
+
const _hoisted_1$f = {
|
|
75
70
|
key: 0,
|
|
76
|
-
"data-testid": "ck-agent-message-icon",
|
|
77
|
-
class: "flex flex-shrink-0 justify-center"
|
|
78
|
-
};
|
|
79
|
-
const _hoisted_4$7 = {
|
|
80
|
-
key: 1,
|
|
81
71
|
"data-testid": "ck-agent-message-header",
|
|
82
|
-
class: "
|
|
72
|
+
class: "w-full min-w-0"
|
|
83
73
|
};
|
|
84
|
-
const
|
|
85
|
-
const
|
|
74
|
+
const _hoisted_2$a = { class: "text-content-on-surface-primary min-w-0 text-base leading-7" };
|
|
75
|
+
const _hoisted_3$9 = {
|
|
86
76
|
key: 1,
|
|
87
77
|
class: "flex items-center gap-4"
|
|
88
78
|
};
|
|
89
|
-
const _sfc_main$
|
|
79
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
90
80
|
...{ name: "CkAgentMessage" },
|
|
91
81
|
__name: "CkAgentMessage",
|
|
82
|
+
props: {
|
|
83
|
+
bottomSeparator: { type: Boolean, default: true }
|
|
84
|
+
},
|
|
92
85
|
setup(__props) {
|
|
93
86
|
return (_ctx, _cache) => {
|
|
94
|
-
return openBlock(), createElementBlock("div",
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
return openBlock(), createElementBlock("div", {
|
|
88
|
+
class: normalizeClass([
|
|
89
|
+
"flex w-full min-w-0 flex-col gap-6 pb-6",
|
|
90
|
+
__props.bottomSeparator && "border-border-surface-default border-b"
|
|
91
|
+
])
|
|
92
|
+
}, [
|
|
93
|
+
_ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
94
|
+
renderSlot(_ctx.$slots, "header")
|
|
102
95
|
])) : createCommentVNode("", true),
|
|
103
|
-
createElementVNode("div",
|
|
96
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
104
97
|
renderSlot(_ctx.$slots, "default")
|
|
105
98
|
]),
|
|
106
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div",
|
|
99
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
|
|
107
100
|
renderSlot(_ctx.$slots, "footer")
|
|
108
101
|
])) : createCommentVNode("", true)
|
|
109
|
-
]);
|
|
102
|
+
], 2);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
const _hoisted_1$e = {
|
|
107
|
+
key: 0,
|
|
108
|
+
"data-testid": "ck-agent-message-header-icon",
|
|
109
|
+
class: "flex flex-shrink-0 items-center justify-center"
|
|
110
|
+
};
|
|
111
|
+
const _hoisted_2$9 = { class: "body-14-regular text-content-on-surface-muted line-clamp-2 min-w-0 flex-1 md:line-clamp-1" };
|
|
112
|
+
const _hoisted_3$8 = {
|
|
113
|
+
key: 1,
|
|
114
|
+
"data-testid": "ck-agent-message-header-activity",
|
|
115
|
+
class: "flex flex-shrink-0 items-center"
|
|
116
|
+
};
|
|
117
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
118
|
+
...{ name: "CkAgentMessageHeader" },
|
|
119
|
+
__name: "CkAgentMessageHeader",
|
|
120
|
+
setup(__props) {
|
|
121
|
+
return (_ctx, _cache) => {
|
|
122
|
+
return openBlock(), createElementBlock("div", {
|
|
123
|
+
"data-testid": "ck-agent-message-header-row",
|
|
124
|
+
class: normalizeClass([
|
|
125
|
+
"flex w-full min-w-0 items-center gap-3",
|
|
126
|
+
_ctx.$slots.activity && "border-border-surface-default border-b py-4"
|
|
127
|
+
])
|
|
128
|
+
}, [
|
|
129
|
+
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
130
|
+
renderSlot(_ctx.$slots, "icon")
|
|
131
|
+
])) : createCommentVNode("", true),
|
|
132
|
+
createElementVNode("span", _hoisted_2$9, [
|
|
133
|
+
renderSlot(_ctx.$slots, "default")
|
|
134
|
+
]),
|
|
135
|
+
_ctx.$slots.activity ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
|
|
136
|
+
renderSlot(_ctx.$slots, "activity")
|
|
137
|
+
])) : createCommentVNode("", true)
|
|
138
|
+
], 2);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
143
|
+
...{
|
|
144
|
+
name: "CkHeaderActivityButton"
|
|
145
|
+
},
|
|
146
|
+
__name: "CkHeaderActivityButton",
|
|
147
|
+
props: {
|
|
148
|
+
disabled: { type: Boolean, default: false },
|
|
149
|
+
ariaLabel: {},
|
|
150
|
+
icon: { default: "arrow-right" }
|
|
151
|
+
},
|
|
152
|
+
emits: ["click"],
|
|
153
|
+
setup(__props, { emit: __emit }) {
|
|
154
|
+
const props = __props;
|
|
155
|
+
const emit = __emit;
|
|
156
|
+
function handleClick() {
|
|
157
|
+
if (props.disabled) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
emit("click");
|
|
161
|
+
}
|
|
162
|
+
return (_ctx, _cache) => {
|
|
163
|
+
return openBlock(), createBlock(unref(UiButton), mergeProps({ ariaLabel: __props.ariaLabel }, {
|
|
164
|
+
disabled: __props.disabled,
|
|
165
|
+
variant: "ghost",
|
|
166
|
+
size: "sm",
|
|
167
|
+
class: "label-12-medium text-content-on-surface-muted gap-1 rounded-[3px] px-2 py-1",
|
|
168
|
+
onClick: handleClick
|
|
169
|
+
}), {
|
|
170
|
+
default: withCtx(() => [
|
|
171
|
+
renderSlot(_ctx.$slots, "default"),
|
|
172
|
+
__props.icon ? (openBlock(), createBlock(unref(UiIcon), {
|
|
173
|
+
key: 0,
|
|
174
|
+
name: __props.icon,
|
|
175
|
+
size: 12,
|
|
176
|
+
"aria-hidden": "true"
|
|
177
|
+
}, null, 8, ["name"])) : createCommentVNode("", true)
|
|
178
|
+
]),
|
|
179
|
+
_: 3
|
|
180
|
+
}, 16, ["disabled"]);
|
|
110
181
|
};
|
|
111
182
|
}
|
|
112
183
|
});
|
|
113
184
|
const _hoisted_1$d = { class: "ck-citation-card flex w-[22.5rem] max-w-[90vw] flex-col gap-2 rounded-md bg-background-surface-floating px-6 pb-6 pt-4 shadow-md" };
|
|
114
|
-
const _hoisted_2$8 = { class: "flex items-center gap-
|
|
185
|
+
const _hoisted_2$8 = { class: "flex items-center gap-2" };
|
|
115
186
|
const _hoisted_3$7 = ["title"];
|
|
116
187
|
const _hoisted_4$6 = { class: "break-words text-sm leading-5 text-content-on-surface-secondary" };
|
|
117
188
|
const _hoisted_5$4 = {
|
|
118
189
|
key: 0,
|
|
119
190
|
class: "text-sm leading-5 text-content-on-surface-muted"
|
|
120
191
|
};
|
|
121
|
-
const _sfc_main$
|
|
192
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
122
193
|
...{
|
|
123
194
|
name: "CkCitationCard"
|
|
124
195
|
},
|
|
@@ -151,7 +222,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
151
222
|
class: "shrink-0"
|
|
152
223
|
}, null, 8, ["filename"]),
|
|
153
224
|
createElementVNode("p", {
|
|
154
|
-
class: "min-w-0
|
|
225
|
+
class: "min-w-0 truncate text-sm font-medium text-content-on-surface-primary",
|
|
155
226
|
title: __props.fileName
|
|
156
227
|
}, toDisplayString(__props.fileName), 9, _hoisted_3$7),
|
|
157
228
|
__props.url ? (openBlock(), createBlock(unref(UiButton), {
|
|
@@ -180,7 +251,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
180
251
|
});
|
|
181
252
|
const _hoisted_1$c = ["aria-label"];
|
|
182
253
|
const CLOSE_DELAY_MS = 80;
|
|
183
|
-
const _sfc_main$
|
|
254
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
184
255
|
...{
|
|
185
256
|
name: "CkCitation"
|
|
186
257
|
},
|
|
@@ -204,7 +275,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
204
275
|
() => props.ariaLabel ?? `${labels.value.citationSourceLabel ?? defaultChatKitLabels.citationSourceLabel} ${props.index}`
|
|
205
276
|
);
|
|
206
277
|
const open = ref(false);
|
|
207
|
-
const
|
|
278
|
+
const openedByPointer = ref(false);
|
|
208
279
|
let closeTimer;
|
|
209
280
|
function show() {
|
|
210
281
|
if (closeTimer) {
|
|
@@ -221,15 +292,22 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
221
292
|
}, CLOSE_DELAY_MS);
|
|
222
293
|
}
|
|
223
294
|
function onPointerEnter() {
|
|
224
|
-
|
|
295
|
+
if (!open.value) openedByPointer.value = true;
|
|
225
296
|
show();
|
|
226
297
|
}
|
|
227
298
|
function onPointerLeave() {
|
|
228
|
-
isPointerInteraction.value = false;
|
|
229
299
|
scheduleHide();
|
|
230
300
|
}
|
|
301
|
+
function onTriggerKeydown(event) {
|
|
302
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
303
|
+
openedByPointer.value = false;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
231
306
|
function onOpenAutoFocus(event) {
|
|
232
|
-
if (
|
|
307
|
+
if (openedByPointer.value) event.preventDefault();
|
|
308
|
+
}
|
|
309
|
+
function onCloseAutoFocus(event) {
|
|
310
|
+
if (openedByPointer.value) event.preventDefault();
|
|
233
311
|
}
|
|
234
312
|
function onContentFocusOut(event) {
|
|
235
313
|
const nextTarget = event.relatedTarget;
|
|
@@ -256,6 +334,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
256
334
|
"ck-citation mx-px inline-flex h-5 min-w-5 select-none items-center justify-center rounded-sm px-1 align-middle text-sm leading-4 tabular-nums transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
257
335
|
__props.selected ? "bg-background-accent-soft text-black" : "bg-background-accent-yellow text-background-status-warning"
|
|
258
336
|
]),
|
|
337
|
+
onKeydown: onTriggerKeydown,
|
|
259
338
|
onMouseenter: onPointerEnter,
|
|
260
339
|
onMouseleave: onPointerLeave
|
|
261
340
|
}, toDisplayString(__props.index), 43, _hoisted_1$c)
|
|
@@ -267,13 +346,14 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
267
346
|
"side-offset": 8,
|
|
268
347
|
class: "w-auto border-0 bg-transparent p-0 shadow-none",
|
|
269
348
|
onOpenAutoFocus,
|
|
349
|
+
onCloseAutoFocus,
|
|
270
350
|
onMouseenter: onPointerEnter,
|
|
271
351
|
onMouseleave: onPointerLeave,
|
|
272
352
|
onFocusin: show,
|
|
273
353
|
onFocusout: onContentFocusOut
|
|
274
354
|
}, {
|
|
275
355
|
default: withCtx(() => [
|
|
276
|
-
createVNode(unref(_sfc_main$
|
|
356
|
+
createVNode(unref(_sfc_main$n), {
|
|
277
357
|
"file-name": __props.fileName,
|
|
278
358
|
snippet: __props.snippet,
|
|
279
359
|
"location-label": __props.locationLabel,
|
|
@@ -297,7 +377,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
297
377
|
}
|
|
298
378
|
return target;
|
|
299
379
|
};
|
|
300
|
-
const CkCitation = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
380
|
+
const CkCitation = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-73025da4"]]);
|
|
301
381
|
const _hoisted_1$b = ["data-message-row"];
|
|
302
382
|
const _hoisted_2$7 = {
|
|
303
383
|
key: 0,
|
|
@@ -307,7 +387,7 @@ const _hoisted_3$6 = {
|
|
|
307
387
|
key: 1,
|
|
308
388
|
class: "flex min-w-0 justify-start"
|
|
309
389
|
};
|
|
310
|
-
const _sfc_main$
|
|
390
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
311
391
|
...{ name: "CkConversationLayout" },
|
|
312
392
|
__name: "CkConversationLayout",
|
|
313
393
|
props: {
|
|
@@ -439,7 +519,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
439
519
|
return openBlock(), createElementBlock("div", {
|
|
440
520
|
ref_key: "scrollContainerRef",
|
|
441
521
|
ref: scrollContainerRef,
|
|
442
|
-
class: "relative flex flex-col gap-
|
|
522
|
+
class: "relative flex flex-col gap-8 overflow-y-auto",
|
|
443
523
|
onScroll: handleScroll
|
|
444
524
|
}, [
|
|
445
525
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.messages, (message) => {
|
|
@@ -464,7 +544,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
464
544
|
};
|
|
465
545
|
}
|
|
466
546
|
});
|
|
467
|
-
const _sfc_main$
|
|
547
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
468
548
|
...{
|
|
469
549
|
name: "CkMessageButton"
|
|
470
550
|
},
|
|
@@ -492,7 +572,7 @@ const _hoisted_1$a = {
|
|
|
492
572
|
class: "sr-only",
|
|
493
573
|
"aria-live": "polite"
|
|
494
574
|
};
|
|
495
|
-
const _sfc_main$
|
|
575
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
496
576
|
...{
|
|
497
577
|
name: "CkCopyMessageButton"
|
|
498
578
|
},
|
|
@@ -549,7 +629,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
549
629
|
"delay-duration": 0
|
|
550
630
|
}, {
|
|
551
631
|
default: withCtx(() => [
|
|
552
|
-
createVNode(unref(_sfc_main$
|
|
632
|
+
createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
|
|
553
633
|
disabled: __props.disabled,
|
|
554
634
|
onClick: handleClick
|
|
555
635
|
}), {
|
|
@@ -583,7 +663,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
583
663
|
};
|
|
584
664
|
}
|
|
585
665
|
});
|
|
586
|
-
const CkCopyMessageButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
666
|
+
const CkCopyMessageButton = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-ba2e5f32"]]);
|
|
587
667
|
const _hoisted_1$9 = {
|
|
588
668
|
width: "208",
|
|
589
669
|
height: "144",
|
|
@@ -593,7 +673,7 @@ const _hoisted_1$9 = {
|
|
|
593
673
|
"aria-hidden": "true",
|
|
594
674
|
focusable: "false"
|
|
595
675
|
};
|
|
596
|
-
const _sfc_main$
|
|
676
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
597
677
|
...{ name: "CkDropZoneIllustration" },
|
|
598
678
|
__name: "CkDropZoneIllustration",
|
|
599
679
|
setup(__props) {
|
|
@@ -618,7 +698,7 @@ const _hoisted_6$2 = {
|
|
|
618
698
|
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",
|
|
619
699
|
role: "alert"
|
|
620
700
|
};
|
|
621
|
-
const _sfc_main$
|
|
701
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
622
702
|
...{
|
|
623
703
|
name: "CkDropZoneOverlay"
|
|
624
704
|
},
|
|
@@ -781,7 +861,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
781
861
|
}, [
|
|
782
862
|
createElementVNode("div", _hoisted_2$6, [
|
|
783
863
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
784
|
-
createVNode(_sfc_main$
|
|
864
|
+
createVNode(_sfc_main$i, { class: "h-36 w-52" }),
|
|
785
865
|
createElementVNode("div", _hoisted_3$5, [
|
|
786
866
|
createElementVNode("p", _hoisted_4$5, toDisplayString(resolvedHeading.value), 1),
|
|
787
867
|
__props.hint ? (openBlock(), createElementBlock("p", _hoisted_5$3, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
|
|
@@ -806,9 +886,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
806
886
|
};
|
|
807
887
|
}
|
|
808
888
|
});
|
|
809
|
-
const CkDropZoneOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
889
|
+
const CkDropZoneOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-54119668"]]);
|
|
810
890
|
const _hoisted_1$7 = ["aria-label"];
|
|
811
|
-
const _sfc_main$
|
|
891
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
812
892
|
...{
|
|
813
893
|
name: "CkFeedbackButton"
|
|
814
894
|
},
|
|
@@ -863,7 +943,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
863
943
|
"delay-duration": 0
|
|
864
944
|
}, {
|
|
865
945
|
default: withCtx(() => [
|
|
866
|
-
createVNode(unref(_sfc_main$
|
|
946
|
+
createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
|
|
867
947
|
"aria-pressed": isUpSelected.value,
|
|
868
948
|
"aria-disabled": __props.locked || void 0,
|
|
869
949
|
disabled: isUpDisabled.value,
|
|
@@ -893,7 +973,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
893
973
|
"delay-duration": 0
|
|
894
974
|
}, {
|
|
895
975
|
default: withCtx(() => [
|
|
896
|
-
createVNode(unref(_sfc_main$
|
|
976
|
+
createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
|
|
897
977
|
"aria-pressed": isDownSelected.value,
|
|
898
978
|
"aria-disabled": __props.locked || void 0,
|
|
899
979
|
disabled: isDownDisabled.value,
|
|
@@ -920,7 +1000,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
920
1000
|
};
|
|
921
1001
|
}
|
|
922
1002
|
});
|
|
923
|
-
const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1003
|
+
const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-cf3d46b6"]]);
|
|
924
1004
|
function useCitationRendering(citations, onOpenSource) {
|
|
925
1005
|
const sourcesByIndex = computed(
|
|
926
1006
|
() => new Map(
|
|
@@ -1003,7 +1083,7 @@ function domToVNode(node, ctx) {
|
|
|
1003
1083
|
}
|
|
1004
1084
|
return vnode;
|
|
1005
1085
|
}
|
|
1006
|
-
const _sfc_main$
|
|
1086
|
+
const _sfc_main$f = defineComponent({
|
|
1007
1087
|
name: "CkMarkdownRenderer",
|
|
1008
1088
|
props: {
|
|
1009
1089
|
content: { type: String, required: true },
|
|
@@ -1071,7 +1151,7 @@ const _hoisted_4$4 = {
|
|
|
1071
1151
|
class: "self-end text-sm text-content-on-surface-muted tabular-nums",
|
|
1072
1152
|
"aria-live": "polite"
|
|
1073
1153
|
};
|
|
1074
|
-
const _sfc_main$
|
|
1154
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
1075
1155
|
...{
|
|
1076
1156
|
name: "CkFeedbackDialog"
|
|
1077
1157
|
},
|
|
@@ -1232,7 +1312,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
1232
1312
|
_: 1
|
|
1233
1313
|
}),
|
|
1234
1314
|
createElementVNode("div", _hoisted_2$5, [
|
|
1235
|
-
createVNode(unref(_sfc_main$
|
|
1315
|
+
createVNode(unref(_sfc_main$f), { content: __props.responseText }, null, 8, ["content"])
|
|
1236
1316
|
])
|
|
1237
1317
|
])) : createCommentVNode("", true),
|
|
1238
1318
|
createElementVNode("section", _hoisted_3$4, [
|
|
@@ -1298,8 +1378,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
1298
1378
|
};
|
|
1299
1379
|
}
|
|
1300
1380
|
});
|
|
1301
|
-
const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1302
|
-
const _sfc_main$
|
|
1381
|
+
const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-12dfee8a"]]);
|
|
1382
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1303
1383
|
...{
|
|
1304
1384
|
name: "CkFileItemRow",
|
|
1305
1385
|
inheritAttrs: false
|
|
@@ -1359,14 +1439,16 @@ const _hoisted_6$1 = {
|
|
|
1359
1439
|
};
|
|
1360
1440
|
const _hoisted_7$1 = ["aria-label"];
|
|
1361
1441
|
const _hoisted_8$1 = ["onClick"];
|
|
1362
|
-
const
|
|
1442
|
+
const ITEM_GAP = 8;
|
|
1443
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1363
1444
|
...{
|
|
1364
1445
|
name: "CkFileItemsList"
|
|
1365
1446
|
},
|
|
1366
1447
|
__name: "CkFileItemsList",
|
|
1367
1448
|
props: {
|
|
1368
1449
|
files: {},
|
|
1369
|
-
|
|
1450
|
+
minItemWidth: { default: 200 },
|
|
1451
|
+
maxItemWidth: { default: 256 },
|
|
1370
1452
|
size: { default: "small" },
|
|
1371
1453
|
isRemovable: { type: Boolean, default: false },
|
|
1372
1454
|
removeLabel: { default: "Remove file" },
|
|
@@ -1381,7 +1463,30 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1381
1463
|
setup(__props, { emit: __emit }) {
|
|
1382
1464
|
const props = __props;
|
|
1383
1465
|
const emit = __emit;
|
|
1384
|
-
const
|
|
1466
|
+
const rootRef = ref(null);
|
|
1467
|
+
const containerWidth = ref(0);
|
|
1468
|
+
let resizeObserver;
|
|
1469
|
+
onMounted(() => {
|
|
1470
|
+
const el = rootRef.value;
|
|
1471
|
+
if (!el) return;
|
|
1472
|
+
containerWidth.value = el.clientWidth;
|
|
1473
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
1474
|
+
resizeObserver = new ResizeObserver((entries) => {
|
|
1475
|
+
for (const entry of entries) {
|
|
1476
|
+
containerWidth.value = entry.contentRect.width;
|
|
1477
|
+
}
|
|
1478
|
+
});
|
|
1479
|
+
resizeObserver.observe(el);
|
|
1480
|
+
}
|
|
1481
|
+
});
|
|
1482
|
+
onBeforeUnmount(() => resizeObserver?.disconnect());
|
|
1483
|
+
const inlineCapacity = computed(() => {
|
|
1484
|
+
const width = containerWidth.value;
|
|
1485
|
+
if (!width) return props.files.length;
|
|
1486
|
+
const fit = Math.floor((width + ITEM_GAP) / (props.minItemWidth + ITEM_GAP));
|
|
1487
|
+
return Math.max(1, fit);
|
|
1488
|
+
});
|
|
1489
|
+
const isCollapsed = computed(() => props.files.length > inlineCapacity.value);
|
|
1385
1490
|
const isOpen = ref(false);
|
|
1386
1491
|
function isRowDisabled(file) {
|
|
1387
1492
|
return props.disabled || file.disabled === true;
|
|
@@ -1436,119 +1541,130 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1436
1541
|
if (isOpen.value) isOpen.value = false;
|
|
1437
1542
|
}
|
|
1438
1543
|
return (_ctx, _cache) => {
|
|
1439
|
-
return
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
class: "
|
|
1443
|
-
"aria-label": __props.listLabel
|
|
1544
|
+
return openBlock(), createElementBlock("div", {
|
|
1545
|
+
ref_key: "rootRef",
|
|
1546
|
+
ref: rootRef,
|
|
1547
|
+
class: "w-full min-w-0"
|
|
1444
1548
|
}, [
|
|
1445
|
-
(openBlock(
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
"
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1549
|
+
!isCollapsed.value ? (openBlock(), createElementBlock("ul", {
|
|
1550
|
+
key: 0,
|
|
1551
|
+
"data-slot": "file-items-list",
|
|
1552
|
+
class: "m-0 flex w-full min-w-0 list-none flex-wrap items-center gap-2 p-0",
|
|
1553
|
+
"aria-label": __props.listLabel
|
|
1554
|
+
}, [
|
|
1555
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.files, (file) => {
|
|
1556
|
+
return openBlock(), createElementBlock("li", {
|
|
1557
|
+
key: file.id,
|
|
1558
|
+
class: "flex-1 basis-0",
|
|
1559
|
+
style: normalizeStyle({
|
|
1560
|
+
minWidth: `${__props.minItemWidth}px`,
|
|
1561
|
+
maxWidth: `${__props.maxItemWidth}px`
|
|
1562
|
+
}),
|
|
1563
|
+
onClick: ($event) => handleRowClick(file, $event)
|
|
1564
|
+
}, [
|
|
1565
|
+
createVNode(_sfc_main$d, {
|
|
1566
|
+
file,
|
|
1567
|
+
size: __props.size,
|
|
1568
|
+
"is-removable": __props.isRemovable,
|
|
1569
|
+
"remove-label": __props.removeLabel,
|
|
1570
|
+
disabled: isRowDisabled(file),
|
|
1571
|
+
onRemove: ($event) => handleRemove(file)
|
|
1572
|
+
}, {
|
|
1573
|
+
default: withCtx((bindings) => [
|
|
1574
|
+
renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, bindings))
|
|
1575
|
+
]),
|
|
1576
|
+
_: 3
|
|
1577
|
+
}, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
|
|
1578
|
+
], 12, _hoisted_2$4);
|
|
1579
|
+
}), 128))
|
|
1580
|
+
], 8, _hoisted_1$5)) : (openBlock(), createBlock(unref(UiPopover), {
|
|
1581
|
+
key: 1,
|
|
1582
|
+
open: isOpen.value,
|
|
1583
|
+
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => isOpen.value = $event)
|
|
1584
|
+
}, {
|
|
1585
|
+
default: withCtx(() => [
|
|
1586
|
+
createVNode(unref(UiPopoverTrigger), { "as-child": "" }, {
|
|
1587
|
+
default: withCtx(() => [
|
|
1588
|
+
createElementVNode("button", {
|
|
1589
|
+
type: "button",
|
|
1590
|
+
"data-slot": "file-items-list-trigger",
|
|
1591
|
+
disabled: __props.disabled,
|
|
1592
|
+
class: normalizeClass(["relative flex w-full max-w-64 min-w-0 items-center gap-3 rounded-xl bg-background-surface-muted-subtle text-left transition-colors hover:bg-background-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-background-surface-muted-subtle", __props.size === "small" ? "p-2" : "p-3"]),
|
|
1593
|
+
"aria-label": resolvedTriggerAriaLabel.value
|
|
1594
|
+
}, [
|
|
1595
|
+
__props.showStatus && hasFailures.value && !uploadInProgress.value ? (openBlock(), createBlock(unref(UiFileType), {
|
|
1596
|
+
key: 0,
|
|
1597
|
+
error: true
|
|
1598
|
+
})) : (openBlock(), createBlock(unref(UiFileType), {
|
|
1599
|
+
key: 1,
|
|
1600
|
+
icon: "paperclip",
|
|
1601
|
+
tone: "default"
|
|
1602
|
+
})),
|
|
1603
|
+
!__props.showStatus ? (openBlock(), createElementBlock("span", {
|
|
1604
|
+
key: 2,
|
|
1605
|
+
class: normalizeClass(["min-w-0 flex-1 truncate text-content-on-surface-primary", __props.size === "small" ? "label-12-medium" : "body-14-medium"])
|
|
1606
|
+
}, toDisplayString(resolvedTriggerLabel.value), 3)) : (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
1607
|
+
createElementVNode("span", {
|
|
1608
|
+
class: normalizeClass(["w-full truncate text-content-on-surface-primary", __props.size === "small" ? "label-12-medium" : "body-14-medium"])
|
|
1609
|
+
}, toDisplayString(resolvedTriggerLabel.value), 3),
|
|
1610
|
+
uploadInProgress.value ? (openBlock(), createBlock(unref(UiProgress), {
|
|
1611
|
+
key: 0,
|
|
1612
|
+
"model-value": aggregateProgress.value,
|
|
1613
|
+
class: "h-1 w-full",
|
|
1614
|
+
"aria-label": `${resolvedTriggerLabel.value} upload progress`
|
|
1615
|
+
}, 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)
|
|
1616
|
+
])),
|
|
1617
|
+
createVNode(unref(UiIcon), {
|
|
1618
|
+
name: "chevron-down",
|
|
1619
|
+
size: 16,
|
|
1620
|
+
"aria-hidden": "true",
|
|
1621
|
+
class: normalizeClass(["shrink-0 text-content-on-surface-muted transition-transform", isOpen.value && "rotate-180"])
|
|
1622
|
+
}, null, 8, ["class"])
|
|
1623
|
+
], 10, _hoisted_3$3)
|
|
1624
|
+
]),
|
|
1625
|
+
_: 1
|
|
1626
|
+
}),
|
|
1627
|
+
createVNode(unref(UiPopoverContent), {
|
|
1628
|
+
align: "start",
|
|
1629
|
+
"side-offset": 4,
|
|
1630
|
+
class: normalizeClass(["w-64 p-2", __props.popoverClass])
|
|
1458
1631
|
}, {
|
|
1459
|
-
default: withCtx((
|
|
1460
|
-
|
|
1632
|
+
default: withCtx(() => [
|
|
1633
|
+
createElementVNode("ul", {
|
|
1634
|
+
"data-slot": "file-items-list-collapsed",
|
|
1635
|
+
class: "m-0 flex list-none flex-col gap-2 p-0",
|
|
1636
|
+
"aria-label": __props.listLabel
|
|
1637
|
+
}, [
|
|
1638
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.files, (file) => {
|
|
1639
|
+
return openBlock(), createElementBlock("li", {
|
|
1640
|
+
key: file.id,
|
|
1641
|
+
class: "min-w-0",
|
|
1642
|
+
style: normalizeStyle({ maxWidth: `${__props.maxItemWidth}px` }),
|
|
1643
|
+
onClick: ($event) => handleRowClick(file, $event)
|
|
1644
|
+
}, [
|
|
1645
|
+
createVNode(_sfc_main$d, {
|
|
1646
|
+
file,
|
|
1647
|
+
size: __props.size,
|
|
1648
|
+
"is-removable": __props.isRemovable,
|
|
1649
|
+
"remove-label": __props.removeLabel,
|
|
1650
|
+
disabled: isRowDisabled(file),
|
|
1651
|
+
onRemove: ($event) => handleRemove(file)
|
|
1652
|
+
}, {
|
|
1653
|
+
default: withCtx((bindings) => [
|
|
1654
|
+
renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, bindings))
|
|
1655
|
+
]),
|
|
1656
|
+
_: 3
|
|
1657
|
+
}, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
|
|
1658
|
+
], 12, _hoisted_8$1);
|
|
1659
|
+
}), 128))
|
|
1660
|
+
], 8, _hoisted_7$1)
|
|
1461
1661
|
]),
|
|
1462
1662
|
_: 3
|
|
1463
|
-
}, 8, ["
|
|
1464
|
-
],
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
open: isOpen.value,
|
|
1469
|
-
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => isOpen.value = $event)
|
|
1470
|
-
}, {
|
|
1471
|
-
default: withCtx(() => [
|
|
1472
|
-
createVNode(unref(UiPopoverTrigger), { "as-child": "" }, {
|
|
1473
|
-
default: withCtx(() => [
|
|
1474
|
-
createElementVNode("button", {
|
|
1475
|
-
type: "button",
|
|
1476
|
-
"data-slot": "file-items-list-trigger",
|
|
1477
|
-
disabled: __props.disabled,
|
|
1478
|
-
class: normalizeClass(["relative flex w-full max-w-64 min-w-0 items-center gap-3 rounded-xl bg-background-surface-muted-subtle text-left transition-colors hover:bg-background-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-background-surface-muted-subtle", __props.size === "small" ? "p-2" : "p-3"]),
|
|
1479
|
-
"aria-label": resolvedTriggerAriaLabel.value
|
|
1480
|
-
}, [
|
|
1481
|
-
__props.showStatus && hasFailures.value && !uploadInProgress.value ? (openBlock(), createBlock(unref(UiFileType), {
|
|
1482
|
-
key: 0,
|
|
1483
|
-
error: true
|
|
1484
|
-
})) : (openBlock(), createBlock(unref(UiFileType), {
|
|
1485
|
-
key: 1,
|
|
1486
|
-
icon: "paperclip",
|
|
1487
|
-
tone: "default"
|
|
1488
|
-
})),
|
|
1489
|
-
!__props.showStatus ? (openBlock(), createElementBlock("span", {
|
|
1490
|
-
key: 2,
|
|
1491
|
-
class: normalizeClass(["min-w-0 flex-1 truncate text-content-on-surface-primary", __props.size === "small" ? "label-12-medium" : "body-14-medium"])
|
|
1492
|
-
}, toDisplayString(resolvedTriggerLabel.value), 3)) : (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
1493
|
-
createElementVNode("span", {
|
|
1494
|
-
class: normalizeClass(["w-full truncate text-content-on-surface-primary", __props.size === "small" ? "label-12-medium" : "body-14-medium"])
|
|
1495
|
-
}, toDisplayString(resolvedTriggerLabel.value), 3),
|
|
1496
|
-
uploadInProgress.value ? (openBlock(), createBlock(unref(UiProgress), {
|
|
1497
|
-
key: 0,
|
|
1498
|
-
"model-value": aggregateProgress.value,
|
|
1499
|
-
class: "h-1 w-full",
|
|
1500
|
-
"aria-label": `${resolvedTriggerLabel.value} upload progress`
|
|
1501
|
-
}, 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)
|
|
1502
|
-
])),
|
|
1503
|
-
createVNode(unref(UiIcon), {
|
|
1504
|
-
name: "chevron-down",
|
|
1505
|
-
size: 16,
|
|
1506
|
-
"aria-hidden": "true",
|
|
1507
|
-
class: normalizeClass(["shrink-0 text-content-on-surface-muted transition-transform", isOpen.value && "rotate-180"])
|
|
1508
|
-
}, null, 8, ["class"])
|
|
1509
|
-
], 10, _hoisted_3$3)
|
|
1510
|
-
]),
|
|
1511
|
-
_: 1
|
|
1512
|
-
}),
|
|
1513
|
-
createVNode(unref(UiPopoverContent), {
|
|
1514
|
-
align: "start",
|
|
1515
|
-
"side-offset": 4,
|
|
1516
|
-
class: normalizeClass(["w-64 p-2", __props.popoverClass])
|
|
1517
|
-
}, {
|
|
1518
|
-
default: withCtx(() => [
|
|
1519
|
-
createElementVNode("ul", {
|
|
1520
|
-
"data-slot": "file-items-list-collapsed",
|
|
1521
|
-
class: "m-0 flex list-none flex-col gap-2 p-0",
|
|
1522
|
-
"aria-label": __props.listLabel
|
|
1523
|
-
}, [
|
|
1524
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.files, (file) => {
|
|
1525
|
-
return openBlock(), createElementBlock("li", {
|
|
1526
|
-
key: file.id,
|
|
1527
|
-
class: "min-w-0 max-w-64",
|
|
1528
|
-
onClick: ($event) => handleRowClick(file, $event)
|
|
1529
|
-
}, [
|
|
1530
|
-
createVNode(_sfc_main$e, {
|
|
1531
|
-
file,
|
|
1532
|
-
size: __props.size,
|
|
1533
|
-
"is-removable": __props.isRemovable,
|
|
1534
|
-
"remove-label": __props.removeLabel,
|
|
1535
|
-
disabled: isRowDisabled(file),
|
|
1536
|
-
onRemove: ($event) => handleRemove(file)
|
|
1537
|
-
}, {
|
|
1538
|
-
default: withCtx((bindings) => [
|
|
1539
|
-
renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, bindings))
|
|
1540
|
-
]),
|
|
1541
|
-
_: 3
|
|
1542
|
-
}, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
|
|
1543
|
-
], 8, _hoisted_8$1);
|
|
1544
|
-
}), 128))
|
|
1545
|
-
], 8, _hoisted_7$1)
|
|
1546
|
-
]),
|
|
1547
|
-
_: 3
|
|
1548
|
-
}, 8, ["class"])
|
|
1549
|
-
]),
|
|
1550
|
-
_: 3
|
|
1551
|
-
}, 8, ["open"]));
|
|
1663
|
+
}, 8, ["class"])
|
|
1664
|
+
]),
|
|
1665
|
+
_: 3
|
|
1666
|
+
}, 8, ["open"]))
|
|
1667
|
+
], 512);
|
|
1552
1668
|
};
|
|
1553
1669
|
}
|
|
1554
1670
|
});
|
|
@@ -1575,7 +1691,7 @@ const _hoisted_7 = {
|
|
|
1575
1691
|
const _hoisted_8 = ["aria-label"];
|
|
1576
1692
|
const _hoisted_9 = ["aria-label"];
|
|
1577
1693
|
const _hoisted_10 = ["aria-label"];
|
|
1578
|
-
const _sfc_main$
|
|
1694
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1579
1695
|
...{
|
|
1580
1696
|
name: "CkHistoryItem",
|
|
1581
1697
|
inheritAttrs: false
|
|
@@ -1816,7 +1932,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
1816
1932
|
}
|
|
1817
1933
|
});
|
|
1818
1934
|
const baseClass = "flex w-full min-w-0 flex-col p-2";
|
|
1819
|
-
const _sfc_main$
|
|
1935
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
1820
1936
|
...{
|
|
1821
1937
|
name: "CkHistoryWrapper",
|
|
1822
1938
|
inheritAttrs: false
|
|
@@ -1851,7 +1967,7 @@ const _hoisted_2$2 = { class: "min-w-0 max-w-[10rem] truncate" };
|
|
|
1851
1967
|
const _hoisted_3$1 = ["aria-label"];
|
|
1852
1968
|
const _hoisted_4$1 = ["aria-selected", "onClick"];
|
|
1853
1969
|
const _hoisted_5 = { class: "min-w-0 flex-1 truncate" };
|
|
1854
|
-
const _sfc_main$
|
|
1970
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1855
1971
|
...{ name: "CkModelSelector" },
|
|
1856
1972
|
__name: "CkModelSelector",
|
|
1857
1973
|
props: {
|
|
@@ -1959,7 +2075,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1959
2075
|
};
|
|
1960
2076
|
}
|
|
1961
2077
|
});
|
|
1962
|
-
const _sfc_main$
|
|
2078
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1963
2079
|
...{ name: "CkPromptSendButton" },
|
|
1964
2080
|
__name: "CkPromptSendButton",
|
|
1965
2081
|
props: {
|
|
@@ -1985,7 +2101,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1985
2101
|
};
|
|
1986
2102
|
}
|
|
1987
2103
|
});
|
|
1988
|
-
const _sfc_main$
|
|
2104
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1989
2105
|
...{ name: "CkPromptMenuButton" },
|
|
1990
2106
|
__name: "CkPromptMenuButton",
|
|
1991
2107
|
props: {
|
|
@@ -2015,7 +2131,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2015
2131
|
};
|
|
2016
2132
|
}
|
|
2017
2133
|
});
|
|
2018
|
-
const _sfc_main$
|
|
2134
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
2019
2135
|
...{ name: "CkPromptStopButton" },
|
|
2020
2136
|
__name: "CkPromptStopButton",
|
|
2021
2137
|
props: {
|
|
@@ -2041,16 +2157,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2041
2157
|
};
|
|
2042
2158
|
}
|
|
2043
2159
|
});
|
|
2044
|
-
const _hoisted_1$2 = { class: "flex flex-col gap-2" };
|
|
2160
|
+
const _hoisted_1$2 = { class: "ck-prompt-root flex flex-col gap-2" };
|
|
2045
2161
|
const _hoisted_2$1 = {
|
|
2046
2162
|
key: 0,
|
|
2047
2163
|
style: { "grid-area": "top" }
|
|
2048
2164
|
};
|
|
2049
2165
|
const _hoisted_3 = ["for"];
|
|
2050
2166
|
const _hoisted_4 = ["id", "value", "placeholder", "disabled"];
|
|
2051
|
-
const LINE_HEIGHT = 24;
|
|
2052
2167
|
const MAX_LINES = 6;
|
|
2053
|
-
const _sfc_main$
|
|
2168
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
2054
2169
|
...{ name: "CkPromptInput" },
|
|
2055
2170
|
__name: "CkPromptInput",
|
|
2056
2171
|
props: {
|
|
@@ -2061,7 +2176,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2061
2176
|
},
|
|
2062
2177
|
emits: ["update:modelValue", "submit"],
|
|
2063
2178
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2064
|
-
const MAX_HEIGHT = LINE_HEIGHT * MAX_LINES;
|
|
2065
2179
|
const props = __props;
|
|
2066
2180
|
const emit = __emit;
|
|
2067
2181
|
const textareaId = useId();
|
|
@@ -2092,11 +2206,13 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2092
2206
|
el.style.height = "";
|
|
2093
2207
|
return;
|
|
2094
2208
|
}
|
|
2209
|
+
const lineHeight = parseFloat(getComputedStyle(el).lineHeight) || 24;
|
|
2210
|
+
const maxHeight = lineHeight * MAX_LINES;
|
|
2095
2211
|
el.style.height = "auto";
|
|
2096
2212
|
const measured = el.scrollHeight;
|
|
2097
|
-
el.style.height = `${Math.min(measured,
|
|
2213
|
+
el.style.height = `${Math.min(measured, maxHeight)}px`;
|
|
2098
2214
|
const hasExplicitNewline = props.modelValue.includes("\n");
|
|
2099
|
-
if (!isMultiLine.value && (hasExplicitNewline || measured >=
|
|
2215
|
+
if (!isMultiLine.value && (hasExplicitNewline || measured >= lineHeight * 2)) {
|
|
2100
2216
|
isMultiLine.value = true;
|
|
2101
2217
|
}
|
|
2102
2218
|
}
|
|
@@ -2118,6 +2234,19 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2118
2234
|
function focus() {
|
|
2119
2235
|
textareaRef.value?.focus();
|
|
2120
2236
|
}
|
|
2237
|
+
const isKeyboardFocused = ref(false);
|
|
2238
|
+
let focusedByPointer = false;
|
|
2239
|
+
function onPointerDown() {
|
|
2240
|
+
focusedByPointer = true;
|
|
2241
|
+
}
|
|
2242
|
+
function onFocus() {
|
|
2243
|
+
isKeyboardFocused.value = !focusedByPointer;
|
|
2244
|
+
focusedByPointer = false;
|
|
2245
|
+
}
|
|
2246
|
+
function onBlur() {
|
|
2247
|
+
isKeyboardFocused.value = false;
|
|
2248
|
+
focusedByPointer = false;
|
|
2249
|
+
}
|
|
2121
2250
|
watch(
|
|
2122
2251
|
() => props.modelValue,
|
|
2123
2252
|
() => nextTick(adjustHeight)
|
|
@@ -2128,8 +2257,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2128
2257
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
2129
2258
|
createElementVNode("form", {
|
|
2130
2259
|
class: normalizeClass([
|
|
2131
|
-
"
|
|
2132
|
-
hasMultipleRows.value ? "rounded-2xl" : "rounded-3xl"
|
|
2260
|
+
"border-border-surface-default bg-background-input-strong 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)] ",
|
|
2261
|
+
hasMultipleRows.value ? "rounded-2xl" : "rounded-3xl",
|
|
2262
|
+
isKeyboardFocused.value ? "border-border-surface-focus-ring ring-border-surface-focus-ring/40 ring-2" : "ck-prompt-form"
|
|
2133
2263
|
]),
|
|
2134
2264
|
style: normalizeStyle({
|
|
2135
2265
|
gridTemplateColumns: "auto 1fr auto",
|
|
@@ -2161,11 +2291,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2161
2291
|
disabled: __props.disabled,
|
|
2162
2292
|
style: { "grid-area": "input" },
|
|
2163
2293
|
class: normalizeClass([
|
|
2164
|
-
"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
|
|
2294
|
+
"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 font-normal focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",
|
|
2165
2295
|
isMultiLine.value ? "pl-3 pr-3" : "px-0"
|
|
2166
2296
|
]),
|
|
2167
2297
|
onInput,
|
|
2168
|
-
onKeydown
|
|
2298
|
+
onKeydown,
|
|
2299
|
+
onPointerdown: onPointerDown,
|
|
2300
|
+
onFocus,
|
|
2301
|
+
onBlur
|
|
2169
2302
|
}, null, 42, _hoisted_4),
|
|
2170
2303
|
createElementVNode("div", {
|
|
2171
2304
|
class: normalizeClass([!isMultiLine.value && "pl-4"]),
|
|
@@ -2183,12 +2316,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2183
2316
|
};
|
|
2184
2317
|
}
|
|
2185
2318
|
});
|
|
2186
|
-
const CkPromptInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2319
|
+
const CkPromptInput = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-d828da46"]]);
|
|
2187
2320
|
const _hoisted_1$1 = {
|
|
2188
2321
|
key: 0,
|
|
2189
|
-
class: "text-
|
|
2322
|
+
class: "text-center text-content-on-surface-muted text-xs font-normal leading-4"
|
|
2190
2323
|
};
|
|
2191
|
-
const _sfc_main$
|
|
2324
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
2192
2325
|
...{ name: "CkPromptInputDisclaimer" },
|
|
2193
2326
|
__name: "CkPromptInputDisclaimer",
|
|
2194
2327
|
props: {
|
|
@@ -2204,7 +2337,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
2204
2337
|
};
|
|
2205
2338
|
}
|
|
2206
2339
|
});
|
|
2207
|
-
const _sfc_main$
|
|
2340
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2208
2341
|
...{
|
|
2209
2342
|
name: "CkRegenerateMessageButton"
|
|
2210
2343
|
},
|
|
@@ -2231,7 +2364,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
2231
2364
|
"delay-duration": 0
|
|
2232
2365
|
}, {
|
|
2233
2366
|
default: withCtx(() => [
|
|
2234
|
-
createVNode(unref(_sfc_main$
|
|
2367
|
+
createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: __props.ariaLabel }, {
|
|
2235
2368
|
disabled: __props.disabled,
|
|
2236
2369
|
onClick: handleClick
|
|
2237
2370
|
}), {
|
|
@@ -2252,7 +2385,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
2252
2385
|
});
|
|
2253
2386
|
const _hoisted_1 = { class: "inline-flex max-w-[536px] flex-col items-end justify-start gap-1" };
|
|
2254
2387
|
const _hoisted_2 = ["aria-expanded"];
|
|
2255
|
-
const _sfc_main$
|
|
2388
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
2256
2389
|
...{ name: "CkUserMessage" },
|
|
2257
2390
|
__name: "CkUserMessage",
|
|
2258
2391
|
props: {
|
|
@@ -2321,8 +2454,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2321
2454
|
};
|
|
2322
2455
|
}
|
|
2323
2456
|
});
|
|
2324
|
-
const CkUserMessage = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2325
|
-
const _sfc_main$
|
|
2457
|
+
const CkUserMessage = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c759a863"]]);
|
|
2458
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2326
2459
|
...{ name: "CkConversation" },
|
|
2327
2460
|
__name: "CkConversation",
|
|
2328
2461
|
props: {
|
|
@@ -2340,11 +2473,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2340
2473
|
() => Boolean(props.agentAvatarImage) || Boolean(props.agentAvatarFallback) || Boolean(slots["agent-message-icon"])
|
|
2341
2474
|
);
|
|
2342
2475
|
const isLoading = (message) => message.status === "started" || message.status === "sending";
|
|
2476
|
+
const lastAgentMessageId = computed(() => {
|
|
2477
|
+
for (let i = props.messages.length - 1; i >= 0; i--) {
|
|
2478
|
+
if (props.messages[i].role !== "user") return props.messages[i].id;
|
|
2479
|
+
}
|
|
2480
|
+
return void 0;
|
|
2481
|
+
});
|
|
2343
2482
|
function getMessageText(message) {
|
|
2344
2483
|
return message.content.filter((c) => c.type === "text").map((c) => c.text).join("");
|
|
2345
2484
|
}
|
|
2346
2485
|
return (_ctx, _cache) => {
|
|
2347
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2486
|
+
return openBlock(), createBlock(_sfc_main$l, { messages: __props.messages }, {
|
|
2348
2487
|
"user-message": withCtx(({ message }) => [
|
|
2349
2488
|
createElementVNode("div", {
|
|
2350
2489
|
class: normalizeClass({ "ml-8": hasIcon.value })
|
|
@@ -2363,7 +2502,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2363
2502
|
]),
|
|
2364
2503
|
"agent-message": withCtx(({ message }) => [
|
|
2365
2504
|
renderSlot(_ctx.$slots, "agent-message", { message }, () => [
|
|
2366
|
-
createVNode(_sfc_main$
|
|
2505
|
+
createVNode(_sfc_main$q, {
|
|
2506
|
+
"bottom-separator": message.id !== lastAgentMessageId.value
|
|
2507
|
+
}, createSlots({
|
|
2367
2508
|
footer: withCtx(() => [
|
|
2368
2509
|
renderSlot(_ctx.$slots, "agent-message-footer", { message }, () => [
|
|
2369
2510
|
getMessageText(message) && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageButton, {
|
|
@@ -2376,7 +2517,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2376
2517
|
]),
|
|
2377
2518
|
default: withCtx(() => [
|
|
2378
2519
|
renderSlot(_ctx.$slots, "agent-message-content", { message }, () => [
|
|
2379
|
-
createVNode(_sfc_main$
|
|
2520
|
+
createVNode(_sfc_main$f, {
|
|
2380
2521
|
content: getMessageText(message),
|
|
2381
2522
|
classes: __props.agentMarkdownClasses
|
|
2382
2523
|
}, createSlots({ _: 2 }, [
|
|
@@ -2392,61 +2533,76 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2392
2533
|
]),
|
|
2393
2534
|
_: 2
|
|
2394
2535
|
}, [
|
|
2395
|
-
hasIcon.value ? {
|
|
2396
|
-
name: "
|
|
2536
|
+
hasIcon.value || _ctx.$slots["agent-message-header"] || _ctx.$slots["agent-message-header-content"] || _ctx.$slots["agent-message-header-activity"] ? {
|
|
2537
|
+
name: "header",
|
|
2397
2538
|
fn: withCtx(() => [
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
message
|
|
2401
|
-
}, () => [
|
|
2402
|
-
__props.agentLoadingImage ? (openBlock(), createBlock(unref(UiAvatar), {
|
|
2403
|
-
key: 0,
|
|
2404
|
-
class: "size-6"
|
|
2405
|
-
}, {
|
|
2406
|
-
default: withCtx(() => [
|
|
2407
|
-
createVNode(unref(UiAvatarImage), {
|
|
2408
|
-
src: __props.agentLoadingImage,
|
|
2409
|
-
alt: unref(labels).agentLoadingAvatarAlt
|
|
2410
|
-
}, null, 8, ["src", "alt"])
|
|
2411
|
-
]),
|
|
2412
|
-
_: 1
|
|
2413
|
-
})) : (openBlock(), createBlock(unref(UiSpinner), {
|
|
2414
|
-
key: 1,
|
|
2415
|
-
class: "size-6",
|
|
2416
|
-
"aria-label": unref(labels).agentLoadingAvatarAlt
|
|
2417
|
-
}, null, 8, ["aria-label"]))
|
|
2418
|
-
]) : renderSlot(_ctx.$slots, "agent-message-icon", {
|
|
2419
|
-
key: 1,
|
|
2420
|
-
message
|
|
2421
|
-
}, () => [
|
|
2422
|
-
createVNode(unref(UiAvatar), { class: "size-6" }, {
|
|
2539
|
+
renderSlot(_ctx.$slots, "agent-message-header", { message }, () => [
|
|
2540
|
+
createVNode(_sfc_main$p, null, createSlots({
|
|
2423
2541
|
default: withCtx(() => [
|
|
2424
|
-
|
|
2425
|
-
key: 0,
|
|
2426
|
-
src: __props.agentAvatarImage,
|
|
2427
|
-
alt: unref(labels).agentAvatarAlt
|
|
2428
|
-
}, null, 8, ["src", "alt"])) : createCommentVNode("", true),
|
|
2429
|
-
__props.agentAvatarFallback ? (openBlock(), createBlock(unref(UiAvatarFallback), { key: 1 }, {
|
|
2430
|
-
default: withCtx(() => [
|
|
2431
|
-
createTextVNode(toDisplayString(__props.agentAvatarFallback), 1)
|
|
2432
|
-
]),
|
|
2433
|
-
_: 1
|
|
2434
|
-
})) : createCommentVNode("", true)
|
|
2542
|
+
renderSlot(_ctx.$slots, "agent-message-header-content", { message })
|
|
2435
2543
|
]),
|
|
2436
|
-
_:
|
|
2437
|
-
}
|
|
2544
|
+
_: 2
|
|
2545
|
+
}, [
|
|
2546
|
+
hasIcon.value ? {
|
|
2547
|
+
name: "icon",
|
|
2548
|
+
fn: withCtx(() => [
|
|
2549
|
+
isLoading(message) ? renderSlot(_ctx.$slots, "agent-message-loading-icon", {
|
|
2550
|
+
key: 0,
|
|
2551
|
+
message
|
|
2552
|
+
}, () => [
|
|
2553
|
+
__props.agentLoadingImage ? (openBlock(), createBlock(unref(UiAvatar), {
|
|
2554
|
+
key: 0,
|
|
2555
|
+
class: "size-8"
|
|
2556
|
+
}, {
|
|
2557
|
+
default: withCtx(() => [
|
|
2558
|
+
createVNode(unref(UiAvatarImage), {
|
|
2559
|
+
src: __props.agentLoadingImage,
|
|
2560
|
+
alt: unref(labels).agentLoadingAvatarAlt
|
|
2561
|
+
}, null, 8, ["src", "alt"])
|
|
2562
|
+
]),
|
|
2563
|
+
_: 1
|
|
2564
|
+
})) : (openBlock(), createBlock(unref(UiSpinner), {
|
|
2565
|
+
key: 1,
|
|
2566
|
+
class: "size-8",
|
|
2567
|
+
"aria-label": unref(labels).agentLoadingAvatarAlt
|
|
2568
|
+
}, null, 8, ["aria-label"]))
|
|
2569
|
+
]) : renderSlot(_ctx.$slots, "agent-message-icon", {
|
|
2570
|
+
key: 1,
|
|
2571
|
+
message
|
|
2572
|
+
}, () => [
|
|
2573
|
+
createVNode(unref(UiAvatar), { class: "size-8" }, {
|
|
2574
|
+
default: withCtx(() => [
|
|
2575
|
+
__props.agentAvatarImage ? (openBlock(), createBlock(unref(UiAvatarImage), {
|
|
2576
|
+
key: 0,
|
|
2577
|
+
src: __props.agentAvatarImage,
|
|
2578
|
+
alt: unref(labels).agentAvatarAlt
|
|
2579
|
+
}, null, 8, ["src", "alt"])) : createCommentVNode("", true),
|
|
2580
|
+
__props.agentAvatarFallback ? (openBlock(), createBlock(unref(UiAvatarFallback), { key: 1 }, {
|
|
2581
|
+
default: withCtx(() => [
|
|
2582
|
+
createTextVNode(toDisplayString(__props.agentAvatarFallback), 1)
|
|
2583
|
+
]),
|
|
2584
|
+
_: 1
|
|
2585
|
+
})) : createCommentVNode("", true)
|
|
2586
|
+
]),
|
|
2587
|
+
_: 1
|
|
2588
|
+
})
|
|
2589
|
+
])
|
|
2590
|
+
]),
|
|
2591
|
+
key: "0"
|
|
2592
|
+
} : void 0,
|
|
2593
|
+
_ctx.$slots["agent-message-header-activity"] ? {
|
|
2594
|
+
name: "activity",
|
|
2595
|
+
fn: withCtx(() => [
|
|
2596
|
+
renderSlot(_ctx.$slots, "agent-message-header-activity", { message })
|
|
2597
|
+
]),
|
|
2598
|
+
key: "1"
|
|
2599
|
+
} : void 0
|
|
2600
|
+
]), 1024)
|
|
2438
2601
|
])
|
|
2439
2602
|
]),
|
|
2440
2603
|
key: "0"
|
|
2441
|
-
} : void 0,
|
|
2442
|
-
_ctx.$slots["agent-message-header"] ? {
|
|
2443
|
-
name: "header",
|
|
2444
|
-
fn: withCtx(() => [
|
|
2445
|
-
renderSlot(_ctx.$slots, "agent-message-header", { message })
|
|
2446
|
-
]),
|
|
2447
|
-
key: "1"
|
|
2448
2604
|
} : void 0
|
|
2449
|
-
]),
|
|
2605
|
+
]), 1032, ["bottom-separator"])
|
|
2450
2606
|
])
|
|
2451
2607
|
]),
|
|
2452
2608
|
_: 3
|
|
@@ -2454,7 +2610,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2454
2610
|
};
|
|
2455
2611
|
}
|
|
2456
2612
|
});
|
|
2457
|
-
const _sfc_main
|
|
2613
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2458
2614
|
...{ name: "CkHistory" },
|
|
2459
2615
|
__name: "CkHistory",
|
|
2460
2616
|
props: {
|
|
@@ -2502,7 +2658,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2502
2658
|
}
|
|
2503
2659
|
return (_ctx, _cache) => {
|
|
2504
2660
|
return openBlock(), createElementBlock("div", null, [
|
|
2505
|
-
createVNode(_sfc_main$
|
|
2661
|
+
createVNode(_sfc_main$a, {
|
|
2506
2662
|
class: normalizeClass(isExpanded.value && props.maxHeight ? "overflow-y-auto" : void 0),
|
|
2507
2663
|
style: normalizeStyle(
|
|
2508
2664
|
isExpanded.value && props.maxHeight ? { maxHeight: props.maxHeight } : void 0
|
|
@@ -2521,7 +2677,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2521
2677
|
edit: () => emit("edit", conversation),
|
|
2522
2678
|
delete: () => emit("delete", conversation)
|
|
2523
2679
|
}, () => [
|
|
2524
|
-
createVNode(_sfc_main$
|
|
2680
|
+
createVNode(_sfc_main$b, {
|
|
2525
2681
|
as: "a",
|
|
2526
2682
|
href: hrefFor(conversation),
|
|
2527
2683
|
"is-active": conversation.id === props.activeId,
|
|
@@ -2587,132 +2743,33 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2587
2743
|
};
|
|
2588
2744
|
}
|
|
2589
2745
|
});
|
|
2590
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2591
|
-
...{ name: "CkInput" },
|
|
2592
|
-
__name: "CkInput",
|
|
2593
|
-
props: {
|
|
2594
|
-
modelValue: { default: "" },
|
|
2595
|
-
placeholder: { default: "Ask me anything" },
|
|
2596
|
-
disabled: { type: Boolean, default: false },
|
|
2597
|
-
loading: { type: Boolean, default: false },
|
|
2598
|
-
ariaLabel: { default: "Chat message input" },
|
|
2599
|
-
stopAriaLabel: { default: "Stop generating" },
|
|
2600
|
-
disclaimer: { default: void 0 }
|
|
2601
|
-
},
|
|
2602
|
-
emits: ["update:modelValue", "submit", "stop"],
|
|
2603
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2604
|
-
const props = __props;
|
|
2605
|
-
const emit = __emit;
|
|
2606
|
-
const promptInputRef = useTemplateRef("promptInputRef");
|
|
2607
|
-
const isDisabled = computed(() => props.disabled || props.loading);
|
|
2608
|
-
function onUpdateModelValue(value) {
|
|
2609
|
-
emit("update:modelValue", value);
|
|
2610
|
-
}
|
|
2611
|
-
function onSubmit(value) {
|
|
2612
|
-
emit("submit", value);
|
|
2613
|
-
}
|
|
2614
|
-
function onStop() {
|
|
2615
|
-
emit("stop");
|
|
2616
|
-
}
|
|
2617
|
-
function focus() {
|
|
2618
|
-
promptInputRef.value?.focus();
|
|
2619
|
-
}
|
|
2620
|
-
function submit() {
|
|
2621
|
-
promptInputRef.value?.submit();
|
|
2622
|
-
}
|
|
2623
|
-
__expose({ focus, submit });
|
|
2624
|
-
return (_ctx, _cache) => {
|
|
2625
|
-
return openBlock(), createBlock(CkPromptInput, {
|
|
2626
|
-
ref_key: "promptInputRef",
|
|
2627
|
-
ref: promptInputRef,
|
|
2628
|
-
"model-value": __props.modelValue,
|
|
2629
|
-
placeholder: __props.placeholder,
|
|
2630
|
-
disabled: isDisabled.value,
|
|
2631
|
-
"aria-label": __props.ariaLabel,
|
|
2632
|
-
"onUpdate:modelValue": onUpdateModelValue,
|
|
2633
|
-
onSubmit
|
|
2634
|
-
}, createSlots({
|
|
2635
|
-
"toolbar-right": withCtx((scope) => [
|
|
2636
|
-
renderSlot(_ctx.$slots, "toolbar-right", normalizeProps(guardReactiveProps(scope)), () => [
|
|
2637
|
-
__props.loading ? (openBlock(), createBlock(_sfc_main$7, {
|
|
2638
|
-
key: 0,
|
|
2639
|
-
"aria-label": __props.stopAriaLabel,
|
|
2640
|
-
disabled: __props.disabled,
|
|
2641
|
-
onClick: onStop
|
|
2642
|
-
}, {
|
|
2643
|
-
default: withCtx(() => [
|
|
2644
|
-
renderSlot(_ctx.$slots, "stop-icon", {}, () => [
|
|
2645
|
-
createVNode(_sfc_main$q)
|
|
2646
|
-
])
|
|
2647
|
-
]),
|
|
2648
|
-
_: 3
|
|
2649
|
-
}, 8, ["aria-label", "disabled"])) : (openBlock(), createBlock(_sfc_main$9, mergeProps({ key: 1 }, { ariaLabel: "Send message" }, {
|
|
2650
|
-
type: "submit",
|
|
2651
|
-
disabled: scope.disabled
|
|
2652
|
-
}), {
|
|
2653
|
-
default: withCtx(() => [
|
|
2654
|
-
renderSlot(_ctx.$slots, "send-icon", {}, () => [
|
|
2655
|
-
createVNode(_sfc_main$r)
|
|
2656
|
-
])
|
|
2657
|
-
]),
|
|
2658
|
-
_: 3
|
|
2659
|
-
}, 16, ["disabled"]))
|
|
2660
|
-
])
|
|
2661
|
-
]),
|
|
2662
|
-
footer: withCtx(() => [
|
|
2663
|
-
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
2664
|
-
__props.disclaimer ? (openBlock(), createBlock(_sfc_main$5, {
|
|
2665
|
-
key: 0,
|
|
2666
|
-
text: __props.disclaimer
|
|
2667
|
-
}, null, 8, ["text"])) : createCommentVNode("", true)
|
|
2668
|
-
])
|
|
2669
|
-
]),
|
|
2670
|
-
_: 2
|
|
2671
|
-
}, [
|
|
2672
|
-
_ctx.$slots["toolbar-top"] ? {
|
|
2673
|
-
name: "toolbar-top",
|
|
2674
|
-
fn: withCtx(() => [
|
|
2675
|
-
renderSlot(_ctx.$slots, "toolbar-top")
|
|
2676
|
-
]),
|
|
2677
|
-
key: "0"
|
|
2678
|
-
} : void 0,
|
|
2679
|
-
_ctx.$slots["toolbar-left"] ? {
|
|
2680
|
-
name: "toolbar-left",
|
|
2681
|
-
fn: withCtx(() => [
|
|
2682
|
-
renderSlot(_ctx.$slots, "toolbar-left")
|
|
2683
|
-
]),
|
|
2684
|
-
key: "1"
|
|
2685
|
-
} : void 0
|
|
2686
|
-
]), 1032, ["model-value", "placeholder", "disabled", "aria-label"]);
|
|
2687
|
-
};
|
|
2688
|
-
}
|
|
2689
|
-
});
|
|
2690
2746
|
export {
|
|
2691
2747
|
CkCitation as C,
|
|
2692
|
-
_sfc_main$
|
|
2693
|
-
_sfc_main$
|
|
2694
|
-
_sfc_main$
|
|
2695
|
-
_sfc_main$
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
_sfc_main$
|
|
2702
|
-
_sfc_main$
|
|
2703
|
-
_sfc_main
|
|
2704
|
-
_sfc_main as l,
|
|
2705
|
-
_sfc_main$
|
|
2706
|
-
_sfc_main$
|
|
2707
|
-
_sfc_main$
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
_sfc_main$
|
|
2711
|
-
_sfc_main$
|
|
2712
|
-
_sfc_main$
|
|
2713
|
-
_sfc_main$
|
|
2714
|
-
_sfc_main$
|
|
2715
|
-
_sfc_main$
|
|
2716
|
-
|
|
2717
|
-
|
|
2748
|
+
_sfc_main$q as _,
|
|
2749
|
+
_sfc_main$p as a,
|
|
2750
|
+
_sfc_main$n as b,
|
|
2751
|
+
_sfc_main$1 as c,
|
|
2752
|
+
_sfc_main$l as d,
|
|
2753
|
+
CkCopyMessageButton as e,
|
|
2754
|
+
CkDropZoneOverlay as f,
|
|
2755
|
+
CkFeedbackButton as g,
|
|
2756
|
+
CkFeedbackDialog as h,
|
|
2757
|
+
_sfc_main$c as i,
|
|
2758
|
+
_sfc_main$o as j,
|
|
2759
|
+
_sfc_main as k,
|
|
2760
|
+
_sfc_main$b as l,
|
|
2761
|
+
_sfc_main$a as m,
|
|
2762
|
+
_sfc_main$f as n,
|
|
2763
|
+
_sfc_main$k as o,
|
|
2764
|
+
_sfc_main$9 as p,
|
|
2765
|
+
CkPromptInput as q,
|
|
2766
|
+
_sfc_main$4 as r,
|
|
2767
|
+
_sfc_main$7 as s,
|
|
2768
|
+
_sfc_main$8 as t,
|
|
2769
|
+
_sfc_main$6 as u,
|
|
2770
|
+
_sfc_main$3 as v,
|
|
2771
|
+
_sfc_main$s as w,
|
|
2772
|
+
_sfc_main$r as x,
|
|
2773
|
+
CkUserMessage as y,
|
|
2774
|
+
formatRelativeTime as z
|
|
2718
2775
|
};
|