@ckeditor/ckeditor5-heading 38.1.1 → 38.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-heading",
3
- "version": "38.1.1",
3
+ "version": "38.2.0-alpha.1",
4
4
  "description": "Headings feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -11,8 +11,9 @@
11
11
  "ckeditor5-dll"
12
12
  ],
13
13
  "main": "src/index.js",
14
+ "type": "module",
14
15
  "dependencies": {
15
- "ckeditor5": "38.1.1"
16
+ "ckeditor5": "38.2.0-alpha.1"
16
17
  },
17
18
  "engines": {
18
19
  "node": ">=16.0.0",
@@ -1,30 +1,30 @@
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
- import type { Heading, HeadingCommand, HeadingConfig, HeadingEditing, HeadingUI, Title, TitleConfig } from './index';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface EditorConfig {
8
- /**
9
- * The configuration of the heading feature. Introduced by the {@link module:heading/headingediting~HeadingEditing} feature.
10
- *
11
- * Read more in {@link module:heading/headingconfig~HeadingConfig}.
12
- */
13
- heading?: HeadingConfig;
14
- /**
15
- * The configuration of the {@link module:heading/title~Title title feature}.
16
- *
17
- * Read more in {@link module:heading/title~TitleConfig}.
18
- */
19
- title?: TitleConfig;
20
- }
21
- interface PluginsMap {
22
- [Heading.pluginName]: Heading;
23
- [HeadingEditing.pluginName]: HeadingEditing;
24
- [HeadingUI.pluginName]: HeadingUI;
25
- [Title.pluginName]: Title;
26
- }
27
- interface CommandsMap {
28
- heading: HeadingCommand;
29
- }
30
- }
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
+ import type { Heading, HeadingCommand, HeadingConfig, HeadingEditing, HeadingUI, Title, TitleConfig } from './index.js';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface EditorConfig {
8
+ /**
9
+ * The configuration of the heading feature. Introduced by the {@link module:heading/headingediting~HeadingEditing} feature.
10
+ *
11
+ * Read more in {@link module:heading/headingconfig~HeadingConfig}.
12
+ */
13
+ heading?: HeadingConfig;
14
+ /**
15
+ * The configuration of the {@link module:heading/title~Title title feature}.
16
+ *
17
+ * Read more in {@link module:heading/title~TitleConfig}.
18
+ */
19
+ title?: TitleConfig;
20
+ }
21
+ interface PluginsMap {
22
+ [Heading.pluginName]: Heading;
23
+ [HeadingEditing.pluginName]: HeadingEditing;
24
+ [HeadingUI.pluginName]: HeadingUI;
25
+ [Title.pluginName]: Title;
26
+ }
27
+ interface CommandsMap {
28
+ heading: HeadingCommand;
29
+ }
30
+ }
@@ -1,5 +1,5 @@
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
- export {};
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
+ export {};
package/src/heading.d.ts CHANGED
@@ -1,32 +1,32 @@
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 heading/heading
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import HeadingEditing from './headingediting';
10
- import HeadingUI from './headingui';
11
- import '../theme/heading.css';
12
- /**
13
- * The headings feature.
14
- *
15
- * For a detailed overview, check the {@glink features/headings Headings feature} guide
16
- * and the {@glink api/heading package page}.
17
- *
18
- * This is a "glue" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}
19
- * and {@link module:heading/headingui~HeadingUI heading UI feature}.
20
- *
21
- * @extends module:core/plugin~Plugin
22
- */
23
- export default class Heading extends Plugin {
24
- /**
25
- * @inheritDoc
26
- */
27
- static get requires(): readonly [typeof HeadingEditing, typeof HeadingUI];
28
- /**
29
- * @inheritDoc
30
- */
31
- static get pluginName(): "Heading";
32
- }
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 heading/heading
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import HeadingEditing from './headingediting.js';
10
+ import HeadingUI from './headingui.js';
11
+ import '../theme/heading.css';
12
+ /**
13
+ * The headings feature.
14
+ *
15
+ * For a detailed overview, check the {@glink features/headings Headings feature} guide
16
+ * and the {@glink api/heading package page}.
17
+ *
18
+ * This is a "glue" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}
19
+ * and {@link module:heading/headingui~HeadingUI heading UI feature}.
20
+ *
21
+ * @extends module:core/plugin~Plugin
22
+ */
23
+ export default class Heading extends Plugin {
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get requires(): readonly [typeof HeadingEditing, typeof HeadingUI];
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ static get pluginName(): "Heading";
32
+ }
package/src/heading.js CHANGED
@@ -1,36 +1,36 @@
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 heading/heading
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import HeadingEditing from './headingediting';
10
- import HeadingUI from './headingui';
11
- import '../theme/heading.css';
12
- /**
13
- * The headings feature.
14
- *
15
- * For a detailed overview, check the {@glink features/headings Headings feature} guide
16
- * and the {@glink api/heading package page}.
17
- *
18
- * This is a "glue" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}
19
- * and {@link module:heading/headingui~HeadingUI heading UI feature}.
20
- *
21
- * @extends module:core/plugin~Plugin
22
- */
23
- export default class Heading extends Plugin {
24
- /**
25
- * @inheritDoc
26
- */
27
- static get requires() {
28
- return [HeadingEditing, HeadingUI];
29
- }
30
- /**
31
- * @inheritDoc
32
- */
33
- static get pluginName() {
34
- return 'Heading';
35
- }
36
- }
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 heading/heading
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import HeadingEditing from './headingediting.js';
10
+ import HeadingUI from './headingui.js';
11
+ import '../theme/heading.css';
12
+ /**
13
+ * The headings feature.
14
+ *
15
+ * For a detailed overview, check the {@glink features/headings Headings feature} guide
16
+ * and the {@glink api/heading package page}.
17
+ *
18
+ * This is a "glue" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}
19
+ * and {@link module:heading/headingui~HeadingUI heading UI feature}.
20
+ *
21
+ * @extends module:core/plugin~Plugin
22
+ */
23
+ export default class Heading extends Plugin {
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get requires() {
28
+ return [HeadingEditing, HeadingUI];
29
+ }
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ static get pluginName() {
34
+ return 'Heading';
35
+ }
36
+ }
@@ -1,51 +1,51 @@
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 heading/headingbuttonsui
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- /**
10
- * The `HeadingButtonsUI` plugin defines a set of UI buttons that can be used instead of the
11
- * standard drop down component.
12
- *
13
- * This feature is not enabled by default by the {@link module:heading/heading~Heading} plugin and needs to be
14
- * installed manually to the editor configuration.
15
- *
16
- * Plugin introduces button UI elements, which names are same as `model` property from {@link module:heading/headingconfig~HeadingOption}.
17
- *
18
- * ```ts
19
- * ClassicEditor
20
- * .create( {
21
- * plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ]
22
- * heading: {
23
- * options: [
24
- * { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
25
- * { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
26
- * { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
27
- * { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
28
- * ]
29
- * },
30
- * toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
31
- * } )
32
- * .then( ... )
33
- * .catch( ... );
34
- * ```
35
- *
36
- * NOTE: The `'paragraph'` button is defined in by the {@link module:paragraph/paragraphbuttonui~ParagraphButtonUI} plugin
37
- * which needs to be loaded manually as well.
38
- *
39
- * It is possible to use custom icons by providing `icon` config option in {@link module:heading/headingconfig~HeadingOption}.
40
- * For the default configuration standard icons are used.
41
- */
42
- export default class HeadingButtonsUI extends Plugin {
43
- /**
44
- * @inheritDoc
45
- */
46
- init(): void;
47
- /**
48
- * Creates single button view from provided configuration option.
49
- */
50
- private _createButton;
51
- }
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 heading/headingbuttonsui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The `HeadingButtonsUI` plugin defines a set of UI buttons that can be used instead of the
11
+ * standard drop down component.
12
+ *
13
+ * This feature is not enabled by default by the {@link module:heading/heading~Heading} plugin and needs to be
14
+ * installed manually to the editor configuration.
15
+ *
16
+ * Plugin introduces button UI elements, which names are same as `model` property from {@link module:heading/headingconfig~HeadingOption}.
17
+ *
18
+ * ```ts
19
+ * ClassicEditor
20
+ * .create( {
21
+ * plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ]
22
+ * heading: {
23
+ * options: [
24
+ * { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
25
+ * { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
26
+ * { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
27
+ * { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
28
+ * ]
29
+ * },
30
+ * toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
31
+ * } )
32
+ * .then( ... )
33
+ * .catch( ... );
34
+ * ```
35
+ *
36
+ * NOTE: The `'paragraph'` button is defined in by the {@link module:paragraph/paragraphbuttonui~ParagraphButtonUI} plugin
37
+ * which needs to be loaded manually as well.
38
+ *
39
+ * It is possible to use custom icons by providing `icon` config option in {@link module:heading/headingconfig~HeadingOption}.
40
+ * For the default configuration standard icons are used.
41
+ */
42
+ export default class HeadingButtonsUI extends Plugin {
43
+ /**
44
+ * @inheritDoc
45
+ */
46
+ init(): void;
47
+ /**
48
+ * Creates single button view from provided configuration option.
49
+ */
50
+ private _createButton;
51
+ }
@@ -1,89 +1,89 @@
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 heading/headingbuttonsui
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { ButtonView } from 'ckeditor5/src/ui';
10
- import { getLocalizedOptions } from './utils';
11
- import iconHeading1 from '../theme/icons/heading1.svg';
12
- import iconHeading2 from '../theme/icons/heading2.svg';
13
- import iconHeading3 from '../theme/icons/heading3.svg';
14
- import iconHeading4 from '../theme/icons/heading4.svg';
15
- import iconHeading5 from '../theme/icons/heading5.svg';
16
- import iconHeading6 from '../theme/icons/heading6.svg';
17
- const defaultIcons = {
18
- heading1: iconHeading1,
19
- heading2: iconHeading2,
20
- heading3: iconHeading3,
21
- heading4: iconHeading4,
22
- heading5: iconHeading5,
23
- heading6: iconHeading6
24
- };
25
- /**
26
- * The `HeadingButtonsUI` plugin defines a set of UI buttons that can be used instead of the
27
- * standard drop down component.
28
- *
29
- * This feature is not enabled by default by the {@link module:heading/heading~Heading} plugin and needs to be
30
- * installed manually to the editor configuration.
31
- *
32
- * Plugin introduces button UI elements, which names are same as `model` property from {@link module:heading/headingconfig~HeadingOption}.
33
- *
34
- * ```ts
35
- * ClassicEditor
36
- * .create( {
37
- * plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ]
38
- * heading: {
39
- * options: [
40
- * { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
41
- * { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
42
- * { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
43
- * { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
44
- * ]
45
- * },
46
- * toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
47
- * } )
48
- * .then( ... )
49
- * .catch( ... );
50
- * ```
51
- *
52
- * NOTE: The `'paragraph'` button is defined in by the {@link module:paragraph/paragraphbuttonui~ParagraphButtonUI} plugin
53
- * which needs to be loaded manually as well.
54
- *
55
- * It is possible to use custom icons by providing `icon` config option in {@link module:heading/headingconfig~HeadingOption}.
56
- * For the default configuration standard icons are used.
57
- */
58
- export default class HeadingButtonsUI extends Plugin {
59
- /**
60
- * @inheritDoc
61
- */
62
- init() {
63
- const options = getLocalizedOptions(this.editor);
64
- options
65
- .filter(item => item.model !== 'paragraph')
66
- .map(item => this._createButton(item));
67
- }
68
- /**
69
- * Creates single button view from provided configuration option.
70
- */
71
- _createButton(option) {
72
- const editor = this.editor;
73
- editor.ui.componentFactory.add(option.model, locale => {
74
- const view = new ButtonView(locale);
75
- const command = editor.commands.get('heading');
76
- view.label = option.title;
77
- view.icon = option.icon || defaultIcons[option.model];
78
- view.tooltip = true;
79
- view.isToggleable = true;
80
- view.bind('isEnabled').to(command);
81
- view.bind('isOn').to(command, 'value', value => value == option.model);
82
- view.on('execute', () => {
83
- editor.execute('heading', { value: option.model });
84
- editor.editing.view.focus();
85
- });
86
- return view;
87
- });
88
- }
89
- }
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 heading/headingbuttonsui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { ButtonView } from 'ckeditor5/src/ui.js';
10
+ import { getLocalizedOptions } from './utils.js';
11
+ import iconHeading1 from '../theme/icons/heading1.svg';
12
+ import iconHeading2 from '../theme/icons/heading2.svg';
13
+ import iconHeading3 from '../theme/icons/heading3.svg';
14
+ import iconHeading4 from '../theme/icons/heading4.svg';
15
+ import iconHeading5 from '../theme/icons/heading5.svg';
16
+ import iconHeading6 from '../theme/icons/heading6.svg';
17
+ const defaultIcons = {
18
+ heading1: iconHeading1,
19
+ heading2: iconHeading2,
20
+ heading3: iconHeading3,
21
+ heading4: iconHeading4,
22
+ heading5: iconHeading5,
23
+ heading6: iconHeading6
24
+ };
25
+ /**
26
+ * The `HeadingButtonsUI` plugin defines a set of UI buttons that can be used instead of the
27
+ * standard drop down component.
28
+ *
29
+ * This feature is not enabled by default by the {@link module:heading/heading~Heading} plugin and needs to be
30
+ * installed manually to the editor configuration.
31
+ *
32
+ * Plugin introduces button UI elements, which names are same as `model` property from {@link module:heading/headingconfig~HeadingOption}.
33
+ *
34
+ * ```ts
35
+ * ClassicEditor
36
+ * .create( {
37
+ * plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ]
38
+ * heading: {
39
+ * options: [
40
+ * { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
41
+ * { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
42
+ * { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
43
+ * { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
44
+ * ]
45
+ * },
46
+ * toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
47
+ * } )
48
+ * .then( ... )
49
+ * .catch( ... );
50
+ * ```
51
+ *
52
+ * NOTE: The `'paragraph'` button is defined in by the {@link module:paragraph/paragraphbuttonui~ParagraphButtonUI} plugin
53
+ * which needs to be loaded manually as well.
54
+ *
55
+ * It is possible to use custom icons by providing `icon` config option in {@link module:heading/headingconfig~HeadingOption}.
56
+ * For the default configuration standard icons are used.
57
+ */
58
+ export default class HeadingButtonsUI extends Plugin {
59
+ /**
60
+ * @inheritDoc
61
+ */
62
+ init() {
63
+ const options = getLocalizedOptions(this.editor);
64
+ options
65
+ .filter(item => item.model !== 'paragraph')
66
+ .map(item => this._createButton(item));
67
+ }
68
+ /**
69
+ * Creates single button view from provided configuration option.
70
+ */
71
+ _createButton(option) {
72
+ const editor = this.editor;
73
+ editor.ui.componentFactory.add(option.model, locale => {
74
+ const view = new ButtonView(locale);
75
+ const command = editor.commands.get('heading');
76
+ view.label = option.title;
77
+ view.icon = option.icon || defaultIcons[option.model];
78
+ view.tooltip = true;
79
+ view.isToggleable = true;
80
+ view.bind('isEnabled').to(command);
81
+ view.bind('isOn').to(command, 'value', value => value == option.model);
82
+ view.on('execute', () => {
83
+ editor.execute('heading', { value: option.model });
84
+ editor.editing.view.focus();
85
+ });
86
+ return view;
87
+ });
88
+ }
89
+ }
@@ -1,48 +1,48 @@
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 heading/headingcommand
7
- */
8
- import { Command, type Editor } from 'ckeditor5/src/core';
9
- /**
10
- * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings.
11
- */
12
- export default class HeadingCommand extends Command {
13
- /**
14
- * If the selection starts in a heading (which {@link #modelElements is supported by this command})
15
- * the value is set to the name of that heading model element.
16
- * It is set to `false` otherwise.
17
- *
18
- * @observable
19
- * @readonly
20
- */
21
- value: false | string;
22
- /**
23
- * Set of defined model's elements names that this command support.
24
- * See {@link module:heading/headingconfig~HeadingOption}.
25
- */
26
- readonly modelElements: Array<string>;
27
- /**
28
- * Creates an instance of the command.
29
- *
30
- * @param editor Editor instance.
31
- * @param modelElements Names of the element which this command can apply in the model.
32
- */
33
- constructor(editor: Editor, modelElements: Array<string>);
34
- /**
35
- * @inheritDoc
36
- */
37
- refresh(): void;
38
- /**
39
- * Executes the command. Applies the heading to the selected blocks or, if the first selected
40
- * block is a heading already, turns selected headings (of this level only) to paragraphs.
41
- *
42
- * @param options.value Name of the element which this command will apply in the model.
43
- * @fires execute
44
- */
45
- execute(options: {
46
- value: string;
47
- }): void;
48
- }
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 heading/headingcommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings.
11
+ */
12
+ export default class HeadingCommand extends Command {
13
+ /**
14
+ * If the selection starts in a heading (which {@link #modelElements is supported by this command})
15
+ * the value is set to the name of that heading model element.
16
+ * It is set to `false` otherwise.
17
+ *
18
+ * @observable
19
+ * @readonly
20
+ */
21
+ value: false | string;
22
+ /**
23
+ * Set of defined model's elements names that this command support.
24
+ * See {@link module:heading/headingconfig~HeadingOption}.
25
+ */
26
+ readonly modelElements: Array<string>;
27
+ /**
28
+ * Creates an instance of the command.
29
+ *
30
+ * @param editor Editor instance.
31
+ * @param modelElements Names of the element which this command can apply in the model.
32
+ */
33
+ constructor(editor: Editor, modelElements: Array<string>);
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ refresh(): void;
38
+ /**
39
+ * Executes the command. Applies the heading to the selected blocks or, if the first selected
40
+ * block is a heading already, turns selected headings (of this level only) to paragraphs.
41
+ *
42
+ * @param options.value Name of the element which this command will apply in the model.
43
+ * @fires execute
44
+ */
45
+ execute(options: {
46
+ value: string;
47
+ }): void;
48
+ }