@aleph-alpha/chat-kit 6.2.0 → 6.3.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/{CkHistory.vue_vue_type_script_setup_true_lang-DPCpIxWc.js → CkHistory.vue_vue_type_script_setup_true_lang-gV-lp0ZB.js} +345 -164
- package/dist/chat-kit.css +111 -28
- package/dist/code-palette-DAJUTnR-.js +21598 -0
- package/dist/components/base/CkCodeEditor/CkCodeEditor.stories.d.ts +43 -0
- package/dist/components/base/CkCodeEditor/CkCodeEditor.stories.d.ts.map +1 -0
- package/dist/components/base/CkCodeEditor/CkCodeEditor.vue.d.ts +39 -0
- package/dist/components/base/CkCodeEditor/CkCodeEditor.vue.d.ts.map +1 -0
- package/dist/components/base/CkCodeEditor/createCodeMirror.d.ts +44 -0
- package/dist/components/base/CkCodeEditor/createCodeMirror.d.ts.map +1 -0
- package/dist/components/base/CkCodeEditor/index.d.ts +3 -0
- package/dist/components/base/CkCodeEditor/index.d.ts.map +1 -0
- package/dist/components/base/CkCodeEditor/types.d.ts +129 -0
- package/dist/components/base/CkCodeEditor/types.d.ts.map +1 -0
- package/dist/components/base/CkMilkdownEditor/CkMilkdownEditor.stories.d.ts +6 -0
- package/dist/components/base/CkMilkdownEditor/CkMilkdownEditor.stories.d.ts.map +1 -1
- package/dist/components/base/CkMilkdownEditor/CkMilkdownEditor.vue.d.ts +1 -0
- package/dist/components/base/CkMilkdownEditor/CkMilkdownEditor.vue.d.ts.map +1 -1
- package/dist/components/base/CkMilkdownEditor/createCrepeEditor.d.ts +1 -0
- package/dist/components/base/CkMilkdownEditor/createCrepeEditor.d.ts.map +1 -1
- package/dist/components/base/CkMilkdownEditor/types.d.ts +8 -0
- package/dist/components/base/CkMilkdownEditor/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 +27 -26
- package/dist/createCodeMirror-BkV6FEPn.js +101 -0
- package/dist/{createCrepeEditor-C9seqnzm.js → createCrepeEditor-Ci5FHHIV.js} +1433 -24739
- package/dist/handlers/index.js +1 -1
- package/dist/handlers/useChatKitLabels.d.ts +6 -0
- package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
- package/dist/{components/base/CkMilkdownEditor/codeMirrorTheme.d.ts → helpers/codemirror/theme.d.ts} +1 -1
- package/dist/helpers/codemirror/theme.d.ts.map +1 -0
- package/dist/{index-DzpUblMx.js → index-B2tew8uf.js} +3 -3
- package/dist/{index-DLZcs4H8.js → index-BLVAx_f8.js} +2 -2
- package/dist/{index-CHtY7ztn.js → index-BUCqcTPA.js} +2 -2
- package/dist/{index-8mYiDHFC.js → index-BhvbqYsK.js} +2 -2
- package/dist/{index-B0nlcqqF.js → index-BoUJGvvQ.js} +2 -2
- package/dist/{index-U4LYutvz.js → index-BtY1uxn6.js} +3 -2
- package/dist/{index-C5UC1wP7.js → index-BvG6l44n.js} +3 -2
- package/dist/{index-D85elIIr.js → index-CB6xZVsf.js} +2 -2
- package/dist/{index-DbVRgXxM.js → index-CIF93PZF.js} +3 -3
- package/dist/{index-reQfKGuJ.js → index-CN8d3yl1.js} +1 -1
- package/dist/{index-By7WdPbk.js → index-CYk7AB8M.js} +4 -4
- package/dist/{index-DO8xk00f.js → index-Cxs6kPho.js} +3 -3
- package/dist/index-D6ftdiLa.js +1825 -0
- package/dist/{index-DXTRMb09.js → index-DgCcFC3N.js} +3 -3
- package/dist/{index-Bxg0Q_mk.js → index-DhwsowEf.js} +2 -2
- package/dist/{index-C90_LSx6.js → index-Dl24CCB3.js} +4 -4
- package/dist/{index-eZunhxNH.js → index-DqGDenO9.js} +2 -2
- package/dist/{index-DfvAv_Y2.js → index-DufAP1JF.js} +3 -2
- package/dist/{index-VbqLf82s.js → index-DxTzaHLr.js} +4 -4
- package/dist/{index-CFdcEeXx.js → index-MfXW4ZyN.js} +3 -2
- package/dist/{index-6PiPEjJd.js → index-ZHg2R9iD.js} +3 -2
- package/dist/{index-DNxEOsDD.js → index-gYt3E3Cp.js} +2 -2
- package/dist/{index-DINJn4Mn.js → index-w2yzH7vs.js} +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -28
- package/dist/{useChatKitLabels-Bz58tas9.js → useChatKitLabels-CatQSpfL.js} +2 -0
- package/package.json +5 -3
- package/src/components/base/CkCodeEditor/CkCodeEditor.spec.ts +223 -0
- package/src/components/base/CkCodeEditor/CkCodeEditor.stories.ts +311 -0
- package/src/components/base/CkCodeEditor/CkCodeEditor.vue +238 -0
- package/src/components/base/CkCodeEditor/createCodeMirror.ts +188 -0
- package/src/components/base/CkCodeEditor/index.ts +2 -0
- package/src/components/base/CkCodeEditor/types.ts +128 -0
- package/src/components/base/CkMilkdownEditor/CkMilkdownEditor.spec.ts +13 -0
- package/src/components/base/CkMilkdownEditor/CkMilkdownEditor.stories.ts +34 -0
- package/src/components/base/CkMilkdownEditor/CkMilkdownEditor.vue +3 -1
- package/src/components/base/CkMilkdownEditor/createCrepeEditor.ts +2 -1
- package/src/components/base/CkMilkdownEditor/milkdown-theme.css +39 -26
- package/src/components/base/CkMilkdownEditor/types.ts +8 -0
- package/src/components/base/index.ts +6 -0
- package/src/components/index.ts +4 -0
- package/src/handlers/useChatKitLabels.ts +6 -0
- package/src/helpers/codemirror/code-palette.css +49 -0
- package/src/{components/base/CkMilkdownEditor/codeMirrorTheme.ts → helpers/codemirror/theme.ts} +23 -12
- package/src/index.ts +4 -0
- package/dist/components/base/CkMilkdownEditor/codeMirrorTheme.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, createElementBlock, createElementVNode, normalizeClass, renderSlot, createCommentVNode, mergeProps, withCtx, ref, watch, onScopeDispose, computed, useTemplateRef, createVNode, toDisplayString, resolveDynamicComponent, onBeforeUnmount, useSlots, onMounted, nextTick, onUnmounted, Fragment, renderList, normalizeStyle, Transition, createStaticVNode, Teleport, withModifiers, toValue, h, toRefs, useId, createTextVNode, useAttrs, onUpdated, createSlots, normalizeProps, guardReactiveProps, Comment, Text } from "vue";
|
|
2
2
|
import { UiIcon, UiButton, UiFileType, UiTooltip, UiPopover, UiPopoverTrigger, UiPopoverContent, formatFileSize, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiProgress, Primitive, UiFloatActions, UiFloatActionItems, UiCodeBlock, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
|
|
3
|
-
import { u as useChatKitLabels, d as defaultChatKitLabels, r as remarkCitations, b as useMarkdownParser } from "./useChatKitLabels-
|
|
3
|
+
import { u as useChatKitLabels, d as defaultChatKitLabels, r as remarkCitations, b as useMarkdownParser } from "./useChatKitLabels-CatQSpfL.js";
|
|
4
4
|
const MINUTE = 60;
|
|
5
5
|
const HOUR = 60 * MINUTE;
|
|
6
6
|
const DAY = 24 * HOUR;
|
|
@@ -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$w = /* @__PURE__ */ defineComponent({
|
|
40
40
|
...{ name: "CkSendIcon" },
|
|
41
41
|
__name: "CkSendIcon",
|
|
42
42
|
setup(__props) {
|
|
@@ -45,19 +45,19 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
const _hoisted_1$
|
|
48
|
+
const _hoisted_1$i = {
|
|
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$v = /* @__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$i, [..._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,17 +66,17 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
const _hoisted_1$
|
|
69
|
+
const _hoisted_1$h = {
|
|
70
70
|
key: 0,
|
|
71
71
|
"data-testid": "ck-agent-message-header",
|
|
72
72
|
class: "w-full min-w-0"
|
|
73
73
|
};
|
|
74
|
-
const _hoisted_2$
|
|
75
|
-
const _hoisted_3$
|
|
74
|
+
const _hoisted_2$b = { class: "text-content-on-surface-primary min-w-0 text-base leading-7" };
|
|
75
|
+
const _hoisted_3$a = {
|
|
76
76
|
key: 1,
|
|
77
77
|
class: "flex items-center gap-4"
|
|
78
78
|
};
|
|
79
|
-
const _sfc_main$
|
|
79
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
80
80
|
...{ name: "CkAgentMessage" },
|
|
81
81
|
__name: "CkAgentMessage",
|
|
82
82
|
props: {
|
|
@@ -90,31 +90,31 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
90
90
|
__props.bottomSeparator && "border-border-surface-default border-b"
|
|
91
91
|
])
|
|
92
92
|
}, [
|
|
93
|
-
_ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
93
|
+
_ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
94
94
|
renderSlot(_ctx.$slots, "header")
|
|
95
95
|
])) : createCommentVNode("", true),
|
|
96
|
-
createElementVNode("div", _hoisted_2$
|
|
96
|
+
createElementVNode("div", _hoisted_2$b, [
|
|
97
97
|
renderSlot(_ctx.$slots, "default")
|
|
98
98
|
]),
|
|
99
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
99
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
|
|
100
100
|
renderSlot(_ctx.$slots, "footer")
|
|
101
101
|
])) : createCommentVNode("", true)
|
|
102
102
|
], 2);
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
-
const _hoisted_1$
|
|
106
|
+
const _hoisted_1$g = {
|
|
107
107
|
key: 0,
|
|
108
108
|
"data-testid": "ck-agent-message-header-icon",
|
|
109
109
|
class: "flex flex-shrink-0 items-center justify-center"
|
|
110
110
|
};
|
|
111
|
-
const _hoisted_2$
|
|
112
|
-
const _hoisted_3$
|
|
111
|
+
const _hoisted_2$a = { 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$9 = {
|
|
113
113
|
key: 1,
|
|
114
114
|
"data-testid": "ck-agent-message-header-activity",
|
|
115
115
|
class: "flex flex-shrink-0 items-center"
|
|
116
116
|
};
|
|
117
|
-
const _sfc_main$
|
|
117
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
118
118
|
...{ name: "CkAgentMessageHeader" },
|
|
119
119
|
__name: "CkAgentMessageHeader",
|
|
120
120
|
setup(__props) {
|
|
@@ -126,20 +126,20 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
126
126
|
_ctx.$slots.activity && "border-border-surface-default border-b py-4"
|
|
127
127
|
])
|
|
128
128
|
}, [
|
|
129
|
-
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
129
|
+
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
130
130
|
renderSlot(_ctx.$slots, "icon")
|
|
131
131
|
])) : createCommentVNode("", true),
|
|
132
|
-
createElementVNode("span", _hoisted_2$
|
|
132
|
+
createElementVNode("span", _hoisted_2$a, [
|
|
133
133
|
renderSlot(_ctx.$slots, "default")
|
|
134
134
|
]),
|
|
135
|
-
_ctx.$slots.activity ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
135
|
+
_ctx.$slots.activity ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
|
|
136
136
|
renderSlot(_ctx.$slots, "activity")
|
|
137
137
|
])) : createCommentVNode("", true)
|
|
138
138
|
], 2);
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
|
-
const _sfc_main$
|
|
142
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
143
143
|
...{
|
|
144
144
|
name: "CkHeaderActivityButton"
|
|
145
145
|
},
|
|
@@ -219,9 +219,9 @@ function useIsTruncated(elementRef, watchSource) {
|
|
|
219
219
|
});
|
|
220
220
|
return isTruncated;
|
|
221
221
|
}
|
|
222
|
-
const _hoisted_1$
|
|
223
|
-
const _hoisted_2$
|
|
224
|
-
const _hoisted_3$
|
|
222
|
+
const _hoisted_1$f = { 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" };
|
|
223
|
+
const _hoisted_2$9 = { class: "flex min-w-0 items-center gap-3 py-0.5" };
|
|
224
|
+
const _hoisted_3$8 = { class: "line-clamp-6 break-words text-sm leading-5 text-content-on-surface-secondary" };
|
|
225
225
|
const _hoisted_4$7 = {
|
|
226
226
|
key: 0,
|
|
227
227
|
class: "flex items-center gap-1.5 text-sm leading-5 text-content-on-surface-muted"
|
|
@@ -235,7 +235,7 @@ const _hoisted_6$4 = {
|
|
|
235
235
|
key: 2,
|
|
236
236
|
class: "shrink-0"
|
|
237
237
|
};
|
|
238
|
-
const _sfc_main$
|
|
238
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
239
239
|
...{
|
|
240
240
|
name: "CkCitationCard"
|
|
241
241
|
},
|
|
@@ -269,8 +269,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
return (_ctx, _cache) => {
|
|
272
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
273
|
-
createElementVNode("div", _hoisted_2$
|
|
272
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
273
|
+
createElementVNode("div", _hoisted_2$9, [
|
|
274
274
|
createVNode(unref(UiFileType), {
|
|
275
275
|
filename: __props.fileName,
|
|
276
276
|
class: "shrink-0"
|
|
@@ -307,7 +307,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
307
307
|
_: 1
|
|
308
308
|
}, 8, ["aria-label"])) : createCommentVNode("", true)
|
|
309
309
|
]),
|
|
310
|
-
createElementVNode("p", _hoisted_3$
|
|
310
|
+
createElementVNode("p", _hoisted_3$8, toDisplayString(__props.snippet), 1),
|
|
311
311
|
__props.collectionName || __props.locationLabel ? (openBlock(), createElementBlock("p", _hoisted_4$7, [
|
|
312
312
|
__props.collectionName ? (openBlock(), createBlock(unref(UiTooltip), {
|
|
313
313
|
key: 0,
|
|
@@ -331,7 +331,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
331
331
|
};
|
|
332
332
|
}
|
|
333
333
|
});
|
|
334
|
-
const _sfc_main$
|
|
334
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
335
335
|
...{
|
|
336
336
|
name: "CkCitationLabel"
|
|
337
337
|
},
|
|
@@ -379,9 +379,9 @@ const _export_sfc = (sfc, props) => {
|
|
|
379
379
|
}
|
|
380
380
|
return target;
|
|
381
381
|
};
|
|
382
|
-
const CkCitationLabel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
382
|
+
const CkCitationLabel = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-66ed453e"]]);
|
|
383
383
|
const CLOSE_DELAY_MS = 80;
|
|
384
|
-
const _sfc_main$
|
|
384
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
385
385
|
...{
|
|
386
386
|
name: "CkCitation"
|
|
387
387
|
},
|
|
@@ -477,7 +477,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
477
477
|
onFocusout: onContentFocusOut
|
|
478
478
|
}, {
|
|
479
479
|
default: withCtx(() => [
|
|
480
|
-
createVNode(unref(_sfc_main$
|
|
480
|
+
createVNode(unref(_sfc_main$r), {
|
|
481
481
|
"file-name": __props.fileName,
|
|
482
482
|
snippet: __props.snippet,
|
|
483
483
|
"location-label": __props.locationLabel,
|
|
@@ -495,9 +495,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
497
|
});
|
|
498
|
-
const _hoisted_1$
|
|
499
|
-
const _hoisted_2$
|
|
500
|
-
const _hoisted_3$
|
|
498
|
+
const _hoisted_1$e = { class: "relative flex min-h-0 flex-col overflow-hidden" };
|
|
499
|
+
const _hoisted_2$8 = ["data-message-row"];
|
|
500
|
+
const _hoisted_3$7 = {
|
|
501
501
|
key: 0,
|
|
502
502
|
class: "flex min-w-0 justify-end"
|
|
503
503
|
};
|
|
@@ -505,7 +505,7 @@ const _hoisted_4$6 = {
|
|
|
505
505
|
key: 1,
|
|
506
506
|
class: "flex min-w-0 justify-start"
|
|
507
507
|
};
|
|
508
|
-
const _sfc_main$
|
|
508
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
509
509
|
...{ name: "CkConversationLayout" },
|
|
510
510
|
__name: "CkConversationLayout",
|
|
511
511
|
props: {
|
|
@@ -664,7 +664,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
664
664
|
);
|
|
665
665
|
__expose({ scrollToMessage: scrollMessageToTop });
|
|
666
666
|
return (_ctx, _cache) => {
|
|
667
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
667
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
668
668
|
createElementVNode("div", {
|
|
669
669
|
"aria-hidden": "true",
|
|
670
670
|
class: normalizeClass(["pointer-events-none absolute inset-x-0 top-0 z-10 h-8 bg-gradient-to-b from-background-surface-secondary to-transparent transition-opacity duration-200", showTopFade.value ? "opacity-100" : "opacity-0"])
|
|
@@ -681,12 +681,12 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
681
681
|
"data-message-row": message.role,
|
|
682
682
|
class: normalizeClass(["min-w-0", index === 0 ? "mt-2xl" : "mt-3xl"])
|
|
683
683
|
}, [
|
|
684
|
-
message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
684
|
+
message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
|
|
685
685
|
renderSlot(_ctx.$slots, "user-message", { message })
|
|
686
686
|
])) : (openBlock(), createElementBlock("div", _hoisted_4$6, [
|
|
687
687
|
renderSlot(_ctx.$slots, "agent-message", { message })
|
|
688
688
|
]))
|
|
689
|
-
], 10, _hoisted_2$
|
|
689
|
+
], 10, _hoisted_2$8);
|
|
690
690
|
}), 128)),
|
|
691
691
|
_ctx.$slots["thread-footer"] ? (openBlock(), createElementBlock("div", {
|
|
692
692
|
key: 0,
|
|
@@ -709,7 +709,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
709
709
|
};
|
|
710
710
|
}
|
|
711
711
|
});
|
|
712
|
-
const _sfc_main$
|
|
712
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
713
713
|
...{
|
|
714
714
|
name: "CkMessageButton"
|
|
715
715
|
},
|
|
@@ -733,11 +733,11 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
733
733
|
};
|
|
734
734
|
}
|
|
735
735
|
});
|
|
736
|
-
const _hoisted_1$
|
|
736
|
+
const _hoisted_1$d = {
|
|
737
737
|
class: "sr-only",
|
|
738
738
|
"aria-live": "polite"
|
|
739
739
|
};
|
|
740
|
-
const _sfc_main$
|
|
740
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
741
741
|
...{
|
|
742
742
|
name: "CkCopyMessageButton"
|
|
743
743
|
},
|
|
@@ -794,7 +794,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
794
794
|
"delay-duration": 0
|
|
795
795
|
}, {
|
|
796
796
|
default: withCtx(() => [
|
|
797
|
-
createVNode(unref(_sfc_main$
|
|
797
|
+
createVNode(unref(_sfc_main$n), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
|
|
798
798
|
disabled: __props.disabled,
|
|
799
799
|
onClick: handleClick
|
|
800
800
|
}), {
|
|
@@ -821,15 +821,15 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
821
821
|
]),
|
|
822
822
|
_: 1
|
|
823
823
|
}, 16, ["disabled"]),
|
|
824
|
-
createElementVNode("span", _hoisted_1$
|
|
824
|
+
createElementVNode("span", _hoisted_1$d, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
|
|
825
825
|
]),
|
|
826
826
|
_: 1
|
|
827
827
|
}, 8, ["open", "content"]);
|
|
828
828
|
};
|
|
829
829
|
}
|
|
830
830
|
});
|
|
831
|
-
const CkCopyMessageButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
832
|
-
const _hoisted_1$
|
|
831
|
+
const CkCopyMessageButton = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-ba2e5f32"]]);
|
|
832
|
+
const _hoisted_1$c = {
|
|
833
833
|
width: "208",
|
|
834
834
|
height: "144",
|
|
835
835
|
viewBox: "0 0 208 144",
|
|
@@ -838,20 +838,20 @@ const _hoisted_1$b = {
|
|
|
838
838
|
"aria-hidden": "true",
|
|
839
839
|
focusable: "false"
|
|
840
840
|
};
|
|
841
|
-
const _sfc_main$
|
|
841
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
842
842
|
...{ name: "CkDropZoneIllustration" },
|
|
843
843
|
__name: "CkDropZoneIllustration",
|
|
844
844
|
setup(__props) {
|
|
845
845
|
return (_ctx, _cache) => {
|
|
846
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
846
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$c, [..._cache[0] || (_cache[0] = [
|
|
847
847
|
createStaticVNode('<g clip-path="url(#ck-drop-zone-clip)"><path d="M0 71.5391C0 32.0292 32.0292 0 71.5391 0H135.739C175.249 0 207.278 32.0292 207.278 71.5391C207.278 111.049 175.249 143.078 135.739 143.078H71.5392C32.0292 143.078 0 111.049 0 71.5391Z" fill="#F2EBE8"></path><path d="M120.899 98.2608L134.973 45.7385C135.223 44.805 136.182 44.251 137.116 44.5011L172.976 54.1098C173.909 54.3599 174.463 55.3195 174.213 56.2531L160.14 108.775C159.89 109.709 158.93 110.263 157.997 110.013L122.137 100.404C121.203 100.154 120.649 99.1943 120.899 98.2608Z" fill="#FFCCBB" stroke="#333333"></path><g><path d="M153.839 69.86L144.18 67.2718C143.118 66.9871 142.015 67.6235 141.731 68.686L137.589 84.1409C137.305 85.2034 137.941 86.3056 139.004 86.5904L150.595 89.6962C151.657 89.9809 152.76 89.3445 153.044 88.282L156.668 74.759L153.839 69.86Z" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path><path d="M153.839 69.86L153.063 72.7578C152.921 73.2891 153.239 73.8402 153.77 73.9825L156.668 74.759" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path><path d="M143.783 76.4828L151.51 78.5534" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path><path d="M143.006 79.3806L150.733 81.4511" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path><path d="M142.23 82.2784L147.059 83.5725" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path></g><path d="M86.3795 98.2608L72.3062 45.7385C72.0561 44.805 71.0965 44.251 70.1629 44.5011L34.3029 54.1098C33.3694 54.3599 32.8153 55.3195 33.0655 56.2531L47.1388 108.775C47.3889 109.709 48.3485 110.263 49.2821 110.013L85.1421 100.404C86.0756 100.154 86.6297 99.1943 86.3795 98.2608Z" fill="#FFE9B5" stroke="#333333"></path><g><path d="M60.3294 76.0227L58.0001 67.3293C60.3057 66.7116 62.7623 67.035 64.8294 68.2284C66.8966 69.4219 68.405 71.3877 69.0228 73.6933L60.3294 76.0227Z" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path><path d="M55.3303 68.8899C54.4077 69.3934 53.5755 70.0573 52.8752 70.8559C51.7015 72.1942 50.9511 73.8504 50.7187 75.6152C50.4864 77.38 50.7826 79.1741 51.5699 80.7706C52.3572 82.367 53.6002 83.6942 55.1417 84.5842C56.6833 85.4742 58.4541 85.8871 60.2304 85.7707C62.0066 85.6543 63.7084 85.0138 65.1206 83.9302C66.5328 82.8465 67.5919 81.3685 68.1641 79.6829C68.5135 78.6536 68.6717 77.5751 68.6371 76.4998" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path></g><path d="M76.5186 107.5L76.5185 35C76.5185 33.6193 77.6378 32.5 79.0185 32.5H128.519C129.899 32.5 131.019 33.6193 131.019 35V107.5C131.019 108.881 129.899 110 128.519 110H79.0186C77.6378 110 76.5186 108.881 76.5186 107.5Z" fill="#FFB3DD" stroke="#333333"></path><g><path d="M107.519 56.8335H95.519C94.419 56.8335 93.519 57.7335 93.519 58.8335V82.1665C93.519 83.2675 94.419 84.1665 95.519 84.1665H111.519C112.619 84.1665 113.519 83.2675 113.519 82.1665V64.8335L107.519 56.8335Z" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path><path d="M107.519 56.8335V62.8335C107.519 63.9335 108.419 64.8335 109.519 64.8335H113.519" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path><path d="M103.519 78.8335V70.8335" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path><path d="M99.519 74.8335L103.519 70.8335L107.519 74.8335" stroke="#1D1D1B" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"></path></g></g><defs><clipPath id="ck-drop-zone-clip"><rect width="208" height="144" fill="white"></rect></clipPath></defs>', 2)
|
|
848
848
|
])]);
|
|
849
849
|
};
|
|
850
850
|
}
|
|
851
851
|
});
|
|
852
|
-
const _hoisted_1$
|
|
853
|
-
const _hoisted_2$
|
|
854
|
-
const _hoisted_3$
|
|
852
|
+
const _hoisted_1$b = ["aria-label"];
|
|
853
|
+
const _hoisted_2$7 = { class: "pointer-events-none flex h-full w-full flex-col items-center justify-center gap-4 text-content-on-surface-primary" };
|
|
854
|
+
const _hoisted_3$6 = { class: "flex flex-col items-center gap-1 text-center" };
|
|
855
855
|
const _hoisted_4$5 = { class: "body-16-bold" };
|
|
856
856
|
const _hoisted_5$3 = {
|
|
857
857
|
key: 0,
|
|
@@ -863,7 +863,7 @@ const _hoisted_6$3 = {
|
|
|
863
863
|
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",
|
|
864
864
|
role: "alert"
|
|
865
865
|
};
|
|
866
|
-
const _sfc_main$
|
|
866
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
867
867
|
...{
|
|
868
868
|
name: "CkDropZoneOverlay"
|
|
869
869
|
},
|
|
@@ -1024,16 +1024,16 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
1024
1024
|
}, ["prevent"])),
|
|
1025
1025
|
onDrop: onOverlayDrop
|
|
1026
1026
|
}, [
|
|
1027
|
-
createElementVNode("div", _hoisted_2$
|
|
1027
|
+
createElementVNode("div", _hoisted_2$7, [
|
|
1028
1028
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1029
|
-
createVNode(_sfc_main$
|
|
1030
|
-
createElementVNode("div", _hoisted_3$
|
|
1029
|
+
createVNode(_sfc_main$l, { class: "h-36 w-52" }),
|
|
1030
|
+
createElementVNode("div", _hoisted_3$6, [
|
|
1031
1031
|
createElementVNode("p", _hoisted_4$5, toDisplayString(resolvedHeading.value), 1),
|
|
1032
1032
|
__props.hint ? (openBlock(), createElementBlock("p", _hoisted_5$3, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
|
|
1033
1033
|
])
|
|
1034
1034
|
], true)
|
|
1035
1035
|
])
|
|
1036
|
-
], 40, _hoisted_1$
|
|
1036
|
+
], 40, _hoisted_1$b)) : createCommentVNode("", true)
|
|
1037
1037
|
]),
|
|
1038
1038
|
_: 3
|
|
1039
1039
|
}),
|
|
@@ -1051,9 +1051,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
1051
1051
|
};
|
|
1052
1052
|
}
|
|
1053
1053
|
});
|
|
1054
|
-
const CkDropZoneOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1055
|
-
const _hoisted_1$
|
|
1056
|
-
const _sfc_main$
|
|
1054
|
+
const CkDropZoneOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-54119668"]]);
|
|
1055
|
+
const _hoisted_1$a = ["aria-label"];
|
|
1056
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
1057
1057
|
...{
|
|
1058
1058
|
name: "CkFeedbackButton"
|
|
1059
1059
|
},
|
|
@@ -1108,7 +1108,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1108
1108
|
"delay-duration": 0
|
|
1109
1109
|
}, {
|
|
1110
1110
|
default: withCtx(() => [
|
|
1111
|
-
createVNode(unref(_sfc_main$
|
|
1111
|
+
createVNode(unref(_sfc_main$n), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
|
|
1112
1112
|
"aria-pressed": isUpSelected.value,
|
|
1113
1113
|
"aria-disabled": __props.locked || void 0,
|
|
1114
1114
|
disabled: isUpDisabled.value,
|
|
@@ -1135,7 +1135,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1135
1135
|
"delay-duration": 0
|
|
1136
1136
|
}, {
|
|
1137
1137
|
default: withCtx(() => [
|
|
1138
|
-
createVNode(unref(_sfc_main$
|
|
1138
|
+
createVNode(unref(_sfc_main$n), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
|
|
1139
1139
|
"aria-pressed": isDownSelected.value,
|
|
1140
1140
|
"aria-disabled": __props.locked || void 0,
|
|
1141
1141
|
disabled: isDownDisabled.value,
|
|
@@ -1155,11 +1155,11 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1155
1155
|
]),
|
|
1156
1156
|
_: 1
|
|
1157
1157
|
}, 8, ["content"])
|
|
1158
|
-
], 8, _hoisted_1$
|
|
1158
|
+
], 8, _hoisted_1$a);
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
1161
|
});
|
|
1162
|
-
const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1162
|
+
const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-c4c638c3"]]);
|
|
1163
1163
|
function useCitationRendering(citations, onOpenSource) {
|
|
1164
1164
|
const sourcesByIndex = computed(
|
|
1165
1165
|
() => new Map(
|
|
@@ -1178,7 +1178,7 @@ function useCitationRendering(citations, onOpenSource) {
|
|
|
1178
1178
|
const source = sourcesByIndex.value.get(index);
|
|
1179
1179
|
if (!source) return null;
|
|
1180
1180
|
if (slot) return slot({ source, openSource: onOpenSource });
|
|
1181
|
-
return h(_sfc_main$
|
|
1181
|
+
return h(_sfc_main$p, { ...source, onOpenSource });
|
|
1182
1182
|
}
|
|
1183
1183
|
return { citationPlugins, renderCitationNode };
|
|
1184
1184
|
}
|
|
@@ -1242,7 +1242,7 @@ function domToVNode(node, ctx) {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
return vnode;
|
|
1244
1244
|
}
|
|
1245
|
-
const _sfc_main$
|
|
1245
|
+
const _sfc_main$i = defineComponent({
|
|
1246
1246
|
name: "CkMarkdownRenderer",
|
|
1247
1247
|
props: {
|
|
1248
1248
|
content: { type: String, required: true },
|
|
@@ -1300,17 +1300,17 @@ const _sfc_main$h = defineComponent({
|
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
1302
|
});
|
|
1303
|
-
const _hoisted_1$
|
|
1303
|
+
const _hoisted_1$9 = {
|
|
1304
1304
|
key: 0,
|
|
1305
1305
|
class: "flex min-h-0 flex-col gap-2"
|
|
1306
1306
|
};
|
|
1307
|
-
const _hoisted_2$
|
|
1308
|
-
const _hoisted_3$
|
|
1307
|
+
const _hoisted_2$6 = { 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" };
|
|
1308
|
+
const _hoisted_3$5 = { class: "flex min-h-0 flex-col gap-4" };
|
|
1309
1309
|
const _hoisted_4$4 = {
|
|
1310
1310
|
class: "self-end text-sm text-content-on-surface-muted tabular-nums",
|
|
1311
1311
|
"aria-live": "polite"
|
|
1312
1312
|
};
|
|
1313
|
-
const _sfc_main$
|
|
1313
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
1314
1314
|
...{
|
|
1315
1315
|
name: "CkFeedbackDialog"
|
|
1316
1316
|
},
|
|
@@ -1468,15 +1468,15 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1468
1468
|
showResponseColumn.value ? "grid-cols-2" : "grid-cols-1"
|
|
1469
1469
|
])
|
|
1470
1470
|
}, [
|
|
1471
|
-
showResponseColumn.value ? (openBlock(), createElementBlock("section", _hoisted_1$
|
|
1471
|
+
showResponseColumn.value ? (openBlock(), createElementBlock("section", _hoisted_1$9, [
|
|
1472
1472
|
createVNode(unref(UiFieldLabel), null, {
|
|
1473
1473
|
default: withCtx(() => [
|
|
1474
1474
|
createTextVNode(toDisplayString(responseHeading.value), 1)
|
|
1475
1475
|
]),
|
|
1476
1476
|
_: 1
|
|
1477
1477
|
}),
|
|
1478
|
-
createElementVNode("div", _hoisted_2$
|
|
1479
|
-
createVNode(unref(_sfc_main$
|
|
1478
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
1479
|
+
createVNode(unref(_sfc_main$i), {
|
|
1480
1480
|
content: __props.responseText,
|
|
1481
1481
|
citations: __props.citations
|
|
1482
1482
|
}, {
|
|
@@ -1489,7 +1489,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1489
1489
|
}, 8, ["content", "citations"])
|
|
1490
1490
|
])
|
|
1491
1491
|
])) : createCommentVNode("", true),
|
|
1492
|
-
createElementVNode("section", _hoisted_3$
|
|
1492
|
+
createElementVNode("section", _hoisted_3$5, [
|
|
1493
1493
|
createVNode(unref(UiToggleGroup), {
|
|
1494
1494
|
modelValue: selectedReasons.value,
|
|
1495
1495
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedReasons.value = $event),
|
|
@@ -1552,8 +1552,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1552
1552
|
};
|
|
1553
1553
|
}
|
|
1554
1554
|
});
|
|
1555
|
-
const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1556
|
-
const _sfc_main$
|
|
1555
|
+
const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-fce18e3e"]]);
|
|
1556
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1557
1557
|
...{
|
|
1558
1558
|
name: "CkFileItemRow",
|
|
1559
1559
|
inheritAttrs: false
|
|
@@ -1596,9 +1596,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
1596
1596
|
};
|
|
1597
1597
|
}
|
|
1598
1598
|
});
|
|
1599
|
-
const _hoisted_1$
|
|
1600
|
-
const _hoisted_2$
|
|
1601
|
-
const _hoisted_3$
|
|
1599
|
+
const _hoisted_1$8 = ["aria-label"];
|
|
1600
|
+
const _hoisted_2$5 = ["onClick"];
|
|
1601
|
+
const _hoisted_3$4 = ["disabled", "aria-label"];
|
|
1602
1602
|
const _hoisted_4$3 = {
|
|
1603
1603
|
key: 3,
|
|
1604
1604
|
class: "flex min-w-0 flex-1 flex-col items-start gap-0.5"
|
|
@@ -1614,7 +1614,7 @@ const _hoisted_6$2 = {
|
|
|
1614
1614
|
const _hoisted_7$2 = ["aria-label"];
|
|
1615
1615
|
const _hoisted_8$1 = ["onClick"];
|
|
1616
1616
|
const ITEM_GAP = 8;
|
|
1617
|
-
const _sfc_main$
|
|
1617
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
1618
1618
|
...{
|
|
1619
1619
|
name: "CkFileItemsList"
|
|
1620
1620
|
},
|
|
@@ -1736,7 +1736,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
1736
1736
|
}),
|
|
1737
1737
|
onClick: ($event) => handleRowClick(file, $event)
|
|
1738
1738
|
}, [
|
|
1739
|
-
createVNode(_sfc_main$
|
|
1739
|
+
createVNode(_sfc_main$g, {
|
|
1740
1740
|
file,
|
|
1741
1741
|
size: __props.size,
|
|
1742
1742
|
"is-removable": __props.isRemovable,
|
|
@@ -1749,9 +1749,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
1749
1749
|
]),
|
|
1750
1750
|
_: 3
|
|
1751
1751
|
}, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
|
|
1752
|
-
], 12, _hoisted_2$
|
|
1752
|
+
], 12, _hoisted_2$5);
|
|
1753
1753
|
}), 128))
|
|
1754
|
-
], 8, _hoisted_1$
|
|
1754
|
+
], 8, _hoisted_1$8)) : (openBlock(), createBlock(unref(UiPopover), {
|
|
1755
1755
|
key: 1,
|
|
1756
1756
|
open: isOpen.value,
|
|
1757
1757
|
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => isOpen.value = $event)
|
|
@@ -1794,7 +1794,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
1794
1794
|
"aria-hidden": "true",
|
|
1795
1795
|
class: normalizeClass(["shrink-0 text-content-on-surface-muted transition-transform", isOpen.value && "rotate-180"])
|
|
1796
1796
|
}, null, 8, ["class"])
|
|
1797
|
-
], 10, _hoisted_3$
|
|
1797
|
+
], 10, _hoisted_3$4)
|
|
1798
1798
|
]),
|
|
1799
1799
|
_: 1
|
|
1800
1800
|
}),
|
|
@@ -1816,7 +1816,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
1816
1816
|
style: normalizeStyle({ maxWidth: `${__props.maxItemWidth}px` }),
|
|
1817
1817
|
onClick: ($event) => handleRowClick(file, $event)
|
|
1818
1818
|
}, [
|
|
1819
|
-
createVNode(_sfc_main$
|
|
1819
|
+
createVNode(_sfc_main$g, {
|
|
1820
1820
|
file,
|
|
1821
1821
|
size: __props.size,
|
|
1822
1822
|
"is-removable": __props.isRemovable,
|
|
@@ -1843,9 +1843,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
1843
1843
|
}
|
|
1844
1844
|
});
|
|
1845
1845
|
const CHAT_HISTORY_ACTIVE_INDICATOR_CLASS = "ui-active-indicator";
|
|
1846
|
-
const _hoisted_1$
|
|
1847
|
-
const _hoisted_2$
|
|
1848
|
-
const _hoisted_3$
|
|
1846
|
+
const _hoisted_1$7 = ["data-active"];
|
|
1847
|
+
const _hoisted_2$4 = { class: "min-w-0 flex-1" };
|
|
1848
|
+
const _hoisted_3$3 = { class: "truncate body-14-regular text-content-on-surface-primary" };
|
|
1849
1849
|
const _hoisted_4$2 = {
|
|
1850
1850
|
key: 0,
|
|
1851
1851
|
class: "mt-0.5 flex min-w-0 items-center gap-1 label-12-medium text-content-on-surface-muted"
|
|
@@ -1865,7 +1865,7 @@ const _hoisted_7$1 = {
|
|
|
1865
1865
|
const _hoisted_8 = ["aria-label"];
|
|
1866
1866
|
const _hoisted_9 = ["aria-label"];
|
|
1867
1867
|
const _hoisted_10 = ["aria-label"];
|
|
1868
|
-
const _sfc_main$
|
|
1868
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
1869
1869
|
...{
|
|
1870
1870
|
name: "CkHistoryItem",
|
|
1871
1871
|
inheritAttrs: false
|
|
@@ -1992,8 +1992,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1992
1992
|
class: itemClass.value
|
|
1993
1993
|
}), {
|
|
1994
1994
|
default: withCtx(() => [
|
|
1995
|
-
createElementVNode("div", _hoisted_2$
|
|
1996
|
-
createElementVNode("div", _hoisted_3$
|
|
1995
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
1996
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(props.title), 1),
|
|
1997
1997
|
props.metaStart || props.metaEnd || _ctx.$slots.meta ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
1998
1998
|
renderSlot(_ctx.$slots, "meta", {}, () => [
|
|
1999
1999
|
props.metaStart ? (openBlock(), createElementBlock("span", _hoisted_5$1, toDisplayString(props.metaStart), 1)) : createCommentVNode("", true),
|
|
@@ -2099,12 +2099,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2099
2099
|
}))
|
|
2100
2100
|
], 42, _hoisted_10))
|
|
2101
2101
|
], 34)) : createCommentVNode("", true)
|
|
2102
|
-
], 10, _hoisted_1$
|
|
2102
|
+
], 10, _hoisted_1$7);
|
|
2103
2103
|
};
|
|
2104
2104
|
}
|
|
2105
2105
|
});
|
|
2106
2106
|
const baseClass = "flex w-full min-w-0 flex-col py-2";
|
|
2107
|
-
const _sfc_main$
|
|
2107
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
2108
2108
|
...{
|
|
2109
2109
|
name: "CkHistoryWrapper",
|
|
2110
2110
|
inheritAttrs: false
|
|
@@ -2135,9 +2135,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2135
2135
|
};
|
|
2136
2136
|
}
|
|
2137
2137
|
});
|
|
2138
|
-
const _hoisted_1$
|
|
2139
|
-
const _hoisted_2$
|
|
2140
|
-
const _hoisted_3$
|
|
2138
|
+
const _hoisted_1$6 = ["disabled", "aria-expanded", "aria-label"];
|
|
2139
|
+
const _hoisted_2$3 = { class: "min-w-0 max-w-[10rem] truncate" };
|
|
2140
|
+
const _hoisted_3$2 = ["aria-label"];
|
|
2141
2141
|
const _hoisted_4$1 = ["aria-selected", "onClick"];
|
|
2142
2142
|
const _hoisted_5 = { class: "flex min-w-0 flex-1 flex-col" };
|
|
2143
2143
|
const _hoisted_6 = { class: "min-w-0 truncate" };
|
|
@@ -2145,7 +2145,7 @@ const _hoisted_7 = {
|
|
|
2145
2145
|
key: 0,
|
|
2146
2146
|
class: "min-w-0 truncate text-xs text-content-on-surface-muted"
|
|
2147
2147
|
};
|
|
2148
|
-
const _sfc_main$
|
|
2148
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
2149
2149
|
...{ name: "CkModelSelector" },
|
|
2150
2150
|
__name: "CkModelSelector",
|
|
2151
2151
|
props: {
|
|
@@ -2195,14 +2195,14 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2195
2195
|
"aria-expanded": open.value,
|
|
2196
2196
|
"aria-label": triggerAriaLabel.value
|
|
2197
2197
|
}, [
|
|
2198
|
-
createElementVNode("span", _hoisted_2$
|
|
2198
|
+
createElementVNode("span", _hoisted_2$3, toDisplayString(selectedLabel.value), 1),
|
|
2199
2199
|
createVNode(unref(UiIcon), {
|
|
2200
2200
|
name: "chevron-down",
|
|
2201
2201
|
size: 16,
|
|
2202
2202
|
class: "shrink-0",
|
|
2203
2203
|
"aria-hidden": "true"
|
|
2204
2204
|
})
|
|
2205
|
-
], 8, _hoisted_1$
|
|
2205
|
+
], 8, _hoisted_1$6)
|
|
2206
2206
|
]),
|
|
2207
2207
|
_: 1
|
|
2208
2208
|
}),
|
|
@@ -2246,7 +2246,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2246
2246
|
], 8, _hoisted_4$1)
|
|
2247
2247
|
]);
|
|
2248
2248
|
}), 128))
|
|
2249
|
-
], 8, _hoisted_3$
|
|
2249
|
+
], 8, _hoisted_3$2)
|
|
2250
2250
|
]),
|
|
2251
2251
|
_: 1
|
|
2252
2252
|
}, 8, ["side", "align", "side-offset"])
|
|
@@ -2256,7 +2256,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2256
2256
|
};
|
|
2257
2257
|
}
|
|
2258
2258
|
});
|
|
2259
|
-
const _sfc_main$
|
|
2259
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2260
2260
|
...{ name: "CkPromptSendButton" },
|
|
2261
2261
|
__name: "CkPromptSendButton",
|
|
2262
2262
|
props: {
|
|
@@ -2282,7 +2282,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
2282
2282
|
};
|
|
2283
2283
|
}
|
|
2284
2284
|
});
|
|
2285
|
-
const _sfc_main$
|
|
2285
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
2286
2286
|
...{ name: "CkPromptMenuButton" },
|
|
2287
2287
|
__name: "CkPromptMenuButton",
|
|
2288
2288
|
props: {
|
|
@@ -2312,7 +2312,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
2312
2312
|
};
|
|
2313
2313
|
}
|
|
2314
2314
|
});
|
|
2315
|
-
const _sfc_main$
|
|
2315
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
2316
2316
|
...{ name: "CkPromptStopButton" },
|
|
2317
2317
|
__name: "CkPromptStopButton",
|
|
2318
2318
|
props: {
|
|
@@ -2338,15 +2338,15 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2338
2338
|
};
|
|
2339
2339
|
}
|
|
2340
2340
|
});
|
|
2341
|
-
const _hoisted_1$
|
|
2342
|
-
const _hoisted_2$
|
|
2341
|
+
const _hoisted_1$5 = { class: "ck-prompt-root flex flex-col gap-2" };
|
|
2342
|
+
const _hoisted_2$2 = {
|
|
2343
2343
|
key: 0,
|
|
2344
2344
|
style: { "grid-area": "top" }
|
|
2345
2345
|
};
|
|
2346
|
-
const _hoisted_3 = ["for"];
|
|
2346
|
+
const _hoisted_3$1 = ["for"];
|
|
2347
2347
|
const _hoisted_4 = ["id", "value", "placeholder", "disabled"];
|
|
2348
2348
|
const MAX_LINES = 6;
|
|
2349
|
-
const _sfc_main$
|
|
2349
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
2350
2350
|
...{ name: "CkPromptInput" },
|
|
2351
2351
|
__name: "CkPromptInput",
|
|
2352
2352
|
props: {
|
|
@@ -2435,7 +2435,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2435
2435
|
onMounted(adjustHeight);
|
|
2436
2436
|
__expose({ focus, submit });
|
|
2437
2437
|
return (_ctx, _cache) => {
|
|
2438
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2438
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
2439
2439
|
createElementVNode("form", {
|
|
2440
2440
|
class: normalizeClass([
|
|
2441
2441
|
"ck-prompt-form border-border-surface-default bg-background-input-strong grid items-center gap-x-0 gap-y-5 border transition-[border-radius] duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] ",
|
|
@@ -2448,14 +2448,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2448
2448
|
}),
|
|
2449
2449
|
onSubmit: withModifiers(submit, ["prevent"])
|
|
2450
2450
|
}, [
|
|
2451
|
-
hasToolbarTop.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
2451
|
+
hasToolbarTop.value ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
2452
2452
|
renderSlot(_ctx.$slots, "toolbar-top", {}, void 0, true)
|
|
2453
2453
|
])) : createCommentVNode("", true),
|
|
2454
2454
|
__props.ariaLabel ? (openBlock(), createElementBlock("label", {
|
|
2455
2455
|
key: 1,
|
|
2456
2456
|
for: unref(textareaId),
|
|
2457
2457
|
class: "sr-only"
|
|
2458
|
-
}, toDisplayString(__props.ariaLabel), 9, _hoisted_3)) : createCommentVNode("", true),
|
|
2458
|
+
}, toDisplayString(__props.ariaLabel), 9, _hoisted_3$1)) : createCommentVNode("", true),
|
|
2459
2459
|
createElementVNode("div", {
|
|
2460
2460
|
class: normalizeClass([!isMultiLine.value && "pr-2"]),
|
|
2461
2461
|
style: { "grid-area": "left" }
|
|
@@ -2497,12 +2497,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2497
2497
|
};
|
|
2498
2498
|
}
|
|
2499
2499
|
});
|
|
2500
|
-
const CkPromptInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2501
|
-
const _hoisted_1$
|
|
2500
|
+
const CkPromptInput = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-c6b78cec"]]);
|
|
2501
|
+
const _hoisted_1$4 = {
|
|
2502
2502
|
key: 0,
|
|
2503
2503
|
class: "text-center text-content-on-surface-muted text-xs font-normal leading-4"
|
|
2504
2504
|
};
|
|
2505
|
-
const _sfc_main$
|
|
2505
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
2506
2506
|
...{ name: "CkPromptInputDisclaimer" },
|
|
2507
2507
|
__name: "CkPromptInputDisclaimer",
|
|
2508
2508
|
props: {
|
|
@@ -2510,7 +2510,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2510
2510
|
},
|
|
2511
2511
|
setup(__props) {
|
|
2512
2512
|
return (_ctx, _cache) => {
|
|
2513
|
-
return _ctx.$slots.default || __props.text ? (openBlock(), createElementBlock("p", _hoisted_1$
|
|
2513
|
+
return _ctx.$slots.default || __props.text ? (openBlock(), createElementBlock("p", _hoisted_1$4, [
|
|
2514
2514
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2515
2515
|
createTextVNode(toDisplayString(__props.text), 1)
|
|
2516
2516
|
])
|
|
@@ -2518,7 +2518,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2518
2518
|
};
|
|
2519
2519
|
}
|
|
2520
2520
|
});
|
|
2521
|
-
const _sfc_main$
|
|
2521
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
2522
2522
|
...{
|
|
2523
2523
|
name: "CkRegenerateMessageButton"
|
|
2524
2524
|
},
|
|
@@ -2545,7 +2545,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
2545
2545
|
"delay-duration": 0
|
|
2546
2546
|
}, {
|
|
2547
2547
|
default: withCtx(() => [
|
|
2548
|
-
createVNode(unref(_sfc_main$
|
|
2548
|
+
createVNode(unref(_sfc_main$n), mergeProps({ ariaLabel: __props.ariaLabel }, {
|
|
2549
2549
|
disabled: __props.disabled,
|
|
2550
2550
|
onClick: handleClick
|
|
2551
2551
|
}), {
|
|
@@ -2564,9 +2564,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
2564
2564
|
};
|
|
2565
2565
|
}
|
|
2566
2566
|
});
|
|
2567
|
-
const _hoisted_1$
|
|
2568
|
-
const _hoisted_2 = ["aria-expanded"];
|
|
2569
|
-
const _sfc_main$
|
|
2567
|
+
const _hoisted_1$3 = { class: "inline-flex max-w-[536px] flex-col items-end justify-start gap-1" };
|
|
2568
|
+
const _hoisted_2$1 = ["aria-expanded"];
|
|
2569
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
2570
2570
|
...{ name: "CkUserMessage" },
|
|
2571
2571
|
__name: "CkUserMessage",
|
|
2572
2572
|
props: {
|
|
@@ -2611,7 +2611,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
2611
2611
|
nextTick(measure);
|
|
2612
2612
|
});
|
|
2613
2613
|
return (_ctx, _cache) => {
|
|
2614
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2614
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
2615
2615
|
createElementVNode("div", {
|
|
2616
2616
|
ref_key: "contentRef",
|
|
2617
2617
|
ref: contentRef,
|
|
@@ -2633,13 +2633,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
2633
2633
|
"aria-expanded": expanded.value,
|
|
2634
2634
|
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",
|
|
2635
2635
|
onClick: toggle
|
|
2636
|
-
}, toDisplayString(expanded.value ? showLessLabel.value : showMoreLabel.value), 9, _hoisted_2)) : createCommentVNode("", true)
|
|
2636
|
+
}, toDisplayString(expanded.value ? showLessLabel.value : showMoreLabel.value), 9, _hoisted_2$1)) : createCommentVNode("", true)
|
|
2637
2637
|
]);
|
|
2638
2638
|
};
|
|
2639
2639
|
}
|
|
2640
2640
|
});
|
|
2641
|
-
const CkUserMessage = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2642
|
-
const _sfc_main$
|
|
2641
|
+
const CkUserMessage = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-75aacd04"]]);
|
|
2642
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
2643
2643
|
...{ name: "CkEditableUserMessage" },
|
|
2644
2644
|
__name: "CkEditableUserMessage",
|
|
2645
2645
|
props: {
|
|
@@ -2700,8 +2700,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2700
2700
|
};
|
|
2701
2701
|
}
|
|
2702
2702
|
});
|
|
2703
|
-
const _hoisted_1$
|
|
2704
|
-
const _sfc_main$
|
|
2703
|
+
const _hoisted_1$2 = ["aria-disabled"];
|
|
2704
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2705
2705
|
...{ name: "CkMilkdownEditor" },
|
|
2706
2706
|
__name: "CkMilkdownEditor",
|
|
2707
2707
|
props: {
|
|
@@ -2711,7 +2711,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2711
2711
|
disabled: { type: Boolean, default: false },
|
|
2712
2712
|
ariaLabel: { default: void 0 },
|
|
2713
2713
|
classes: { default: () => ({}) },
|
|
2714
|
-
autofocus: { type: Boolean, default: false }
|
|
2714
|
+
autofocus: { type: Boolean, default: false },
|
|
2715
|
+
showLineNumbers: { type: Boolean, default: false }
|
|
2715
2716
|
},
|
|
2716
2717
|
emits: ["update:modelValue", "focus", "blur"],
|
|
2717
2718
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -2732,7 +2733,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2732
2733
|
onMounted(async () => {
|
|
2733
2734
|
const root = rootRef.value;
|
|
2734
2735
|
if (!root) return;
|
|
2735
|
-
const { createCrepeEditor } = await import("./createCrepeEditor-
|
|
2736
|
+
const { createCrepeEditor } = await import("./createCrepeEditor-Ci5FHHIV.js");
|
|
2736
2737
|
if (destroyed) return;
|
|
2737
2738
|
const initialMarkdown = props.modelValue;
|
|
2738
2739
|
lastKnownMarkdown = initialMarkdown;
|
|
@@ -2794,18 +2795,197 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2794
2795
|
ref_key: "rootRef",
|
|
2795
2796
|
ref: rootRef,
|
|
2796
2797
|
class: normalizeClass([
|
|
2797
|
-
"ck-milkdown min-w-0 break-words",
|
|
2798
|
+
"ck-milkdown ck-code-surface min-w-0 break-words",
|
|
2798
2799
|
isReady.value && "ck-milkdown--ready",
|
|
2799
|
-
__props.disabled && "ck-milkdown--disabled"
|
|
2800
|
+
__props.disabled && "ck-milkdown--disabled",
|
|
2801
|
+
__props.showLineNumbers && "ck-milkdown--line-numbers"
|
|
2800
2802
|
]),
|
|
2801
2803
|
"aria-disabled": __props.disabled || void 0,
|
|
2802
2804
|
onFocusin: onFocusIn,
|
|
2803
2805
|
onFocusout: onFocusOut
|
|
2804
|
-
}, null, 42, _hoisted_1$
|
|
2806
|
+
}, null, 42, _hoisted_1$2);
|
|
2807
|
+
};
|
|
2808
|
+
}
|
|
2809
|
+
});
|
|
2810
|
+
const CkMilkdownEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-d1a2a9cf"]]);
|
|
2811
|
+
const _hoisted_1$1 = ["aria-disabled"];
|
|
2812
|
+
const _hoisted_2 = {
|
|
2813
|
+
key: 0,
|
|
2814
|
+
class: "border-border-surface-default bg-background-surface-muted flex items-center justify-between border-b px-4 py-2"
|
|
2815
|
+
};
|
|
2816
|
+
const _hoisted_3 = { class: "text-content-on-surface-secondary font-mono text-sm" };
|
|
2817
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
2818
|
+
...{ name: "CkCodeEditor" },
|
|
2819
|
+
__name: "CkCodeEditor",
|
|
2820
|
+
props: {
|
|
2821
|
+
modelValue: { default: "" },
|
|
2822
|
+
language: { default: "text" },
|
|
2823
|
+
filename: { default: void 0 },
|
|
2824
|
+
placeholder: { default: void 0 },
|
|
2825
|
+
readonly: { type: Boolean, default: false },
|
|
2826
|
+
disabled: { type: Boolean, default: false },
|
|
2827
|
+
ariaLabel: { default: void 0 },
|
|
2828
|
+
showHeader: { type: Boolean, default: true },
|
|
2829
|
+
showCopyButton: { type: Boolean, default: true },
|
|
2830
|
+
showLineNumbers: { type: Boolean, default: true },
|
|
2831
|
+
lineWrapping: { type: Boolean, default: false },
|
|
2832
|
+
maxHeight: { default: void 0 },
|
|
2833
|
+
autofocus: { type: Boolean, default: false },
|
|
2834
|
+
writeToClipboard: { type: Function, default: void 0 }
|
|
2835
|
+
},
|
|
2836
|
+
emits: ["update:modelValue", "focus", "blur", "copy"],
|
|
2837
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2838
|
+
const props = __props;
|
|
2839
|
+
const emit = __emit;
|
|
2840
|
+
const labels = useChatKitLabels();
|
|
2841
|
+
const rootRef = useTemplateRef("rootRef");
|
|
2842
|
+
const hostRef = useTemplateRef("hostRef");
|
|
2843
|
+
const isLocked = computed(() => props.readonly || props.disabled);
|
|
2844
|
+
const isReady = ref(false);
|
|
2845
|
+
const isCopied = ref(false);
|
|
2846
|
+
const headerLabel = computed(() => {
|
|
2847
|
+
const label = props.filename || props.language;
|
|
2848
|
+
return label === "text" ? "" : label;
|
|
2849
|
+
});
|
|
2850
|
+
const copyLabel = computed(
|
|
2851
|
+
() => isCopied.value ? labels.value.codeEditorCopied ?? "Copied" : labels.value.codeEditorCopy ?? "Copy code"
|
|
2852
|
+
);
|
|
2853
|
+
let editor;
|
|
2854
|
+
let destroyed = false;
|
|
2855
|
+
let lastKnownCode = props.modelValue;
|
|
2856
|
+
let copyTimer;
|
|
2857
|
+
function handleChange(value) {
|
|
2858
|
+
if (value === lastKnownCode) return;
|
|
2859
|
+
lastKnownCode = value;
|
|
2860
|
+
emit("update:modelValue", value);
|
|
2861
|
+
}
|
|
2862
|
+
onMounted(async () => {
|
|
2863
|
+
const parent = hostRef.value;
|
|
2864
|
+
if (!parent) return;
|
|
2865
|
+
const { createCodeMirror } = await import("./createCodeMirror-BkV6FEPn.js");
|
|
2866
|
+
if (destroyed) return;
|
|
2867
|
+
const initialCode = props.modelValue;
|
|
2868
|
+
lastKnownCode = initialCode;
|
|
2869
|
+
const handle = await createCodeMirror({
|
|
2870
|
+
parent,
|
|
2871
|
+
doc: initialCode,
|
|
2872
|
+
language: props.language,
|
|
2873
|
+
placeholder: props.placeholder,
|
|
2874
|
+
ariaLabel: props.ariaLabel,
|
|
2875
|
+
readonly: isLocked.value,
|
|
2876
|
+
showLineNumbers: props.showLineNumbers,
|
|
2877
|
+
lineWrapping: props.lineWrapping,
|
|
2878
|
+
onChange: handleChange,
|
|
2879
|
+
onFocus: () => emit("focus"),
|
|
2880
|
+
onBlur: () => emit("blur")
|
|
2881
|
+
});
|
|
2882
|
+
if (destroyed) {
|
|
2883
|
+
handle.destroy();
|
|
2884
|
+
return;
|
|
2885
|
+
}
|
|
2886
|
+
editor = handle;
|
|
2887
|
+
if (props.modelValue !== initialCode) handle.setCode(props.modelValue);
|
|
2888
|
+
isReady.value = true;
|
|
2889
|
+
if (props.autofocus) handle.focus();
|
|
2890
|
+
});
|
|
2891
|
+
watch(
|
|
2892
|
+
() => props.modelValue,
|
|
2893
|
+
(next) => {
|
|
2894
|
+
if (next === lastKnownCode) return;
|
|
2895
|
+
lastKnownCode = next;
|
|
2896
|
+
editor?.setCode(next);
|
|
2897
|
+
}
|
|
2898
|
+
);
|
|
2899
|
+
watch(
|
|
2900
|
+
() => props.language,
|
|
2901
|
+
(next) => {
|
|
2902
|
+
editor?.setLanguage(next).catch(() => void 0);
|
|
2903
|
+
}
|
|
2904
|
+
);
|
|
2905
|
+
watch(isLocked, (locked) => editor?.setReadonly(locked));
|
|
2906
|
+
watch(
|
|
2907
|
+
() => props.showLineNumbers,
|
|
2908
|
+
(show) => editor?.setShowLineNumbers(show)
|
|
2909
|
+
);
|
|
2910
|
+
watch(
|
|
2911
|
+
() => props.lineWrapping,
|
|
2912
|
+
(wrap) => editor?.setLineWrapping(wrap)
|
|
2913
|
+
);
|
|
2914
|
+
onBeforeUnmount(() => {
|
|
2915
|
+
destroyed = true;
|
|
2916
|
+
clearTimeout(copyTimer);
|
|
2917
|
+
editor?.destroy();
|
|
2918
|
+
editor = void 0;
|
|
2919
|
+
});
|
|
2920
|
+
async function handleCopy() {
|
|
2921
|
+
const write = props.writeToClipboard ?? ((text) => globalThis.navigator.clipboard.writeText(text));
|
|
2922
|
+
try {
|
|
2923
|
+
await write(getCode());
|
|
2924
|
+
isCopied.value = true;
|
|
2925
|
+
clearTimeout(copyTimer);
|
|
2926
|
+
copyTimer = setTimeout(() => {
|
|
2927
|
+
isCopied.value = false;
|
|
2928
|
+
}, 2e3);
|
|
2929
|
+
emit("copy", { success: true });
|
|
2930
|
+
} catch {
|
|
2931
|
+
emit("copy", { success: false });
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
function isInsideRoot(target) {
|
|
2935
|
+
return target instanceof Node && (rootRef.value?.contains(target) ?? false);
|
|
2936
|
+
}
|
|
2937
|
+
function onFocusOut(event) {
|
|
2938
|
+
if (!isInsideRoot(event.relatedTarget)) emit("blur");
|
|
2939
|
+
}
|
|
2940
|
+
function focus() {
|
|
2941
|
+
editor?.focus();
|
|
2942
|
+
}
|
|
2943
|
+
function getCode() {
|
|
2944
|
+
return editor?.getCode() ?? props.modelValue;
|
|
2945
|
+
}
|
|
2946
|
+
__expose({ focus, getCode });
|
|
2947
|
+
return (_ctx, _cache) => {
|
|
2948
|
+
return openBlock(), createElementBlock("div", {
|
|
2949
|
+
ref_key: "rootRef",
|
|
2950
|
+
ref: rootRef,
|
|
2951
|
+
class: normalizeClass([
|
|
2952
|
+
"ck-code-editor ck-code-surface border-border-surface-default min-w-0 overflow-hidden rounded-lg border",
|
|
2953
|
+
isReady.value && "ck-code-editor--ready",
|
|
2954
|
+
isLocked.value && "ck-code-editor--readonly",
|
|
2955
|
+
__props.disabled && "ck-code-editor--disabled"
|
|
2956
|
+
]),
|
|
2957
|
+
"aria-disabled": __props.disabled || void 0,
|
|
2958
|
+
onFocusout: onFocusOut
|
|
2959
|
+
}, [
|
|
2960
|
+
__props.showHeader ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
2961
|
+
createElementVNode("span", _hoisted_3, toDisplayString(headerLabel.value), 1),
|
|
2962
|
+
__props.showCopyButton ? (openBlock(), createBlock(unref(UiButton), {
|
|
2963
|
+
key: 0,
|
|
2964
|
+
variant: "ghost",
|
|
2965
|
+
size: "icon-sm",
|
|
2966
|
+
"aria-label": copyLabel.value,
|
|
2967
|
+
onClick: handleCopy
|
|
2968
|
+
}, {
|
|
2969
|
+
default: withCtx(() => [
|
|
2970
|
+
createVNode(unref(UiIcon), {
|
|
2971
|
+
name: isCopied.value ? "check" : "copy",
|
|
2972
|
+
size: 14
|
|
2973
|
+
}, null, 8, ["name"])
|
|
2974
|
+
]),
|
|
2975
|
+
_: 1
|
|
2976
|
+
}, 8, ["aria-label"])) : createCommentVNode("", true)
|
|
2977
|
+
])) : createCommentVNode("", true),
|
|
2978
|
+
createElementVNode("div", {
|
|
2979
|
+
ref_key: "hostRef",
|
|
2980
|
+
ref: hostRef,
|
|
2981
|
+
class: "ck-code-editor__host",
|
|
2982
|
+
style: normalizeStyle(__props.maxHeight ? { "--ck-code-max-height": __props.maxHeight } : void 0)
|
|
2983
|
+
}, null, 4)
|
|
2984
|
+
], 42, _hoisted_1$1);
|
|
2805
2985
|
};
|
|
2806
2986
|
}
|
|
2807
2987
|
});
|
|
2808
|
-
const
|
|
2988
|
+
const CkCodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-567251c3"]]);
|
|
2809
2989
|
const _hoisted_1 = {
|
|
2810
2990
|
key: 1,
|
|
2811
2991
|
class: "flex size-8 shrink-0 items-center justify-center rounded-2xl bg-background-surface-muted-subtle"
|
|
@@ -2856,7 +3036,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2856
3036
|
}
|
|
2857
3037
|
__expose({ scrollToMessage });
|
|
2858
3038
|
return (_ctx, _cache) => {
|
|
2859
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3039
|
+
return openBlock(), createBlock(_sfc_main$o, {
|
|
2860
3040
|
ref_key: "layoutRef",
|
|
2861
3041
|
ref: layoutRef,
|
|
2862
3042
|
messages: __props.messages
|
|
@@ -2879,7 +3059,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2879
3059
|
]),
|
|
2880
3060
|
"agent-message": withCtx(({ message }) => [
|
|
2881
3061
|
renderSlot(_ctx.$slots, "agent-message", { message }, () => [
|
|
2882
|
-
createVNode(_sfc_main$
|
|
3062
|
+
createVNode(_sfc_main$u, {
|
|
2883
3063
|
"bottom-separator": message.id !== lastAgentMessageId.value
|
|
2884
3064
|
}, createSlots({
|
|
2885
3065
|
footer: withCtx(() => [
|
|
@@ -2894,7 +3074,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2894
3074
|
]),
|
|
2895
3075
|
default: withCtx(() => [
|
|
2896
3076
|
renderSlot(_ctx.$slots, "agent-message-content", { message }, () => [
|
|
2897
|
-
createVNode(_sfc_main$
|
|
3077
|
+
createVNode(_sfc_main$i, {
|
|
2898
3078
|
content: getMessageText(message),
|
|
2899
3079
|
classes: __props.agentMarkdownClasses
|
|
2900
3080
|
}, {
|
|
@@ -2916,7 +3096,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2916
3096
|
name: "header",
|
|
2917
3097
|
fn: withCtx(() => [
|
|
2918
3098
|
renderSlot(_ctx.$slots, "agent-message-header", { message }, () => [
|
|
2919
|
-
createVNode(_sfc_main$
|
|
3099
|
+
createVNode(_sfc_main$t, null, createSlots({
|
|
2920
3100
|
default: withCtx(() => [
|
|
2921
3101
|
renderSlot(_ctx.$slots, "agent-message-header-content", { message })
|
|
2922
3102
|
]),
|
|
@@ -3050,7 +3230,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3050
3230
|
}
|
|
3051
3231
|
return (_ctx, _cache) => {
|
|
3052
3232
|
return openBlock(), createElementBlock("div", null, [
|
|
3053
|
-
createVNode(_sfc_main$
|
|
3233
|
+
createVNode(_sfc_main$d, {
|
|
3054
3234
|
class: normalizeClass([
|
|
3055
3235
|
isExpanded.value && props.maxHeight ? "overflow-y-auto" : void 0,
|
|
3056
3236
|
props.contentClass
|
|
@@ -3072,7 +3252,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3072
3252
|
edit: () => emit("edit", conversation),
|
|
3073
3253
|
delete: () => emit("delete", conversation)
|
|
3074
3254
|
}, () => [
|
|
3075
|
-
createVNode(_sfc_main$
|
|
3255
|
+
createVNode(_sfc_main$e, {
|
|
3076
3256
|
as: "a",
|
|
3077
3257
|
href: hrefFor(conversation),
|
|
3078
3258
|
"is-active": conversation.id === props.activeId,
|
|
@@ -3139,35 +3319,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3139
3319
|
}
|
|
3140
3320
|
});
|
|
3141
3321
|
export {
|
|
3142
|
-
_sfc_main$
|
|
3143
|
-
|
|
3322
|
+
_sfc_main$w as A,
|
|
3323
|
+
_sfc_main$v as B,
|
|
3144
3324
|
CkCitationLabel as C,
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
_sfc_main$
|
|
3148
|
-
_sfc_main$
|
|
3149
|
-
_sfc_main$
|
|
3150
|
-
_sfc_main$
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
_sfc_main as
|
|
3160
|
-
_sfc_main$
|
|
3161
|
-
_sfc_main
|
|
3162
|
-
_sfc_main$
|
|
3163
|
-
_sfc_main$
|
|
3164
|
-
|
|
3165
|
-
_sfc_main$
|
|
3166
|
-
|
|
3167
|
-
_sfc_main$
|
|
3168
|
-
|
|
3325
|
+
CkUserMessage as D,
|
|
3326
|
+
formatRelativeTime as E,
|
|
3327
|
+
_sfc_main$u as _,
|
|
3328
|
+
_sfc_main$t as a,
|
|
3329
|
+
_sfc_main$p as b,
|
|
3330
|
+
_sfc_main$r as c,
|
|
3331
|
+
CkCodeEditor as d,
|
|
3332
|
+
_sfc_main$1 as e,
|
|
3333
|
+
_sfc_main$o as f,
|
|
3334
|
+
CkCopyMessageButton as g,
|
|
3335
|
+
CkDropZoneOverlay as h,
|
|
3336
|
+
_sfc_main$4 as i,
|
|
3337
|
+
CkFeedbackButton as j,
|
|
3338
|
+
CkFeedbackDialog as k,
|
|
3339
|
+
_sfc_main$f as l,
|
|
3340
|
+
_sfc_main$s as m,
|
|
3341
|
+
_sfc_main as n,
|
|
3342
|
+
_sfc_main$e as o,
|
|
3343
|
+
_sfc_main$d as p,
|
|
3344
|
+
_sfc_main$i as q,
|
|
3345
|
+
_sfc_main$n as r,
|
|
3346
|
+
CkMilkdownEditor as s,
|
|
3347
|
+
_sfc_main$c as t,
|
|
3348
|
+
CkPromptInput as u,
|
|
3349
|
+
_sfc_main$7 as v,
|
|
3169
3350
|
_sfc_main$a as w,
|
|
3170
|
-
_sfc_main$
|
|
3171
|
-
_sfc_main$
|
|
3172
|
-
_sfc_main$
|
|
3351
|
+
_sfc_main$b as x,
|
|
3352
|
+
_sfc_main$9 as y,
|
|
3353
|
+
_sfc_main$6 as z
|
|
3173
3354
|
};
|