-
Notifications
You must be signed in to change notification settings - Fork 667
Chat: Add STT integration types #32399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 26_1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ import { DataSourceOptions } from 'devextreme/data/data_source'; | |
| import { Store } from 'devextreme/data/store'; | ||
| import { Format } from 'devextreme/common/core/localization'; | ||
| import { dxFileUploaderOptions } from 'devextreme/ui/file_uploader'; | ||
| import { dxSpeechToTextOptions } from 'devextreme/ui/speech_to_text'; | ||
|
|
||
| import DxChat from 'devextreme/ui/chat'; | ||
|
|
||
|
|
@@ -56,11 +57,14 @@ import { DxoUserModule } from 'devextreme-angular/ui/nested'; | |
| import { DxiChatAlertModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxiChatAttachmentModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxoChatAuthorModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxoChatCustomSpeechRecognizerModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxoChatDayHeaderFormatModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxoChatEditingModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxoChatFileUploaderOptionsModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxiChatItemModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxoChatMessageTimestampFormatModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxoChatSpeechRecognitionConfigModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxoChatSpeechToTextOptionsModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxiChatTypingUserModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { DxoChatUserModule } from 'devextreme-angular/ui/chat/nested'; | ||
| import { | ||
|
|
@@ -291,6 +295,16 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges | |
| } | ||
|
|
||
|
|
||
|
|
||
| @Input() | ||
| get inputFieldText(): string | undefined { | ||
| return this._getOption('inputFieldText'); | ||
| } | ||
| set inputFieldText(value: string | undefined) { | ||
| this._setOption('inputFieldText', value); | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * [descr:dxChatOptions.items] | ||
|
|
||
|
|
@@ -408,6 +422,16 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges | |
| } | ||
|
|
||
|
|
||
|
|
||
| @Input() | ||
| get speechToTextOptions(): dxSpeechToTextOptions { | ||
| return this._getOption('speechToTextOptions'); | ||
| } | ||
| set speechToTextOptions(value: dxSpeechToTextOptions) { | ||
| this._setOption('speechToTextOptions', value); | ||
| } | ||
|
Comment on lines
424
to
+432
|
||
|
|
||
|
|
||
| /** | ||
| * [descr:dxChatOptions.typingUsers] | ||
|
|
||
|
|
@@ -661,6 +685,13 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges | |
| */ | ||
| @Output() hoverStateEnabledChange: EventEmitter<boolean>; | ||
|
|
||
| /** | ||
|
|
||
| * This member supports the internal infrastructure and is not intended to be used directly from your code. | ||
|
|
||
| */ | ||
| @Output() inputFieldTextChange: EventEmitter<string | undefined>; | ||
|
|
||
| /** | ||
|
|
||
| * This member supports the internal infrastructure and is not intended to be used directly from your code. | ||
|
|
@@ -724,6 +755,13 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges | |
| */ | ||
| @Output() showUserNameChange: EventEmitter<boolean>; | ||
|
|
||
| /** | ||
|
|
||
| * This member supports the internal infrastructure and is not intended to be used directly from your code. | ||
|
|
||
| */ | ||
| @Output() speechToTextOptionsChange: EventEmitter<dxSpeechToTextOptions>; | ||
|
|
||
| /** | ||
|
|
||
| * This member supports the internal infrastructure and is not intended to be used directly from your code. | ||
|
|
@@ -792,6 +830,7 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges | |
| { emit: 'heightChange' }, | ||
| { emit: 'hintChange' }, | ||
| { emit: 'hoverStateEnabledChange' }, | ||
| { emit: 'inputFieldTextChange' }, | ||
| { emit: 'itemsChange' }, | ||
| { emit: 'messageTemplateChange' }, | ||
| { emit: 'messageTimestampFormatChange' }, | ||
|
|
@@ -801,6 +840,7 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges | |
| { emit: 'showDayHeadersChange' }, | ||
| { emit: 'showMessageTimestampChange' }, | ||
| { emit: 'showUserNameChange' }, | ||
| { emit: 'speechToTextOptionsChange' }, | ||
| { emit: 'typingUsersChange' }, | ||
| { emit: 'userChange' }, | ||
| { emit: 'visibleChange' }, | ||
|
|
@@ -869,11 +909,14 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges | |
| DxiChatAlertModule, | ||
| DxiChatAttachmentModule, | ||
| DxoChatAuthorModule, | ||
| DxoChatCustomSpeechRecognizerModule, | ||
| DxoChatDayHeaderFormatModule, | ||
| DxoChatEditingModule, | ||
| DxoChatFileUploaderOptionsModule, | ||
| DxiChatItemModule, | ||
| DxoChatMessageTimestampFormatModule, | ||
| DxoChatSpeechRecognitionConfigModule, | ||
| DxoChatSpeechToTextOptionsModule, | ||
| DxiChatTypingUserModule, | ||
| DxoChatUserModule, | ||
| DxIntegrationModule, | ||
|
|
@@ -892,11 +935,14 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges | |
| DxiChatAlertModule, | ||
| DxiChatAttachmentModule, | ||
| DxoChatAuthorModule, | ||
| DxoChatCustomSpeechRecognizerModule, | ||
| DxoChatDayHeaderFormatModule, | ||
| DxoChatEditingModule, | ||
| DxoChatFileUploaderOptionsModule, | ||
| DxiChatItemModule, | ||
| DxoChatMessageTimestampFormatModule, | ||
| DxoChatSpeechRecognitionConfigModule, | ||
| DxoChatSpeechToTextOptionsModule, | ||
| DxiChatTypingUserModule, | ||
| DxoChatUserModule, | ||
| DxTemplateModule | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| /* tslint:disable:max-line-length */ | ||
|
|
||
|
|
||
| import { | ||
| Component, | ||
| OnInit, | ||
| OnDestroy, | ||
| NgModule, | ||
| Host, | ||
| SkipSelf, | ||
| Input | ||
| } from '@angular/core'; | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| import { | ||
| DxIntegrationModule, | ||
| NestedOptionHost, | ||
| } from 'devextreme-angular/core'; | ||
| import { NestedOption } from 'devextreme-angular/core'; | ||
|
|
||
|
|
||
| @Component({ | ||
| selector: 'dxo-chat-custom-speech-recognizer', | ||
| standalone: true, | ||
| template: '', | ||
| styles: [''], | ||
| imports: [ DxIntegrationModule ], | ||
| providers: [NestedOptionHost] | ||
| }) | ||
| export class DxoChatCustomSpeechRecognizerComponent extends NestedOption implements OnDestroy, OnInit { | ||
| @Input() | ||
| get enabled(): boolean { | ||
| return this._getOption('enabled'); | ||
| } | ||
| set enabled(value: boolean) { | ||
| this._setOption('enabled', value); | ||
| } | ||
|
|
||
| @Input() | ||
| get isListening(): boolean { | ||
| return this._getOption('isListening'); | ||
| } | ||
| set isListening(value: boolean) { | ||
| this._setOption('isListening', value); | ||
| } | ||
|
|
||
|
|
||
| protected get _optionPath() { | ||
| return 'customSpeechRecognizer'; | ||
| } | ||
|
|
||
|
|
||
| constructor(@SkipSelf() @Host() parentOptionHost: NestedOptionHost, | ||
| @Host() optionHost: NestedOptionHost) { | ||
| super(); | ||
| parentOptionHost.setNestedOption(this); | ||
| optionHost.setHost(this, this._fullOptionPath.bind(this)); | ||
| } | ||
|
|
||
|
|
||
| ngOnInit() { | ||
| this._addRecreatedComponent(); | ||
| } | ||
|
|
||
| ngOnDestroy() { | ||
| this._addRemovedOption(this._getOptionPath()); | ||
| } | ||
|
|
||
|
|
||
| } | ||
|
|
||
| @NgModule({ | ||
| imports: [ | ||
| DxoChatCustomSpeechRecognizerComponent | ||
| ], | ||
| exports: [ | ||
| DxoChatCustomSpeechRecognizerComponent | ||
| ], | ||
| }) | ||
| export class DxoChatCustomSpeechRecognizerModule { } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,14 @@ | ||
| export * from './alert-dxi'; | ||
| export * from './attachment-dxi'; | ||
| export * from './author'; | ||
| export * from './custom-speech-recognizer'; | ||
| export * from './day-header-format'; | ||
| export * from './editing'; | ||
| export * from './file-uploader-options'; | ||
| export * from './item-dxi'; | ||
| export * from './message-timestamp-format'; | ||
| export * from './speech-recognition-config'; | ||
| export * from './speech-to-text-options'; | ||
| export * from './typing-user-dxi'; | ||
| export * from './user'; | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| /* tslint:disable:max-line-length */ | ||
|
|
||
|
|
||
| import { | ||
| Component, | ||
| OnInit, | ||
| OnDestroy, | ||
| NgModule, | ||
| Host, | ||
| SkipSelf, | ||
| Input | ||
| } from '@angular/core'; | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| import { | ||
| DxIntegrationModule, | ||
| NestedOptionHost, | ||
| } from 'devextreme-angular/core'; | ||
| import { NestedOption } from 'devextreme-angular/core'; | ||
|
|
||
|
|
||
| @Component({ | ||
| selector: 'dxo-chat-speech-recognition-config', | ||
| standalone: true, | ||
| template: '', | ||
| styles: [''], | ||
| imports: [ DxIntegrationModule ], | ||
| providers: [NestedOptionHost] | ||
| }) | ||
| export class DxoChatSpeechRecognitionConfigComponent extends NestedOption implements OnDestroy, OnInit { | ||
| @Input() | ||
| get continuous(): boolean { | ||
| return this._getOption('continuous'); | ||
| } | ||
| set continuous(value: boolean) { | ||
| this._setOption('continuous', value); | ||
| } | ||
|
|
||
| @Input() | ||
| get grammars(): Array<string> { | ||
| return this._getOption('grammars'); | ||
| } | ||
| set grammars(value: Array<string>) { | ||
| this._setOption('grammars', value); | ||
| } | ||
|
|
||
| @Input() | ||
| get interimResults(): boolean { | ||
| return this._getOption('interimResults'); | ||
| } | ||
| set interimResults(value: boolean) { | ||
| this._setOption('interimResults', value); | ||
| } | ||
|
|
||
| @Input() | ||
| get lang(): string { | ||
| return this._getOption('lang'); | ||
| } | ||
| set lang(value: string) { | ||
| this._setOption('lang', value); | ||
| } | ||
|
|
||
| @Input() | ||
| get maxAlternatives(): number { | ||
| return this._getOption('maxAlternatives'); | ||
| } | ||
| set maxAlternatives(value: number) { | ||
| this._setOption('maxAlternatives', value); | ||
| } | ||
|
|
||
|
|
||
| protected get _optionPath() { | ||
| return 'speechRecognitionConfig'; | ||
| } | ||
|
|
||
|
|
||
| constructor(@SkipSelf() @Host() parentOptionHost: NestedOptionHost, | ||
| @Host() optionHost: NestedOptionHost) { | ||
| super(); | ||
| parentOptionHost.setNestedOption(this); | ||
| optionHost.setHost(this, this._fullOptionPath.bind(this)); | ||
| } | ||
|
|
||
|
|
||
| ngOnInit() { | ||
| this._addRecreatedComponent(); | ||
| } | ||
|
|
||
| ngOnDestroy() { | ||
| this._addRemovedOption(this._getOptionPath()); | ||
| } | ||
|
|
||
|
|
||
| } | ||
|
|
||
| @NgModule({ | ||
| imports: [ | ||
| DxoChatSpeechRecognitionConfigComponent | ||
| ], | ||
| exports: [ | ||
| DxoChatSpeechRecognitionConfigComponent | ||
| ], | ||
| }) | ||
| export class DxoChatSpeechRecognitionConfigModule { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Angular wrapper imports
dxSpeechToTextOptionsfromdevextreme/ui/speech_to_text, but that module's typings do not export adxSpeechToTextOptionssymbol (it exportsProperties). This will break TypeScript builds. Please importProperties(aliased) instead, or add adxSpeechToTextOptionsexport in the corespeech_to_text.d.ts.