diff --git a/ui/src/flux/components/TimeMachineEditor.tsx b/ui/src/flux/components/TimeMachineEditor.tsx index eb4195e49..213edd503 100644 --- a/ui/src/flux/components/TimeMachineEditor.tsx +++ b/ui/src/flux/components/TimeMachineEditor.tsx @@ -5,8 +5,7 @@ import {EditorChange, LineWidget} from 'codemirror' import {ShowHintOptions} from 'src/types/codemirror' import {ErrorHandling} from 'src/shared/decorators/errors' import {OnChangeScript, Suggestion} from 'src/types/flux' -import {EXCLUDED_KEYS} from 'src/flux/constants/editor' -import {getSuggestions} from 'src/flux/helpers/autoComplete' +import {getSuggestions, EXCLUDED_KEYS} from 'src/flux/helpers/autoComplete' import 'src/external/codemirror' interface Gutter { diff --git a/ui/src/flux/constants/editor.ts b/ui/src/flux/constants/editor.ts deleted file mode 100644 index f0ab8905f..000000000 --- a/ui/src/flux/constants/editor.ts +++ /dev/null @@ -1,62 +0,0 @@ -export const EXCLUDED_KEYS = [ - 'ArrowRight', - 'ArrowLeft', - 'ArrowDown', - 'ArrowUp', - 'Backspace', - 'Tab', - 'Enter', - 'Shift', - 'Ctrl', - 'Control', - 'Alt', - 'Pause', - 'Capslock', - 'Escape', - 'Pageup', - 'Pagedown', - 'End', - 'Home', - 'Left', - 'Up', - 'Right', - 'Down', - 'Insert', - 'Delete', - 'Left window key', - 'Right window key', - 'Select', - 'Add', - 'Subtract', - 'Decimal point', - 'Divide', - '>', - '|', - ')', - 'F1', - 'F2', - 'F3', - 'F4', - 'F5', - 'F6', - 'F7', - 'F8', - 'F9', - 'F10', - 'F11', - 'F12', - 'Numlock', - 'Scrolllock', - 'Semicolon', - 'Equalsign', - 'Comma', - 'Dash', - 'Slash', - 'Graveaccent', - 'Backslash', - 'Quote', - 'Meta', - ' ', -] - -export const DEFAULT_SCRIPT = '' diff --git a/ui/src/flux/constants/index.ts b/ui/src/flux/constants/index.ts index 19254ca49..4811e86f0 100644 --- a/ui/src/flux/constants/index.ts +++ b/ui/src/flux/constants/index.ts @@ -1,9 +1,8 @@ import {ast} from 'src/flux/constants/ast' -import * as editor from 'src/flux/constants/editor' import * as argTypes from 'src/flux/constants/argumentTypes' import * as vis from 'src/flux/constants/vis' import * as explorer from 'src/flux/constants/explorer' const MAX_RESPONSE_BYTES = 1e7 // 10 MB -export {ast, argTypes, editor, vis, explorer, MAX_RESPONSE_BYTES} +export {ast, argTypes, vis, explorer, MAX_RESPONSE_BYTES} diff --git a/ui/src/flux/helpers/autoComplete.ts b/ui/src/flux/helpers/autoComplete.ts index 2b1149afe..ef1ca68d9 100644 --- a/ui/src/flux/helpers/autoComplete.ts +++ b/ui/src/flux/helpers/autoComplete.ts @@ -3,6 +3,66 @@ import {IInstance} from 'react-codemirror2' import {Suggestion} from 'src/types/flux' import {Hints} from 'src/types/codemirror' +export const EXCLUDED_KEYS = [ + 'ArrowRight', + 'ArrowLeft', + 'ArrowDown', + 'ArrowUp', + 'Backspace', + 'Tab', + 'Enter', + 'Shift', + 'Ctrl', + 'Control', + 'Alt', + 'Pause', + 'Capslock', + 'Escape', + 'Pageup', + 'Pagedown', + 'End', + 'Home', + 'Left', + 'Up', + 'Right', + 'Down', + 'Insert', + 'Delete', + 'Left window key', + 'Right window key', + 'Select', + 'Add', + 'Subtract', + 'Decimal point', + 'Divide', + '>', + '|', + ')', + 'F1', + 'F2', + 'F3', + 'F4', + 'F5', + 'F6', + 'F7', + 'F8', + 'F9', + 'F10', + 'F11', + 'F12', + 'Numlock', + 'Scrolllock', + 'Semicolon', + 'Equalsign', + 'Comma', + 'Dash', + 'Slash', + 'Graveaccent', + 'Backslash', + 'Quote', + 'Meta', +] + export const getSuggestions = ( editor: IInstance, allSuggestions: Suggestion[]