ai12z 3.7.1-alpha.13 → 3.7.1-alpha.14
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/cjs/ai12z-chat_2.cjs.entry.js +23 -7
- package/dist/cjs/ai12z-chat_2.cjs.entry.js.map +1 -1
- package/dist/cjs/chat-avatar_7.cjs.entry.js +1 -1
- package/dist/cjs/chat-avatar_7.cjs.entry.js.map +1 -1
- package/dist/collection/components/ai12z-bot/components/chat-avatar/chat-avatar.js +1 -1
- package/dist/collection/components/ai12z-bot/components/chat-avatar/chat-avatar.js.map +1 -1
- package/dist/collection/components/ai12z-cta/components/Chat.js +23 -7
- package/dist/collection/components/ai12z-cta/components/Chat.js.map +1 -1
- package/dist/esm/ai12z-chat_2.entry.js +23 -7
- package/dist/esm/ai12z-chat_2.entry.js.map +1 -1
- package/dist/esm/chat-avatar_7.entry.js +1 -1
- package/dist/esm/chat-avatar_7.entry.js.map +1 -1
- package/dist/library/library.esm.js +1 -1
- package/dist/library/{p-58c161f6.entry.js → p-01716b4d.entry.js} +2 -2
- package/dist/library/{p-58c161f6.entry.js.map → p-01716b4d.entry.js.map} +1 -1
- package/dist/library/p-4a92dd32.entry.js +2 -0
- package/dist/library/p-4a92dd32.entry.js.map +1 -0
- package/package.json +2 -2
- package/dist/library/p-89ea5471.entry.js +0 -2
- package/dist/library/p-89ea5471.entry.js.map +0 -1
|
@@ -337,6 +337,7 @@ const MyChat = class {
|
|
|
337
337
|
console.log("Already processing endResponse, ignoring duplicate");
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
|
+
this.scrollToLatestBubble();
|
|
340
341
|
this.isProcessingEndResponse = true;
|
|
341
342
|
const idx = this.chats.findIndex(item => item.id === this.aiMessageId);
|
|
342
343
|
requestAnimationFrame(async () => {
|
|
@@ -943,7 +944,7 @@ const MyChat = class {
|
|
|
943
944
|
this.chats[this.chats.length - 1].text = "Error connecting to server. Please try again later.";
|
|
944
945
|
}
|
|
945
946
|
});
|
|
946
|
-
this.scrollToLatestBubble()
|
|
947
|
+
// this.scrollToLatestBubble()
|
|
947
948
|
}
|
|
948
949
|
}
|
|
949
950
|
updateAnchorTags(htmlContent) {
|
|
@@ -1067,9 +1068,11 @@ const MyChat = class {
|
|
|
1067
1068
|
this.query = (_b = _state.detail) === null || _b === void 0 ? void 0 : _b.search;
|
|
1068
1069
|
this.imgFiles = (_c = _state.detail) === null || _c === void 0 ? void 0 : _c.imgFiles;
|
|
1069
1070
|
this.invokeSocket();
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1071
|
+
if (this.chats.length !== 2) {
|
|
1072
|
+
setTimeout(() => {
|
|
1073
|
+
this.scrollToLatestBubble();
|
|
1074
|
+
}, 500);
|
|
1075
|
+
}
|
|
1073
1076
|
}
|
|
1074
1077
|
}
|
|
1075
1078
|
highlightcode() {
|
|
@@ -1161,7 +1164,7 @@ const MyChat = class {
|
|
|
1161
1164
|
render() {
|
|
1162
1165
|
var _a;
|
|
1163
1166
|
const email = "";
|
|
1164
|
-
return (index.h("div", { key: '
|
|
1167
|
+
return (index.h("div", { key: 'dac42cf225d4c06d29c040113a40ed117289f2d0' }, index.h("ul", { key: 'db96cbf3c49709bcdd77a7e710b5ee9897fc855d', id: "main-content", tabindex: "-1", class: {
|
|
1165
1168
|
"chat-list": true,
|
|
1166
1169
|
"custom-list": this.componentType === "search",
|
|
1167
1170
|
// "custom-chat-top-height": this.componentType === "search",
|
|
@@ -1183,7 +1186,20 @@ const MyChat = class {
|
|
|
1183
1186
|
"chat-align-list": chat.type !== "user",
|
|
1184
1187
|
"chat-not-user-list": chat.type === "user",
|
|
1185
1188
|
"pointer-events-none": chat.type === "user",
|
|
1186
|
-
}, tabindex: idx === this.focusedIndex ? 0 : -1, onKeyDown: (e) => this.handleChatKeyNav(e, idx), ref: el => (this.chatItemRefs[idx] = el), role: "article", "aria-label": `${chat.type === 'user' ? 'Your message' : 'Bot response'} ${idx + 1}` }, chat.type !== "user" && (index.h("div", { class: "chat-inner-list default-avatar" }, !this.avatarUrl && (index.h("svg", {
|
|
1189
|
+
}, tabindex: idx === this.focusedIndex ? 0 : -1, onKeyDown: (e) => this.handleChatKeyNav(e, idx), ref: el => (this.chatItemRefs[idx] = el), role: "article", "aria-label": `${chat.type === 'user' ? 'Your message' : 'Bot response'} ${idx + 1}` }, chat.type !== "user" && (index.h("div", { class: "chat-inner-list default-avatar" }, !this.avatarUrl && (index.h("svg", { viewBox: "0 0 48 48", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", class: `w-8 h-8 ${showAvatar ? "hidden md:block" : "opacity-0"}` }, index.h("path", { d: "M24 2c-3 8-8 13-16 16 8 3 13 8 16 16 3-8 8-13 16-16-8-3-13-8-16-16z" }))
|
|
1190
|
+
// <svg
|
|
1191
|
+
// stroke="currentColor"
|
|
1192
|
+
// fill="currentColor"
|
|
1193
|
+
// stroke-width="0"
|
|
1194
|
+
// viewBox="0 0 16 16"
|
|
1195
|
+
// height="20"
|
|
1196
|
+
// width="20"
|
|
1197
|
+
// xmlns="http://www.w3.org/2000/svg"
|
|
1198
|
+
// class={`w-8 h-8 ${showAvatar ? "hidden md:block" : "opacity-0"}`}
|
|
1199
|
+
// >
|
|
1200
|
+
// <path d="M8 1a5 5 0 0 0-5 5v1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a6 6 0 1 1 12 0v6a2.5 2.5 0 0 1-2.5 2.5H9.366a1 1 0 0 1-.866.5h-1a1 1 0 1 1 0-2h1a1 1 0 0 1 .866.5H11.5A1.5 1.5 0 0 0 13 12h-1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1V6a5 5 0 0 0-5-5"></path>
|
|
1201
|
+
// </svg>
|
|
1202
|
+
), this.avatarUrl && (index.h("div", { class: `avatar-container ${showAvatar ? "hidden md:block" : "opacity-0"}` }, index.h("img", { src: this.avatarUrl, alt: "Avatar", class: "avatar-image w-8 h-8 rounded-full" }))))), chat.status === "pending" && (index.h("div", { class: "pending-chat" }, index.h("svg", { class: "animate-spin h-5 w-5 text-gray-400", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24" }, index.h("circle", { class: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "4" }), index.h("path", { class: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })))), index.h("div", { id: "parent-element", onMouseEnter: e => {
|
|
1187
1203
|
let popup = e.target.querySelector(".non-user-container");
|
|
1188
1204
|
if (popup)
|
|
1189
1205
|
popup.style.display = "block";
|
|
@@ -1217,7 +1233,7 @@ const MyChat = class {
|
|
|
1217
1233
|
}
|
|
1218
1234
|
// this.isPlayed = false
|
|
1219
1235
|
} }, index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "icon-md-heavy" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM9.5 8.5C8.94772 8.5 8.5 8.94772 8.5 9.5V14.5C8.5 15.0523 8.94772 15.5 9.5 15.5H14.5C15.0523 15.5 15.5 15.0523 15.5 14.5V9.5C15.5 8.94772 15.0523 8.5 14.5 8.5H9.5Z", fill: "currentColor" })))), !this.isPlayed && (index.h("button", { class: "copy-btn", onClick: () => this.speakText(this.removeHtmlTags(chat.clipboard)), "aria-label": "Play", tabindex: "0" }, index.h("svg", { class: "w-6 h-6", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11 4.9099C11 4.47485 10.4828 4.24734 10.1621 4.54132L6.67572 7.7372C6.49129 7.90626 6.25019 8.00005 6 8.00005H4C3.44772 8.00005 3 8.44776 3 9.00005V15C3 15.5523 3.44772 16 4 16H6C6.25019 16 6.49129 16.0938 6.67572 16.2629L10.1621 19.4588C10.4828 19.7527 11 19.5252 11 19.0902V4.9099ZM8.81069 3.06701C10.4142 1.59714 13 2.73463 13 4.9099V19.0902C13 21.2655 10.4142 22.403 8.81069 20.9331L5.61102 18H4C2.34315 18 1 16.6569 1 15V9.00005C1 7.34319 2.34315 6.00005 4 6.00005H5.61102L8.81069 3.06701ZM20.3166 6.35665C20.8019 6.09313 21.409 6.27296 21.6725 6.75833C22.5191 8.3176 22.9996 10.1042 22.9996 12.0001C22.9996 13.8507 22.5418 15.5974 21.7323 17.1302C21.4744 17.6185 20.8695 17.8054 20.3811 17.5475C19.8927 17.2896 19.7059 16.6846 19.9638 16.1962C20.6249 14.9444 20.9996 13.5175 20.9996 12.0001C20.9996 10.4458 20.6064 8.98627 19.9149 7.71262C19.6514 7.22726 19.8312 6.62017 20.3166 6.35665ZM15.7994 7.90049C16.241 7.5688 16.8679 7.65789 17.1995 8.09947C18.0156 9.18593 18.4996 10.5379 18.4996 12.0001C18.4996 13.3127 18.1094 14.5372 17.4385 15.5604C17.1357 16.0222 16.5158 16.1511 16.0539 15.8483C15.5921 15.5455 15.4632 14.9255 15.766 14.4637C16.2298 13.7564 16.4996 12.9113 16.4996 12.0001C16.4996 10.9859 16.1653 10.0526 15.6004 9.30063C15.2687 8.85905 15.3578 8.23218 15.7994 7.90049Z", fill: "currentColor" })))), index.h("button", { class: "copy-btn", onClick: () => this.copyToClipboard(chat.clipboard), "aria-label": "Copy to Clipboard", tabindex: "0" }, !this.copied && (index.h("svg", { class: "w-6 h-6", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7 5C7 3.34315 8.34315 2 10 2H19C20.6569 2 22 3.34315 22 5V14C22 15.6569 20.6569 17 19 17H17V19C17 20.6569 15.6569 22 14 22H5C3.34315 22 2 20.6569 2 19V10C2 8.34315 3.34315 7 5 7H7V5ZM9 7H14C15.6569 7 17 8.34315 17 10V15H19C19.5523 15 20 14.5523 20 14V5C20 4.44772 19.5523 4 19 4H10C9.44772 4 9 4.44772 9 5V7ZM5 9C4.44772 9 4 9.44772 4 10V19C4 19.5523 4.44772 20 5 20H14C14.5523 20 15 19.5523 15 19V10C15 9.44772 14.5523 9 14 9H5Z", fill: "currentColor" }))), this.copied && (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "w-6 h-6" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M19.8198 6.19526C20.0601 6.45561 20.0601 6.87772 19.8198 7.13807L9.9736 17.8047C9.73328 18.0651 9.34364 18.0651 9.10332 17.8047L4.18024 12.4714C3.93992 12.2111 3.93992 11.7889 4.18024 11.5286C4.42056 11.2682 4.8102 11.2682 5.05053 11.5286L9.53846 16.3905L18.9495 6.19526C19.1898 5.93491 19.5794 5.93491 19.8198 6.19526Z", fill: "currentColor" })))), index.h("button", { id: `thumbsUp_${chat.thumbsId}`, onClick: () => this.thumbsUp(chat.thumbsId, chat.insightId), class: "chat-thumbs-up", "aria-label": "Thumbs Up", tabindex: "0" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "w-6 h-6" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z" }))), index.h("button", { id: `thumbsDown_${chat.thumbsId}`, onClick: () => this.thumbsDown(chat.thumbsId, chat.insightId), class: "chat-thumbs-up", "aria-label": "Thumbs Down", tabindex: "0" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "w-6 h-6" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M7.498 15.25H4.372c-1.026 0-1.945-.694-2.054-1.715a12.137 12.137 0 0 1-.068-1.285c0-2.848.992-5.464 2.649-7.521C5.287 4.247 5.886 4 6.504 4h4.016a4.5 4.5 0 0 1 1.423.23l3.114 1.04a4.5 4.5 0 0 0 1.423.23h1.294M7.498 15.25c.618 0 .991.724.725 1.282A7.471 7.471 0 0 0 7.5 19.75 2.25 2.25 0 0 0 9.75 22a.75.75 0 0 0 .75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 0 0 2.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384m-10.253 1.5H9.7m8.075-9.75c.01.05.027.1.05.148.593 1.2.925 2.55.925 3.977 0 1.487-.36 2.89-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398-.306.774-1.086 1.227-1.918 1.227h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 0 0 .303-.54" }))), index.h("button", { class: "copy-btn", tabindex: "0", "aria-label": "Send Email" }, index.h("a", { href: `mailto:${email}?subject=${encodeURIComponent((_e = this.chats[idx - 1]) === null || _e === void 0 ? void 0 : _e.message)}&body=${encodeURIComponent(this.removeHtmlTags(chat.clipboard))}`, target: "_blank", "aria-label": "Send Email" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", "stroke-width": "0.3", class: "w-6 h-6" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M3.75 5.25L3 6V18L3.75 18.75H20.25L21 18V6L20.25 5.25H3.75ZM4.5 7.6955V17.25H19.5V7.69525L11.9999 14.5136L4.5 7.6955ZM18.3099 6.75H5.68986L11.9999 12.4864L18.3099 6.75Z", fill: "currentColor" }), " "))))))));
|
|
1220
|
-
}), index.h("div", { key: '
|
|
1236
|
+
}), index.h("div", { key: '5ba3da67de5bcf29058f971ec5c124e9f2e56265', class: "scroll-bottom" }))));
|
|
1221
1237
|
}
|
|
1222
1238
|
get element() { return index.getElement(this); }
|
|
1223
1239
|
static get watchers() { return {
|