Просмотр исходного кода

fix(keyboard-shortcuts): Rename .web/.native files.

The keyboard shortcuts feature is used only on web. We don't need the suffixes.
factor2
Hristo Terezov 8 месяцев назад
Родитель
Сommit
b0a050b66a

+ 0
- 60
react/features/keyboard-shortcuts/actions.any.ts Просмотреть файл

@@ -1,60 +0,0 @@
1
-import { AnyAction } from 'redux';
2
-
3
-import {
4
-    DISABLE_KEYBOARD_SHORTCUTS,
5
-    ENABLE_KEYBOARD_SHORTCUTS,
6
-    REGISTER_KEYBOARD_SHORTCUT,
7
-    UNREGISTER_KEYBOARD_SHORTCUT
8
-} from './actionTypes';
9
-import { IKeyboardShortcut } from './types';
10
-
11
-/**
12
- * Action to register a new shortcut.
13
- *
14
- * @param {IKeyboardShortcut} shortcut - The shortcut to register.
15
- * @returns {AnyAction}
16
-*/
17
-export const registerShortcut = (shortcut: IKeyboardShortcut): AnyAction => {
18
-    return {
19
-        type: REGISTER_KEYBOARD_SHORTCUT,
20
-        shortcut
21
-    };
22
-};
23
-
24
-/**
25
-* Action to unregister a shortcut.
26
-*
27
-* @param {string} character - The character of the shortcut to unregister.
28
-* @param {boolean} altKey - Whether the shortcut used altKey.
29
-* @returns {AnyAction}
30
-*/
31
-export const unregisterShortcut = (character: string, altKey = false): AnyAction => {
32
-    return {
33
-        alt: altKey,
34
-        type: UNREGISTER_KEYBOARD_SHORTCUT,
35
-        character
36
-    };
37
-};
38
-
39
-/**
40
- * Action to enable keyboard shortcuts.
41
- *
42
- * @returns {AnyAction}
43
- */
44
-export const enableKeyboardShortcuts = (): AnyAction => {
45
-    return {
46
-        type: ENABLE_KEYBOARD_SHORTCUTS
47
-    };
48
-};
49
-
50
-
51
-/**
52
- * Action to enable keyboard shortcuts.
53
- *
54
- * @returns {AnyAction}
55
- */
56
-export const disableKeyboardShortcuts = (): AnyAction => {
57
-    return {
58
-        type: DISABLE_KEYBOARD_SHORTCUTS
59
-    };
60
-};

react/features/keyboard-shortcuts/actions.web.ts → react/features/keyboard-shortcuts/actions.ts Просмотреть файл

@@ -1,4 +1,5 @@
1 1
 import { batch } from 'react-redux';
2
+import { AnyAction } from 'redux';
2 3
 
3 4
 import { ACTION_SHORTCUT_PRESSED, ACTION_SHORTCUT_RELEASED, createShortcutEvent } from '../analytics/AnalyticsEvents';
4 5
 import { sendAnalytics } from '../analytics/functions';
@@ -8,13 +9,67 @@ import { openSettingsDialog } from '../settings/actions.web';
8 9
 import { SETTINGS_TABS } from '../settings/constants';
9 10
 import { iAmVisitor } from '../visitors/functions';
10 11
 
11
-import { registerShortcut, unregisterShortcut } from './actions.any';
12
+import {
13
+    DISABLE_KEYBOARD_SHORTCUTS,
14
+    ENABLE_KEYBOARD_SHORTCUTS,
15
+    REGISTER_KEYBOARD_SHORTCUT,
16
+    UNREGISTER_KEYBOARD_SHORTCUT
17
+} from './actionTypes';
12 18
 import { areKeyboardShortcutsEnabled, getKeyboardShortcuts } from './functions';
13 19
 import logger from './logger';
20
+import { IKeyboardShortcut } from './types';
14 21
 import { getKeyboardKey, getPriorityFocusedElement } from './utils';
15 22
 
16
-export * from './actions.any';
23
+/**
24
+ * Action to register a new shortcut.
25
+ *
26
+ * @param {IKeyboardShortcut} shortcut - The shortcut to register.
27
+ * @returns {AnyAction}
28
+*/
29
+export const registerShortcut = (shortcut: IKeyboardShortcut): AnyAction => {
30
+    return {
31
+        type: REGISTER_KEYBOARD_SHORTCUT,
32
+        shortcut
33
+    };
34
+};
35
+
36
+/**
37
+* Action to unregister a shortcut.
38
+*
39
+* @param {string} character - The character of the shortcut to unregister.
40
+* @param {boolean} altKey - Whether the shortcut used altKey.
41
+* @returns {AnyAction}
42
+*/
43
+export const unregisterShortcut = (character: string, altKey = false): AnyAction => {
44
+    return {
45
+        alt: altKey,
46
+        type: UNREGISTER_KEYBOARD_SHORTCUT,
47
+        character
48
+    };
49
+};
50
+
51
+/**
52
+ * Action to enable keyboard shortcuts.
53
+ *
54
+ * @returns {AnyAction}
55
+ */
56
+export const enableKeyboardShortcuts = (): AnyAction => {
57
+    return {
58
+        type: ENABLE_KEYBOARD_SHORTCUTS
59
+    };
60
+};
61
+
17 62
 
63
+/**
64
+ * Action to enable keyboard shortcuts.
65
+ *
66
+ * @returns {AnyAction}
67
+ */
68
+export const disableKeyboardShortcuts = (): AnyAction => {
69
+    return {
70
+        type: DISABLE_KEYBOARD_SHORTCUTS
71
+    };
72
+};
18 73
 
19 74
 type KeyHandler = ((e: KeyboardEvent) => void) | undefined;
20 75
 

react/features/keyboard-shortcuts/components/web/KeyboardShortcutsButton.ts → react/features/keyboard-shortcuts/components/KeyboardShortcutsButton.ts Просмотреть файл

@@ -1,15 +1,15 @@
1 1
 import { connect } from 'react-redux';
2 2
 
3
-import { createToolbarEvent } from '../../../analytics/AnalyticsEvents';
4
-import { sendAnalytics } from '../../../analytics/functions';
5
-import { IReduxState } from '../../../app/types';
6
-import { isMobileBrowser } from '../../../base/environment/utils';
7
-import { translate } from '../../../base/i18n/functions';
8
-import { IconShortcuts } from '../../../base/icons/svg';
9
-import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';
10
-import { openSettingsDialog } from '../../../settings/actions';
11
-import { SETTINGS_TABS } from '../../../settings/constants';
12
-import { areKeyboardShortcutsEnabled } from '../../functions';
3
+import { createToolbarEvent } from '../../analytics/AnalyticsEvents';
4
+import { sendAnalytics } from '../../analytics/functions';
5
+import { IReduxState } from '../../app/types';
6
+import { isMobileBrowser } from '../../base/environment/utils';
7
+import { translate } from '../../base/i18n/functions';
8
+import { IconShortcuts } from '../../base/icons/svg';
9
+import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
10
+import { openSettingsDialog } from '../../settings/actions.web';
11
+import { SETTINGS_TABS } from '../../settings/constants';
12
+import { areKeyboardShortcutsEnabled } from '../functions';
13 13
 
14 14
 /**
15 15
  * Implementation of a button for opening keyboard shortcuts dialog.

react/features/keyboard-shortcuts/hooks.web.ts → react/features/keyboard-shortcuts/hooks.ts Просмотреть файл

@@ -2,7 +2,7 @@ import { useSelector } from 'react-redux';
2 2
 
3 3
 import { isMobileBrowser } from '../base/environment/utils';
4 4
 
5
-import KeyboardShortcutsButton from './components/web/KeyboardShortcutsButton';
5
+import KeyboardShortcutsButton from './components/KeyboardShortcutsButton';
6 6
 import { areKeyboardShortcutsEnabled } from './functions';
7 7
 
8 8
 const shortcuts = {

+ 1
- 1
react/features/settings/actions.web.ts Просмотреть файл

@@ -17,7 +17,7 @@ import { getNormalizedDisplayName } from '../base/participants/functions';
17 17
 import { updateSettings } from '../base/settings/actions';
18 18
 import { getLocalVideoTrack } from '../base/tracks/functions.web';
19 19
 import { appendURLHashParam } from '../base/util/uri';
20
-import { disableKeyboardShortcuts, enableKeyboardShortcuts } from '../keyboard-shortcuts/actions.web';
20
+import { disableKeyboardShortcuts, enableKeyboardShortcuts } from '../keyboard-shortcuts/actions';
21 21
 import { toggleBackgroundEffect } from '../virtual-background/actions';
22 22
 import virtualBackgroundLogger from '../virtual-background/logger';
23 23
 

+ 2
- 2
react/features/toolbox/hooks.web.ts Просмотреть файл

@@ -20,8 +20,8 @@ import { useFeedbackButton } from '../feedback/hooks.web';
20 20
 import { setGifMenuVisibility } from '../gifs/actions';
21 21
 import { isGifEnabled } from '../gifs/function.any';
22 22
 import InviteButton from '../invite/components/add-people-dialog/web/InviteButton';
23
-import { registerShortcut, unregisterShortcut } from '../keyboard-shortcuts/actions.web';
24
-import { useKeyboardShortcutsButton } from '../keyboard-shortcuts/hooks.web';
23
+import { registerShortcut, unregisterShortcut } from '../keyboard-shortcuts/actions';
24
+import { useKeyboardShortcutsButton } from '../keyboard-shortcuts/hooks';
25 25
 import NoiseSuppressionButton from '../noise-suppression/components/NoiseSuppressionButton';
26 26
 import {
27 27
     close as closeParticipantsPane,

Загрузка…
Отмена
Сохранить