-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
editoruiview.ts
61 lines (48 loc) · 1.32 KB
/
editoruiview.ts
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/**
* @module ui/editorui/editoruiview
*/
import View from '../view.js';
import BodyCollection from './bodycollection.js';
import type EditableUIView from '../editableui/editableuiview.js';
import type { Locale, LocaleTranslate } from '@ckeditor/ckeditor5-utils';
import '../../theme/components/editorui/editorui.css';
/**
* The editor UI view class. Base class for the editor main views.
*/
export default abstract class EditorUIView extends View {
/**
* Collection of the child views, detached from the DOM
* structure of the editor, like panels, icons etc.
*/
public readonly body: BodyCollection;
declare public locale: Locale;
declare public t: LocaleTranslate;
public abstract get editable(): EditableUIView;
/**
* Creates an instance of the editor UI view class.
*
* @param locale The locale instance.
*/
constructor( locale: Locale ) {
super( locale );
this.body = new BodyCollection( locale );
}
/**
* @inheritDoc
*/
public override render(): void {
super.render();
this.body.attachToDom();
}
/**
* @inheritDoc
*/
public override destroy(): void {
this.body.detachFromDom();
return super.destroy();
}
}