2021-07-01 12:08:37 +00:00
|
|
|
import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants';
|
2022-05-13 15:07:43 +00:00
|
|
|
import { s__, __ } from '~/locale';
|
2020-08-26 09:10:16 +00:00
|
|
|
|
|
|
|
export const URI_PREFIX = 'gitlab';
|
2021-07-01 12:08:37 +00:00
|
|
|
export const CONTENT_UPDATE_DEBOUNCE = DEFAULT_DEBOUNCE_AND_THROTTLE_MS;
|
2020-12-15 00:10:07 +00:00
|
|
|
|
2021-01-25 09:09:10 +00:00
|
|
|
export const EDITOR_READY_EVENT = 'editor-ready';
|
|
|
|
|
2021-02-04 00:09:18 +00:00
|
|
|
export const EDITOR_TYPE_CODE = 'vs.editor.ICodeEditor';
|
|
|
|
export const EDITOR_TYPE_DIFF = 'vs.editor.IDiffEditor';
|
|
|
|
|
2021-02-18 18:10:41 +00:00
|
|
|
export const EDITOR_CODE_INSTANCE_FN = 'createInstance';
|
|
|
|
export const EDITOR_DIFF_INSTANCE_FN = 'createDiffInstance';
|
|
|
|
|
2022-04-16 09:08:34 +00:00
|
|
|
export const EDITOR_TOOLBAR_LEFT_GROUP = 'left';
|
|
|
|
export const EDITOR_TOOLBAR_RIGHT_GROUP = 'right';
|
|
|
|
|
2021-11-16 15:13:28 +00:00
|
|
|
export const SOURCE_EDITOR_INSTANCE_ERROR_NO_EL = s__(
|
|
|
|
'SourceEditor|"el" parameter is required for createInstance()',
|
|
|
|
);
|
|
|
|
export const ERROR_INSTANCE_REQUIRED_FOR_EXTENSION = s__(
|
|
|
|
'SourceEditor|Source Editor instance is required to set up an extension.',
|
|
|
|
);
|
2021-11-10 21:09:47 +00:00
|
|
|
export const EDITOR_EXTENSION_DEFINITION_ERROR = s__(
|
|
|
|
'SourceEditor|Extension definition should be either a class or a function',
|
|
|
|
);
|
2021-11-16 15:13:28 +00:00
|
|
|
export const EDITOR_EXTENSION_NO_DEFINITION_ERROR = s__(
|
|
|
|
'SourceEditor|`definition` property is expected on the extension.',
|
|
|
|
);
|
|
|
|
export const EDITOR_EXTENSION_DEFINITION_TYPE_ERROR = s__(
|
|
|
|
'SourceEditor|Extension definition should be either class, function, or an Array of definitions.',
|
|
|
|
);
|
|
|
|
export const EDITOR_EXTENSION_NOT_SPECIFIED_FOR_UNUSE_ERROR = s__(
|
|
|
|
'SourceEditor|No extension for unuse has been specified.',
|
|
|
|
);
|
|
|
|
export const EDITOR_EXTENSION_NOT_REGISTERED_ERROR = s__('SourceEditor|%{name} is not registered.');
|
|
|
|
export const EDITOR_EXTENSION_NAMING_CONFLICT_ERROR = s__(
|
|
|
|
'SourceEditor|Name conflict for "%{prop}()" method.',
|
|
|
|
);
|
|
|
|
export const EDITOR_EXTENSION_STORE_IS_MISSING_ERROR = s__(
|
|
|
|
'SourceEditor|Extensions Store is required to check for an extension.',
|
|
|
|
);
|
2021-11-10 21:09:47 +00:00
|
|
|
|
2020-12-17 12:09:57 +00:00
|
|
|
//
|
|
|
|
// EXTENSIONS' CONSTANTS
|
|
|
|
//
|
|
|
|
|
2021-12-15 15:15:54 +00:00
|
|
|
// Source Editor Base Extension
|
|
|
|
export const EXTENSION_BASE_LINE_LINK_ANCHOR_CLASS = 'link-anchor';
|
|
|
|
export const EXTENSION_BASE_LINE_NUMBERS_CLASS = 'line-numbers';
|
|
|
|
|
2020-12-17 12:09:57 +00:00
|
|
|
// For CI config schemas the filename must match
|
|
|
|
// '*.gitlab-ci.yml' regardless of project configuration.
|
|
|
|
// https://gitlab.com/gitlab-org/gitlab/-/issues/293641
|
|
|
|
export const EXTENSION_CI_SCHEMA_FILE_NAME_MATCH = '.gitlab-ci.yml';
|
2021-08-16 12:09:17 +00:00
|
|
|
|
|
|
|
export const EXTENSION_MARKDOWN_PREVIEW_PANEL_CLASS = 'md';
|
|
|
|
export const EXTENSION_MARKDOWN_PREVIEW_PANEL_PARENT_CLASS = 'source-editor-preview';
|
|
|
|
export const EXTENSION_MARKDOWN_PREVIEW_ACTION_ID = 'markdown-preview';
|
2022-05-13 15:07:43 +00:00
|
|
|
export const EXTENSION_MARKDOWN_PREVIEW_HIDE_ACTION_ID = 'markdown-preview-hide';
|
2021-08-16 12:09:17 +00:00
|
|
|
export const EXTENSION_MARKDOWN_PREVIEW_PANEL_WIDTH = 0.5; // 50% of the width
|
2021-08-17 15:10:19 +00:00
|
|
|
export const EXTENSION_MARKDOWN_PREVIEW_UPDATE_DELAY = 250; // ms
|
2022-05-13 15:07:43 +00:00
|
|
|
export const EXTENSION_MARKDOWN_PREVIEW_LABEL = __('Preview Markdown');
|
|
|
|
export const EXTENSION_MARKDOWN_HIDE_PREVIEW_LABEL = __('Hide Live Preview');
|