1 | /**
|
2 | * @license Copyright (c) 2003-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 | * @module list/list/listui
|
7 | */
|
8 | import { createUIComponent } from './utils';
|
9 | import numberedListIcon from '../../theme/icons/numberedlist.svg';
|
10 | import bulletedListIcon from '../../theme/icons/bulletedlist.svg';
|
11 | import { Plugin } from 'ckeditor5/src/core';
|
12 | /**
|
13 | * The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that
|
14 | * allow to convert paragraphs to and from list items and indent or outdent them.
|
15 | */
|
16 | export default class ListUI extends Plugin {
|
17 | /**
|
18 | * @inheritDoc
|
19 | */
|
20 | static get pluginName() {
|
21 | return 'ListUI';
|
22 | }
|
23 | /**
|
24 | * @inheritDoc
|
25 | */
|
26 | init() {
|
27 | const t = this.editor.t;
|
28 | // Create two buttons and link them with numberedList and bulletedList commands.
|
29 | createUIComponent(this.editor, 'numberedList', t('Numbered List'), numberedListIcon);
|
30 | createUIComponent(this.editor, 'bulletedList', t('Bulleted List'), bulletedListIcon);
|
31 | }
|
32 | }
|