@aleph-alpha/chat-kit 1.1.0 → 1.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/{CkInput.vue_vue_type_script_setup_true_lang-DpYyyCgU.js → CkInput.vue_vue_type_script_setup_true_lang-BoUxOQbH.js} +154 -39
- package/dist/chat-kit.css +18 -0
- package/dist/components/base/CkFeedbackButton/CkFeedbackButton.stories.d.ts +38 -0
- package/dist/components/base/CkFeedbackButton/CkFeedbackButton.stories.d.ts.map +1 -0
- package/dist/components/base/CkFeedbackButton/CkFeedbackButton.vue.d.ts +16 -0
- package/dist/components/base/CkFeedbackButton/CkFeedbackButton.vue.d.ts.map +1 -0
- package/dist/components/base/CkFeedbackButton/index.d.ts +3 -0
- package/dist/components/base/CkFeedbackButton/index.d.ts.map +1 -0
- package/dist/components/base/CkFeedbackButton/types.d.ts +60 -0
- package/dist/components/base/CkFeedbackButton/types.d.ts.map +1 -0
- package/dist/components/base/index.d.ts +2 -0
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/composed/CkConversation/CkConversation.stories.d.ts +4 -3
- package/dist/components/composed/CkConversation/CkConversation.stories.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 +15 -14
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/index.js +3 -2
- package/dist/composables/useConversationSessions.d.ts +29 -0
- package/dist/composables/useConversationSessions.d.ts.map +1 -0
- package/dist/handlers/index.js +2 -2
- package/dist/handlers/useChatKitLabels.d.ts +18 -0
- package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -19
- package/dist/purify.es-md74IFlY.js +1081 -0
- package/dist/{useChatKitLabels-Dvi2FmjE.js → useChatKitLabels-ftC52m7f.js} +78 -1152
- package/dist/{useConversations-Ca242D2P.js → useConversationSessions-ulFhtpQr.js} +50 -2
- package/dist/{useMessageHandler-uLHNac39.js → useMessageHandler-BmBdu2EW.js} +4 -1
- package/package.json +2 -2
- package/src/components/base/CkFeedbackButton/CkFeedbackButton.spec.ts +174 -0
- package/src/components/base/CkFeedbackButton/CkFeedbackButton.stories.ts +179 -0
- package/src/components/base/CkFeedbackButton/CkFeedbackButton.vue +157 -0
- package/src/components/base/CkFeedbackButton/index.ts +2 -0
- package/src/components/base/CkFeedbackButton/types.ts +61 -0
- package/src/components/base/index.ts +5 -0
- package/src/components/composed/CkConversation/CkConversation.stories.ts +46 -17
- package/src/components/index.ts +3 -0
- package/src/composables/index.ts +6 -0
- package/src/composables/useConversationSessions.spec.ts +86 -0
- package/src/composables/useConversationSessions.ts +85 -0
- package/src/handlers/useChatKitLabels.spec.ts +70 -50
- package/src/handlers/useChatKitLabels.ts +21 -0
- package/src/index.ts +11 -1
- package/dist/generateId-BHf0W4Rq.js +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString,
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, computed, normalizeClass, useAttrs, useSlots, withModifiers, resolveDynamicComponent, toRefs, h, useId, useTemplateRef, createTextVNode, createSlots, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-ftC52m7f.js";
|
|
3
3
|
import { UiButton, UiTooltip, UiIcon, Primitive, UiPopover, UiPopoverTrigger, UiPopoverContent, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
|
|
4
|
-
const _hoisted_1$
|
|
4
|
+
const _hoisted_1$9 = {
|
|
5
5
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6
6
|
width: "16",
|
|
7
7
|
height: "16",
|
|
@@ -12,31 +12,31 @@ const _hoisted_1$8 = {
|
|
|
12
12
|
"stroke-linecap": "round",
|
|
13
13
|
"stroke-linejoin": "round"
|
|
14
14
|
};
|
|
15
|
-
const _sfc_main$
|
|
15
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
16
16
|
...{ name: "CkSendIcon" },
|
|
17
17
|
__name: "CkSendIcon",
|
|
18
18
|
setup(__props) {
|
|
19
19
|
return (_ctx, _cache) => {
|
|
20
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
20
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._cache[0] || (_cache[0] = [
|
|
21
21
|
createElementVNode("path", { d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z" }, null, -1),
|
|
22
22
|
createElementVNode("path", { d: "M6 12h16" }, null, -1)
|
|
23
23
|
])]);
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
const _hoisted_1$
|
|
27
|
+
const _hoisted_1$8 = {
|
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
|
29
29
|
width: "16",
|
|
30
30
|
height: "16",
|
|
31
31
|
viewBox: "0 0 16 16",
|
|
32
32
|
fill: "none"
|
|
33
33
|
};
|
|
34
|
-
const _sfc_main$
|
|
34
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
35
35
|
...{ name: "CkStopIcon" },
|
|
36
36
|
__name: "CkStopIcon",
|
|
37
37
|
setup(__props) {
|
|
38
38
|
return (_ctx, _cache) => {
|
|
39
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
39
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$8, [..._cache[0] || (_cache[0] = [
|
|
40
40
|
createElementVNode("path", {
|
|
41
41
|
d: "M13.3335 3.33301C13.3335 2.96482 13.035 2.66634 12.6668 2.66634H3.3335C2.96531 2.66634 2.66683 2.96482 2.66683 3.33301V12.6663C2.66683 13.0345 2.96531 13.333 3.3335 13.333H12.6668C13.035 13.333 13.3335 13.0345 13.3335 12.6663V3.33301ZM14.6668 12.6663C14.6668 13.7709 13.7714 14.6663 12.6668 14.6663H3.3335C2.22893 14.6663 1.3335 13.7709 1.3335 12.6663V3.33301C1.3335 2.22844 2.22893 1.33301 3.3335 1.33301H12.6668C13.7714 1.33301 14.6668 2.22844 14.6668 3.33301V12.6663Z",
|
|
42
42
|
fill: "#1D1D1B"
|
|
@@ -45,7 +45,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
const _hoisted_1$
|
|
48
|
+
const _hoisted_1$7 = { class: "flex w-full items-start gap-2" };
|
|
49
49
|
const _hoisted_2$4 = {
|
|
50
50
|
key: 0,
|
|
51
51
|
class: "flex flex-shrink-0 items-center justify-center"
|
|
@@ -59,12 +59,12 @@ const _hoisted_5$2 = {
|
|
|
59
59
|
key: 1,
|
|
60
60
|
class: "flex items-center"
|
|
61
61
|
};
|
|
62
|
-
const _sfc_main$
|
|
62
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
63
63
|
...{ name: "CkAgentMessage" },
|
|
64
64
|
__name: "CkAgentMessage",
|
|
65
65
|
setup(__props) {
|
|
66
66
|
return (_ctx, _cache) => {
|
|
67
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
67
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
68
68
|
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
|
|
69
69
|
renderSlot(_ctx.$slots, "icon")
|
|
70
70
|
])) : createCommentVNode("", true),
|
|
@@ -83,7 +83,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
const _hoisted_1$
|
|
86
|
+
const _hoisted_1$6 = ["data-message-row"];
|
|
87
87
|
const _hoisted_2$3 = {
|
|
88
88
|
key: 0,
|
|
89
89
|
class: "flex justify-end"
|
|
@@ -92,7 +92,7 @@ const _hoisted_3$2 = {
|
|
|
92
92
|
key: 1,
|
|
93
93
|
class: "flex justify-start"
|
|
94
94
|
};
|
|
95
|
-
const _sfc_main$
|
|
95
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
96
96
|
...{ name: "CkConversationLayout" },
|
|
97
97
|
__name: "CkConversationLayout",
|
|
98
98
|
props: {
|
|
@@ -237,7 +237,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
237
237
|
])) : (openBlock(), createElementBlock("div", _hoisted_3$2, [
|
|
238
238
|
renderSlot(_ctx.$slots, "agent-message", { message })
|
|
239
239
|
]))
|
|
240
|
-
], 8, _hoisted_1$
|
|
240
|
+
], 8, _hoisted_1$6);
|
|
241
241
|
}), 128)),
|
|
242
242
|
hasBottomSpacer.value ? (openBlock(), createElementBlock("div", {
|
|
243
243
|
key: 0,
|
|
@@ -248,7 +248,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
});
|
|
251
|
-
const _sfc_main$
|
|
251
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
252
252
|
...{
|
|
253
253
|
name: "CkMessageActionButton"
|
|
254
254
|
},
|
|
@@ -272,11 +272,11 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
});
|
|
275
|
-
const _hoisted_1$
|
|
275
|
+
const _hoisted_1$5 = {
|
|
276
276
|
class: "sr-only",
|
|
277
277
|
"aria-live": "polite"
|
|
278
278
|
};
|
|
279
|
-
const _sfc_main$
|
|
279
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
280
280
|
...{
|
|
281
281
|
name: "CkCopyMessageActionButton"
|
|
282
282
|
},
|
|
@@ -333,7 +333,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
333
333
|
"delay-duration": 0
|
|
334
334
|
}, {
|
|
335
335
|
default: withCtx(() => [
|
|
336
|
-
createVNode(unref(_sfc_main$
|
|
336
|
+
createVNode(unref(_sfc_main$d), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
|
|
337
337
|
disabled: __props.disabled,
|
|
338
338
|
onClick: handleClick
|
|
339
339
|
}), {
|
|
@@ -360,7 +360,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
360
360
|
]),
|
|
361
361
|
_: 1
|
|
362
362
|
}, 16, ["disabled"]),
|
|
363
|
-
createElementVNode("span", _hoisted_1$
|
|
363
|
+
createElementVNode("span", _hoisted_1$5, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
|
|
364
364
|
]),
|
|
365
365
|
_: 1
|
|
366
366
|
}, 8, ["open", "content"]);
|
|
@@ -374,7 +374,121 @@ const _export_sfc = (sfc, props) => {
|
|
|
374
374
|
}
|
|
375
375
|
return target;
|
|
376
376
|
};
|
|
377
|
-
const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
377
|
+
const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-f77a1193"]]);
|
|
378
|
+
const _hoisted_1$4 = ["aria-label"];
|
|
379
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
380
|
+
...{
|
|
381
|
+
name: "CkFeedbackButton"
|
|
382
|
+
},
|
|
383
|
+
__name: "CkFeedbackButton",
|
|
384
|
+
props: {
|
|
385
|
+
value: { default: null },
|
|
386
|
+
locked: { type: Boolean, default: false },
|
|
387
|
+
disabled: { type: Boolean, default: false },
|
|
388
|
+
ariaLabelThumbsUp: { default: void 0 },
|
|
389
|
+
ariaLabelThumbsDown: { default: void 0 },
|
|
390
|
+
ariaLabelGroup: { default: void 0 }
|
|
391
|
+
},
|
|
392
|
+
emits: ["update:value"],
|
|
393
|
+
setup(__props, { emit: __emit }) {
|
|
394
|
+
const props = __props;
|
|
395
|
+
const emit = __emit;
|
|
396
|
+
const labels = useChatKitLabels();
|
|
397
|
+
const thumbsUpLabel = computed(
|
|
398
|
+
() => props.ariaLabelThumbsUp ?? labels.value.feedbackThumbsUp ?? defaultChatKitLabels.feedbackThumbsUp
|
|
399
|
+
);
|
|
400
|
+
const thumbsDownLabel = computed(
|
|
401
|
+
() => props.ariaLabelThumbsDown ?? labels.value.feedbackThumbsDown ?? defaultChatKitLabels.feedbackThumbsDown
|
|
402
|
+
);
|
|
403
|
+
const groupLabel = computed(
|
|
404
|
+
() => props.ariaLabelGroup ?? labels.value.feedbackGroup ?? defaultChatKitLabels.feedbackGroup
|
|
405
|
+
);
|
|
406
|
+
const isUpSelected = computed(() => props.value === "up");
|
|
407
|
+
const isDownSelected = computed(() => props.value === "down");
|
|
408
|
+
const isUpDisabled = computed(
|
|
409
|
+
() => props.disabled || props.locked && !isUpSelected.value
|
|
410
|
+
);
|
|
411
|
+
const isDownDisabled = computed(
|
|
412
|
+
() => props.disabled || props.locked && !isDownSelected.value
|
|
413
|
+
);
|
|
414
|
+
function handleClick(target) {
|
|
415
|
+
if (props.disabled || props.locked) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const isCurrentlySelected = target === "up" ? isUpSelected.value : isDownSelected.value;
|
|
419
|
+
emit("update:value", isCurrentlySelected ? null : target);
|
|
420
|
+
}
|
|
421
|
+
return (_ctx, _cache) => {
|
|
422
|
+
return openBlock(), createElementBlock("div", {
|
|
423
|
+
role: "group",
|
|
424
|
+
"aria-label": groupLabel.value,
|
|
425
|
+
class: "ck-feedback-button flex items-center gap-1"
|
|
426
|
+
}, [
|
|
427
|
+
createVNode(unref(UiTooltip), {
|
|
428
|
+
content: thumbsUpLabel.value,
|
|
429
|
+
side: "bottom",
|
|
430
|
+
align: "center",
|
|
431
|
+
"delay-duration": 0
|
|
432
|
+
}, {
|
|
433
|
+
default: withCtx(() => [
|
|
434
|
+
createVNode(unref(_sfc_main$d), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
|
|
435
|
+
"aria-pressed": isUpSelected.value,
|
|
436
|
+
"aria-disabled": __props.locked || void 0,
|
|
437
|
+
disabled: isUpDisabled.value,
|
|
438
|
+
class: [
|
|
439
|
+
"ck-feedback-button__thumb",
|
|
440
|
+
{ "ck-feedback-button__thumb--selected": isUpSelected.value }
|
|
441
|
+
],
|
|
442
|
+
onClick: _cache[0] || (_cache[0] = ($event) => handleClick("up"))
|
|
443
|
+
}), {
|
|
444
|
+
default: withCtx(() => [
|
|
445
|
+
createVNode(unref(UiIcon), {
|
|
446
|
+
name: "thumbs-up",
|
|
447
|
+
size: 16,
|
|
448
|
+
"aria-hidden": "true",
|
|
449
|
+
class: normalizeClass(isUpSelected.value ? "fill-current" : void 0)
|
|
450
|
+
}, null, 8, ["class"])
|
|
451
|
+
]),
|
|
452
|
+
_: 1
|
|
453
|
+
}, 16, ["aria-pressed", "aria-disabled", "disabled", "class"])
|
|
454
|
+
]),
|
|
455
|
+
_: 1
|
|
456
|
+
}, 8, ["content"]),
|
|
457
|
+
createVNode(unref(UiTooltip), {
|
|
458
|
+
content: thumbsDownLabel.value,
|
|
459
|
+
side: "bottom",
|
|
460
|
+
align: "center",
|
|
461
|
+
"delay-duration": 0
|
|
462
|
+
}, {
|
|
463
|
+
default: withCtx(() => [
|
|
464
|
+
createVNode(unref(_sfc_main$d), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
|
|
465
|
+
"aria-pressed": isDownSelected.value,
|
|
466
|
+
"aria-disabled": __props.locked || void 0,
|
|
467
|
+
disabled: isDownDisabled.value,
|
|
468
|
+
class: [
|
|
469
|
+
"ck-feedback-button__thumb",
|
|
470
|
+
{ "ck-feedback-button__thumb--selected": isDownSelected.value }
|
|
471
|
+
],
|
|
472
|
+
onClick: _cache[1] || (_cache[1] = ($event) => handleClick("down"))
|
|
473
|
+
}), {
|
|
474
|
+
default: withCtx(() => [
|
|
475
|
+
createVNode(unref(UiIcon), {
|
|
476
|
+
name: "thumbs-down",
|
|
477
|
+
size: 16,
|
|
478
|
+
"aria-hidden": "true",
|
|
479
|
+
class: normalizeClass(isDownSelected.value ? "fill-current" : void 0)
|
|
480
|
+
}, null, 8, ["class"])
|
|
481
|
+
]),
|
|
482
|
+
_: 1
|
|
483
|
+
}, 16, ["aria-pressed", "aria-disabled", "disabled", "class"])
|
|
484
|
+
]),
|
|
485
|
+
_: 1
|
|
486
|
+
}, 8, ["content"])
|
|
487
|
+
], 8, _hoisted_1$4);
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-c452d66c"]]);
|
|
378
492
|
const CHAT_HISTORY_ACTIVE_INDICATOR_CLASS = 'before:absolute before:z-10 before:top-1/2 before:left-0 before:h-1/2 before:w-0.5 before:-translate-y-1/2 before:origin-left before:scale-x-0 before:rounded-full before:bg-background-accent-default before:opacity-0 before:transition-[transform,opacity] before:duration-200 before:ease-linear before:content-[""] data-[active=true]:before:scale-x-100 data-[active=true]:before:opacity-100';
|
|
379
493
|
const _hoisted_1$3 = ["data-active"];
|
|
380
494
|
const _hoisted_2$2 = { class: "min-w-0 flex-1" };
|
|
@@ -949,7 +1063,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
949
1063
|
);
|
|
950
1064
|
const isLoading = (message) => message.status === "started" || message.status === "sending";
|
|
951
1065
|
return (_ctx, _cache) => {
|
|
952
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1066
|
+
return openBlock(), createBlock(_sfc_main$e, { messages: __props.messages }, {
|
|
953
1067
|
"user-message": withCtx(({ message }) => [
|
|
954
1068
|
createElementVNode("div", {
|
|
955
1069
|
class: normalizeClass({ "ml-8": hasIcon.value })
|
|
@@ -970,7 +1084,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
970
1084
|
]),
|
|
971
1085
|
"agent-message": withCtx(({ message }) => [
|
|
972
1086
|
renderSlot(_ctx.$slots, "agent-message", { message }, () => [
|
|
973
|
-
createVNode(_sfc_main$
|
|
1087
|
+
createVNode(_sfc_main$f, null, createSlots({
|
|
974
1088
|
footer: withCtx(() => [
|
|
975
1089
|
renderSlot(_ctx.$slots, "agent-message-footer", { message }, () => [
|
|
976
1090
|
message.content && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageActionButton, {
|
|
@@ -1213,7 +1327,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1213
1327
|
}, {
|
|
1214
1328
|
default: withCtx(() => [
|
|
1215
1329
|
renderSlot(_ctx.$slots, "stop-icon", {}, () => [
|
|
1216
|
-
createVNode(_sfc_main$
|
|
1330
|
+
createVNode(_sfc_main$g)
|
|
1217
1331
|
])
|
|
1218
1332
|
]),
|
|
1219
1333
|
_: 3
|
|
@@ -1223,7 +1337,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1223
1337
|
}), {
|
|
1224
1338
|
default: withCtx(() => [
|
|
1225
1339
|
renderSlot(_ctx.$slots, "send-icon", {}, () => [
|
|
1226
|
-
createVNode(_sfc_main$
|
|
1340
|
+
createVNode(_sfc_main$h)
|
|
1227
1341
|
])
|
|
1228
1342
|
]),
|
|
1229
1343
|
_: 3
|
|
@@ -1253,20 +1367,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1253
1367
|
});
|
|
1254
1368
|
export {
|
|
1255
1369
|
CkCopyMessageActionButton as C,
|
|
1256
|
-
_sfc_main$
|
|
1370
|
+
_sfc_main$f as _,
|
|
1257
1371
|
_sfc_main$2 as a,
|
|
1258
|
-
_sfc_main$
|
|
1259
|
-
|
|
1260
|
-
_sfc_main$
|
|
1261
|
-
_sfc_main$
|
|
1262
|
-
_sfc_main as f,
|
|
1263
|
-
_sfc_main
|
|
1264
|
-
_sfc_main$
|
|
1265
|
-
_sfc_main$
|
|
1266
|
-
_sfc_main$
|
|
1267
|
-
_sfc_main$
|
|
1268
|
-
_sfc_main$
|
|
1269
|
-
_sfc_main$
|
|
1270
|
-
_sfc_main$
|
|
1271
|
-
_sfc_main$
|
|
1372
|
+
_sfc_main$e as b,
|
|
1373
|
+
CkFeedbackButton as c,
|
|
1374
|
+
_sfc_main$1 as d,
|
|
1375
|
+
_sfc_main$a as e,
|
|
1376
|
+
_sfc_main$9 as f,
|
|
1377
|
+
_sfc_main as g,
|
|
1378
|
+
_sfc_main$8 as h,
|
|
1379
|
+
_sfc_main$d as i,
|
|
1380
|
+
_sfc_main$7 as j,
|
|
1381
|
+
_sfc_main$5 as k,
|
|
1382
|
+
_sfc_main$4 as l,
|
|
1383
|
+
_sfc_main$6 as m,
|
|
1384
|
+
_sfc_main$h as n,
|
|
1385
|
+
_sfc_main$g as o,
|
|
1386
|
+
_sfc_main$3 as p
|
|
1272
1387
|
};
|
package/dist/chat-kit.css
CHANGED
|
@@ -13,3 +13,21 @@
|
|
|
13
13
|
transition-duration: 0.01ms;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
.ck-feedback-button__thumb[data-v-c452d66c] button {
|
|
18
|
+
transition: background-color 0.15s ease-out;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Selected thumbs stay visually emphasised on top of the default ghost
|
|
22
|
+
variant: the filled icon (via `fill-current`) carries the primary
|
|
23
|
+
affordance; the tinted background reinforces it without competing with
|
|
24
|
+
neighbouring action buttons. The token matches `bg-core-bg-tertiary`
|
|
25
|
+
used elsewhere in chat-kit. */
|
|
26
|
+
.ck-feedback-button__thumb--selected[data-v-c452d66c] button {
|
|
27
|
+
background-color: var(--core-bg-tertiary);
|
|
28
|
+
}
|
|
29
|
+
@media (prefers-reduced-motion: reduce) {
|
|
30
|
+
.ck-feedback-button__thumb[data-v-c452d66c] button {
|
|
31
|
+
transition-duration: 0.01ms;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import CkFeedbackButton from './CkFeedbackButton.vue';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
3
|
+
declare const meta: Meta<typeof CkFeedbackButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
/**
|
|
7
|
+
* Default, idle state. Both thumbs are interactive and unfilled. Use this
|
|
8
|
+
* inside `CkConversation`'s `#agent-message-footer` slot to collect binary
|
|
9
|
+
* feedback on assistant replies.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
/**
|
|
13
|
+
* Thumbs-up is selected. The icon fills and the button shows a tinted
|
|
14
|
+
* background to mark the active choice. The host still receives
|
|
15
|
+
* `update:value` events; pass `locked` to make the choice final.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SelectedUp: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Thumbs-down is selected. Same affordance as `SelectedUp`, on the other
|
|
20
|
+
* thumb.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SelectedDown: Story;
|
|
23
|
+
/**
|
|
24
|
+
* Locked after submission. The chosen thumb stays filled; the other becomes
|
|
25
|
+
* non-interactive. Clicks no longer emit `update:value`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const Locked: Story;
|
|
28
|
+
/**
|
|
29
|
+
* Both thumbs disabled, for example while the assistant message is still
|
|
30
|
+
* streaming or after a network error.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Disabled: Story;
|
|
33
|
+
/**
|
|
34
|
+
* Realistic flow: the host listens for `update:value`, persists the choice,
|
|
35
|
+
* then sets `locked` to freeze the control. Click a thumb to see it lock.
|
|
36
|
+
*/
|
|
37
|
+
export declare const SubmitOnSelect: Story;
|
|
38
|
+
//# sourceMappingURL=CkFeedbackButton.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CkFeedbackButton.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackButton/CkFeedbackButton.stories.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AAEtD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CA+BvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqEnC;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,KAGxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAG1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAGpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAGtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAmB5B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CkFeedbackButtonProps, CkFeedbackValue } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<CkFeedbackButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
"update:value": (value: CkFeedbackValue) => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<CkFeedbackButtonProps> & Readonly<{
|
|
5
|
+
"onUpdate:value"?: ((value: CkFeedbackValue) => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
value: CkFeedbackValue;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
locked: boolean;
|
|
10
|
+
ariaLabelThumbsUp: string;
|
|
11
|
+
ariaLabelThumbsDown: string;
|
|
12
|
+
ariaLabelGroup: string;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=CkFeedbackButton.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CkFeedbackButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackButton/CkFeedbackButton.vue"],"names":[],"mappings":"AAqKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAyRtE,QAAA,MAAM,YAAY;;;;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Binary thumbs up / thumbs down feedback control for assistant messages.
|
|
3
|
+
* Fully prop-driven: the host application owns the selection and lock state
|
|
4
|
+
* and decides when (or if) to persist it to a backend.
|
|
5
|
+
*
|
|
6
|
+
* Labels default to those provided by `useChatKitLabels` (which can be
|
|
7
|
+
* translated via `provideChatKitLabels`). The `ariaLabel*` props override
|
|
8
|
+
* the injected labels on a per-instance basis when set.
|
|
9
|
+
*
|
|
10
|
+
* @category Feedback
|
|
11
|
+
* @useCases like or dislike an assistant reply, collect binary message rating, lock feedback after submission, rate AI response
|
|
12
|
+
* @keywords feedback, thumbs up, thumbs down, like, dislike, rating, vote, action, message, button
|
|
13
|
+
* @related CkMessageActionButton, CkCopyMessageActionButton, CkAgentMessage, CkConversation
|
|
14
|
+
*/
|
|
15
|
+
export type CkFeedbackValue = 'up' | 'down' | null;
|
|
16
|
+
export interface CkFeedbackButtonProps {
|
|
17
|
+
/**
|
|
18
|
+
* Currently selected feedback value. `null` means no choice has been made.
|
|
19
|
+
* @default null
|
|
20
|
+
*/
|
|
21
|
+
value?: CkFeedbackValue;
|
|
22
|
+
/**
|
|
23
|
+
* When `true`, the current `value` is final: clicks are ignored and the
|
|
24
|
+
* unselected thumb becomes non-interactive. Use after the host has
|
|
25
|
+
* persisted the user's choice.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
locked?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* When `true`, both thumbs are disabled regardless of `value`. Use while
|
|
31
|
+
* the parent message is still streaming or in an error state.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Overrides the injected `feedbackThumbsUp` label for the thumbs-up button.
|
|
37
|
+
* When omitted, falls back to `useChatKitLabels().feedbackThumbsUp`.
|
|
38
|
+
*/
|
|
39
|
+
ariaLabelThumbsUp?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Overrides the injected `feedbackThumbsDown` label for the thumbs-down
|
|
42
|
+
* button. When omitted, falls back to
|
|
43
|
+
* `useChatKitLabels().feedbackThumbsDown`.
|
|
44
|
+
*/
|
|
45
|
+
ariaLabelThumbsDown?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Overrides the injected `feedbackGroup` label for the surrounding group.
|
|
48
|
+
* When omitted, falls back to `useChatKitLabels().feedbackGroup`.
|
|
49
|
+
*/
|
|
50
|
+
ariaLabelGroup?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface CkFeedbackButtonEmits {
|
|
53
|
+
/**
|
|
54
|
+
* Emitted when the user clicks an enabled thumb. The payload is the new
|
|
55
|
+
* value: `'up'`, `'down'`, or `null` when toggling off the current choice.
|
|
56
|
+
* Not emitted while `locked` or `disabled`.
|
|
57
|
+
*/
|
|
58
|
+
(e: 'update:value', value: CkFeedbackValue): void;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackButton/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;AAEnD,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;CACnD"}
|
|
@@ -3,6 +3,8 @@ export { CkAgentMessage } from './CkAgentMessage';
|
|
|
3
3
|
export { CkConversationLayout } from './CkConversationLayout';
|
|
4
4
|
export type { CkConversationLayoutProps } from './CkConversationLayout';
|
|
5
5
|
export { CkCopyMessageActionButton } from './CkCopyMessageActionButton';
|
|
6
|
+
export { CkFeedbackButton } from './CkFeedbackButton';
|
|
7
|
+
export type { CkFeedbackButtonProps, CkFeedbackValue, } from './CkFeedbackButton';
|
|
6
8
|
export { CkHistoryItem } from './CkHistoryItem';
|
|
7
9
|
export type { CkHistoryItemProps, CkHistoryItemEmits } from './CkHistoryItem';
|
|
8
10
|
export { CkHistoryWrapper } from './CkHistoryWrapper';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -31,9 +31,10 @@ export declare const NoIcon: Story;
|
|
|
31
31
|
*/
|
|
32
32
|
export declare const WithCustomIcon: Story;
|
|
33
33
|
/**
|
|
34
|
-
* Overrides `#agent-message-footer` to add
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* Overrides `#agent-message-footer` to add real action buttons next to each
|
|
35
|
+
* assistant reply: `CkCopyMessageActionButton` for clipboard copy and
|
|
36
|
+
* `CkFeedbackButton` for binary thumbs up / thumbs down feedback. The
|
|
37
|
+
* feedback state is owned by the host and locked once submitted.
|
|
37
38
|
*/
|
|
38
39
|
export declare const WithFooterActions: Story;
|
|
39
40
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkConversation.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkConversation/CkConversation.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkConversation.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkConversation/CkConversation.stories.ts"],"names":[],"mappings":"AAIA,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AA8D3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAkCrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAiNnC;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAYtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KASpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,KAe5B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KA8B/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAiBnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAiBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAsFjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAmBvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAgDjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CkAgentMessage, CkConversationLayout, CkCopyMessageActionButton, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageActionButton, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './base';
|
|
2
|
-
export type { CkConversationLayoutProps, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkUserMessageProps, } from './base';
|
|
1
|
+
export { CkAgentMessage, CkConversationLayout, CkCopyMessageActionButton, CkFeedbackButton, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageActionButton, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './base';
|
|
2
|
+
export type { CkConversationLayoutProps, CkFeedbackButtonProps, CkFeedbackValue, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkUserMessageProps, } from './base';
|
|
3
3
|
export { CkConversation, CkHistory, CkInput } from './composed';
|
|
4
4
|
export type { CkConversationProps, CkHistoryEmits, CkHistoryProps, } 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,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { _, a, b, C, c, d, e, f, g, h, i, j, k, l, m, n, o } from "../CkInput.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _, a, b, C, c, d, e, f, g, h, i, j, k, l, m, n, o, p } from "../CkInput.vue_vue_type_script_setup_true_lang-BoUxOQbH.js";
|
|
2
2
|
export {
|
|
3
3
|
_ as CkAgentMessage,
|
|
4
4
|
a as CkConversation,
|
|
5
5
|
b as CkConversationLayout,
|
|
6
6
|
C as CkCopyMessageActionButton,
|
|
7
|
-
c as
|
|
8
|
-
d as
|
|
9
|
-
e as
|
|
10
|
-
f as
|
|
11
|
-
g as
|
|
12
|
-
h as
|
|
13
|
-
i as
|
|
14
|
-
j as
|
|
15
|
-
k as
|
|
16
|
-
l as
|
|
17
|
-
m as
|
|
18
|
-
n as
|
|
19
|
-
o as
|
|
7
|
+
c as CkFeedbackButton,
|
|
8
|
+
d as CkHistory,
|
|
9
|
+
e as CkHistoryItem,
|
|
10
|
+
f as CkHistoryWrapper,
|
|
11
|
+
g as CkInput,
|
|
12
|
+
h as CkMarkdownRenderer,
|
|
13
|
+
i as CkMessageActionButton,
|
|
14
|
+
j as CkPromptActionButton,
|
|
15
|
+
k as CkPromptInput,
|
|
16
|
+
l as CkPromptInputDisclaimer,
|
|
17
|
+
m as CkPromptStopButton,
|
|
18
|
+
n as CkSendIcon,
|
|
19
|
+
o as CkStopIcon,
|
|
20
|
+
p as CkUserMessage
|
|
20
21
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { useChat } from './useChat';
|
|
2
2
|
export { useConversations } from './useConversations';
|
|
3
3
|
export type { CreateConversationInput, MutationOptions, UseConversationsOptions, UseConversationsReturn, } from './useConversations';
|
|
4
|
+
export { useConversationSessions } from './useConversationSessions';
|
|
5
|
+
export type { ConversationSession, MessageHandler, UseConversationSessionsReturn, } from './useConversationSessions';
|
|
4
6
|
export type { ChatActions, ChatState, UseChatReturn } from './types';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,uBAAuB,EACvB,eAAe,EACf,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,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,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,uBAAuB,EACvB,eAAe,EACf,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useMessageHandler } from '../handlers';
|
|
2
|
+
import { type ComputedRef } from 'vue';
|
|
3
|
+
export type MessageHandler = ReturnType<typeof useMessageHandler>;
|
|
4
|
+
/** One conversation’s runtime message tree (`useMessageHandler` per id). */
|
|
5
|
+
export interface ConversationSession {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly messageHandler: MessageHandler;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Per-conversation `useMessageHandler` instances; `setActiveConversation` picks
|
|
11
|
+
* which session is exposed as `activeSession` / `messageHandler`.
|
|
12
|
+
*/
|
|
13
|
+
export interface UseConversationSessionsReturn {
|
|
14
|
+
/** Focused session, or `null`. */
|
|
15
|
+
activeSession: ComputedRef<ConversationSession | null>;
|
|
16
|
+
/** `activeSession?.messageHandler`, or `null`. */
|
|
17
|
+
messageHandler: ComputedRef<MessageHandler | null>;
|
|
18
|
+
/** Get or create a session for `conversationId` (idempotent). */
|
|
19
|
+
createSession: (conversationId: string) => ConversationSession;
|
|
20
|
+
/** Session if it exists; does not create. */
|
|
21
|
+
getSession: (conversationId: string) => ConversationSession | undefined;
|
|
22
|
+
/** Focus `conversationId` (creates session if needed), or `null` to unfocus. */
|
|
23
|
+
setActiveConversation: (conversationId: string | null) => void;
|
|
24
|
+
/** Remove session; clears focus if it was active. */
|
|
25
|
+
removeSession: (conversationId: string) => void;
|
|
26
|
+
}
|
|
27
|
+
/** Registry of sessions by id (plain `Map` so nested refs stay valid). */
|
|
28
|
+
export declare function useConversationSessions(): UseConversationSessionsReturn;
|
|
29
|
+
//# sourceMappingURL=useConversationSessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConversationSessions.d.ts","sourceRoot":"","sources":["../../src/composables/useConversationSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAiB,KAAK,WAAW,EAAY,MAAM,KAAK,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,4EAA4E;AAC5E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACzC;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,kCAAkC;IAClC,aAAa,EAAE,WAAW,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACvD,kDAAkD;IAClD,cAAc,EAAE,WAAW,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD,iEAAiE;IACjE,aAAa,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,mBAAmB,CAAC;IAC/D,6CAA6C;IAC7C,UAAU,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,mBAAmB,GAAG,SAAS,CAAC;IACxE,gFAAgF;IAChF,qBAAqB,EAAE,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,qDAAqD;IACrD,aAAa,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,IAAI,6BAA6B,CAqDvE"}
|