@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.
Files changed (23) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +82 -122
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/speech-recognition/speech-recognition/speech-recognition.component.d.ts +2 -5
  6. package/components/speech-recognition/speech-recognition.service.d.ts +2 -3
  7. package/components/text-area/text-area/text-area.component.d.ts +3 -1
  8. package/esm2015/components/bignumber-input/bignumber-input.directive.js +6 -5
  9. package/esm2015/components/speech-recognition/speech-recognition/speech-recognition.component.js +20 -38
  10. package/esm2015/components/speech-recognition/speech-recognition.service.js +22 -41
  11. package/esm2015/components/speech-recognition/text-to-speech.service.js +1 -1
  12. package/esm2015/components/text-area/text-area/text-area.component.js +14 -3
  13. package/esm5/components/bignumber-input/bignumber-input.directive.js +6 -5
  14. package/esm5/components/speech-recognition/speech-recognition/speech-recognition.component.js +19 -43
  15. package/esm5/components/speech-recognition/speech-recognition.service.js +46 -78
  16. package/esm5/components/speech-recognition/text-to-speech.service.js +1 -1
  17. package/esm5/components/text-area/text-area/text-area.component.js +18 -3
  18. package/fesm2015/seniorsistemas-angular-components.js +57 -82
  19. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  20. package/fesm5/seniorsistemas-angular-components.js +84 -124
  21. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  22. package/package.json +1 -1
  23. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -1,5 +1,5 @@
1
- import { __decorate, __awaiter, __param, __rest } from 'tslib';
2
- import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Renderer2, Directive, TemplateRef, ViewContainerRef, Pipe, ɵɵinject, HostBinding, ChangeDetectorRef, ViewChildren, InjectionToken, Inject, PLATFORM_ID, KeyValueDiffers, ViewEncapsulation, INJECTOR, NgZone, ContentChild, Optional } from '@angular/core';
1
+ import { __decorate, __param, __awaiter, __rest } from 'tslib';
2
+ import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Renderer2, Directive, TemplateRef, ViewContainerRef, Pipe, ɵɵinject, Inject, HostBinding, ChangeDetectorRef, ViewChildren, InjectionToken, PLATFORM_ID, KeyValueDiffers, ViewEncapsulation, INJECTOR, NgZone, ContentChild, Optional } from '@angular/core';
3
3
  import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
4
4
  import { Subject, of, from, ReplaySubject, throwError, fromEvent, forkJoin, pipe } from 'rxjs';
5
5
  import { takeUntil, tap, map, switchMap, catchError, first, filter, take, delay, debounceTime, repeat, finalize } from 'rxjs/operators';
@@ -1819,7 +1819,7 @@ let BignumberInputDirective = BignumberInputDirective_1 = class BignumberInputDi
1819
1819
  };
1820
1820
  BignumberInputDirective.ctorParameters = () => [
1821
1821
  { type: Injector },
1822
- { type: LocaleService }
1822
+ { type: LocaleService, decorators: [{ type: Inject, args: [LocaleService,] }] }
1823
1823
  ];
1824
1824
  __decorate([
1825
1825
  Input()
@@ -1865,7 +1865,8 @@ BignumberInputDirective = BignumberInputDirective_1 = __decorate([
1865
1865
  multi: true,
1866
1866
  },
1867
1867
  ],
1868
- })
1868
+ }),
1869
+ __param(1, Inject(LocaleService))
1869
1870
  ], BignumberInputDirective);
1870
1871
 
1871
1872
  let BignumberInputModule = class BignumberInputModule {
@@ -10624,8 +10625,9 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10624
10625
  this.translateService = translateService;
10625
10626
  this.hasSupportSpeechRecognition = false;
10626
10627
  this.isListening = false;
10627
- this.microphoneStatus$ = new Subject();
10628
+ this.hasMicrophoneAccess = false;
10628
10629
  this.TIMEOUT_NO_MESSAGE = 3000;
10630
+ this.verifyMicrophoneState();
10629
10631
  this.setRecognition();
10630
10632
  }
10631
10633
  listen() {
@@ -10633,13 +10635,12 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10633
10635
  if (this.isListening) {
10634
10636
  speechSubject.error('Already listening');
10635
10637
  }
10636
- this.hasMicrophoneAccess.then((hasAccess) => {
10637
- if (!hasAccess) {
10638
- this.toastService.show({ severity: 'error', text: this.translateService.instant('platform.angular_components.no_microphone_permission') });
10639
- speechSubject.error('Microphone access is disabled');
10640
- return;
10641
- }
10642
- this.microphoneStatus$.next('active');
10638
+ else if (!this.hasMicrophoneAccess) {
10639
+ this.isListening = false;
10640
+ this.toastService.show({ severity: 'error', text: this.translateService.instant('platform.angular_components.no_microphone_permission') });
10641
+ speechSubject.error('Microphone access is disabled');
10642
+ }
10643
+ else {
10643
10644
  this.isListening = true;
10644
10645
  this.recognition.continuous = true;
10645
10646
  this.recognition.interimResults = true;
@@ -10679,7 +10680,6 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10679
10680
  }
10680
10681
  this.isListening = false;
10681
10682
  speechSubject.error('Speech recognition error');
10682
- this.microphoneStatus$.next('inactive');
10683
10683
  });
10684
10684
  };
10685
10685
  this.recognition.onend = () => {
@@ -10690,16 +10690,26 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10690
10690
  speechSubject.next({ text: fullTranscript + interimTranscript, isFinal: true });
10691
10691
  this.isListening = false;
10692
10692
  speechSubject.complete();
10693
- this.microphoneStatus$.next('inactive');
10694
10693
  });
10695
10694
  };
10696
10695
  this.recognition.start();
10697
- });
10696
+ }
10698
10697
  return speechSubject;
10699
10698
  }
10700
10699
  stop() {
10701
10700
  this.recognition.stop();
10702
10701
  }
10702
+ verifyMicrophoneState() {
10703
+ navigator.permissions.query({ name: 'microphone' }).then((result) => {
10704
+ const microphoneResultState = result.state;
10705
+ this.hasMicrophoneAccess = microphoneResultState === 'granted';
10706
+ result.onchange = () => {
10707
+ this.ngZone.run(() => {
10708
+ this.hasMicrophoneAccess = result.state === 'granted';
10709
+ });
10710
+ };
10711
+ });
10712
+ }
10703
10713
  setRecognition() {
10704
10714
  var _a;
10705
10715
  const SpeechRecognitionConstructor = window.SpeechRecognition || window.webkitSpeechRecognition;
@@ -10714,34 +10724,6 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10714
10724
  this.recognition.maxAlternatives = 1;
10715
10725
  this.localeService.getLocale().subscribe(locale => this.recognition.lang = locale);
10716
10726
  }
10717
- get hasMicrophoneAccess() {
10718
- return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
10719
- const permission = yield navigator.permissions.query({ name: 'microphone' });
10720
- if (permission.state === 'denied') {
10721
- resolve(false);
10722
- }
10723
- else if (permission.state === 'granted') {
10724
- resolve(true);
10725
- }
10726
- else if (permission.state === 'prompt') {
10727
- try {
10728
- navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
10729
- stream.getTracks().forEach(t => t.stop());
10730
- }).catch(() => {
10731
- resolve(false);
10732
- });
10733
- permission.onchange = () => {
10734
- this.ngZone.run(() => {
10735
- resolve(permission.state === 'granted' ? true : false);
10736
- });
10737
- };
10738
- }
10739
- catch (error) {
10740
- resolve(false);
10741
- }
10742
- }
10743
- }));
10744
- }
10745
10727
  };
10746
10728
  SpeechRecognitionService.ctorParameters = () => [
10747
10729
  { type: LocaleService },
@@ -12664,6 +12646,17 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent {
12664
12646
  this.cdr.detectChanges();
12665
12647
  });
12666
12648
  }
12649
+ get placeholder() {
12650
+ return this._placeholder;
12651
+ }
12652
+ set placeholder(value) {
12653
+ if (value) {
12654
+ this._placeholder = value;
12655
+ }
12656
+ else {
12657
+ this._placeholder = '';
12658
+ }
12659
+ }
12667
12660
  get inputStyle() {
12668
12661
  return this._inputStyle;
12669
12662
  }
@@ -12724,7 +12717,7 @@ __decorate([
12724
12717
  ], TextAreaComponent.prototype, "maxLength", void 0);
12725
12718
  __decorate([
12726
12719
  Input()
12727
- ], TextAreaComponent.prototype, "placeholder", void 0);
12720
+ ], TextAreaComponent.prototype, "placeholder", null);
12728
12721
  __decorate([
12729
12722
  Input()
12730
12723
  ], TextAreaComponent.prototype, "inputStyle", null);
@@ -12734,7 +12727,7 @@ __decorate([
12734
12727
  TextAreaComponent = TextAreaComponent_1 = __decorate([
12735
12728
  Component({
12736
12729
  selector: 's-textarea',
12737
- 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 ? 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 ? 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",
12730
+ 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",
12738
12731
  providers: [
12739
12732
  {
12740
12733
  provide: NG_VALUE_ACCESSOR,
@@ -12824,8 +12817,7 @@ TextToSpeechService = __decorate([
12824
12817
  })
12825
12818
  ], TextToSpeechService);
12826
12819
 
12827
- var SpeechRecognitionComponent_1;
12828
- let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechRecognitionComponent {
12820
+ let SpeechRecognitionComponent = class SpeechRecognitionComponent {
12829
12821
  constructor(speechRecognitionService, textToSpeechService, translateService) {
12830
12822
  this.speechRecognitionService = speechRecognitionService;
12831
12823
  this.textToSpeechService = textToSpeechService;
@@ -12834,7 +12826,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12834
12826
  this.speechRecognitionPlaceholder = '';
12835
12827
  this._recognizedText = '';
12836
12828
  this.originalTextAreaElementText = '';
12837
- this.isDoneTextToSpeech = false;
12829
+ this.isDoneSpeaking = false;
12838
12830
  this.onDestroy$ = new Subject();
12839
12831
  this.VOICE_SPEEDS = [0.5, 1, 1.5, 2];
12840
12832
  this.keydownEventListener = (event) => {
@@ -12843,7 +12835,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12843
12835
  }
12844
12836
  };
12845
12837
  this.disabled = false;
12846
- this.isListeningUserVoice = false;
12838
+ this.isSpeaking = false;
12847
12839
  this.voiceSpeed = 1;
12848
12840
  this.isDisabledMicrophone = false;
12849
12841
  this.canRenderMicrophone = true;
@@ -12864,25 +12856,17 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12864
12856
  }
12865
12857
  this.textAreaElement.placeholder = this.speechRecognitionPlaceholder ? this.speechRecognitionPlaceholder : this.translateService.instant("platform.angular_components.text_area_speech_recognition_placeholder");
12866
12858
  this.textAreaElement.addEventListener('keydown', this.keydownEventListener);
12867
- this.speechRecognitionService.microphoneStatus$.pipe(takeUntil(this.onDestroy$)).subscribe((status) => {
12868
- if (status === 'active') {
12869
- this.onCloseToolbar();
12870
- }
12871
- });
12872
12859
  }
12873
12860
  onListen() {
12874
12861
  if (this.isDisabledMicrophone || this.isListening) {
12875
12862
  return;
12876
12863
  }
12877
- // if (this.isPlayingTextToSpeech) {
12878
- // this.onCloseToolbar();
12879
- // }
12880
12864
  this.disabled = true;
12881
12865
  this.canRenderMicrophone = false;
12882
12866
  this.canRenderListeningText = true;
12883
12867
  this.originalTextAreaElementText = this.textAreaElement.value;
12884
12868
  this.textAreaElement.value = '';
12885
- this.isListeningUserVoice = true;
12869
+ this.isSpeaking = true;
12886
12870
  this.speechRecognitionService.listen()
12887
12871
  .pipe(takeUntil(this.onDestroy$))
12888
12872
  .subscribe(({ text, isFinal }) => {
@@ -12893,10 +12877,10 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12893
12877
  this.canRenderAprove = true;
12894
12878
  this.canRenderDiscard = true;
12895
12879
  this.canRenderListeningText = false;
12896
- this.isListeningUserVoice = false;
12880
+ this.isSpeaking = false;
12897
12881
  }
12898
12882
  }, () => {
12899
- this.isListeningUserVoice = false;
12883
+ this.isSpeaking = false;
12900
12884
  this.canRenderMicrophone = true;
12901
12885
  this.isDisabledMicrophone = false;
12902
12886
  this.canRenderListeningText = false;
@@ -12914,15 +12898,15 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12914
12898
  }
12915
12899
  this.canRenderTextToSpeechToolbar = true;
12916
12900
  this.canRenderTextToSpeech = false;
12917
- SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = true;
12901
+ this.isPlayingTextToSpeech = true;
12918
12902
  this.speak();
12919
12903
  }
12920
12904
  onCloseToolbar() {
12921
12905
  this.canRenderTextToSpeechToolbar = false;
12922
12906
  this.canRenderTextToSpeech = true;
12923
- this.stopTextToSpeech();
12907
+ this.isPlayingTextToSpeech = false;
12908
+ this.textToSpeechService.cancel();
12924
12909
  this.voiceSpeed = 1;
12925
- SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = false;
12926
12910
  }
12927
12911
  onDiscard() {
12928
12912
  this.canRenderAprove = false;
@@ -12933,8 +12917,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12933
12917
  this._recognizedText = '';
12934
12918
  this.setTextAreaValue(this.originalTextAreaElementText);
12935
12919
  this.disabled = false;
12936
- this.stopTextToSpeech();
12937
- SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = false;
12920
+ this.textToSpeechService.cancel();
12938
12921
  }
12939
12922
  onAprove() {
12940
12923
  this.canRenderAprove = false;
@@ -12964,7 +12947,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12964
12947
  this.textToSpeechService.pause();
12965
12948
  }
12966
12949
  else {
12967
- if (this.isDoneTextToSpeech) {
12950
+ if (this.isDoneSpeaking) {
12968
12951
  this.speak();
12969
12952
  }
12970
12953
  else {
@@ -12974,6 +12957,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12974
12957
  this.isPlayingTextToSpeech = !this.isPlayingTextToSpeech;
12975
12958
  }
12976
12959
  restartTextToSpeech() {
12960
+ this.isPlayingTextToSpeech = true;
12977
12961
  this.textToSpeechService.cancel();
12978
12962
  this.speak();
12979
12963
  }
@@ -12995,28 +12979,19 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12995
12979
  }
12996
12980
  get isDisabledTextToSpeech() {
12997
12981
  const hasTextToSpeechVoice = this.textToSpeechService.hasVoice;
12998
- return !this.textToSpeech || !hasTextToSpeechVoice || this.isListening || SpeechRecognitionComponent_1.TOOLBAR_ACTIVE;
12982
+ return !this._recognizedText || !hasTextToSpeechVoice || this.isListening;
12999
12983
  }
13000
12984
  setTextAreaValue(value) {
13001
12985
  this.textAreaElement.value = value;
13002
12986
  }
13003
- stopTextToSpeech() {
13004
- this.isPlayingTextToSpeech = false;
13005
- this.textToSpeechService.cancel();
13006
- }
13007
12987
  speak() {
13008
- this.isDoneTextToSpeech = false;
13009
- this.isPlayingTextToSpeech = true;
13010
- this.textToSpeechService.speak(this.textToSpeech, this.voiceSpeed).then(() => {
12988
+ this.isDoneSpeaking = false;
12989
+ this.textToSpeechService.speak(this._recognizedText, this.voiceSpeed).then(() => {
13011
12990
  this.isPlayingTextToSpeech = false;
13012
- this.isDoneTextToSpeech = true;
12991
+ this.isDoneSpeaking = true;
13013
12992
  });
13014
12993
  }
13015
- get textToSpeech() {
13016
- return this.textAreaElement.value;
13017
- }
13018
12994
  };
13019
- SpeechRecognitionComponent.TOOLBAR_ACTIVE = false;
13020
12995
  SpeechRecognitionComponent.ctorParameters = () => [
13021
12996
  { type: SpeechRecognitionService },
13022
12997
  { type: TextToSpeechService },
@@ -13034,11 +13009,11 @@ __decorate([
13034
13009
  __decorate([
13035
13010
  Output()
13036
13011
  ], SpeechRecognitionComponent.prototype, "recognizedText", void 0);
13037
- SpeechRecognitionComponent = SpeechRecognitionComponent_1 = __decorate([
13012
+ SpeechRecognitionComponent = __decorate([
13038
13013
  Component({
13039
13014
  selector: 's-speech-recognition',
13040
- 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=\"isListeningUserVoice\">\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",
13041
- 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;height:25px}.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-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}"]
13015
+ 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",
13016
+ 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}"]
13042
13017
  })
13043
13018
  ], SpeechRecognitionComponent);
13044
13019