summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/rich_content_editor/constants.js
blob: 44d43ca8f6957727d8ee9d0a7fd2b02b4b9d20c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { __ } from '~/locale';

export const CUSTOM_EVENTS = {
  openAddImageModal: 'gl_openAddImageModal',
};

export const ALLOWED_VIDEO_ORIGINS = ['https://www.youtube.com'];

/* eslint-disable @gitlab/require-i18n-strings */
export const TOOLBAR_ITEM_CONFIGS = [
  { icon: 'heading', event: 'openHeadingSelect', classes: 'tui-heading', tooltip: __('Headings') },
  { icon: 'bold', command: 'Bold', tooltip: __('Add bold text') },
  { icon: 'italic', command: 'Italic', tooltip: __('Add italic text') },
  { icon: 'strikethrough', command: 'Strike', tooltip: __('Add strikethrough text') },
  { isDivider: true },
  { icon: 'quote', command: 'Blockquote', tooltip: __('Insert a quote') },
  { icon: 'link', event: 'openPopupAddLink', tooltip: __('Add a link') },
  { isDivider: true },
  { icon: 'list-bulleted', command: 'UL', tooltip: __('Add a bullet list') },
  { icon: 'list-numbered', command: 'OL', tooltip: __('Add a numbered list') },
  { icon: 'list-task', command: 'Task', tooltip: __('Add a task list') },
  { icon: 'list-indent', command: 'Indent', tooltip: __('Indent') },
  { icon: 'list-outdent', command: 'Outdent', tooltip: __('Outdent') },
  { isDivider: true },
  { icon: 'dash', command: 'HR', tooltip: __('Add a line') },
  { icon: 'table', event: 'openPopupAddTable', classes: 'tui-table', tooltip: __('Add a table') },
  { icon: 'doc-image', event: CUSTOM_EVENTS.openAddImageModal, tooltip: __('Insert an image') },
  { isDivider: true },
  { icon: 'code', command: 'Code', tooltip: __('Insert inline code') },
  { icon: 'doc-code', command: 'CodeBlock', tooltip: __('Insert a code block') },
];

export const EDITOR_TYPES = {
  markdown: 'markdown',
  wysiwyg: 'wysiwyg',
};

export const EDITOR_HEIGHT = '100%';

export const EDITOR_PREVIEW_STYLE = 'horizontal';

export const IMAGE_TABS = { UPLOAD_TAB: 0, URL_TAB: 1 };

export const MAX_FILE_SIZE = 2097152; // 2Mb