deep-chat-dev 9.0.8 → 9.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/deepChat.js
CHANGED
@@ -7175,9 +7175,9 @@ var Messages = /*#__PURE__*/function () {
|
|
7175
7175
|
}, {
|
7176
7176
|
key: "removeMessageOnError",
|
7177
7177
|
value: function removeMessageOnError() {
|
7178
|
-
var
|
7179
|
-
|
7180
|
-
(
|
7178
|
+
var e = this._messageElementRefs[this._messageElementRefs.length - 1],
|
7179
|
+
t = e == null ? void 0 : e.bubbleElement;
|
7180
|
+
(t != null && t.classList.contains("streamed-message") && t.textContent === "" || t != null && t.classList.contains("loading-message-text")) && (e.outerContainer.remove(), this._messageElementRefs.pop());
|
7181
7181
|
}
|
7182
7182
|
// prettier-ignore
|
7183
7183
|
}, {
|
@@ -7216,8 +7216,10 @@ var Messages = /*#__PURE__*/function () {
|
|
7216
7216
|
}, {
|
7217
7217
|
key: "getLastMessageBubbleElement",
|
7218
7218
|
value: function getLastMessageBubbleElement() {
|
7219
|
-
var e, t
|
7220
|
-
return (
|
7219
|
+
var e, t;
|
7220
|
+
return Array.from(((t = (e = this.getLastMessageElement()) == null ? void 0 : e.children) == null ? void 0 : t[0].children) || []).find(function (n) {
|
7221
|
+
return n.classList.contains("message-bubble");
|
7222
|
+
});
|
7221
7223
|
}
|
7222
7224
|
}, {
|
7223
7225
|
key: "isLastMessageError",
|
@@ -7263,7 +7265,8 @@ var Messages = /*#__PURE__*/function () {
|
|
7263
7265
|
}, {
|
7264
7266
|
key: "finaliseStreamedMessage",
|
7265
7267
|
value: function finaliseStreamedMessage() {
|
7266
|
-
|
7268
|
+
var e;
|
7269
|
+
(e = this.getLastMessageBubbleElement()) != null && e.classList.contains("streamed-message") && (this.messages[this.messages.length - 1].text = this._streamedText, this.sendClientUpdate(Messages.createMessageContent(!0, this._streamedText), !1), this._textToSpeech && TextToSpeech.speak(this._streamedText, this._textToSpeech), this._streamedText = "");
|
7267
7270
|
}
|
7268
7271
|
}, {
|
7269
7272
|
key: "populateIntroPanel",
|
@@ -7320,6 +7323,11 @@ var Messages = /*#__PURE__*/function () {
|
|
7320
7323
|
this._messageElementRefs.forEach(function (o) {
|
7321
7324
|
var a = o.bubbleElement.classList;
|
7322
7325
|
a.contains("loading-message-text") || a.contains("streamed-message") ? t.push(o) : o.outerContainer.remove();
|
7326
|
+
}), Array.from(this.elementRef.children).forEach(function (o) {
|
7327
|
+
var l, c;
|
7328
|
+
console.log((l = o.children[0]) == null ? void 0 : l.children[0]);
|
7329
|
+
var a = (c = o.children[0]) == null ? void 0 : c.children[0];
|
7330
|
+
a != null && a.classList.contains("error-message-text") && o.remove();
|
7323
7331
|
}), this._messageElementRefs = t, e !== !1 && ((n = this._introPanel) != null && n._elementRef && this._introPanel.display(), this.addIntroductoryMessage()), this.messages.splice(0, this.messages.length), (s = this._onClearMessages) == null || s.call(this);
|
7324
7332
|
}
|
7325
7333
|
// this is mostly used for enabling highlight.js to highlight code if it is downloads later
|
@@ -7381,10 +7389,10 @@ var Messages = /*#__PURE__*/function () {
|
|
7381
7389
|
return Messages;
|
7382
7390
|
}();
|
7383
7391
|
var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
|
7384
|
-
function
|
7385
|
-
_classCallCheck(this,
|
7392
|
+
function T() {
|
7393
|
+
_classCallCheck(this, T);
|
7386
7394
|
}
|
7387
|
-
_createClass(
|
7395
|
+
_createClass(T, null, [{
|
7388
7396
|
key: "adjustInputPadding",
|
7389
7397
|
value: function adjustInputPadding(e, t) {
|
7390
7398
|
t["inside-left"].length > 0 && e.classList.add("text-input-inner-left-adjustment"), t["inside-right"].length > 0 && e.classList.add("text-input-inner-right-adjustment");
|
@@ -7392,7 +7400,7 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
|
|
7392
7400
|
}, {
|
7393
7401
|
key: "adjustForOutsideButton",
|
7394
7402
|
value: function adjustForOutsideButton(e, t, n) {
|
7395
|
-
n["outside-right"].length === 0 && n["outside-left"].length > 0 ? (e[0].classList.add(
|
7403
|
+
n["outside-right"].length === 0 && n["outside-left"].length > 0 ? (e[0].classList.add(T.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS)) : n["outside-left"].length === 0 && n["outside-right"].length > 0 && (e[3].classList.add(T.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS));
|
7396
7404
|
}
|
7397
7405
|
// when submit is the only button
|
7398
7406
|
// when submit button is outside by itself - we increase the height for a better look
|
@@ -7400,10 +7408,10 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
|
|
7400
7408
|
key: "adjustOutsideSubmit",
|
7401
7409
|
value: function adjustOutsideSubmit(e, t, n) {
|
7402
7410
|
if (!(n["inside-left"].length > 0 || n["inside-right"].length > 0)) {
|
7403
|
-
if (n["outside-right"].length === 0 && n["outside-left"].length > 0) return e[0].classList.add(
|
7411
|
+
if (n["outside-right"].length === 0 && n["outside-left"].length > 0) return e[0].classList.add(T.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), n["outside-left"].map(function (s) {
|
7404
7412
|
return s.button.elementRef.classList.add("submit-button-enlarged");
|
7405
7413
|
});
|
7406
|
-
if (n["outside-left"].length === 0 && n["outside-right"].length > 0) return e[3].classList.add(
|
7414
|
+
if (n["outside-left"].length === 0 && n["outside-right"].length > 0) return e[3].classList.add(T.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), n["outside-right"].map(function (s) {
|
7407
7415
|
return s.button.elementRef.classList.add("submit-button-enlarged");
|
7408
7416
|
});
|
7409
7417
|
}
|
@@ -7411,10 +7419,10 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
|
|
7411
7419
|
}, {
|
7412
7420
|
key: "set",
|
7413
7421
|
value: function set(e, t, n, s) {
|
7414
|
-
!!
|
7422
|
+
!!T.adjustOutsideSubmit(t, n, s) || T.adjustForOutsideButton(t, n, s), T.adjustInputPadding(e, s);
|
7415
7423
|
}
|
7416
7424
|
}]);
|
7417
|
-
return
|
7425
|
+
return T;
|
7418
7426
|
}();
|
7419
7427
|
_InputButtonStyleAdjustments.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment";
|
7420
7428
|
_InputButtonStyleAdjustments.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment";
|
@@ -8281,11 +8289,11 @@ var FileAttachments = /*#__PURE__*/function () {
|
|
8281
8289
|
return FileAttachments;
|
8282
8290
|
}();
|
8283
8291
|
var _Modal = /*#__PURE__*/function () {
|
8284
|
-
function
|
8285
|
-
_classCallCheck(this,
|
8286
|
-
this._isOpen = !1, this._contentRef =
|
8292
|
+
function w(e, t, n) {
|
8293
|
+
_classCallCheck(this, w);
|
8294
|
+
this._isOpen = !1, this._contentRef = w.createModalContent(t, n == null ? void 0 : n.backgroundColor), this._buttonPanel = w.createButtonPanel(n == null ? void 0 : n.backgroundColor), this._elementRef = w.createContainer(this._contentRef, n), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = w.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
|
8287
8295
|
}
|
8288
|
-
_createClass(
|
8296
|
+
_createClass(w, [{
|
8289
8297
|
key: "isOpen",
|
8290
8298
|
value: function isOpen() {
|
8291
8299
|
return this._isOpen;
|
@@ -8307,7 +8315,7 @@ var _Modal = /*#__PURE__*/function () {
|
|
8307
8315
|
var _this40 = this;
|
8308
8316
|
this._elementRef.classList.remove("show-modal"), this._elementRef.classList.add("hide-modal"), this._backgroundPanelRef.classList.remove("show-modal-background"), this._backgroundPanelRef.classList.add("hide-modal-background"), this._isOpen = !1, setTimeout(function () {
|
8309
8317
|
_this40._elementRef.style.display = "none", _this40._backgroundPanelRef.style.display = "none";
|
8310
|
-
},
|
8318
|
+
}, w.MODAL_CLOSE_TIMEOUT_MS);
|
8311
8319
|
}
|
8312
8320
|
}, {
|
8313
8321
|
key: "displayModalElements",
|
@@ -8323,7 +8331,7 @@ var _Modal = /*#__PURE__*/function () {
|
|
8323
8331
|
key: "addCloseButton",
|
8324
8332
|
value: function addCloseButton(e, t, n) {
|
8325
8333
|
var _this41 = this;
|
8326
|
-
var s = t ?
|
8334
|
+
var s = t ? w.createSVGButton(e) : w.createTextButton(e);
|
8327
8335
|
return this.addButtons(s), s.onclick = function () {
|
8328
8336
|
_this41.close(), setTimeout(function () {
|
8329
8337
|
n == null || n();
|
@@ -8383,12 +8391,12 @@ var _Modal = /*#__PURE__*/function () {
|
|
8383
8391
|
value: function createTextModalFunc(e, t, n) {
|
8384
8392
|
var s;
|
8385
8393
|
if (_typeof(t) == "object" && (s = t.files) != null && s.infoModal) {
|
8386
|
-
var o = new
|
8394
|
+
var o = new w(e, ["modal-content"], t.files.infoModal.containerStyle);
|
8387
8395
|
return o.addCloseButton("OK", !1, n), o.openTextModal.bind(o, t.infoModalTextMarkUp || "");
|
8388
8396
|
}
|
8389
8397
|
}
|
8390
8398
|
}]);
|
8391
|
-
return
|
8399
|
+
return w;
|
8392
8400
|
}();
|
8393
8401
|
_Modal.MODAL_CLOSE_TIMEOUT_MS = 190;
|
8394
8402
|
var Modal = _Modal;
|
@@ -51,7 +51,7 @@ export declare class Messages {
|
|
51
51
|
private getPermittedMessage;
|
52
52
|
private getLastMessageElement;
|
53
53
|
private getLastMessageBubbleElement;
|
54
|
-
isLastMessageError(): boolean;
|
54
|
+
isLastMessageError(): boolean | undefined;
|
55
55
|
removeError(): void;
|
56
56
|
addLoadingMessage(): void;
|
57
57
|
addNewStreamedMessage(): HTMLElement;
|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