8
0
Эх сурвалжийг харах

Other: Renamed 'headings' ui component to 'heading'.

Maciej Gołaszewski 7 жил өмнө
parent
commit
6207593d8d

+ 2 - 2
packages/ckeditor5-heading/docs/features/headings.md

@@ -122,7 +122,7 @@ import Heading from '@ckeditor/ckeditor5-heading/src/heading';
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ Heading, ... ],
-		toolbar: [ 'headings', ... ]
+		toolbar: [ 'heading', ... ]
 	} )
 	.then( ... )
 	.catch( ... );
@@ -132,7 +132,7 @@ ClassicEditor
 
 The {@link module:heading/heading~Heading} plugin registers:
 
-* The `'headings'` dropdown.
+* The `'heading'` dropdown.
 * The `'heading1'`, `'heading2'`, ..., `'headingN'` commands based on the {@link module:heading/heading~HeadingConfig#options `heading.options`} configuration option.
 
 	You can turn the currently selected block(s) to headings by executing one of these commands:

+ 1 - 1
packages/ckeditor5-heading/src/headingui.js

@@ -33,7 +33,7 @@ export default class HeadingUI extends Plugin {
 		const dropdownTooltip = t( 'Heading' );
 
 		// Register UI component.
-		editor.ui.componentFactory.add( 'headings', locale => {
+		editor.ui.componentFactory.add( 'heading', locale => {
 			const commands = [];
 			const dropdownItems = new Collection();
 

+ 6 - 6
packages/ckeditor5-heading/tests/headingui.js

@@ -52,7 +52,7 @@ describe( 'HeadingUI', () => {
 			} )
 			.then( newEditor => {
 				editor = newEditor;
-				dropdown = editor.ui.componentFactory.create( 'headings' );
+				dropdown = editor.ui.componentFactory.create( 'heading' );
 
 				// Set data so the commands will be enabled.
 				setData( editor.model, '<paragraph>f{}oo</paragraph>' );
@@ -67,7 +67,7 @@ describe( 'HeadingUI', () => {
 
 	describe( 'init()', () => {
 		it( 'should register options feature component', () => {
-			const dropdown = editor.ui.componentFactory.create( 'headings' );
+			const dropdown = editor.ui.componentFactory.create( 'heading' );
 
 			expect( dropdown ).to.be.instanceOf( DropdownView );
 			expect( dropdown.buttonView.isEnabled ).to.be.true;
@@ -78,7 +78,7 @@ describe( 'HeadingUI', () => {
 
 		it( 'should execute format command on model execute event', () => {
 			const executeSpy = testUtils.sinon.spy( editor, 'execute' );
-			const dropdown = editor.ui.componentFactory.create( 'headings' );
+			const dropdown = editor.ui.componentFactory.create( 'heading' );
 
 			dropdown.commandName = 'paragraph';
 			dropdown.fire( 'execute' );
@@ -89,7 +89,7 @@ describe( 'HeadingUI', () => {
 
 		it( 'should focus view after command execution', () => {
 			const focusSpy = testUtils.sinon.spy( editor.editing.view, 'focus' );
-			const dropdown = editor.ui.componentFactory.create( 'headings' );
+			const dropdown = editor.ui.componentFactory.create( 'heading' );
 
 			dropdown.commandName = 'paragraph';
 			dropdown.fire( 'execute' );
@@ -98,7 +98,7 @@ describe( 'HeadingUI', () => {
 		} );
 
 		it( 'should add custom CSS class to dropdown', () => {
-			const dropdown = editor.ui.componentFactory.create( 'headings' );
+			const dropdown = editor.ui.componentFactory.create( 'heading' );
 
 			dropdown.render();
 
@@ -226,7 +226,7 @@ describe( 'HeadingUI', () => {
 					} )
 					.then( newEditor => {
 						editor = newEditor;
-						dropdown = editor.ui.componentFactory.create( 'headings' );
+						dropdown = editor.ui.componentFactory.create( 'heading' );
 						commands = {};
 
 						editor.config.get( 'heading.options' ).forEach( ( { model } ) => {

+ 1 - 1
packages/ckeditor5-heading/tests/manual/heading.js

@@ -15,7 +15,7 @@ import Undo from '@ckeditor/ckeditor5-undo/src/undo';
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ Enter, Typing, Undo, Heading, Paragraph ],
-		toolbar: [ 'headings', '|', 'undo', 'redo' ]
+		toolbar: [ 'heading', '|', 'undo', 'redo' ]
 	} )
 	.then( editor => {
 		window.editor = editor;