@aleph-alpha/chat-kit 0.8.0 → 0.9.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-Bpa5PJj-.js → CkInput.vue_vue_type_script_setup_true_lang-DmcLXAgB.js} +50 -35
- package/dist/chat-kit.css +6 -6
- package/dist/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.vue.d.ts.map +1 -1
- package/dist/components/composed/CkConversation/CkConversation.vue.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/handlers/index.js +1 -1
- package/dist/handlers/useChatKitLabels.d.ts +4 -0
- package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{useChatKitLabels-DOiK9ds0.js → useChatKitLabels-DNwoZ1x6.js} +3 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, toRefs, computed, h, useId, useTemplateRef, withModifiers, createTextVNode, useSlots, createSlots, normalizeProps, guardReactiveProps, normalizeClass } from "vue";
|
|
2
|
-
import { a as useMarkdownParser, u as useChatKitLabels } from "./useChatKitLabels-
|
|
3
|
-
import { UiIconButton, UiIcon, UiButton, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback } from "@aleph-alpha/ui-library";
|
|
2
|
+
import { a as useMarkdownParser, u as useChatKitLabels } from "./useChatKitLabels-DNwoZ1x6.js";
|
|
3
|
+
import { UiIconButton, UiTooltip, UiIcon, UiButton, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback } from "@aleph-alpha/ui-library";
|
|
4
4
|
const _hoisted_1$7 = {
|
|
5
5
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6
6
|
width: "16",
|
|
@@ -295,6 +295,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
295
295
|
const props = __props;
|
|
296
296
|
const emit = __emit;
|
|
297
297
|
const copied = ref(false);
|
|
298
|
+
const tooltipOpen = ref(false);
|
|
298
299
|
let resetTimer;
|
|
299
300
|
onUnmounted(() => {
|
|
300
301
|
if (resetTimer !== void 0) {
|
|
@@ -305,10 +306,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
305
306
|
if (props.disabled) {
|
|
306
307
|
return;
|
|
307
308
|
}
|
|
309
|
+
tooltipOpen.value = true;
|
|
308
310
|
try {
|
|
309
311
|
const write = props.writeToClipboard ?? ((t) => globalThis.navigator.clipboard.writeText(t));
|
|
310
312
|
await write(props.text);
|
|
311
313
|
copied.value = true;
|
|
314
|
+
tooltipOpen.value = true;
|
|
312
315
|
emit("copy", { success: true });
|
|
313
316
|
if (resetTimer !== void 0) {
|
|
314
317
|
clearTimeout(resetTimer);
|
|
@@ -322,40 +325,50 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
322
325
|
}
|
|
323
326
|
}
|
|
324
327
|
return (_ctx, _cache) => {
|
|
325
|
-
return openBlock(),
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
328
|
+
return openBlock(), createBlock(unref(UiTooltip), {
|
|
329
|
+
open: tooltipOpen.value,
|
|
330
|
+
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => tooltipOpen.value = $event),
|
|
331
|
+
content: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy,
|
|
332
|
+
side: "bottom",
|
|
333
|
+
align: "center",
|
|
334
|
+
"delay-duration": 0
|
|
335
|
+
}, {
|
|
336
|
+
default: withCtx(() => [
|
|
337
|
+
createVNode(unref(CkMessageActionButton), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
|
|
338
|
+
disabled: __props.disabled,
|
|
339
|
+
onClick: handleClick
|
|
340
|
+
}), {
|
|
341
|
+
default: withCtx(() => [
|
|
342
|
+
createVNode(Transition, {
|
|
343
|
+
name: "copy-message-icon-fade",
|
|
344
|
+
mode: "out-in"
|
|
345
|
+
}, {
|
|
346
|
+
default: withCtx(() => [
|
|
347
|
+
!copied.value ? (openBlock(), createBlock(unref(UiIcon), {
|
|
348
|
+
key: "copy",
|
|
349
|
+
name: "copy",
|
|
350
|
+
size: 16,
|
|
351
|
+
"aria-hidden": "true"
|
|
352
|
+
})) : (openBlock(), createBlock(unref(UiIcon), {
|
|
353
|
+
key: "check",
|
|
354
|
+
name: "check",
|
|
355
|
+
size: 16,
|
|
356
|
+
"aria-hidden": "true"
|
|
357
|
+
}))
|
|
358
|
+
]),
|
|
359
|
+
_: 1
|
|
360
|
+
})
|
|
361
|
+
]),
|
|
362
|
+
_: 1
|
|
363
|
+
}, 16, ["disabled"]),
|
|
364
|
+
createElementVNode("span", _hoisted_1$3, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
|
|
365
|
+
]),
|
|
366
|
+
_: 1
|
|
367
|
+
}, 8, ["open", "content"]);
|
|
355
368
|
};
|
|
356
369
|
}
|
|
357
370
|
});
|
|
358
|
-
const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
371
|
+
const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-141343e6"]]);
|
|
359
372
|
const defaultMarkdownClasses = {
|
|
360
373
|
p: "my-1 leading-7",
|
|
361
374
|
a: "underline underline-offset-4",
|
|
@@ -658,8 +671,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
658
671
|
renderSlot(_ctx.$slots, "agent-message-footer", { message }, () => [
|
|
659
672
|
message.content && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageActionButton, {
|
|
660
673
|
key: 0,
|
|
661
|
-
text: message.content
|
|
662
|
-
|
|
674
|
+
text: message.content,
|
|
675
|
+
"aria-label-copy": unref(labels).copyMessageAction,
|
|
676
|
+
"aria-label-copied": unref(labels).copyMessageActionCopied
|
|
677
|
+
}, null, 8, ["text", "aria-label-copy", "aria-label-copied"])) : createCommentVNode("", true)
|
|
663
678
|
])
|
|
664
679
|
]),
|
|
665
680
|
default: withCtx(() => [
|
package/dist/chat-kit.css
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
opacity: 0 !important;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.copy-message-icon-fade-enter-active[data-v-
|
|
8
|
-
.copy-message-icon-fade-leave-active[data-v-
|
|
7
|
+
.copy-message-icon-fade-enter-active[data-v-141343e6],
|
|
8
|
+
.copy-message-icon-fade-leave-active[data-v-141343e6] {
|
|
9
9
|
transition: opacity 0.15s ease-out;
|
|
10
10
|
}
|
|
11
|
-
.copy-message-icon-fade-enter-from[data-v-
|
|
12
|
-
.copy-message-icon-fade-leave-to[data-v-
|
|
11
|
+
.copy-message-icon-fade-enter-from[data-v-141343e6],
|
|
12
|
+
.copy-message-icon-fade-leave-to[data-v-141343e6] {
|
|
13
13
|
opacity: 0;
|
|
14
14
|
}
|
|
15
15
|
@media (prefers-reduced-motion: reduce) {
|
|
16
|
-
.copy-message-icon-fade-enter-active[data-v-
|
|
17
|
-
.copy-message-icon-fade-leave-active[data-v-
|
|
16
|
+
.copy-message-icon-fade-enter-active[data-v-141343e6],
|
|
17
|
+
.copy-message-icon-fade-leave-active[data-v-141343e6] {
|
|
18
18
|
transition-duration: 0.01ms;
|
|
19
19
|
}
|
|
20
20
|
}
|
package/dist/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkCopyMessageActionButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkCopyMessageActionButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.vue"],"names":[],"mappings":"AAgIE,KAAK,WAAW,GAAG;IACf,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD,CAAC;AAyMN,QAAA,MAAM,YAAY;;iBA5La,OAAO;;;;iBAAP,OAAO;;;cAtBrB,OAAO;gBAEL,MAAM;mBACH,MAAM;qBACJ,MAAM;sBAIL,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;6EA8MtD,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkConversation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkConversation/CkConversation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkConversation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkConversation/CkConversation.vue"],"names":[],"mappings":"AAiIE,OAAO,KAAK,EAAE,WA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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"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _, a, b, C, c, d, e, f, g, h, i, j, k, l } from "../CkInput.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _, a, b, C, c, d, e, f, g, h, i, j, k, l } from "../CkInput.vue_vue_type_script_setup_true_lang-DmcLXAgB.js";
|
|
2
2
|
export {
|
|
3
3
|
_ as CkAgentMessage,
|
|
4
4
|
a as CkConversation,
|
package/dist/handlers/index.js
CHANGED
|
@@ -23,6 +23,10 @@ export type ChatKitLabels = {
|
|
|
23
23
|
agentLoadingAvatarAlt: string;
|
|
24
24
|
/** Placeholder text for the chat input field */
|
|
25
25
|
inputPlaceholder: string;
|
|
26
|
+
/** Accessible label / tooltip for the copy-message action button in its idle state */
|
|
27
|
+
copyMessageAction: string;
|
|
28
|
+
/** Accessible label / tooltip for the copy-message action button after a successful copy */
|
|
29
|
+
copyMessageActionCopied: string;
|
|
26
30
|
};
|
|
27
31
|
/** English defaults used when no labels are provided by the consumer. */
|
|
28
32
|
export declare const defaultChatKitLabels: ChatKitLabels;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatKitLabels.d.ts","sourceRoot":"","sources":["../../src/handlers/useChatKitLabels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gDAAgD;IAChD,gBAAgB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"useChatKitLabels.d.ts","sourceRoot":"","sources":["../../src/handlers/useChatKitLabels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gDAAgD;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,sFAAsF;IACtF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,4FAA4F;IAC5F,uBAAuB,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,EAAE,aAMlC,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAAC,aAAa,CAAC,CAA6B,CAAC;AAEnG,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5C,yFAAyF;AACzF,KAAK,cAAc,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,aAAa,CAAC,CAAC;AAE9F;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAKjE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAAC,aAAa,CAAC,CAK7D"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { C } from "./ChatService-LogwJNxh.js";
|
|
2
2
|
import { u } from "./useMessageHandler-D7OdrrcB.js";
|
|
3
|
-
import { C as C2, d, p, u as u2, a } from "./useChatKitLabels-
|
|
3
|
+
import { C as C2, d, p, u as u2, a } from "./useChatKitLabels-DNwoZ1x6.js";
|
|
4
4
|
import { useChat } from "./composables/index.js";
|
|
5
|
-
import { _, a as a2, b, C as C3, c, d as d2, e, f, g, h, i, j, k, l } from "./CkInput.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _, a as a2, b, C as C3, c, d as d2, e, f, g, h, i, j, k, l } from "./CkInput.vue_vue_type_script_setup_true_lang-DmcLXAgB.js";
|
|
6
6
|
export {
|
|
7
7
|
C2 as CHAT_KIT_LABELS,
|
|
8
8
|
C as ChatService,
|
|
@@ -13777,7 +13777,9 @@ function useMarkdownParser(source, plugins) {
|
|
|
13777
13777
|
const defaultChatKitLabels = {
|
|
13778
13778
|
agentAvatarAlt: "Agent avatar",
|
|
13779
13779
|
agentLoadingAvatarAlt: "Agent loading",
|
|
13780
|
-
inputPlaceholder: "Type a message..."
|
|
13780
|
+
inputPlaceholder: "Type a message...",
|
|
13781
|
+
copyMessageAction: "Copy response",
|
|
13782
|
+
copyMessageActionCopied: "Copied!"
|
|
13781
13783
|
};
|
|
13782
13784
|
const CHAT_KIT_LABELS = /* @__PURE__ */ Symbol("chat-kit-labels");
|
|
13783
13785
|
function provideChatKitLabels(labels) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleph-alpha/chat-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Chat kit package for building chat interfaces with Vue",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"remark-parse": "^11.0.0",
|
|
64
64
|
"remark-rehype": "^11.1.2",
|
|
65
65
|
"unified": "^11.0.5",
|
|
66
|
-
"@aleph-alpha/ui-library": "1.25.
|
|
66
|
+
"@aleph-alpha/ui-library": "1.25.2"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@storybook/addon-a11y": "10.2.17",
|