@aleph-alpha/chat-kit 0.0.1-alpha.28 → 0.2.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/{ChatInput.vue_vue_type_script_setup_true_lang-DVCUwptr.js → ChatInput.vue_vue_type_script_setup_true_lang-DaXHxshB.js} +159 -34
- package/dist/components/base/ChatConversationLayout/ChatConversationLayout.vue.d.ts +1 -0
- package/dist/components/base/ChatConversationLayout/ChatConversationLayout.vue.d.ts.map +1 -1
- package/dist/components/base/MarkdownRenderer/MarkdownRenderer.stories.d.ts +13 -0
- package/dist/components/base/MarkdownRenderer/MarkdownRenderer.stories.d.ts.map +1 -0
- package/dist/components/base/MarkdownRenderer/MarkdownRenderer.vue.d.ts +38 -0
- package/dist/components/base/MarkdownRenderer/MarkdownRenderer.vue.d.ts.map +1 -0
- package/dist/components/base/MarkdownRenderer/index.d.ts +3 -0
- package/dist/components/base/MarkdownRenderer/index.d.ts.map +1 -0
- package/dist/components/base/MarkdownRenderer/types.d.ts +36 -0
- package/dist/components/base/MarkdownRenderer/types.d.ts.map +1 -0
- package/dist/components/base/PromptActionButton/PromptActionButton.vue.d.ts +1 -1
- package/dist/components/base/PromptActionButton/PromptActionButton.vue.d.ts.map +1 -1
- package/dist/components/base/UserMessage/UserMessage.vue.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/composed/ChatConversation/ChatConversation.stories.d.ts +2 -0
- package/dist/components/composed/ChatConversation/ChatConversation.stories.d.ts.map +1 -1
- package/dist/components/composed/ChatConversation/ChatConversation.vue.d.ts +10 -0
- package/dist/components/composed/ChatConversation/ChatConversation.vue.d.ts.map +1 -1
- package/dist/components/composed/ChatConversation/defaultAgentMarkdownClasses.d.ts +3 -0
- package/dist/components/composed/ChatConversation/defaultAgentMarkdownClasses.d.ts.map +1 -0
- package/dist/components/composed/ChatConversation/types.d.ts +5 -0
- package/dist/components/composed/ChatConversation/types.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 +6 -5
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/index.js +3 -2
- package/dist/composables/useChatKitLabels.d.ts +20 -8
- package/dist/composables/useChatKitLabels.d.ts.map +1 -1
- package/dist/composables/useMarkdownParser.d.ts +6 -0
- package/dist/composables/useMarkdownParser.d.ts.map +1 -0
- package/dist/handlers/index.js +1 -1
- package/dist/handlers/useMessageHandler.d.ts +1 -0
- package/dist/handlers/useMessageHandler.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/test-utils/createTextPlugin.d.ts +2 -0
- package/dist/test-utils/createTextPlugin.d.ts.map +1 -0
- package/dist/useChatKitLabels-xZXcnxZZ.js +13740 -0
- package/dist/{useMessageHandler-BdcOcw0w.js → useMessageHandler-Db-ywEa6.js} +15 -6
- package/package.json +22 -12
- package/dist/useChatKitLabels-Bi0szl2l.js +0 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createElementBlock,
|
|
2
|
-
import { u as useChatKitLabels } from "./useChatKitLabels-
|
|
3
|
-
import { UiIconButton, UiAvatar, UiAvatarImage, UiAvatarFallback } from "@aleph-alpha/ui-library";
|
|
1
|
+
import { openBlock, createElementBlock, renderSlot, createCommentVNode, createElementVNode, defineComponent, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, toRefs, computed, h, createBlock, unref, mergeProps, withCtx, useId, useTemplateRef, withModifiers, toDisplayString, createTextVNode, useSlots, createVNode, createSlots, normalizeProps, guardReactiveProps, normalizeClass } from "vue";
|
|
2
|
+
import { a as useMarkdownParser, u as useChatKitLabels } from "./useChatKitLabels-xZXcnxZZ.js";
|
|
3
|
+
import { UiIconButton, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback } from "@aleph-alpha/ui-library";
|
|
4
4
|
const _export_sfc = (sfc, props) => {
|
|
5
5
|
const target = sfc.__vccOpts || sfc;
|
|
6
6
|
for (const [key, val] of props) {
|
|
@@ -8,7 +8,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
8
8
|
}
|
|
9
9
|
return target;
|
|
10
10
|
};
|
|
11
|
-
const _sfc_main$
|
|
11
|
+
const _sfc_main$9 = {};
|
|
12
12
|
const _hoisted_1$5 = { class: "flex w-full items-start gap-2" };
|
|
13
13
|
const _hoisted_2$3 = {
|
|
14
14
|
key: 0,
|
|
@@ -41,7 +41,7 @@ function _sfc_render$1(_ctx, _cache) {
|
|
|
41
41
|
])
|
|
42
42
|
]);
|
|
43
43
|
}
|
|
44
|
-
const AgentMessage = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
44
|
+
const AgentMessage = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$1]]);
|
|
45
45
|
const _hoisted_1$4 = ["data-message-row"];
|
|
46
46
|
const _hoisted_2$2 = {
|
|
47
47
|
key: 0,
|
|
@@ -51,7 +51,7 @@ const _hoisted_3$1 = {
|
|
|
51
51
|
key: 1,
|
|
52
52
|
class: "flex justify-start"
|
|
53
53
|
};
|
|
54
|
-
const _sfc_main$
|
|
54
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
55
55
|
__name: "ChatConversationLayout",
|
|
56
56
|
props: {
|
|
57
57
|
messages: {}
|
|
@@ -61,6 +61,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
const scrollContainerRef = ref(null);
|
|
62
62
|
const containerHeight = ref(0);
|
|
63
63
|
const isAutoScrollEnabled = ref(true);
|
|
64
|
+
const isProgrammaticScroll = ref(false);
|
|
64
65
|
const hasBottomSpacer = ref(false);
|
|
65
66
|
const spacerHeight = ref(0);
|
|
66
67
|
let resizeObserver = null;
|
|
@@ -90,9 +91,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
90
91
|
if (!lastRow) return true;
|
|
91
92
|
const lastRowBottom = lastRow.offsetTop + lastRow.offsetHeight;
|
|
92
93
|
const viewportBottom = container.scrollTop + container.clientHeight;
|
|
93
|
-
return viewportBottom >= lastRowBottom -
|
|
94
|
+
return viewportBottom >= lastRowBottom - 5;
|
|
94
95
|
}
|
|
95
96
|
function handleScroll() {
|
|
97
|
+
if (isProgrammaticScroll.value) return;
|
|
96
98
|
isAutoScrollEnabled.value = isFollowingContent();
|
|
97
99
|
}
|
|
98
100
|
function updateSpacerHeight() {
|
|
@@ -116,7 +118,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
116
118
|
const lastUserTop = lastUserRow.offsetTop;
|
|
117
119
|
const lastRowBottom = lastRow.offsetTop + lastRow.offsetHeight;
|
|
118
120
|
const contentFromUserToEnd = lastRowBottom - lastUserTop;
|
|
119
|
-
|
|
121
|
+
const gap = parseFloat(getComputedStyle(container).rowGap) || 0;
|
|
122
|
+
spacerHeight.value = Math.max(0, containerHeight.value - contentFromUserToEnd - gap);
|
|
120
123
|
}
|
|
121
124
|
function scrollUserMessageToTop() {
|
|
122
125
|
const container = scrollContainerRef.value;
|
|
@@ -127,7 +130,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
127
130
|
const userRows = container.querySelectorAll('[data-message-row="user"]');
|
|
128
131
|
const lastUserRow = userRows[userRows.length - 1];
|
|
129
132
|
if (lastUserRow) {
|
|
133
|
+
isProgrammaticScroll.value = true;
|
|
130
134
|
lastUserRow.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
135
|
+
container.addEventListener(
|
|
136
|
+
"scrollend",
|
|
137
|
+
() => {
|
|
138
|
+
isProgrammaticScroll.value = false;
|
|
139
|
+
},
|
|
140
|
+
{ once: true }
|
|
141
|
+
);
|
|
131
142
|
}
|
|
132
143
|
isAutoScrollEnabled.value = true;
|
|
133
144
|
});
|
|
@@ -141,7 +152,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
141
152
|
const lastRowBottom = lastRow.offsetTop + lastRow.offsetHeight;
|
|
142
153
|
const viewportBottom = container.scrollTop + container.clientHeight;
|
|
143
154
|
if (lastRowBottom > viewportBottom) {
|
|
155
|
+
isProgrammaticScroll.value = true;
|
|
144
156
|
container.scrollTop = lastRowBottom - container.clientHeight;
|
|
157
|
+
requestAnimationFrame(() => {
|
|
158
|
+
isProgrammaticScroll.value = false;
|
|
159
|
+
});
|
|
145
160
|
}
|
|
146
161
|
}
|
|
147
162
|
watch(
|
|
@@ -177,9 +192,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
177
192
|
class: "flex flex-col gap-4 overflow-y-auto",
|
|
178
193
|
onScroll: handleScroll
|
|
179
194
|
}, [
|
|
180
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.messages, (message
|
|
195
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.messages, (message) => {
|
|
181
196
|
return openBlock(), createElementBlock("div", {
|
|
182
|
-
key:
|
|
197
|
+
key: message.id,
|
|
183
198
|
"data-message-row": message.role
|
|
184
199
|
}, [
|
|
185
200
|
message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
@@ -198,6 +213,53 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
198
213
|
};
|
|
199
214
|
}
|
|
200
215
|
});
|
|
216
|
+
function domToVNode(node, slots, classes) {
|
|
217
|
+
if (node.nodeType === Node.TEXT_NODE) return node.textContent;
|
|
218
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return null;
|
|
219
|
+
const el = node;
|
|
220
|
+
if (el.tagName === "PRE" && el.firstElementChild?.tagName === "CODE") {
|
|
221
|
+
const codeEl = el.firstElementChild;
|
|
222
|
+
const language = codeEl.className?.match(/language-(\S+)/)?.[1] ?? "";
|
|
223
|
+
const code = codeEl.textContent ?? "";
|
|
224
|
+
if (slots["code-block"]) {
|
|
225
|
+
return slots["code-block"]({ code, language });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const children = Array.from(node.childNodes).map((child) => domToVNode(child, slots, classes)).filter((c) => c != null);
|
|
229
|
+
const attrs = {};
|
|
230
|
+
for (const attr of el.attributes) {
|
|
231
|
+
attrs[attr.name] = attr.value;
|
|
232
|
+
}
|
|
233
|
+
const tag = el.tagName.toLowerCase();
|
|
234
|
+
const customClass = classes[tag];
|
|
235
|
+
if (customClass) {
|
|
236
|
+
attrs.class = attrs.class ? `${attrs.class} ${customClass}` : customClass;
|
|
237
|
+
}
|
|
238
|
+
return h(tag, attrs, children);
|
|
239
|
+
}
|
|
240
|
+
const _sfc_main$7 = defineComponent({
|
|
241
|
+
name: "MarkdownRenderer",
|
|
242
|
+
props: {
|
|
243
|
+
content: { type: String, required: true },
|
|
244
|
+
classes: { type: Object, default: () => ({}) },
|
|
245
|
+
plugins: { type: Array, default: void 0 }
|
|
246
|
+
},
|
|
247
|
+
setup(props, { slots }) {
|
|
248
|
+
const { content, plugins } = toRefs(props);
|
|
249
|
+
const { html } = useMarkdownParser(content, plugins);
|
|
250
|
+
const parsedNodes = computed(() => {
|
|
251
|
+
const raw = html.value;
|
|
252
|
+
if (!raw) return [];
|
|
253
|
+
const doc = new DOMParser().parseFromString(raw, "text/html");
|
|
254
|
+
return Array.from(doc.body.childNodes);
|
|
255
|
+
});
|
|
256
|
+
return () => {
|
|
257
|
+
const elementClasses = props.classes ?? {};
|
|
258
|
+
const children = parsedNodes.value.map((node) => domToVNode(node, slots, elementClasses)).filter((c) => c != null);
|
|
259
|
+
return h("div", { class: "markdown-renderer" }, children);
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
});
|
|
201
263
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
202
264
|
__name: "PromptActionButton",
|
|
203
265
|
props: {
|
|
@@ -339,8 +401,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
339
401
|
};
|
|
340
402
|
}
|
|
341
403
|
});
|
|
342
|
-
const _hoisted_1$1 = { class: "bg-background-surface-
|
|
343
|
-
const _hoisted_2 = { class: "text-
|
|
404
|
+
const _hoisted_1$1 = { class: "bg-background-surface-primary inline-flex max-w-[600px] flex-col items-end justify-start gap-4 rounded-xl p-6" };
|
|
405
|
+
const _hoisted_2 = { class: "text-content-on-surface-primary justify-start self-stretch text-base leading-6 font-normal" };
|
|
344
406
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
345
407
|
__name: "UserMessage",
|
|
346
408
|
props: {
|
|
@@ -358,42 +420,81 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
358
420
|
};
|
|
359
421
|
}
|
|
360
422
|
});
|
|
423
|
+
const defaultAgentMarkdownClasses = {
|
|
424
|
+
p: "my-1 leading-7",
|
|
425
|
+
a: "underline underline-offset-4",
|
|
426
|
+
h1: "mt-4 mb-2 text-2xl font-bold",
|
|
427
|
+
h2: "mt-3 mb-2 text-xl font-semibold",
|
|
428
|
+
h3: "mt-3 mb-1 text-lg font-semibold",
|
|
429
|
+
ul: "my-1 ml-6 list-disc",
|
|
430
|
+
ol: "my-1 ml-6 list-decimal",
|
|
431
|
+
li: "my-0.5",
|
|
432
|
+
pre: "my-2 overflow-x-auto rounded-lg p-4",
|
|
433
|
+
code: "rounded px-1.5 py-0.5",
|
|
434
|
+
blockquote: "my-2 border-l-2 pl-4 italic",
|
|
435
|
+
table: "my-2 w-full border-collapse",
|
|
436
|
+
th: "border p-2 text-left font-semibold",
|
|
437
|
+
td: "border p-2",
|
|
438
|
+
hr: "my-4"
|
|
439
|
+
};
|
|
361
440
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
362
441
|
__name: "ChatConversation",
|
|
363
442
|
props: {
|
|
364
443
|
messages: {},
|
|
365
444
|
agentAvatarImage: { default: "" },
|
|
366
|
-
agentAvatarFallback: { default: "" }
|
|
445
|
+
agentAvatarFallback: { default: "" },
|
|
446
|
+
agentLoadingImage: { default: "" },
|
|
447
|
+
agentMarkdownClasses: {}
|
|
367
448
|
},
|
|
368
449
|
setup(__props) {
|
|
369
450
|
const props = __props;
|
|
451
|
+
const mergedMarkdownClasses = computed(() => ({
|
|
452
|
+
...defaultAgentMarkdownClasses,
|
|
453
|
+
...props.agentMarkdownClasses
|
|
454
|
+
}));
|
|
370
455
|
const slots = useSlots();
|
|
371
456
|
const labels = useChatKitLabels();
|
|
372
457
|
const hasIcon = computed(
|
|
373
458
|
() => Boolean(props.agentAvatarImage) || Boolean(props.agentAvatarFallback) || Boolean(slots["agent-message-icon"])
|
|
374
459
|
);
|
|
460
|
+
const isLoading = (message) => message.status === "started" || message.status === "sending";
|
|
375
461
|
return (_ctx, _cache) => {
|
|
376
|
-
return openBlock(), createBlock(_sfc_main$
|
|
462
|
+
return openBlock(), createBlock(_sfc_main$8, { messages: __props.messages }, {
|
|
377
463
|
"user-message": withCtx(({ message }) => [
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
},
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
464
|
+
createElementVNode("div", {
|
|
465
|
+
class: normalizeClass({ "ml-8": hasIcon.value })
|
|
466
|
+
}, [
|
|
467
|
+
renderSlot(_ctx.$slots, "user-message", { message }, () => [
|
|
468
|
+
createVNode(_sfc_main$3, {
|
|
469
|
+
message: message.content
|
|
470
|
+
}, {
|
|
471
|
+
default: withCtx(() => [
|
|
472
|
+
renderSlot(_ctx.$slots, "user-message-content", { message }, () => [
|
|
473
|
+
createTextVNode(toDisplayString(message.content), 1)
|
|
474
|
+
])
|
|
475
|
+
]),
|
|
476
|
+
_: 2
|
|
477
|
+
}, 1032, ["message"])
|
|
478
|
+
])
|
|
479
|
+
], 2)
|
|
390
480
|
]),
|
|
391
481
|
"agent-message": withCtx(({ message }) => [
|
|
392
482
|
renderSlot(_ctx.$slots, "agent-message", { message }, () => [
|
|
393
483
|
createVNode(AgentMessage, null, createSlots({
|
|
394
484
|
default: withCtx(() => [
|
|
395
485
|
renderSlot(_ctx.$slots, "agent-message-content", { message }, () => [
|
|
396
|
-
|
|
486
|
+
createVNode(_sfc_main$7, {
|
|
487
|
+
content: message.content,
|
|
488
|
+
classes: mergedMarkdownClasses.value
|
|
489
|
+
}, createSlots({ _: 2 }, [
|
|
490
|
+
_ctx.$slots["agent-message-code-block"] ? {
|
|
491
|
+
name: "code-block",
|
|
492
|
+
fn: withCtx((codeBlockProps) => [
|
|
493
|
+
renderSlot(_ctx.$slots, "agent-message-code-block", normalizeProps(guardReactiveProps(codeBlockProps)))
|
|
494
|
+
]),
|
|
495
|
+
key: "0"
|
|
496
|
+
} : void 0
|
|
497
|
+
]), 1032, ["content", "classes"])
|
|
397
498
|
])
|
|
398
499
|
]),
|
|
399
500
|
_: 2
|
|
@@ -401,8 +502,31 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
401
502
|
hasIcon.value ? {
|
|
402
503
|
name: "icon",
|
|
403
504
|
fn: withCtx(() => [
|
|
404
|
-
renderSlot(_ctx.$slots, "agent-message-icon", {
|
|
405
|
-
|
|
505
|
+
isLoading(message) ? renderSlot(_ctx.$slots, "agent-message-loading-icon", {
|
|
506
|
+
key: 0,
|
|
507
|
+
message
|
|
508
|
+
}, () => [
|
|
509
|
+
__props.agentLoadingImage ? (openBlock(), createBlock(unref(UiAvatar), {
|
|
510
|
+
key: 0,
|
|
511
|
+
class: "size-6"
|
|
512
|
+
}, {
|
|
513
|
+
default: withCtx(() => [
|
|
514
|
+
createVNode(unref(UiAvatarImage), {
|
|
515
|
+
src: __props.agentLoadingImage,
|
|
516
|
+
alt: unref(labels).agentLoadingAvatarAlt
|
|
517
|
+
}, null, 8, ["src", "alt"])
|
|
518
|
+
]),
|
|
519
|
+
_: 1
|
|
520
|
+
})) : (openBlock(), createBlock(unref(UiSpinner), {
|
|
521
|
+
key: 1,
|
|
522
|
+
class: "size-6",
|
|
523
|
+
"aria-label": unref(labels).agentLoadingAvatarAlt
|
|
524
|
+
}, null, 8, ["aria-label"]))
|
|
525
|
+
]) : renderSlot(_ctx.$slots, "agent-message-icon", {
|
|
526
|
+
key: 1,
|
|
527
|
+
message
|
|
528
|
+
}, () => [
|
|
529
|
+
createVNode(unref(UiAvatar), { class: "size-6" }, {
|
|
406
530
|
default: withCtx(() => [
|
|
407
531
|
__props.agentAvatarImage ? (openBlock(), createBlock(unref(UiAvatarImage), {
|
|
408
532
|
key: 0,
|
|
@@ -545,10 +669,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
545
669
|
export {
|
|
546
670
|
AgentMessage as A,
|
|
547
671
|
_sfc_main$2 as _,
|
|
548
|
-
_sfc_main$
|
|
672
|
+
_sfc_main$8 as a,
|
|
549
673
|
_sfc_main as b,
|
|
550
|
-
_sfc_main$
|
|
551
|
-
_sfc_main$
|
|
552
|
-
_sfc_main$
|
|
553
|
-
_sfc_main$
|
|
674
|
+
_sfc_main$7 as c,
|
|
675
|
+
_sfc_main$6 as d,
|
|
676
|
+
_sfc_main$5 as e,
|
|
677
|
+
_sfc_main$4 as f,
|
|
678
|
+
_sfc_main$3 as g
|
|
554
679
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const __VLS_export: <T extends {
|
|
2
|
+
id: string;
|
|
2
3
|
role: string;
|
|
3
4
|
}>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
5
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatConversationLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/ChatConversationLayout/ChatConversationLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatConversationLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/ChatConversationLayout/ChatConversationLayout.vue"],"names":[],"mappings":"AA4ME,QAAA,MAAM,YAAY,GAAK,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAC9D,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WA6PO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB;kBA3PzC,CAAC,EAAE;MA2PyD,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC1I,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;wBAxPS,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;yBAC9B,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;;UAyP7C,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import MarkdownRenderer from './MarkdownRenderer.vue';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
3
|
+
declare const meta: Meta<typeof MarkdownRenderer>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithCodeBlocks: Story;
|
|
8
|
+
export declare const WithCustomCodeBlockSlot: Story;
|
|
9
|
+
export declare const ComplexMarkdown: Story;
|
|
10
|
+
export declare const WithCustomClasses: Story;
|
|
11
|
+
export declare const GfmFeatures: Story;
|
|
12
|
+
export declare const WithCustomPlugin: Story;
|
|
13
|
+
//# sourceMappingURL=MarkdownRenderer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/MarkdownRenderer/MarkdownRenderer.stories.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAUvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAqB5B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KA4BrC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAuC7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAyC/B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA2BzB,CAAC;AAeF,eAAO,MAAM,gBAAgB,EAAE,KAiB9B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type PropType, type VNode } from 'vue';
|
|
2
|
+
import type { PluggableList } from 'unified';
|
|
3
|
+
import type { MarkdownElementClasses } from './types';
|
|
4
|
+
declare const _default: typeof __VLS_export;
|
|
5
|
+
export default _default;
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
|
+
content: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
classes: {
|
|
12
|
+
type: PropType<MarkdownElementClasses>;
|
|
13
|
+
default: () => {};
|
|
14
|
+
};
|
|
15
|
+
plugins: {
|
|
16
|
+
type: PropType<PluggableList>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
content: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
classes: {
|
|
27
|
+
type: PropType<MarkdownElementClasses>;
|
|
28
|
+
default: () => {};
|
|
29
|
+
};
|
|
30
|
+
plugins: {
|
|
31
|
+
type: PropType<PluggableList>;
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
|
+
}>> & Readonly<{}>, {
|
|
35
|
+
classes: MarkdownElementClasses;
|
|
36
|
+
plugins: PluggableList;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
//# sourceMappingURL=MarkdownRenderer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/MarkdownRenderer/MarkdownRenderer.vue"],"names":[],"mappings":"AA2EE,OAAO,EAAwC,KAAK,QAAQ,EAAc,KAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AAClG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;wBAwCjC,OAAO,YAAY;AAAxC,wBAAyC;AAQ3C,QAAA,MAAM,YAAY;;;;;;cAIe,QAAQ,CAAC,sBAAsB,CAAC;;;;cACjC,QAAQ,CAAC,aAAa,CAAC;;;;;;;;;;;cADtB,QAAQ,CAAC,sBAAsB,CAAC;;;;cACjC,QAAQ,CAAC,aAAa,CAAC;;;;;;4EAqBnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/base/MarkdownRenderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PluggableList } from 'unified';
|
|
2
|
+
export interface MarkdownElementClasses {
|
|
3
|
+
h1?: string;
|
|
4
|
+
h2?: string;
|
|
5
|
+
h3?: string;
|
|
6
|
+
h4?: string;
|
|
7
|
+
h5?: string;
|
|
8
|
+
h6?: string;
|
|
9
|
+
p?: string;
|
|
10
|
+
a?: string;
|
|
11
|
+
img?: string;
|
|
12
|
+
strong?: string;
|
|
13
|
+
em?: string;
|
|
14
|
+
del?: string;
|
|
15
|
+
blockquote?: string;
|
|
16
|
+
ul?: string;
|
|
17
|
+
ol?: string;
|
|
18
|
+
li?: string;
|
|
19
|
+
pre?: string;
|
|
20
|
+
code?: string;
|
|
21
|
+
hr?: string;
|
|
22
|
+
br?: string;
|
|
23
|
+
table?: string;
|
|
24
|
+
thead?: string;
|
|
25
|
+
tbody?: string;
|
|
26
|
+
tr?: string;
|
|
27
|
+
th?: string;
|
|
28
|
+
td?: string;
|
|
29
|
+
input?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface MarkdownRendererProps {
|
|
32
|
+
content: string;
|
|
33
|
+
classes?: MarkdownElementClasses;
|
|
34
|
+
plugins?: PluggableList;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/MarkdownRenderer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB"}
|
|
@@ -9,9 +9,9 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
default?: (props: typeof __VLS_8) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
type: "button" | "submit";
|
|
12
13
|
disabled: boolean;
|
|
13
14
|
loading: boolean;
|
|
14
|
-
type: "button" | "submit";
|
|
15
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
17
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptActionButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/PromptActionButton/PromptActionButton.vue"],"names":[],"mappings":"AAkCE,KAAK,WAAW,GAAG;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC5B,CAAC;AA8DN,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"PromptActionButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/PromptActionButton/PromptActionButton.vue"],"names":[],"mappings":"AAkCE,KAAK,WAAW,GAAG;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC5B,CAAC;AA8DN,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU;UAtEH,QAAQ,GAAG,QAAQ;cAFf,OAAO;aACR,OAAO;6EA0ErB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMessage.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/UserMessage/UserMessage.vue"],"names":[],"mappings":"AAoBE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"UserMessage.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/UserMessage/UserMessage.vue"],"names":[],"mappings":"AAoBE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA2ClD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU,4SAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { AgentMessage } from './AgentMessage';
|
|
2
2
|
export { ChatConversationLayout } from './ChatConversationLayout';
|
|
3
3
|
export type { ChatConversationLayoutProps } from './ChatConversationLayout';
|
|
4
|
+
export { MarkdownRenderer } from './MarkdownRenderer';
|
|
5
|
+
export type { MarkdownRendererProps, MarkdownElementClasses } from './MarkdownRenderer';
|
|
4
6
|
export { PromptActionButton } from './PromptActionButton';
|
|
5
7
|
export { PromptInput } from './PromptInput';
|
|
6
8
|
export { PromptInputDisclaimer } from './PromptInputDisclaimer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -12,5 +12,7 @@ export declare const WithFooterActions: Story;
|
|
|
12
12
|
export declare const WithCustomUserContent: Story;
|
|
13
13
|
export declare const WithCustomAgentContent: Story;
|
|
14
14
|
export declare const StreamingSimulation: Story;
|
|
15
|
+
export declare const WithCustomMarkdownClasses: Story;
|
|
16
|
+
export declare const WithCustomCodeBlock: Story;
|
|
15
17
|
export declare const Empty: Story;
|
|
16
18
|
//# sourceMappingURL=ChatConversation.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatConversation.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/ChatConversation/ChatConversation.stories.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatConversation.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/ChatConversation/ChatConversation.stories.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AA8D3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAUvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAStC,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAQpB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAc5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAiB/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAcnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAcpC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAkEjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAgBvC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KA+CjC,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC"}
|
|
@@ -17,6 +17,10 @@ type __VLS_Slots = {
|
|
|
17
17
|
'agent-message-icon': (props: {
|
|
18
18
|
message: BaseMessage;
|
|
19
19
|
}) => void;
|
|
20
|
+
/** Replace the agent loading icon shown while a message is being generated */
|
|
21
|
+
'agent-message-loading-icon': (props: {
|
|
22
|
+
message: BaseMessage;
|
|
23
|
+
}) => void;
|
|
20
24
|
/** Replace the agent message header */
|
|
21
25
|
'agent-message-header': (props: {
|
|
22
26
|
message: BaseMessage;
|
|
@@ -29,10 +33,16 @@ type __VLS_Slots = {
|
|
|
29
33
|
'agent-message-footer': (props: {
|
|
30
34
|
message: BaseMessage;
|
|
31
35
|
}) => void;
|
|
36
|
+
/** Replace the default code block rendering inside agent markdown */
|
|
37
|
+
'agent-message-code-block': (props: {
|
|
38
|
+
code: string;
|
|
39
|
+
language: string;
|
|
40
|
+
}) => void;
|
|
32
41
|
};
|
|
33
42
|
declare const __VLS_base: import("vue").DefineComponent<ChatConversationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ChatConversationProps> & Readonly<{}>, {
|
|
34
43
|
agentAvatarImage: string;
|
|
35
44
|
agentAvatarFallback: string;
|
|
45
|
+
agentLoadingImage: string;
|
|
36
46
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
47
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
38
48
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatConversation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/ChatConversation/ChatConversation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatConversation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/ChatConversation/ChatConversation.vue"],"names":[],"mappings":"AA6HE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMlD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAgBrD,KAAK,WAAW,GAAG;IACjB,gDAAgD;IAChD,cAAc,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1D,yDAAyD;IACzD,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAClE,iDAAiD;IACjD,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3D,oCAAoC;IACpC,oBAAoB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAChE,8EAA8E;IAC9E,4BAA4B,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IACxE,uCAAuC;IACvC,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAClE,qCAAqC;IACrC,uBAAuB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE,mDAAmD;IACnD,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAClE,qEAAqE;IACrE,0BAA0B,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACjF,CAAC;AAyQJ,QAAA,MAAM,UAAU;;;;6EAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultAgentMarkdownClasses.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/ChatConversation/defaultAgentMarkdownClasses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,eAAO,MAAM,2BAA2B,EAAE,sBAgBzC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BaseMessage } from '../../../types';
|
|
2
|
+
import type { MarkdownElementClasses } from '../../base/MarkdownRenderer';
|
|
2
3
|
/**
|
|
3
4
|
* Props for the ChatConversation component
|
|
4
5
|
*/
|
|
@@ -9,5 +10,9 @@ export interface ChatConversationProps {
|
|
|
9
10
|
agentAvatarImage?: string;
|
|
10
11
|
/** Fallback text shown inside the default agent avatar when no image is available */
|
|
11
12
|
agentAvatarFallback?: string;
|
|
13
|
+
/** URL of the loading avatar image shown while a message is being generated */
|
|
14
|
+
agentLoadingImage?: string;
|
|
15
|
+
/** Override default CSS classes applied to markdown elements in agent messages */
|
|
16
|
+
agentMarkdownClasses?: MarkdownElementClasses;
|
|
12
17
|
}
|
|
13
18
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/ChatConversation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/ChatConversation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,sBAAsB,CAAC;CAC/C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { AgentMessage, ChatConversationLayout, PromptActionButton, PromptInput, PromptInputDisclaimer, UserMessage, } from './base';
|
|
2
|
-
export type { ChatConversationLayoutProps, UserMessageProps } from './base';
|
|
1
|
+
export { AgentMessage, ChatConversationLayout, MarkdownRenderer, PromptActionButton, PromptInput, PromptInputDisclaimer, UserMessage, } from './base';
|
|
2
|
+
export type { ChatConversationLayoutProps, MarkdownElementClasses, MarkdownRendererProps, UserMessageProps, } from './base';
|
|
3
3
|
export { ChatConversation, ChatInput } from './composed';
|
|
4
4
|
export type { ChatConversationProps } from './composed';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,WAAW,GACZ,MAAM,QAAQ,CAAC;AAChB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,WAAW,GACZ,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { A, _, a, b, c, d, e, f } from "../ChatInput.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { A, _, a, b, c, d, e, f, g } from "../ChatInput.vue_vue_type_script_setup_true_lang-DaXHxshB.js";
|
|
2
2
|
export {
|
|
3
3
|
A as AgentMessage,
|
|
4
4
|
_ as ChatConversation,
|
|
5
5
|
a as ChatConversationLayout,
|
|
6
6
|
b as ChatInput,
|
|
7
|
-
c as
|
|
8
|
-
d as
|
|
9
|
-
e as
|
|
10
|
-
f as
|
|
7
|
+
c as MarkdownRenderer,
|
|
8
|
+
d as PromptActionButton,
|
|
9
|
+
e as PromptInput,
|
|
10
|
+
f as PromptInputDisclaimer,
|
|
11
|
+
g as UserMessage
|
|
11
12
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { useChat } from './useChat';
|
|
2
|
+
export { useMarkdownParser } from './useMarkdownParser';
|
|
2
3
|
export { provideChatKitLabels, useChatKitLabels, defaultChatKitLabels, CHAT_KIT_LABELS, } from './useChatKitLabels';
|
|
3
4
|
export type { ChatKitLabels } from './useChatKitLabels';
|
|
4
5
|
export type { ChatActions, ChatState, UseChatReturn } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { u } from "../useChat-CtN_iBTc.js";
|
|
2
|
-
import { C, d, p, u as u2 } from "../useChatKitLabels-
|
|
2
|
+
import { C, d, p, u as u2, a } from "../useChatKitLabels-xZXcnxZZ.js";
|
|
3
3
|
export {
|
|
4
4
|
C as CHAT_KIT_LABELS,
|
|
5
5
|
d as defaultChatKitLabels,
|
|
6
6
|
p as provideChatKitLabels,
|
|
7
7
|
u as useChat,
|
|
8
|
-
u2 as useChatKitLabels
|
|
8
|
+
u2 as useChatKitLabels,
|
|
9
|
+
a as useMarkdownParser
|
|
9
10
|
};
|