ai12z 3.7.1 → 3.7.2
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 +13 -13
- package/dist/cjs/ai12z-chat_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/input/Input.js +13 -13
- package/dist/collection/components/input/Input.js.map +1 -1
- package/dist/esm/ai12z-chat_2.entry.js +13 -13
- package/dist/esm/ai12z-chat_2.entry.js.map +1 -1
- package/dist/library/library.esm.js +1 -1
- package/dist/library/{p-a48a00e5.entry.js → p-1f99adef.entry.js} +2 -2
- package/dist/library/{p-a48a00e5.entry.js.map → p-1f99adef.entry.js.map} +1 -1
- package/package.json +2 -2
|
@@ -1391,9 +1391,7 @@ const InputForm = class {
|
|
|
1391
1391
|
const endPos = textarea.selectionEnd;
|
|
1392
1392
|
const currentValue = textarea.value;
|
|
1393
1393
|
// Replace selected text or insert at cursor position
|
|
1394
|
-
const newValue = currentValue.substring(0, startPos) +
|
|
1395
|
-
pastedText +
|
|
1396
|
-
currentValue.substring(endPos);
|
|
1394
|
+
const newValue = currentValue.substring(0, startPos) + pastedText + currentValue.substring(endPos);
|
|
1397
1395
|
// Update the textarea value
|
|
1398
1396
|
textarea.value = newValue;
|
|
1399
1397
|
// Set cursor position after pasted text
|
|
@@ -1445,7 +1443,7 @@ const InputForm = class {
|
|
|
1445
1443
|
this.searchInputElem.value = "";
|
|
1446
1444
|
this.searchInput = "";
|
|
1447
1445
|
const parent = this.el.querySelector(`#previewContainer-${this.instanceId}`);
|
|
1448
|
-
const textarea = this.el.querySelector(`#searchInput
|
|
1446
|
+
const textarea = this.el.querySelector(`#searchInput`);
|
|
1449
1447
|
// textarea["style"].height = "20px"
|
|
1450
1448
|
textarea["style"].overflow = "hidden";
|
|
1451
1449
|
if (parent) {
|
|
@@ -1517,24 +1515,26 @@ const InputForm = class {
|
|
|
1517
1515
|
// this.icon_width = url.searchParams.get("w") || "28"
|
|
1518
1516
|
// this.icon_height = url.searchParams.get("h") || "28"
|
|
1519
1517
|
// }
|
|
1520
|
-
return (index.h("div", { key: '
|
|
1521
|
-
${this.isOpen ? "opacity-100 scale-100 pointer-events-auto" : "opacity-0 scale-90 pointer-events-none"}`, ref: el => (this.menuElem = el) }, index.h("ul", { key: '
|
|
1518
|
+
return (index.h("div", { key: 'b710879654820db9210ccfb4aa92e0a25708d16d' }, index.h("div", { key: '5408dbbfe45b661d58d5bf1037ab524c1156c4ec', class: `absolute left-0 w-48 bg-white rounded-lg shadow-lg transition-all duration-300 ease-in-out z-10
|
|
1519
|
+
${this.isOpen ? "opacity-100 scale-100 pointer-events-auto" : "opacity-0 scale-90 pointer-events-none"}`, ref: el => (this.menuElem = el) }, index.h("ul", { key: '103ee1e4974be113c7666d89fc855b5bb768a85a', class: "space-y-2" }, this.isImageUpload && (index.h("li", { key: '745574831938ae6f62813979cd67f622eac7abed', class: "px-4 py-2 hover:bg-gray-100 cursor-pointer flex" }, index.h("image-uploader", { key: '3e2c64281909b59980b76a05a70de05422fcbc88', maxImages: 10, images: this.imagesBase64List, targetElement: this.searchInputElem, onImagesChange: this.handleImageChange, onError: this.handleImageError, ref: el => (this.imageUploaderRef = el) }))), index.h("li", { key: '1785965c16e263e38df187f1cb56843ce61db27a', class: "px-4 pb-2 hover:bg-gray-100 cursor-pointer flex", onClick: e => {
|
|
1522
1520
|
this.captureScreen();
|
|
1523
1521
|
this.toggleBox(e);
|
|
1524
|
-
} }, index.h("div", { key: '
|
|
1522
|
+
} }, index.h("div", { key: 'b7905767addc89069e6c1daf77c3dca2e71dfc80', class: "mr-1 mt-px" }, index.h("svg", { key: 'f11079ae7e023a86e47619946c95841b3f058821', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: '22a53f62a4103da03dcc11fcecc85eb6ca60291c', d: "M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" }), index.h("path", { key: '652fcc2b453519aff9fb590bad21758de9a906cc', "fill-rule": "evenodd", d: "M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z", "clip-rule": "evenodd" }))), index.h("div", { key: '4488809bd3daf7ee12d280082a600372d7e4c3f9' }, "Capture")), index.h("li", { key: 'ab6fc198b0eb81c6b636e522ca1baeb0a462ed3d', class: "px-4 pb-2 hover:bg-gray-100 cursor-pointer flex", "aria-label": "Start Over", "aria-disabled": this.chatLength === 0, style: { opacity: this.chatLength === 0 ? "0.5" : "1", cursor: this.chatLength === 0 ? "not-allowed" : "pointer" }, onClick: e => {
|
|
1525
1523
|
if (this.chatLength === 0)
|
|
1526
1524
|
return;
|
|
1527
1525
|
// const escapeEvent = new KeyboardEvent("keydown", { key: "Escape" })
|
|
1528
1526
|
// document.dispatchEvent(escapeEvent)
|
|
1529
1527
|
this.handleFollowUp(e);
|
|
1530
1528
|
this.toggleBox(e);
|
|
1531
|
-
} }, index.h("div", { key: '
|
|
1529
|
+
} }, index.h("div", { key: '61a542eaa45f949112ed87f6ed4058adfad60dc6', class: "mr-1 mt-px" }, index.h("svg", { key: '3cf1f6ece6bd36b8305a7f90d8ff57c022fd70f1', width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { key: '15c8bf2a524ce56257c8e4bc7027acf6be91b351', d: "M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.2" }))), index.h("div", { key: '3e4c57aa7a21a3c3bd85331476c228580108e7cd' }, "Start Over")))), index.h("form", { key: 'be70c5e66fbecf1e6ff1e90e58a6eabe0e6a3426', class: "w-full flex flex-col gap-1.5 sticky", onSubmit: this.handleFormSubmit }, index.h("div", { key: '1efa7de82d5b3e16515b83a80e55f915fd3a71d2', class: `flex-1 flex flex-col relative w-full rounded-3xl px-1 ${this.componentType === "inline" ? "inline-searchbar-bgcolor" : "searchbar-bgcolor"}`, dir: "LTR", ref: el => (this.searchFormElem = el) }, index.h("div", { key: '08a343d3ce8fc31178bda7a73fabf398f08af140', class: "flex items-center" }, index.h("div", { key: 'c66ae93e9bc039d5e62e320ed971630ac12d1f96', class: "ml-1 self-center flex space-x-1" }, !this.hideAllButtons && (index.h("div", { key: 'bbf4e37acf4806835973a57574461ea1e173b015', class: "relative inline-block", style: { width: "5%" } }, index.h("button", { key: '0e827515ad96fb518b6da91b7512ac24d7fd2c69', class: "plus-icon", "aria-label": "Options", title: "Add images or capture screen", tabindex: "0", onClick: e => {
|
|
1532
1530
|
e.stopPropagation();
|
|
1533
1531
|
this.toggleBox(e);
|
|
1534
|
-
} }, index.h("svg", { key: '
|
|
1532
|
+
} }, index.h("svg", { key: 'e69dc435f4ddddbf819a12397e6d2ea887511688', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: '3360f8d395d1fd97dcbfa4b91a8a9058de979a25', d: "M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z" })))))), !this.hideAllButtons && (index.h("div", { key: 'b9899911414806239ec816e3e685fdb3032d6d55', class: "scrollbar-hidden text-left bg-transparent dark:text-gray-100 outline-none w-full rounded-xl resize-none h-fit max-h-80 overflow-auto" }, index.h("div", { key: '9a133e7e3864cf3b8ae9d0dd9e67bdfeebce20ca', class: "relative w-full min-w-full h-full min-h-fit flex items-center input-prose" }, index.h("div", { key: 'c565c410c5bae7422d15f4fd100382a09337fbc5', id: `previewContainer-${this.instanceId}`, draggable: true }), index.h("label", { key: '86f1910908282edf08ee380a7496673587de09c0', htmlFor: `searchInput`, class: "sr-only" }, "Your message"), index.h("textarea", { key: '3ae4d8685868f5c370da21d7172bffc1a0df29fc', readOnly: this.submitted, "aria-describedby": this.emptyMessageError ? `message-error-${this.instanceId} search-hint-${this.instanceId}` : `search-hint-${this.instanceId}`, "aria-invalid": this.emptyMessageError, id: `searchInput`, ref: el => {
|
|
1535
1533
|
this.searchInputElem = el;
|
|
1536
1534
|
el === null || el === void 0 ? void 0 : el.focus();
|
|
1537
|
-
}, placeholder: this.placeholder, autoComplete: "off", class: "w-full p-1 custom-input", value: this.searchInput, rows: 1, onInput: utils.debounce(e => this.handleInputChange(e), 500), onKeyUp: this.adjustHeight, onKeyDown: this.handleKeyDown, onFocus: () => this.searchFormElem.classList.add("input-focus-color"), onBlur: () => this.searchFormElem.classList.remove("input-focus-color"), onPaste: e => {
|
|
1535
|
+
}, placeholder: this.placeholder, autoComplete: "off", class: "w-full p-1 custom-input", value: this.searchInput, rows: 1, onInput: utils.debounce(e => this.handleInputChange(e), 500), onKeyUp: this.adjustHeight, onKeyDown: this.handleKeyDown, onFocus: () => this.searchFormElem.classList.add("input-focus-color"), onBlur: () => this.searchFormElem.classList.remove("input-focus-color"), onPaste: e => {
|
|
1536
|
+
this.handlePaste(e);
|
|
1537
|
+
} }), index.h("div", { key: '49137e2305050c43e33b1fc6700f3730a1cf2065', role: "status", "aria-live": "polite", "aria-atomic": "true", class: "sr-only" }, this.announceMessage), index.h("span", { key: '0d6a47354a45ad61751dccce4590e1ba9a86f56d', class: "sr-only" }, "Press Enter to send, Shift+Enter for new line")))), index.h("div", { key: '179faa1a351580def49054d6d2caa45724ef9b8f', class: "p-1 self-end flex space-x-1 flex-row", style: { width: this.hideAllButtons ? "100%" : "auto" } }, index.h("div", { key: '7605ed2f215e037f303cd7e30d51b6c51923ee52', "aria-label": "Record voice", class: "flex self-center", style: { width: this.hideAllButtons ? "100%" : "auto" } }, this.isEnableMic && (index.h("audio-recorder", { key: 'e2572b44c68406cfb14cc2e8439a7671db70d2a4', "component-type": "search", onStartRecord: _ev => {
|
|
1538
1538
|
// console.log("test", ev)
|
|
1539
1539
|
this.hideAllButtons = true;
|
|
1540
1540
|
}, onStopRecord: _ev => {
|
|
@@ -1552,14 +1552,14 @@ const InputForm = class {
|
|
|
1552
1552
|
});
|
|
1553
1553
|
}
|
|
1554
1554
|
}, 1000);
|
|
1555
|
-
}, style: { width: "100%" } }))), " ", !this.hideAllButtons && (index.h("div", { key: '
|
|
1555
|
+
}, style: { width: "100%" } }))), " ", !this.hideAllButtons && (index.h("div", { key: '521ca3e7338c0f2de60d80cdc88c625a8324937f', class: "flex items-center" }, index.h("div", { key: '641b5a7a59d73e730222cfb19607528403ba46e2', "aria-label": "Send message", class: "flex" }, index.h("button", { key: 'cbd9fe575d330dfc3f354bb822aeeb6f0d50c548', id: `send-message-button`, class: "btn-bg-color text-white transition rounded-full p-1.5 self-center",
|
|
1556
1556
|
// type="submit"
|
|
1557
|
-
disabled: this.submitted, onClick: this.handleAskAI, tabindex: "0", "aria-label": "Send Message", title: "Send Message" }, index.h("svg", { key: '
|
|
1557
|
+
disabled: this.submitted, onClick: this.handleAskAI, tabindex: "0", "aria-label": "Send Message", title: "Send Message" }, index.h("svg", { key: '61a236c095bee03e42f2ef4f8f54cb4cb203e7ee', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "size-6" }, index.h("path", { key: 'b3c128071d733511d186b5514b44e567bc273f79', "fill-rule": "evenodd", d: "M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z", "clip-rule": "evenodd" })))))))), this.imagesBase64List.length > 0 && (index.h("div", { key: '53a1f7b0e27f49b7770eacfdcb3e0f395a2d2207', class: "flex flex-wrap gap-2 mx-1 mt-2.5 mb-1" }, this.imagesBase64List.map((img, idx) => (index.h("div", { class: "image-Container sc-ai12z-input-form", key: idx }, index.h("img", { src: img, style: { width: "70px", height: "50px", borderRadius: ".75rem" } }), index.h("span", { class: "delete-image sc-ai12z-input-form cursor-pointer ml-1", onClick: () => {
|
|
1558
1558
|
this.imagesBase64List = this.imagesBase64List.filter((_, i) => i !== idx);
|
|
1559
1559
|
if (this.imageUploaderRef && typeof this.imageUploaderRef.removeImageAtIndex === "function") {
|
|
1560
1560
|
this.imageUploaderRef.removeImageAtIndex(idx);
|
|
1561
1561
|
}
|
|
1562
|
-
} }, "\u00D7"))))))), this.showErrorMessage && index.h("div", { key: '
|
|
1562
|
+
} }, "\u00D7"))))))), this.showErrorMessage && (index.h("div", { key: '68835fe3309ee7c3856fe6eca76e5fc98c0efc41', class: "flex" }, " ", index.h("p", { key: '98f397793822e1cdaefedd76acc41b3df2c65bfd', class: "error-msg", innerHTML: this.errorMessage }))), this.emptyMessageError && (index.h("div", { key: '57bf882093f456cbb39b3c3846897f5ba8138f9b', class: "flex" }, index.h("p", { key: '7d2c00863e48982725c76c4d6899f35c1fb8e007', id: `message-error-${this.instanceId}`, class: "error-msg", role: "alert" }, "Message cannot be empty. Please enter a message to send."))), this.chatLength === 0 && (index.h("div", { key: '730feded06081d0148a0937e158fc5ee35b080e0', class: "enter-tip", role: "tooltip" }, "Tip: Press Enter to send, Shift+Enter for new line")))));
|
|
1563
1563
|
}
|
|
1564
1564
|
get el() { return index.getElement(this); }
|
|
1565
1565
|
};
|