ai12z 1.0.8 → 1.0.9
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-bot_10.cjs.entry.js +8 -6
- package/dist/cjs/ai12z-bot_10.cjs.entry.js.map +1 -1
- package/dist/collection/components/ai12z-cta/components/Chat.js +8 -6
- package/dist/collection/components/ai12z-cta/components/Chat.js.map +1 -1
- package/dist/esm/ai12z-bot_10.entry.js +8 -6
- package/dist/esm/ai12z-bot_10.entry.js.map +1 -1
- package/dist/library/library.esm.js +1 -1
- package/dist/library/{p-8c536bef.entry.js → p-95f58f66.entry.js} +2 -2
- package/dist/library/{p-8c536bef.entry.js.map → p-95f58f66.entry.js.map} +1 -1
- package/package.json +2 -2
|
@@ -58594,15 +58594,17 @@ const MyChat = class {
|
|
|
58594
58594
|
}
|
|
58595
58595
|
finalHtml = this.updateButtonEvents(finalHtml);
|
|
58596
58596
|
// console.log("data.controlType", finalHtml)
|
|
58597
|
-
finalHtml = data.controlType !== null ? " " : finalHtml;
|
|
58597
|
+
finalHtml = data.controlType && data.controlType !== null ? " " : finalHtml;
|
|
58598
58598
|
this.element.shadowRoot.querySelector(`#${this.aiMessageId}`).innerHTML = finalHtml;
|
|
58599
|
-
if (data.controlType !== null) {
|
|
58599
|
+
if (data.controlType && data.controlType !== null) {
|
|
58600
58600
|
const controlElement = ai12zKnowledgeBox.getComponentByControlType(data.controlType, data);
|
|
58601
|
-
this.element.shadowRoot.querySelector(`#${this.aiMessageId}`)
|
|
58601
|
+
if (this.element.shadowRoot.querySelector(`#${this.aiMessageId}`) && controlElement) {
|
|
58602
|
+
this.element.shadowRoot.querySelector(`#${this.aiMessageId}`).appendChild(controlElement);
|
|
58603
|
+
}
|
|
58602
58604
|
}
|
|
58603
58605
|
this.stateChanged.emit({ state: "end_response" });
|
|
58604
58606
|
this.conversationId = data.conversationId;
|
|
58605
|
-
if (data.controlType === null) {
|
|
58607
|
+
if (data.controlType && data.controlType === null) {
|
|
58606
58608
|
this.chats[this.chats.length - 1].message = finalHtml;
|
|
58607
58609
|
}
|
|
58608
58610
|
this.chats[idx].formModel = data.formModel;
|
|
@@ -58685,7 +58687,7 @@ const MyChat = class {
|
|
|
58685
58687
|
render() {
|
|
58686
58688
|
var _a;
|
|
58687
58689
|
const email = "";
|
|
58688
|
-
return (index.h("ul", { key: '
|
|
58690
|
+
return (index.h("ul", { key: '3a261a97116e74a288356480578fa60514dad90b', class: "chat-list" }, (_a = this.chats) === null || _a === void 0 ? void 0 :
|
|
58689
58691
|
_a.map((chat, idx) => {
|
|
58690
58692
|
var _a, _b;
|
|
58691
58693
|
return (index.h("li", { class: {
|
|
@@ -58697,7 +58699,7 @@ const MyChat = class {
|
|
|
58697
58699
|
_b.map(img => {
|
|
58698
58700
|
return index.h("img", { src: img, class: "thumbnail", alt: "thumbnail", width: "70", height: "50" });
|
|
58699
58701
|
}), chat.type !== "user" && (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", id: "spinner" }, 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" }))))), chat.type !== "user" && (index.h("div", { class: "non-user-container" }, index.h("button", { class: "copy-btn", onClick: () => this.copyToClipboard(this.removeHtmlTags(chat.message)) }, !this.copied && (index.h("svg", { width: "24", height: "24", 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", width: "24", height: "24" }, 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" }, 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" }, 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" }, index.h("a", { href: `mailto:${email}?subject=${encodeURIComponent(this.chats[idx - 1].message)}&body=${encodeURIComponent(this.removeHtmlTags(chat.message))}`, target: "_blank" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", width: "24", height: "24", "stroke-width": "0.3" }, 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" }), " ")))))));
|
|
58700
|
-
}), index.h("div", { key: '
|
|
58702
|
+
}), index.h("div", { key: '4fc6fc2cc9da0c48a1df3ef001ad5e52362b6f1b', class: "scroll-bottom" })));
|
|
58701
58703
|
}
|
|
58702
58704
|
static get assetsDirs() { return ["assets"]; }
|
|
58703
58705
|
get element() { return index.getElement(this); }
|