@seniorsistemas/angular-components 17.26.9-bugfix-sds-309-85a29221 → 17.26.9-bugfix-sds-305-deb2a383
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/bundles/seniorsistemas-angular-components.umd.js +82 -122
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/speech-recognition/speech-recognition/speech-recognition.component.d.ts +2 -5
- package/components/speech-recognition/speech-recognition.service.d.ts +2 -3
- package/components/text-area/text-area/text-area.component.d.ts +3 -1
- package/esm2015/components/bignumber-input/bignumber-input.directive.js +6 -5
- package/esm2015/components/speech-recognition/speech-recognition/speech-recognition.component.js +20 -38
- package/esm2015/components/speech-recognition/speech-recognition.service.js +22 -41
- package/esm2015/components/speech-recognition/text-to-speech.service.js +1 -1
- package/esm2015/components/text-area/text-area/text-area.component.js +14 -3
- package/esm5/components/bignumber-input/bignumber-input.directive.js +6 -5
- package/esm5/components/speech-recognition/speech-recognition/speech-recognition.component.js +19 -43
- package/esm5/components/speech-recognition/speech-recognition.service.js +46 -78
- package/esm5/components/speech-recognition/text-to-speech.service.js +1 -1
- package/esm5/components/text-area/text-area/text-area.component.js +18 -3
- package/fesm2015/seniorsistemas-angular-components.js +57 -82
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +84 -124
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -2085,7 +2085,7 @@
|
|
|
2085
2085
|
var BignumberInputDirective_1;
|
|
2086
2086
|
BignumberInputDirective.ctorParameters = function () { return [
|
|
2087
2087
|
{ type: core.Injector },
|
|
2088
|
-
{ type: LocaleService }
|
|
2088
|
+
{ type: LocaleService, decorators: [{ type: core.Inject, args: [LocaleService,] }] }
|
|
2089
2089
|
]; };
|
|
2090
2090
|
__decorate([
|
|
2091
2091
|
core.Input()
|
|
@@ -2131,7 +2131,8 @@
|
|
|
2131
2131
|
multi: true,
|
|
2132
2132
|
},
|
|
2133
2133
|
],
|
|
2134
|
-
})
|
|
2134
|
+
}),
|
|
2135
|
+
__param(1, core.Inject(LocaleService))
|
|
2135
2136
|
], BignumberInputDirective);
|
|
2136
2137
|
return BignumberInputDirective;
|
|
2137
2138
|
}(ng2CurrencyMask.CurrencyMaskDirective));
|
|
@@ -11504,8 +11505,9 @@
|
|
|
11504
11505
|
this.translateService = translateService;
|
|
11505
11506
|
this.hasSupportSpeechRecognition = false;
|
|
11506
11507
|
this.isListening = false;
|
|
11507
|
-
this.
|
|
11508
|
+
this.hasMicrophoneAccess = false;
|
|
11508
11509
|
this.TIMEOUT_NO_MESSAGE = 3000;
|
|
11510
|
+
this.verifyMicrophoneState();
|
|
11509
11511
|
this.setRecognition();
|
|
11510
11512
|
}
|
|
11511
11513
|
SpeechRecognitionService.prototype.listen = function () {
|
|
@@ -11514,73 +11516,82 @@
|
|
|
11514
11516
|
if (this.isListening) {
|
|
11515
11517
|
speechSubject.error('Already listening');
|
|
11516
11518
|
}
|
|
11517
|
-
this.hasMicrophoneAccess
|
|
11518
|
-
|
|
11519
|
-
|
|
11520
|
-
|
|
11521
|
-
|
|
11522
|
-
|
|
11523
|
-
|
|
11524
|
-
|
|
11525
|
-
|
|
11526
|
-
|
|
11527
|
-
|
|
11528
|
-
var
|
|
11529
|
-
|
|
11530
|
-
|
|
11531
|
-
clearTimeout(silenceTimer);
|
|
11519
|
+
else if (!this.hasMicrophoneAccess) {
|
|
11520
|
+
this.isListening = false;
|
|
11521
|
+
this.toastService.show({ severity: 'error', text: this.translateService.instant('platform.angular_components.no_microphone_permission') });
|
|
11522
|
+
speechSubject.error('Microphone access is disabled');
|
|
11523
|
+
}
|
|
11524
|
+
else {
|
|
11525
|
+
this.isListening = true;
|
|
11526
|
+
this.recognition.continuous = true;
|
|
11527
|
+
this.recognition.interimResults = true;
|
|
11528
|
+
this.recognition.maxAlternatives = 1;
|
|
11529
|
+
var silenceTimer_1;
|
|
11530
|
+
var restartSilenceTimer_1 = function () {
|
|
11531
|
+
if (silenceTimer_1 !== undefined) {
|
|
11532
|
+
clearTimeout(silenceTimer_1);
|
|
11532
11533
|
}
|
|
11533
|
-
|
|
11534
|
+
silenceTimer_1 = setTimeout(function () {
|
|
11534
11535
|
_this.recognition.stop();
|
|
11535
11536
|
}, _this.TIMEOUT_NO_MESSAGE);
|
|
11536
11537
|
};
|
|
11537
|
-
var
|
|
11538
|
-
var
|
|
11539
|
-
|
|
11538
|
+
var fullTranscript_1 = '';
|
|
11539
|
+
var interimTranscript_1 = '';
|
|
11540
|
+
this.recognition.onresult = function (event) {
|
|
11540
11541
|
_this.ngZone.run(function () {
|
|
11541
|
-
|
|
11542
|
+
restartSilenceTimer_1();
|
|
11542
11543
|
var interimTranscript = '';
|
|
11543
11544
|
for (var i = event.resultIndex; i < event.results.length; ++i) {
|
|
11544
11545
|
var transcript = event.results[i][0].transcript;
|
|
11545
11546
|
if (event.results[i].isFinal) {
|
|
11546
|
-
|
|
11547
|
+
fullTranscript_1 += transcript + '\n';
|
|
11547
11548
|
}
|
|
11548
11549
|
else {
|
|
11549
11550
|
interimTranscript += transcript;
|
|
11550
11551
|
}
|
|
11551
11552
|
}
|
|
11552
11553
|
interimTranscript = interimTranscript;
|
|
11553
|
-
speechSubject.next({ text:
|
|
11554
|
+
speechSubject.next({ text: fullTranscript_1 + interimTranscript, isFinal: false });
|
|
11554
11555
|
});
|
|
11555
11556
|
};
|
|
11556
|
-
|
|
11557
|
+
this.recognition.onerror = function () {
|
|
11557
11558
|
_this.ngZone.run(function () {
|
|
11558
|
-
if (
|
|
11559
|
-
clearTimeout(
|
|
11559
|
+
if (silenceTimer_1 !== undefined) {
|
|
11560
|
+
clearTimeout(silenceTimer_1);
|
|
11560
11561
|
}
|
|
11561
11562
|
_this.isListening = false;
|
|
11562
11563
|
speechSubject.error('Speech recognition error');
|
|
11563
|
-
_this.microphoneStatus$.next('inactive');
|
|
11564
11564
|
});
|
|
11565
11565
|
};
|
|
11566
|
-
|
|
11566
|
+
this.recognition.onend = function () {
|
|
11567
11567
|
_this.ngZone.run(function () {
|
|
11568
|
-
if (
|
|
11569
|
-
clearTimeout(
|
|
11568
|
+
if (silenceTimer_1 !== undefined) {
|
|
11569
|
+
clearTimeout(silenceTimer_1);
|
|
11570
11570
|
}
|
|
11571
|
-
speechSubject.next({ text:
|
|
11571
|
+
speechSubject.next({ text: fullTranscript_1 + interimTranscript_1, isFinal: true });
|
|
11572
11572
|
_this.isListening = false;
|
|
11573
11573
|
speechSubject.complete();
|
|
11574
|
-
_this.microphoneStatus$.next('inactive');
|
|
11575
11574
|
});
|
|
11576
11575
|
};
|
|
11577
|
-
|
|
11578
|
-
}
|
|
11576
|
+
this.recognition.start();
|
|
11577
|
+
}
|
|
11579
11578
|
return speechSubject;
|
|
11580
11579
|
};
|
|
11581
11580
|
SpeechRecognitionService.prototype.stop = function () {
|
|
11582
11581
|
this.recognition.stop();
|
|
11583
11582
|
};
|
|
11583
|
+
SpeechRecognitionService.prototype.verifyMicrophoneState = function () {
|
|
11584
|
+
var _this = this;
|
|
11585
|
+
navigator.permissions.query({ name: 'microphone' }).then(function (result) {
|
|
11586
|
+
var microphoneResultState = result.state;
|
|
11587
|
+
_this.hasMicrophoneAccess = microphoneResultState === 'granted';
|
|
11588
|
+
result.onchange = function () {
|
|
11589
|
+
_this.ngZone.run(function () {
|
|
11590
|
+
_this.hasMicrophoneAccess = result.state === 'granted';
|
|
11591
|
+
});
|
|
11592
|
+
};
|
|
11593
|
+
});
|
|
11594
|
+
};
|
|
11584
11595
|
SpeechRecognitionService.prototype.setRecognition = function () {
|
|
11585
11596
|
var _this = this;
|
|
11586
11597
|
var _a;
|
|
@@ -11596,48 +11607,6 @@
|
|
|
11596
11607
|
this.recognition.maxAlternatives = 1;
|
|
11597
11608
|
this.localeService.getLocale().subscribe(function (locale) { return _this.recognition.lang = locale; });
|
|
11598
11609
|
};
|
|
11599
|
-
Object.defineProperty(SpeechRecognitionService.prototype, "hasMicrophoneAccess", {
|
|
11600
|
-
get: function () {
|
|
11601
|
-
var _this = this;
|
|
11602
|
-
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
|
|
11603
|
-
var permission;
|
|
11604
|
-
var _this = this;
|
|
11605
|
-
return __generator(this, function (_a) {
|
|
11606
|
-
switch (_a.label) {
|
|
11607
|
-
case 0: return [4 /*yield*/, navigator.permissions.query({ name: 'microphone' })];
|
|
11608
|
-
case 1:
|
|
11609
|
-
permission = _a.sent();
|
|
11610
|
-
if (permission.state === 'denied') {
|
|
11611
|
-
resolve(false);
|
|
11612
|
-
}
|
|
11613
|
-
else if (permission.state === 'granted') {
|
|
11614
|
-
resolve(true);
|
|
11615
|
-
}
|
|
11616
|
-
else if (permission.state === 'prompt') {
|
|
11617
|
-
try {
|
|
11618
|
-
navigator.mediaDevices.getUserMedia({ audio: true }).then(function (stream) {
|
|
11619
|
-
stream.getTracks().forEach(function (t) { return t.stop(); });
|
|
11620
|
-
}).catch(function () {
|
|
11621
|
-
resolve(false);
|
|
11622
|
-
});
|
|
11623
|
-
permission.onchange = function () {
|
|
11624
|
-
_this.ngZone.run(function () {
|
|
11625
|
-
resolve(permission.state === 'granted' ? true : false);
|
|
11626
|
-
});
|
|
11627
|
-
};
|
|
11628
|
-
}
|
|
11629
|
-
catch (error) {
|
|
11630
|
-
resolve(false);
|
|
11631
|
-
}
|
|
11632
|
-
}
|
|
11633
|
-
return [2 /*return*/];
|
|
11634
|
-
}
|
|
11635
|
-
});
|
|
11636
|
-
}); });
|
|
11637
|
-
},
|
|
11638
|
-
enumerable: true,
|
|
11639
|
-
configurable: true
|
|
11640
|
-
});
|
|
11641
11610
|
SpeechRecognitionService.ctorParameters = function () { return [
|
|
11642
11611
|
{ type: LocaleService },
|
|
11643
11612
|
{ type: core.NgZone },
|
|
@@ -13655,6 +13624,21 @@
|
|
|
13655
13624
|
enumerable: true,
|
|
13656
13625
|
configurable: true
|
|
13657
13626
|
});
|
|
13627
|
+
Object.defineProperty(TextAreaComponent.prototype, "placeholder", {
|
|
13628
|
+
get: function () {
|
|
13629
|
+
return this._placeholder;
|
|
13630
|
+
},
|
|
13631
|
+
set: function (value) {
|
|
13632
|
+
if (value) {
|
|
13633
|
+
this._placeholder = value;
|
|
13634
|
+
}
|
|
13635
|
+
else {
|
|
13636
|
+
this._placeholder = '';
|
|
13637
|
+
}
|
|
13638
|
+
},
|
|
13639
|
+
enumerable: true,
|
|
13640
|
+
configurable: true
|
|
13641
|
+
});
|
|
13658
13642
|
Object.defineProperty(TextAreaComponent.prototype, "inputStyle", {
|
|
13659
13643
|
get: function () {
|
|
13660
13644
|
return this._inputStyle;
|
|
@@ -13719,7 +13703,7 @@
|
|
|
13719
13703
|
], TextAreaComponent.prototype, "maxLength", void 0);
|
|
13720
13704
|
__decorate([
|
|
13721
13705
|
core.Input()
|
|
13722
|
-
], TextAreaComponent.prototype, "placeholder",
|
|
13706
|
+
], TextAreaComponent.prototype, "placeholder", null);
|
|
13723
13707
|
__decorate([
|
|
13724
13708
|
core.Input()
|
|
13725
13709
|
], TextAreaComponent.prototype, "inputStyle", null);
|
|
@@ -13729,7 +13713,7 @@
|
|
|
13729
13713
|
TextAreaComponent = TextAreaComponent_1 = __decorate([
|
|
13730
13714
|
core.Component({
|
|
13731
13715
|
selector: 's-textarea',
|
|
13732
|
-
template: "<textarea\n *ngIf=\"keyFilter\"\n #textArea\n class=\"textarea\"\n [pKeyFilter]=\"keyFilter\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder
|
|
13716
|
+
template: "<textarea\n *ngIf=\"keyFilter\"\n #textArea\n class=\"textarea\"\n [pKeyFilter]=\"keyFilter\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<textarea\n *ngIf=\"!keyFilter\"\n #textArea\n class=\"textarea\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<s-speech-recognition\n *ngIf=\"speechRecognition && renderTextArea\"\n [textAreaElement]=\"textAreaElement.nativeElement\"\n [keepContext]=\"keepContext\"\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\n (recognizedText)=\"handleRecognizedText($event)\">\n</s-speech-recognition>\n",
|
|
13733
13717
|
providers: [
|
|
13734
13718
|
{
|
|
13735
13719
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
@@ -13839,7 +13823,7 @@
|
|
|
13839
13823
|
this.speechRecognitionPlaceholder = '';
|
|
13840
13824
|
this._recognizedText = '';
|
|
13841
13825
|
this.originalTextAreaElementText = '';
|
|
13842
|
-
this.
|
|
13826
|
+
this.isDoneSpeaking = false;
|
|
13843
13827
|
this.onDestroy$ = new rxjs.Subject();
|
|
13844
13828
|
this.VOICE_SPEEDS = [0.5, 1, 1.5, 2];
|
|
13845
13829
|
this.keydownEventListener = function (event) {
|
|
@@ -13848,7 +13832,7 @@
|
|
|
13848
13832
|
}
|
|
13849
13833
|
};
|
|
13850
13834
|
this.disabled = false;
|
|
13851
|
-
this.
|
|
13835
|
+
this.isSpeaking = false;
|
|
13852
13836
|
this.voiceSpeed = 1;
|
|
13853
13837
|
this.isDisabledMicrophone = false;
|
|
13854
13838
|
this.canRenderMicrophone = true;
|
|
@@ -13860,9 +13844,7 @@
|
|
|
13860
13844
|
this.isPlayingTextToSpeech = false;
|
|
13861
13845
|
this.recognizedText = new core.EventEmitter();
|
|
13862
13846
|
}
|
|
13863
|
-
SpeechRecognitionComponent_1 = SpeechRecognitionComponent;
|
|
13864
13847
|
SpeechRecognitionComponent.prototype.ngOnInit = function () {
|
|
13865
|
-
var _this = this;
|
|
13866
13848
|
if (!this.hasSpeechRecognitionBrowserApi) {
|
|
13867
13849
|
return;
|
|
13868
13850
|
}
|
|
@@ -13871,26 +13853,18 @@
|
|
|
13871
13853
|
}
|
|
13872
13854
|
this.textAreaElement.placeholder = this.speechRecognitionPlaceholder ? this.speechRecognitionPlaceholder : this.translateService.instant("platform.angular_components.text_area_speech_recognition_placeholder");
|
|
13873
13855
|
this.textAreaElement.addEventListener('keydown', this.keydownEventListener);
|
|
13874
|
-
this.speechRecognitionService.microphoneStatus$.pipe(operators.takeUntil(this.onDestroy$)).subscribe(function (status) {
|
|
13875
|
-
if (status === 'active') {
|
|
13876
|
-
_this.onCloseToolbar();
|
|
13877
|
-
}
|
|
13878
|
-
});
|
|
13879
13856
|
};
|
|
13880
13857
|
SpeechRecognitionComponent.prototype.onListen = function () {
|
|
13881
13858
|
var _this = this;
|
|
13882
13859
|
if (this.isDisabledMicrophone || this.isListening) {
|
|
13883
13860
|
return;
|
|
13884
13861
|
}
|
|
13885
|
-
// if (this.isPlayingTextToSpeech) {
|
|
13886
|
-
// this.onCloseToolbar();
|
|
13887
|
-
// }
|
|
13888
13862
|
this.disabled = true;
|
|
13889
13863
|
this.canRenderMicrophone = false;
|
|
13890
13864
|
this.canRenderListeningText = true;
|
|
13891
13865
|
this.originalTextAreaElementText = this.textAreaElement.value;
|
|
13892
13866
|
this.textAreaElement.value = '';
|
|
13893
|
-
this.
|
|
13867
|
+
this.isSpeaking = true;
|
|
13894
13868
|
this.speechRecognitionService.listen()
|
|
13895
13869
|
.pipe(operators.takeUntil(this.onDestroy$))
|
|
13896
13870
|
.subscribe(function (_a) {
|
|
@@ -13902,10 +13876,10 @@
|
|
|
13902
13876
|
_this.canRenderAprove = true;
|
|
13903
13877
|
_this.canRenderDiscard = true;
|
|
13904
13878
|
_this.canRenderListeningText = false;
|
|
13905
|
-
_this.
|
|
13879
|
+
_this.isSpeaking = false;
|
|
13906
13880
|
}
|
|
13907
13881
|
}, function () {
|
|
13908
|
-
_this.
|
|
13882
|
+
_this.isSpeaking = false;
|
|
13909
13883
|
_this.canRenderMicrophone = true;
|
|
13910
13884
|
_this.isDisabledMicrophone = false;
|
|
13911
13885
|
_this.canRenderListeningText = false;
|
|
@@ -13924,15 +13898,15 @@
|
|
|
13924
13898
|
}
|
|
13925
13899
|
this.canRenderTextToSpeechToolbar = true;
|
|
13926
13900
|
this.canRenderTextToSpeech = false;
|
|
13927
|
-
|
|
13901
|
+
this.isPlayingTextToSpeech = true;
|
|
13928
13902
|
this.speak();
|
|
13929
13903
|
};
|
|
13930
13904
|
SpeechRecognitionComponent.prototype.onCloseToolbar = function () {
|
|
13931
13905
|
this.canRenderTextToSpeechToolbar = false;
|
|
13932
13906
|
this.canRenderTextToSpeech = true;
|
|
13933
|
-
this.
|
|
13907
|
+
this.isPlayingTextToSpeech = false;
|
|
13908
|
+
this.textToSpeechService.cancel();
|
|
13934
13909
|
this.voiceSpeed = 1;
|
|
13935
|
-
SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = false;
|
|
13936
13910
|
};
|
|
13937
13911
|
SpeechRecognitionComponent.prototype.onDiscard = function () {
|
|
13938
13912
|
this.canRenderAprove = false;
|
|
@@ -13943,8 +13917,7 @@
|
|
|
13943
13917
|
this._recognizedText = '';
|
|
13944
13918
|
this.setTextAreaValue(this.originalTextAreaElementText);
|
|
13945
13919
|
this.disabled = false;
|
|
13946
|
-
this.
|
|
13947
|
-
SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = false;
|
|
13920
|
+
this.textToSpeechService.cancel();
|
|
13948
13921
|
};
|
|
13949
13922
|
SpeechRecognitionComponent.prototype.onAprove = function () {
|
|
13950
13923
|
this.canRenderAprove = false;
|
|
@@ -13974,7 +13947,7 @@
|
|
|
13974
13947
|
this.textToSpeechService.pause();
|
|
13975
13948
|
}
|
|
13976
13949
|
else {
|
|
13977
|
-
if (this.
|
|
13950
|
+
if (this.isDoneSpeaking) {
|
|
13978
13951
|
this.speak();
|
|
13979
13952
|
}
|
|
13980
13953
|
else {
|
|
@@ -13984,6 +13957,7 @@
|
|
|
13984
13957
|
this.isPlayingTextToSpeech = !this.isPlayingTextToSpeech;
|
|
13985
13958
|
};
|
|
13986
13959
|
SpeechRecognitionComponent.prototype.restartTextToSpeech = function () {
|
|
13960
|
+
this.isPlayingTextToSpeech = true;
|
|
13987
13961
|
this.textToSpeechService.cancel();
|
|
13988
13962
|
this.speak();
|
|
13989
13963
|
};
|
|
@@ -14014,7 +13988,7 @@
|
|
|
14014
13988
|
Object.defineProperty(SpeechRecognitionComponent.prototype, "isDisabledTextToSpeech", {
|
|
14015
13989
|
get: function () {
|
|
14016
13990
|
var hasTextToSpeechVoice = this.textToSpeechService.hasVoice;
|
|
14017
|
-
return !this.
|
|
13991
|
+
return !this._recognizedText || !hasTextToSpeechVoice || this.isListening;
|
|
14018
13992
|
},
|
|
14019
13993
|
enumerable: true,
|
|
14020
13994
|
configurable: true
|
|
@@ -14022,28 +13996,14 @@
|
|
|
14022
13996
|
SpeechRecognitionComponent.prototype.setTextAreaValue = function (value) {
|
|
14023
13997
|
this.textAreaElement.value = value;
|
|
14024
13998
|
};
|
|
14025
|
-
SpeechRecognitionComponent.prototype.stopTextToSpeech = function () {
|
|
14026
|
-
this.isPlayingTextToSpeech = false;
|
|
14027
|
-
this.textToSpeechService.cancel();
|
|
14028
|
-
};
|
|
14029
13999
|
SpeechRecognitionComponent.prototype.speak = function () {
|
|
14030
14000
|
var _this = this;
|
|
14031
|
-
this.
|
|
14032
|
-
this.
|
|
14033
|
-
this.textToSpeechService.speak(this.textToSpeech, this.voiceSpeed).then(function () {
|
|
14001
|
+
this.isDoneSpeaking = false;
|
|
14002
|
+
this.textToSpeechService.speak(this._recognizedText, this.voiceSpeed).then(function () {
|
|
14034
14003
|
_this.isPlayingTextToSpeech = false;
|
|
14035
|
-
_this.
|
|
14004
|
+
_this.isDoneSpeaking = true;
|
|
14036
14005
|
});
|
|
14037
14006
|
};
|
|
14038
|
-
Object.defineProperty(SpeechRecognitionComponent.prototype, "textToSpeech", {
|
|
14039
|
-
get: function () {
|
|
14040
|
-
return this.textAreaElement.value;
|
|
14041
|
-
},
|
|
14042
|
-
enumerable: true,
|
|
14043
|
-
configurable: true
|
|
14044
|
-
});
|
|
14045
|
-
var SpeechRecognitionComponent_1;
|
|
14046
|
-
SpeechRecognitionComponent.TOOLBAR_ACTIVE = false;
|
|
14047
14007
|
SpeechRecognitionComponent.ctorParameters = function () { return [
|
|
14048
14008
|
{ type: SpeechRecognitionService },
|
|
14049
14009
|
{ type: TextToSpeechService },
|
|
@@ -14061,11 +14021,11 @@
|
|
|
14061
14021
|
__decorate([
|
|
14062
14022
|
core.Output()
|
|
14063
14023
|
], SpeechRecognitionComponent.prototype, "recognizedText", void 0);
|
|
14064
|
-
SpeechRecognitionComponent =
|
|
14024
|
+
SpeechRecognitionComponent = __decorate([
|
|
14065
14025
|
core.Component({
|
|
14066
14026
|
selector: 's-speech-recognition',
|
|
14067
|
-
template: "<section class=\"speech-recognition\" *ngIf=\"hasSpeechRecognitionBrowserApi\">\n <div class=\"speech-recognition-text\">\n <ng-container *ngIf=\"canRenderMicrophone\">\n {{ 'platform.angular_components.text_area_before_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"
|
|
14068
|
-
styles: [".speech-recognition{display:-ms-flexbox;display:flex;gap:10px;-ms-flex-pack:justify;justify-content:space-between;width:100%}.speech-recognition-buttons{display:-ms-flexbox;display:flex;gap:10px;position:relative;bottom:15px;margin-right:16px}.speech-recognition-item{display:-ms-inline-flexbox;display:inline-flex;height:25px;padding:4px 12px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:-ms-flexbox;display:flex;border-radius:15px;-ms-flex-align:center;align-items:center;color:#fff
|
|
14027
|
+
template: "<section class=\"speech-recognition\" *ngIf=\"hasSpeechRecognitionBrowserApi\">\n <div class=\"speech-recognition-text\">\n <ng-container *ngIf=\"canRenderMicrophone\">\n {{ 'platform.angular_components.text_area_before_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"isSpeaking\">\n {{ 'platform.angular_components.text_area_while_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"canRenderAprove && canRenderDiscard\">\n {{ 'platform.angular_components.text_area_end_speech' | translate }}\n </ng-container>\n </div>\n <div class=\"speech-recognition-buttons\">\n <span\n *ngIf=\"canRenderListeningText\"\n (click)=\"stopListening()\"\n class=\"speech-recognition-item speech-recognition-item-regular\">\n <i class=\"far fa-ellipsis-h\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderMicrophone\"\n (click)=\"onListen()\"\n class=\"speech-recognition-item speech-recognition-item-microphone\"\n [class.speech-recognition-item-disabled]=\"isDisabledMicrophone || isListening || disabled\">\n <i class=\"fas fa-microphone\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderAprove\"\n (click)=\"onAprove()\"\n class=\"speech-recognition-item speech-recognition-item-aprove\">\n <i class=\"fas fa-check\"></i>\n </span>\n\n <span *ngIf=\"canRenderDiscard\"\n (click)=\"onDiscard()\"\n class=\"speech-recognition-item speech-recognition-item-discard\">\n <i class=\"fas fa-times\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeech\"\n (click)=\"onOpenToolbar()\"\n class=\"speech-recognition-item speech-recognition-item-regular\"\n [class.speech-recognition-item-disabled]=\"isDisabledTextToSpeech\">\n <i class=\"fas fa-volume-down\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeechToolbar\"\n class=\"speech-recognition-item-toolbar\">\n <i class=\"fas\" [class.fa-pause]=\"isPlayingTextToSpeech\" [class.fa-play]=\"!isPlayingTextToSpeech\"\n (click)=\"toggleTextToSpeech()\"></i>\n <i class=\"fas fa-backward\" (click)=\"restartTextToSpeech()\"></i>\n <span (click)=\"updateVoiceSpeed()\">\n {{ voiceSpeed }}x\n </span>\n <i class=\"fas fa-times\" (click)=\"onCloseToolbar()\"></i>\n </span>\n </div>\n</section>\n",
|
|
14028
|
+
styles: [".speech-recognition{display:-ms-flexbox;display:flex;gap:10px;-ms-flex-pack:justify;justify-content:space-between;width:100%}.speech-recognition-buttons{display:-ms-flexbox;display:flex;gap:10px;position:relative;bottom:15px;margin-right:16px}.speech-recognition-item{display:-ms-inline-flexbox;display:inline-flex;height:25px;padding:4px 12px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:-ms-flexbox;display:flex;border-radius:15px;-ms-flex-align:center;align-items:center;color:#fff}.speech-recognition-item-toolbar i,.speech-recognition-item-toolbar span{cursor:pointer}.speech-recognition-item-toolbar i:not(:first-child),.speech-recognition-item-toolbar i:not(:last-child){padding:6px}.speech-recognition-item-toolbar i:first-child{padding-left:10px}.speech-recognition-item-toolbar i:last-child{padding-right:10px}.speech-recognition-item-toolbar span{height:25px}.speech-recognition-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}"]
|
|
14069
14029
|
})
|
|
14070
14030
|
], SpeechRecognitionComponent);
|
|
14071
14031
|
return SpeechRecognitionComponent;
|