Skip to content

Commit f502a51

Browse files
Merge branch '25_2' into 25_2_ng_nested_fix
2 parents 097dc19 + 03772fc commit f502a51

File tree

8 files changed

+94
-1
lines changed

8 files changed

+94
-1
lines changed

apps/demos/Demos/SpeechToText/Overview/Angular/app/app.component.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ import { DxTextAreaModule } from 'devextreme-angular/ui/text-area';
66
import { DxButtonModule } from 'devextreme-angular/ui/button';
77
import { DxSelectBoxModule } from 'devextreme-angular/ui/select-box';
88
import { DxSwitchModule } from 'devextreme-angular/ui/switch';
9+
import notify from 'devextreme/ui/notify';
910

1011
import { AppService } from './app.service';
1112

13+
declare global {
14+
interface Window {
15+
SpeechRecognition?: any;
16+
webkitSpeechRecognition?: any;
17+
}
18+
}
19+
1220
if (!/localhost/.test(document.location.host)) {
1321
enableProdMode();
1422
}
@@ -86,6 +94,17 @@ export class AppComponent {
8694
}
8795

8896
onStartClick() {
97+
if (!window.SpeechRecognition && !window.webkitSpeechRecognition) {
98+
notify({
99+
message: 'The browser does not support Web Speech API (SpeechRecognition).',
100+
type: 'error',
101+
displayTime: 7000,
102+
position: 'bottom center',
103+
width: 'auto',
104+
});
105+
return;
106+
}
107+
89108
this.state = 'listening';
90109
this.hint = 'Stop voice recognition';
91110
if (this.displayMode !== 'Custom') {

apps/demos/Demos/SpeechToText/Overview/React/App.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ import { TextArea } from 'devextreme-react/text-area';
44
import { Button, ButtonTypes } from 'devextreme-react/button';
55
import { SelectBox } from 'devextreme-react/select-box';
66
import { Switch } from 'devextreme-react/switch';
7+
import notify from 'devextreme/ui/notify';
78
import { displayModes, stylingModes, types, languages, langMap } from './data.ts';
89

10+
declare global {
11+
interface Window {
12+
SpeechRecognition: any;
13+
webkitSpeechRecognition: any;
14+
}
15+
}
16+
917
let state = 'initial';
1018
const textAreaLabel = { 'aria-label': 'Recognized Text' };
1119
const displayModeLabel = { 'aria-label': 'Display Mode' };
@@ -33,6 +41,17 @@ export default function App() {
3341
};
3442

3543
const onStartClick = useCallback(() => {
44+
if (!window.SpeechRecognition && !window.webkitSpeechRecognition) {
45+
notify({
46+
message: 'The browser does not support Web Speech API (SpeechRecognition).',
47+
type: 'error',
48+
displayTime: 7000,
49+
position: 'bottom center',
50+
width: 'auto',
51+
});
52+
return;
53+
}
54+
3655
state = 'listening';
3756
setHint('Stop voice recognition');
3857
if (displayMode !== 'Custom') {
@@ -131,6 +150,7 @@ export default function App() {
131150
speechRecognitionConfig={speechRecognitionConfig}
132151
disabled={disabled}
133152
onStartClick={onStartClick}
153+
onStopClick={onEnd}
134154
onEnd={onEnd}
135155
onResult={onResult}
136156
/>

apps/demos/Demos/SpeechToText/Overview/ReactJs/App.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { TextArea } from 'devextreme-react/text-area';
44
import { Button } from 'devextreme-react/button';
55
import { SelectBox } from 'devextreme-react/select-box';
66
import { Switch } from 'devextreme-react/switch';
7+
import notify from 'devextreme/ui/notify';
78
import {
89
displayModes, stylingModes, types, languages, langMap,
910
} from './data.js';
@@ -33,6 +34,16 @@ export default function App() {
3334
continuous,
3435
};
3536
const onStartClick = useCallback(() => {
37+
if (!window.SpeechRecognition && !window.webkitSpeechRecognition) {
38+
notify({
39+
message: 'The browser does not support Web Speech API (SpeechRecognition).',
40+
type: 'error',
41+
displayTime: 7000,
42+
position: 'bottom center',
43+
width: 'auto',
44+
});
45+
return;
46+
}
3647
state = 'listening';
3748
setHint('Stop voice recognition');
3849
if (displayMode !== 'Custom') {
@@ -113,6 +124,7 @@ export default function App() {
113124
speechRecognitionConfig={speechRecognitionConfig}
114125
disabled={disabled}
115126
onStartClick={onStartClick}
127+
onStopClick={onEnd}
116128
onEnd={onEnd}
117129
onResult={onResult}
118130
/>

apps/demos/Demos/SpeechToText/Overview/Vue/App.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,16 @@ import { DxTextArea } from 'devextreme-vue/text-area';
107107
import { DxButton, type DxButtonTypes } from 'devextreme-vue/button';
108108
import { DxSelectBox } from 'devextreme-vue/select-box';
109109
import { DxSwitch } from 'devextreme-vue/switch';
110+
import notify from 'devextreme/ui/notify';
110111
import { displayModes, stylingModes, types, languages, langMap } from './data.ts';
111112
113+
declare global {
114+
interface Window {
115+
SpeechRecognition?: any;
116+
webkitSpeechRecognition?: any;
117+
}
118+
}
119+
112120
let state = 'initial';
113121
const startText = ref('');
114122
const stopText = ref('');
@@ -129,6 +137,17 @@ const speechRecognitionConfig = computed(() => ({
129137
}));
130138
131139
function onStartClick() {
140+
if (!window.SpeechRecognition && !window.webkitSpeechRecognition) {
141+
notify({
142+
message: 'The browser does not support Web Speech API (SpeechRecognition).',
143+
type: 'error',
144+
displayTime: 7000,
145+
position: 'bottom center',
146+
width: 'auto',
147+
});
148+
return;
149+
}
150+
132151
state = 'listening';
133152
hint.value = 'Stop voice recognition';
134153
if (displayMode.value !== 'Custom') {

apps/demos/Demos/SpeechToText/Overview/jQuery/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ $(() => {
1111
continuous: false,
1212
},
1313
onStartClick: ({ component }) => {
14+
if (!window.SpeechRecognition && !window.webkitSpeechRecognition) {
15+
DevExpress.ui.notify({
16+
message: 'The browser does not support Web Speech API (SpeechRecognition).',
17+
type: 'error',
18+
displayTime: 7000,
19+
position: 'bottom center',
20+
width: 'auto',
21+
});
22+
return;
23+
}
24+
1425
state = 'listening';
1526
component.option('hint', 'Stop voice recognition');
1627
if (!shouldUpdateType()) {

apps/demos/menuMeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4995,7 +4995,7 @@
49954995
]
49964996
},
49974997
{
4998-
"Name": "SpeechToText",
4998+
"Name": "Speech To Text",
49994999
"Equivalents": "dxSpeechToText, dx-speechtotext, VoiceInput, VoiceToText, AIDictation, MicrophoneInput, SpeechRecognition, SpeechTranscription, MicInput",
50005000
"Demos": [
50015001
{

packages/devextreme/js/ui/file_manager/ui.file_manager.items_list.thumbnails.list_box.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ class FileManagerThumbnailListBox extends CollectionWidget {
337337

338338
_focusOutHandler() {}
339339

340+
_focusInHandler() {}
341+
340342
_getItems() {
341343
return this.option('items') || [];
342344
}

packages/devextreme/testing/tests/DevExpress.ui.widgets/fileManagerParts/thumbnailsView.tests.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'ui/file_manager';
33
import fx from 'common/core/animation/fx';
44
import { FileManagerWrapper, createTestFileSystem } from '../../../helpers/fileManagerHelpers.js';
55
import { shouldSkipOnMobile } from '../../../helpers/device.js';
6+
import pointerMock from '../../../helpers/pointerMock.js';
67

78
const { test } = QUnit;
89

@@ -302,4 +303,13 @@ QUnit.module('Thumbnails View', moduleConfig, () => {
302303
assert.notOk(this.wrapper.isThumbnailsItemSelected('..'), 'parent folder is not visually highlited');
303304
});
304305

306+
test('Thumbnails view - should focus item only on selection (T1307139)', function(assert) {
307+
this.wrapper.getThumbnailsViewPort().trigger('focusin');
308+
assert.notOk(this.wrapper.isThumbnailsItemFocused('Folder 1'));
309+
310+
pointerMock(this.wrapper.findThumbnailsItem('Folder 1')).click();
311+
this.clock.tick(400);
312+
assert.ok(this.wrapper.isThumbnailsItemSelected('Folder 1'));
313+
assert.ok(this.wrapper.isThumbnailsItemFocused('Folder 1'));
314+
});
305315
});

0 commit comments

Comments
 (0)