Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
/**
2
 * @license Copyright (c) 2014-2023, CKSource Holding sp. z o.o. All rights reserved.
3
 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
 */
5
 
6
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
7
 
8
import { Alignment } from '@ckeditor/ckeditor5-alignment';
9
import { Autoformat } from '@ckeditor/ckeditor5-autoformat';
10
import {
11
	Bold,
12
	Code,
13
	Italic,
14
	Strikethrough,
15
	Subscript,
16
	Superscript,
17
	Underline
18
} from '@ckeditor/ckeditor5-basic-styles';
19
import { BlockQuote } from '@ckeditor/ckeditor5-block-quote';
20
import { CodeBlock } from '@ckeditor/ckeditor5-code-block';
21
import type { EditorConfig } from '@ckeditor/ckeditor5-core';
22
import { Essentials } from '@ckeditor/ckeditor5-essentials';
23
import { FontBackgroundColor, FontColor, FontFamily, FontSize } from '@ckeditor/ckeditor5-font';
24
import { Heading } from '@ckeditor/ckeditor5-heading';
25
import { Highlight } from '@ckeditor/ckeditor5-highlight';
26
import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line';
27
import { GeneralHtmlSupport } from '@ckeditor/ckeditor5-html-support';
28
import {
29
	Image,
30
	ImageCaption,
31
	ImageStyle,
32
	ImageToolbar,
33
	ImageUpload
34
} from '@ckeditor/ckeditor5-image';
35
import { Indent, IndentBlock } from '@ckeditor/ckeditor5-indent';
36
import { AutoLink, Link } from '@ckeditor/ckeditor5-link';
37
import { List } from '@ckeditor/ckeditor5-list';
38
import { MediaEmbed } from '@ckeditor/ckeditor5-media-embed';
39
import { Paragraph } from '@ckeditor/ckeditor5-paragraph';
40
import { PasteFromOffice } from '@ckeditor/ckeditor5-paste-from-office';
41
import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format';
42
import { SelectAll } from '@ckeditor/ckeditor5-select-all';
43
import {
44
	Table,
45
	TableCaption,
46
	TableCellProperties,
47
	TableColumnResize,
48
	TableProperties,
49
	TableToolbar
50
} from '@h5p/ckeditor5-table';
51
import { TextTransformation } from '@ckeditor/ckeditor5-typing';
52
 
53
// You can read more about extending the build with additional plugins in the "Installing plugins" guide.
54
// See https://ckeditor.com/docs/ckeditor5/latest/installation/plugins/installing-plugins.html for details.
55
 
56
class Editor extends ClassicEditor {
57
	public static override builtinPlugins = [
58
		Alignment,
59
		AutoLink,
60
		Autoformat,
61
		BlockQuote,
62
		Bold,
63
		Code,
64
		CodeBlock,
65
		Essentials,
66
		FontBackgroundColor,
67
		FontColor,
68
		FontFamily,
69
		FontSize,
70
		GeneralHtmlSupport,
71
		Heading,
72
		Highlight,
73
		HorizontalLine,
74
		Image,
75
		ImageCaption,
76
		ImageStyle,
77
		ImageToolbar,
78
		ImageUpload,
79
		Indent,
80
		IndentBlock,
81
		Italic,
82
		Link,
83
		List,
84
		MediaEmbed,
85
		Paragraph,
86
		PasteFromOffice,
87
		RemoveFormat,
88
		SelectAll,
89
		Strikethrough,
90
		Subscript,
91
		Superscript,
92
		Table,
93
		TableCaption,
94
		TableCellProperties,
95
		TableColumnResize,
96
		TableProperties,
97
		TableToolbar,
98
		TextTransformation,
99
		Underline
100
	];
101
 
102
	public static override defaultConfig: EditorConfig = {
103
		toolbar: {
104
			items: [
105
				'heading',
106
				'|',
107
				'bold',
108
				'italic',
109
				'underline',
110
				'link',
111
				'|',
112
				'bulletedList',
113
				'numberedList',
114
				'|',
115
				'outdent',
116
				'indent',
117
				'|',
118
				'imageUpload',
119
				'blockQuote',
120
				'insertTable',
121
				'undo',
122
				'redo'
123
			]
124
		},
125
		language: 'en',
126
		image: {
127
			toolbar: [
128
				'imageTextAlternative',
129
				'toggleImageCaption',
130
				'imageStyle:inline',
131
				'imageStyle:block',
132
				'imageStyle:side'
133
			]
134
		},
135
		table: {
136
			contentToolbar: [
137
				'toggleTableCaption',
138
				'tableColumn',
139
				'tableRow',
140
				'mergeTableCells',
141
				'tableCellProperties',
142
				'tableProperties'
143
			]
144
		}
145
	};
146
}
147
 
148
export default Editor;