deep-chat-dev 9.0.168 → 9.0.170
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/custom-elements.json +1995 -1995
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +32 -20
- package/dist/types/microphone.d.ts +10 -1
- package/dist/types/microphone.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/microphone/speechToText/speechToText.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -11939,14 +11939,14 @@ var Tt = /*#__PURE__*/function (_Lt) {
|
|
11939
11939
|
function Tt(e, t, i) {
|
11940
11940
|
var _this56;
|
11941
11941
|
_classCallCheck(this, Tt);
|
11942
|
-
var
|
11943
|
-
_this56 = _callSuper(this, Tt, [
|
11942
|
+
var n = _typeof(e.speechToText) == "object" ? e.speechToText : {};
|
11943
|
+
_this56 = _callSuper(this, Tt, [n == null ? void 0 : n.button]);
|
11944
11944
|
var _this56$processConfig = _this56.processConfiguration(t, e.speechToText),
|
11945
|
-
|
11946
|
-
|
11947
|
-
if (_this56._addErrorMessage = i,
|
11945
|
+
r = _this56$processConfig.serviceName,
|
11946
|
+
o = _this56$processConfig.processedConfig;
|
11947
|
+
if (_this56._addErrorMessage = i, r === "webspeech" && !Kt.isWebSpeechSupported()) _this56.changeToUnsupported();else {
|
11948
11948
|
var a = !e.textInput || !e.textInput.disabled;
|
11949
|
-
_this56.elementRef.onclick = _this56.buttonClick.bind(_this56, t, a,
|
11949
|
+
_this56.elementRef.onclick = _this56.buttonClick.bind(_this56, t, a, r, o);
|
11950
11950
|
}
|
11951
11951
|
setTimeout(function () {
|
11952
11952
|
_this56._validationHandler = e._validationHandler;
|
@@ -11958,7 +11958,7 @@ var Tt = /*#__PURE__*/function (_Lt) {
|
|
11958
11958
|
return _createClass(Tt, [{
|
11959
11959
|
key: "processConfiguration",
|
11960
11960
|
value: function processConfiguration(e, t) {
|
11961
|
-
var _i$displayInterimResu, _i$textColor, _i$translations, _i$commands;
|
11961
|
+
var _i$displayInterimResu, _i$textColor, _i$translations, _i$commands, _i$events;
|
11962
11962
|
var c;
|
11963
11963
|
var i = _typeof(t) == "object" ? t : {},
|
11964
11964
|
n = _typeof(i.webSpeech) == "object" ? i.webSpeech : {},
|
@@ -11967,7 +11967,8 @@ var Tt = /*#__PURE__*/function (_Lt) {
|
|
11967
11967
|
displayInterimResults: (_i$displayInterimResu = i.displayInterimResults) !== null && _i$displayInterimResu !== void 0 ? _i$displayInterimResu : void 0,
|
11968
11968
|
textColor: (_i$textColor = i.textColor) !== null && _i$textColor !== void 0 ? _i$textColor : void 0,
|
11969
11969
|
translations: (_i$translations = i.translations) !== null && _i$translations !== void 0 ? _i$translations : void 0,
|
11970
|
-
commands: (_i$commands = i.commands) !== null && _i$commands !== void 0 ? _i$commands : void 0
|
11970
|
+
commands: (_i$commands = i.commands) !== null && _i$commands !== void 0 ? _i$commands : void 0,
|
11971
|
+
events: (_i$events = i.events) !== null && _i$events !== void 0 ? _i$events : void 0
|
11971
11972
|
}, n), r),
|
11972
11973
|
a = (c = i.commands) == null ? void 0 : c.submit;
|
11973
11974
|
return a && (o.onPreResult = function (d) {
|
@@ -11987,27 +11988,38 @@ var Tt = /*#__PURE__*/function (_Lt) {
|
|
11987
11988
|
key: "buttonClick",
|
11988
11989
|
value: function buttonClick(e, t, i, n) {
|
11989
11990
|
var _this57 = this;
|
11991
|
+
var r = n == null ? void 0 : n.events;
|
11990
11992
|
e.removeTextIfPlaceholder(), Kt.toggle(i, _objectSpread({
|
11991
11993
|
insertInCursorLocation: !1,
|
11992
11994
|
element: t ? e.inputElementRef : void 0,
|
11993
11995
|
onError: function onError() {
|
11994
|
-
var
|
11995
|
-
_this57.onError(), (
|
11996
|
-
},
|
11997
|
-
onStart: this.changeToActive.bind(this),
|
11998
|
-
onStop: function onStop() {
|
11999
|
-
var r, o;
|
12000
|
-
(r = _this57._validationHandler) == null || r.call(_this57), (o = _this57._silenceSubmit) == null || o.clearSilenceTimeout(), _this57.changeToDefault();
|
11996
|
+
var o;
|
11997
|
+
_this57.onError(), (o = _this57._silenceSubmit) == null || o.clearSilenceTimeout();
|
12001
11998
|
},
|
12002
|
-
|
11999
|
+
onStart: function onStart() {
|
12003
12000
|
var o;
|
12004
|
-
(o =
|
12001
|
+
_this57.changeToActive(), (o = r == null ? void 0 : r.onStart) == null || o.call(r);
|
12002
|
+
},
|
12003
|
+
onStop: function onStop() {
|
12004
|
+
var o, a, l;
|
12005
|
+
(o = _this57._validationHandler) == null || o.call(_this57), (a = _this57._silenceSubmit) == null || a.clearSilenceTimeout(), _this57.changeToDefault(), (l = r == null ? void 0 : r.onStop) == null || l.call(r);
|
12005
12006
|
},
|
12006
|
-
|
12007
|
+
onPauseTrigger: function onPauseTrigger(o) {
|
12007
12008
|
var a, l;
|
12008
|
-
|
12009
|
+
(a = _this57._silenceSubmit) == null || a.onPause(o, e, _this57.elementRef.onclick), (l = r == null ? void 0 : r.onPauseTrigger) == null || l.call(r, o);
|
12010
|
+
},
|
12011
|
+
onPreResult: function onPreResult(o, a) {
|
12012
|
+
var l;
|
12013
|
+
(l = r == null ? void 0 : r.onPreResult) == null || l.call(r, o, a);
|
12009
12014
|
},
|
12010
|
-
|
12015
|
+
onResult: function onResult(o, a) {
|
12016
|
+
var l, c, d;
|
12017
|
+
a && ((l = _this57._validationHandler) == null || l.call(_this57)), (c = _this57._silenceSubmit) == null || c.resetSilenceTimeout(e, _this57.elementRef.onclick), (d = r == null ? void 0 : r.onResult) == null || d.call(r, o, a);
|
12018
|
+
},
|
12019
|
+
onCommandModeTrigger: function onCommandModeTrigger(o) {
|
12020
|
+
var a;
|
12021
|
+
_this57.onCommandModeTrigger(o), (a = r == null ? void 0 : r.onCommandModeTrigger) == null || a.call(r, o);
|
12022
|
+
}
|
12011
12023
|
}, n));
|
12012
12024
|
}
|
12013
12025
|
}, {
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import { OnCommandModeTrigger, WebSpeechOptions, OnPauseTrigger, AzureOptions, Translations, OnPreResult, TextColor, Commands, OnResult } from 'speech-to-element/dist/types/options';
|
1
2
|
import { ButtonStyles, ButtonPosition } from './button';
|
2
|
-
import { AzureOptions, Commands, TextColor, Translations, WebSpeechOptions } from 'speech-to-element/dist/types/options';
|
3
3
|
|
4
4
|
export interface MicrophoneStyles {
|
5
5
|
default?: ButtonStyles;
|
@@ -15,6 +15,14 @@ export interface AudioRecordingFiles {
|
|
15
15
|
maxDurationSeconds?: number;
|
16
16
|
}
|
17
17
|
export type SubmitAfterSilence = true | number;
|
18
|
+
export interface SpeechEvents {
|
19
|
+
onStart?: () => void;
|
20
|
+
onStop?: () => void;
|
21
|
+
onResult?: OnResult;
|
22
|
+
onPreResult?: OnPreResult;
|
23
|
+
onCommandModeTrigger?: OnCommandModeTrigger;
|
24
|
+
onPauseTrigger?: OnPauseTrigger;
|
25
|
+
}
|
18
26
|
export type SpeechToTextConfig = {
|
19
27
|
webSpeech?: true | WebSpeechOptions;
|
20
28
|
azure?: AzureOptions;
|
@@ -29,5 +37,6 @@ export type SpeechToTextConfig = {
|
|
29
37
|
button?: {
|
30
38
|
commandMode?: ButtonStyles;
|
31
39
|
} & MicrophoneStyles;
|
40
|
+
events?: SpeechEvents;
|
32
41
|
};
|
33
42
|
//# sourceMappingURL=microphone.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"microphone.d.ts","sourceRoot":"","sources":["../../src/types/microphone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,
|
1
|
+
{"version":3,"file":"microphone.d.ts","sourceRoot":"","sources":["../../src/types/microphone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,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C,MAAM,CAAC,EAAE;QAAC,WAAW,CAAC,EAAE,YAAY,CAAA;KAAC,GAAG,gBAAgB,CAAC;IACzD,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"speechToText.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/chat/input/buttons/microphone/speechToText/speechToText.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAC,WAAW,EAAC,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,4BAA4B,CAAC;AAIpD,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAC,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AAE7D,qBAAa,YAAa,SAAQ,gBAAgB;IAChD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkB;IACnD,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,kBAAkB,CAAC,CAAoB;IAC/C,gBAAuB,2BAA2B,OAAO;gBAE7C,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe;
|
1
|
+
{"version":3,"file":"speechToText.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/chat/input/buttons/microphone/speechToText/speechToText.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAC,WAAW,EAAC,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAC,WAAW,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