@@ -2,6 +2,7 @@ import '@js/ui/drop_down_button';
22
33import type { AIIntegration , RequestCallbacks } from '@js/common/ai-integration' ;
44import localizationMessage from '@js/common/core/localization/message' ;
5+ import Guid from '@js/core/guid' ;
56import type { dxElementWrapper } from '@js/core/renderer' ;
67import $ from '@js/core/renderer' ;
78import { extend } from '@js/core/utils/extend' ;
@@ -39,9 +40,9 @@ import BaseDialog from './m_baseDialog';
3940export const AI_DIALOG_CLASS = 'dx-aidialog' ;
4041export const AI_DIALOG_CONTROLS_CLASS = 'dx-aidialog-controls' ;
4142export const AI_DIALOG_CONTENT_CLASS = 'dx-aidialog-content' ;
43+ export const AI_DIALOG_TITLE_CLASS = 'dx-aidialog-title' ;
4244
4345const AI_DIALOG_LOAD_INDICATOR_CLASS = 'dx-pending-indicator' ;
44- const AI_DIALOG_TITLE_CLASS = 'dx-aidialog-title' ;
4546const AI_DIALOG_TITLE_TEXT_CLASS = 'dx-aidialog-title-text' ;
4647const ICON_CLASS = 'dx-icon' ;
4748const ICON_SPARKLE_CLASS = 'dx-icon-sparkle' ;
@@ -53,6 +54,7 @@ const AI_DIALOG_COMMANDS_WITH_OPTIONS = ['translate', 'changeStyle', 'changeTone
5354const POPUP_MIN_WIDTH = 288 ;
5455const POPUP_MAX_WIDTH = 460 ;
5556const LOADINDICATOR_SIZE = 48 ;
57+
5658export const TEXT_AREA_MIN_HEIGHT = 64 ;
5759export const TEXT_AREA_MAX_HEIGHT = 128 ;
5860export const REPLACE_DROPDOWN_WIDTH = 150 ;
@@ -244,6 +246,7 @@ export default class AIDialog extends BaseDialog<AIDialogResult> {
244246 } ;
245247
246248 const options = {
249+ inputAttr : { 'aria-label' : localizationMessage . format ( 'dxHtmlEditor-aiResultTextAreaAriaLabel' ) } ,
247250 minHeight : TEXT_AREA_MIN_HEIGHT ,
248251 width : '100%' ,
249252 readOnly : true ,
@@ -335,6 +338,7 @@ export default class AIDialog extends BaseDialog<AIDialogResult> {
335338 widget : 'dxDropDownButton' ,
336339 locateInMenu : 'auto' ,
337340 options : {
341+ displayExpr : 'text' ,
338342 text : localizationMessage . format ( 'dxHtmlEditor-aiReplace' ) ,
339343 stylingMode : 'contained' ,
340344 type : 'default' ,
@@ -480,6 +484,7 @@ export default class AIDialog extends BaseDialog<AIDialogResult> {
480484 this . _refreshToolbarItems ( ) ;
481485 this . _refreshLoadIndicator ( ) ;
482486 this . _refreshInformer ( ) ;
487+ this . _refreshDialogAria ( ) ;
483488 }
484489
485490 private _refreshToolbarItems ( ) : void {
@@ -719,6 +724,15 @@ export default class AIDialog extends BaseDialog<AIDialogResult> {
719724 return visible as boolean ;
720725 }
721726
727+ private _refreshDialogAria ( ) : void {
728+ const id = String ( new Guid ( ) ) ;
729+ const $overlayContent = $ ( this . _popup . content ( ) ) . parent ( ) ;
730+ const $title = $overlayContent . find ( `.${ AI_DIALOG_TITLE_CLASS } ` ) ;
731+
732+ $title . attr ( 'id' , id ) ;
733+ $overlayContent . attr ( 'aria-labelledby' , id ) ;
734+ }
735+
722736 updateAIIntegration ( aiIntegration : AIIntegration ) : void {
723737 this . _abort ?.( ) ;
724738 this . _processCommandCompletion ( this . _getInitialDialogState ( ) ) ;
0 commit comments