deep-chat-dev 9.0.150 → 9.0.152
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
@@ -12742,25 +12742,36 @@ var k = /*#__PURE__*/function (_Dt4) {
|
|
12742
12742
|
});
|
12743
12743
|
return _this69;
|
12744
12744
|
}
|
12745
|
-
// prettier-ignore
|
12746
12745
|
_createClass(k, [{
|
12747
12746
|
key: "createInnerElements",
|
12748
12747
|
value: function createInnerElements() {
|
12749
|
-
var
|
12750
|
-
|
12751
|
-
|
12752
|
-
|
12753
|
-
|
12754
|
-
i = _B$create.loading,
|
12755
|
-
n = _B$create.stop,
|
12756
|
-
r = t || k.createSubmitIconElement();
|
12748
|
+
var _this$createCustomEle = this.createCustomElements(),
|
12749
|
+
e = _this$createCustomEle.submit,
|
12750
|
+
t = _this$createCustomEle.loading,
|
12751
|
+
i = _this$createCustomEle.stop,
|
12752
|
+
n = e || k.createSubmitIconElement();
|
12757
12753
|
return {
|
12758
|
-
submit:
|
12759
|
-
loading:
|
12760
|
-
stop:
|
12761
|
-
disabled: this.createDisabledIconElement(
|
12754
|
+
submit: n,
|
12755
|
+
loading: t || k.createLoadingIconElement(),
|
12756
|
+
stop: i || k.createStopIconElement(),
|
12757
|
+
disabled: this.createDisabledIconElement(n)
|
12762
12758
|
};
|
12763
12759
|
}
|
12760
|
+
}, {
|
12761
|
+
key: "createCustomElements",
|
12762
|
+
value: function createCustomElements() {
|
12763
|
+
var _this70 = this;
|
12764
|
+
var e = {
|
12765
|
+
submit: void 0,
|
12766
|
+
loading: void 0,
|
12767
|
+
stop: void 0
|
12768
|
+
};
|
12769
|
+
return Object.keys(e).forEach(function (t) {
|
12770
|
+
var i = t,
|
12771
|
+
n = B.createSpecificStateElement(_this70.elementRef, i, _this70._customStyles);
|
12772
|
+
n && (e[i] = n);
|
12773
|
+
}), e;
|
12774
|
+
}
|
12764
12775
|
}, {
|
12765
12776
|
key: "createDisabledIconElement",
|
12766
12777
|
value: function createDisabledIconElement(e) {
|
@@ -12837,7 +12848,7 @@ var k = /*#__PURE__*/function (_Dt4) {
|
|
12837
12848
|
key: "programmaticSubmit",
|
12838
12849
|
value: function () {
|
12839
12850
|
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee112(e) {
|
12840
|
-
var
|
12851
|
+
var _this71 = this;
|
12841
12852
|
var t;
|
12842
12853
|
return _regeneratorRuntime().wrap(function _callee112$(_context112) {
|
12843
12854
|
while (1) switch (_context112.prev = _context112.next) {
|
@@ -12852,7 +12863,7 @@ var k = /*#__PURE__*/function (_Dt4) {
|
|
12852
12863
|
type: _e.getTypeFromBlob(i)
|
12853
12864
|
};
|
12854
12865
|
})), setTimeout(function () {
|
12855
|
-
return
|
12866
|
+
return _this71.attemptSubmit(t, !0);
|
12856
12867
|
});
|
12857
12868
|
case 3:
|
12858
12869
|
case "end":
|
@@ -12974,10 +12985,10 @@ var k = /*#__PURE__*/function (_Dt4) {
|
|
12974
12985
|
}, {
|
12975
12986
|
key: "changeToSubmitIcon",
|
12976
12987
|
value: function changeToSubmitIcon() {
|
12977
|
-
var
|
12988
|
+
var _this72 = this;
|
12978
12989
|
this.elementRef.classList.contains(k.SUBMIT_CLASS) || (this.elementRef.classList.remove(k.LOADING_CLASS, k.DISABLED_CLASS), this.elementRef.classList.add(k.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.submit), ze.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
|
12979
12990
|
var e;
|
12980
|
-
|
12991
|
+
_this72.submitFromInput(), (e = _this72._microphoneButton) != null && e.isActive && Lt.toggleSpeechAfterSubmit(_this72._microphoneButton.elementRef, !!_this72._stopSTTAfterSubmit);
|
12981
12992
|
});
|
12982
12993
|
}
|
12983
12994
|
// called every time when user triggers an input via ValidationHandler - hence use class to check if not already present
|
@@ -13030,14 +13041,14 @@ var gn = /*#__PURE__*/function (_qe) {
|
|
13030
13041
|
_inherits(gn, _qe);
|
13031
13042
|
// prettier-ignore
|
13032
13043
|
function gn(e, t, i, n) {
|
13033
|
-
var
|
13044
|
+
var _this73;
|
13034
13045
|
_classCallCheck(this, gn);
|
13035
|
-
|
13036
|
-
var
|
13037
|
-
r =
|
13038
|
-
o =
|
13039
|
-
|
13040
|
-
return
|
13046
|
+
_this73 = _callSuper(this, gn, [e, ["modal-content", "modal-camera-content"], i]), _this73._stopped = !1, _this73._format = "image/png", _this73._canvas = document.createElement("canvas"), _this73._canvas.classList.add("camera-modal-canvas");
|
13047
|
+
var _this73$addButtonsAnd = _this73.addButtonsAndTheirEvents(t),
|
13048
|
+
r = _this73$addButtonsAnd.captureButton,
|
13049
|
+
o = _this73$addButtonsAnd.submitButton;
|
13050
|
+
_this73._captureButton = r, _this73._submitButton = o, _this73._captureIcon = _this73._captureButton.children[0], _this73._refreshIcon = J.createSVGElement(aa), _this73._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (n == null ? void 0 : n.format) === "jpeg" && (_this73._format = "image/jpeg"), n != null && n.dimensions && (_this73._dimensions = n.dimensions), _this73._contentRef.appendChild(_this73._canvas), _this73.extensionCloseCallback = _this73.stop;
|
13051
|
+
return _this73;
|
13041
13052
|
}
|
13042
13053
|
_createClass(gn, [{
|
13043
13054
|
key: "addButtonsAndTheirEvents",
|
@@ -13056,38 +13067,38 @@ var gn = /*#__PURE__*/function (_qe) {
|
|
13056
13067
|
}, {
|
13057
13068
|
key: "addButtonEvents",
|
13058
13069
|
value: function addButtonEvents(e, t, i, n) {
|
13059
|
-
var
|
13070
|
+
var _this74 = this;
|
13060
13071
|
e.onclick = function () {
|
13061
|
-
|
13072
|
+
_this74.capture();
|
13062
13073
|
}, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
|
13063
|
-
var r =
|
13064
|
-
r && Ht.addFilesToType([r], [n]),
|
13074
|
+
var r = _this74.getFile();
|
13075
|
+
r && Ht.addFilesToType([r], [n]), _this74.stop(), _this74.close();
|
13065
13076
|
};
|
13066
13077
|
}
|
13067
13078
|
}, {
|
13068
13079
|
key: "stop",
|
13069
13080
|
value: function stop() {
|
13070
|
-
var
|
13081
|
+
var _this75 = this;
|
13071
13082
|
this._mediaStream && this._mediaStream.getTracks().forEach(function (e) {
|
13072
13083
|
return e.stop();
|
13073
13084
|
}), this._stopped = !0, setTimeout(function () {
|
13074
|
-
|
13075
|
-
var e =
|
13076
|
-
e == null || e.clearRect(0, 0,
|
13085
|
+
_this75._captureButton.replaceChildren(_this75._captureIcon), _this75._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
|
13086
|
+
var e = _this75._canvas.getContext("2d");
|
13087
|
+
e == null || e.clearRect(0, 0, _this75._canvas.width, _this75._canvas.height);
|
13077
13088
|
}, qe.MODAL_CLOSE_TIMEOUT_MS);
|
13078
13089
|
}
|
13079
13090
|
}, {
|
13080
13091
|
key: "start",
|
13081
13092
|
value: function start() {
|
13082
|
-
var
|
13093
|
+
var _this76 = this;
|
13083
13094
|
this._dataURL = void 0, this._submitButton.classList.add("modal-svg-submit-disabled"), this._stopped = !1, navigator.mediaDevices.getUserMedia({
|
13084
13095
|
video: this._dimensions || !0
|
13085
13096
|
}).then(function (e) {
|
13086
|
-
if (
|
13097
|
+
if (_this76._mediaStream = e, !_this76.isOpen()) return _this76.stop();
|
13087
13098
|
var t = document.createElement("video");
|
13088
|
-
t.srcObject = e, t.play(), requestAnimationFrame(
|
13099
|
+
t.srcObject = e, t.play(), requestAnimationFrame(_this76.updateCanvas.bind(_this76, t, _this76._canvas));
|
13089
13100
|
})["catch"](function (e) {
|
13090
|
-
console.error(e),
|
13101
|
+
console.error(e), _this76.stop(), _this76.close();
|
13091
13102
|
});
|
13092
13103
|
}
|
13093
13104
|
}, {
|
@@ -13144,13 +13155,13 @@ var ha = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
13144
13155
|
var pi = /*#__PURE__*/function (_Dt5) {
|
13145
13156
|
_inherits(pi, _Dt5);
|
13146
13157
|
function pi(e, t, i) {
|
13147
|
-
var
|
13158
|
+
var _this77;
|
13148
13159
|
_classCallCheck(this, pi);
|
13149
13160
|
var r;
|
13150
|
-
|
13151
|
-
var n =
|
13152
|
-
i &&
|
13153
|
-
return
|
13161
|
+
_this77 = _callSuper(this, pi, [pi.createButtonElement(), (r = i == null ? void 0 : i.button) == null ? void 0 : r.position, (i == null ? void 0 : i.button) || {}, "Photo"]);
|
13162
|
+
var n = _this77.createInnerElements(_this77._customStyles);
|
13163
|
+
i && _this77.addClickEvent(e, t, i.modalContainerStyle, i.files), _this77.elementRef.classList.add("upload-file-button"), _this77.elementRef.appendChild(n.styles), _this77.reapplyStateStyle("styles");
|
13164
|
+
return _this77;
|
13154
13165
|
}
|
13155
13166
|
_createClass(pi, [{
|
13156
13167
|
key: "createInnerElements",
|
@@ -13295,22 +13306,22 @@ var fa = Object.defineProperty,
|
|
13295
13306
|
var y = /*#__PURE__*/function (_Ji) {
|
13296
13307
|
_inherits(y, _Ji);
|
13297
13308
|
function y() {
|
13298
|
-
var
|
13309
|
+
var _this78;
|
13299
13310
|
_classCallCheck(this, y);
|
13300
|
-
|
13311
|
+
_this78 = _callSuper(this, y), _this78.getMessages = function () {
|
13301
13312
|
return [];
|
13302
|
-
},
|
13313
|
+
}, _this78.submitUserMessage = function () {
|
13303
13314
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
13304
|
-
},
|
13315
|
+
}, _this78.addMessage = function () {
|
13305
13316
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
13306
|
-
},
|
13307
|
-
return vi.focusFromParentElement(
|
13308
|
-
},
|
13317
|
+
}, _this78.focusInput = function () {
|
13318
|
+
return vi.focusFromParentElement(_this78._elementRef);
|
13319
|
+
}, _this78.refreshMessages = function () {}, _this78.clearMessages = function () {}, _this78.scrollToBottom = function () {}, _this78.disableSubmitButton = function () {}, _this78._hasBeenRendered = !1, _this78._auxiliaryStyleApplied = !1, _this78._elementRef = document.createElement("div"), _this78._elementRef.id = "container", _this78.attachShadow({
|
13309
13320
|
mode: "open"
|
13310
|
-
}).appendChild(
|
13311
|
-
|
13321
|
+
}).appendChild(_this78._elementRef), mt.apply(ua, _this78.shadowRoot), setTimeout(function () {
|
13322
|
+
_this78._hasBeenRendered || _this78.onRender();
|
13312
13323
|
}, 20);
|
13313
|
-
return
|
13324
|
+
return _this78;
|
13314
13325
|
}
|
13315
13326
|
_createClass(y, [{
|
13316
13327
|
key: "changeToChatView",
|
@@ -31,6 +31,7 @@ export declare class SubmitButton extends InputButton<Styles> {
|
|
31
31
|
};
|
32
32
|
constructor(deepChat: DeepChat, inputElementRef: HTMLElement, messages: Messages, serviceIO: ServiceIO, fileAttachments: FileAttachments, buttons: Buttons);
|
33
33
|
private createInnerElements;
|
34
|
+
private createCustomElements;
|
34
35
|
private static createButtonContainerElement;
|
35
36
|
private static createSubmitIconElement;
|
36
37
|
private static createLoadingIconElement;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"submitButton.d.ts","sourceRoot":"","sources":["../../../../../../src/views/chat/input/buttons/submit/submitButton.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,eAAe,EAAC,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAC,kBAAkB,EAAC,MAAM,mCAAmC,CAAC;AAIrE,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AAGnE,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAE5D,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAK1D,OAAO,EAAC,QAAQ,EAAC,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAC;AACpC,OAAO,EAEL,wBAA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