浏览代码

Got rid of Feature class and renamed featureComponents.

Piotrek Koszuliński 9 年之前
父节点
当前提交
7ff5c379fe

+ 3 - 3
packages/ckeditor5-heading/src/heading.js

@@ -5,7 +5,7 @@
 
 import HeadingEngine from './headingengine.js';
 
-import Feature from '../core/feature.js';
+import Plugin from '../core/plugin.js';
 
 import Model from '../ui/model.js';
 import createListDropdown from '../ui/dropdown/list/createlistdropdown.js';
@@ -19,7 +19,7 @@ import Collection from '../utils/collection.js';
  * @memberOf heading
  * @extends core.Feature
  */
-export default class Heading extends Feature {
+export default class Heading extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
@@ -56,7 +56,7 @@ export default class Heading extends Feature {
 		dropdownModel.bind( 'label' ).to( command, 'value', format => format.label );
 
 		// Register UI component.
-		editor.ui.featureComponents.add( 'headings', ( locale ) => {
+		editor.ui.componentFactory.add( 'headings', ( locale ) => {
 			const dropdown = createListDropdown( dropdownModel, locale );
 
 			// Execute command when an item from the dropdown is selected.

+ 2 - 2
packages/ckeditor5-heading/src/headingengine.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  */
 
-import Feature from '../core/feature.js';
+import Plugin from '../core/plugin.js';
 import buildModelConverter from '../engine/conversion/buildmodelconverter.js';
 import buildViewConverter from '../engine/conversion/buildviewconverter.js';
 import Paragraph from '../paragraph/paragraph.js';
@@ -23,7 +23,7 @@ const formats = [
  * @memberOf heading
  * @extends core.Feature
  */
-export default class HeadingEngine extends Feature {
+export default class HeadingEngine extends Plugin {
 	/**
 	 * @inheritDoc
 	 */

+ 5 - 5
packages/ckeditor5-heading/tests/heading.js

@@ -21,12 +21,12 @@ describe( 'Heading', () => {
 		document.body.appendChild( editorElement );
 
 		return ClassicTestEditor.create( editorElement, {
-			features: [ Heading ],
+			plugins: [ Heading ],
 			toolbar: [ 'heading' ]
 		} )
 		.then( newEditor => {
 			editor = newEditor;
-			dropdown = editor.ui.featureComponents.create( 'headings' );
+			dropdown = editor.ui.componentFactory.create( 'headings' );
 		} );
 	} );
 
@@ -44,7 +44,7 @@ describe( 'Heading', () => {
 
 	describe( 'init()', () => {
 		it( 'should register formats feature component', () => {
-			const dropdown = editor.ui.featureComponents.create( 'headings' );
+			const dropdown = editor.ui.componentFactory.create( 'headings' );
 
 			expect( dropdown ).to.be.instanceOf( DropdownView );
 			expect( dropdown.buttonView.isEnabled ).to.be.true;
@@ -54,7 +54,7 @@ describe( 'Heading', () => {
 
 		it( 'should execute format command on model execute event', () => {
 			const executeSpy = testUtils.sinon.spy( editor, 'execute' );
-			const dropdown = editor.ui.featureComponents.create( 'headings' );
+			const dropdown = editor.ui.componentFactory.create( 'headings' );
 
 			dropdown.formatId = 'foo';
 			dropdown.fire( 'execute' );
@@ -65,7 +65,7 @@ describe( 'Heading', () => {
 
 		it( 'should focus view after command execution', () => {
 			const focusSpy = testUtils.sinon.spy( editor.editing.view, 'focus' );
-			const dropdown = editor.ui.featureComponents.create( 'headings' );
+			const dropdown = editor.ui.componentFactory.create( 'headings' );
 
 			dropdown.fire( 'execute' );
 

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

@@ -15,7 +15,7 @@ describe( 'HeadingEngine', () => {
 
 	beforeEach( () => {
 		return VirtualTestEditor.create( {
-			features: [ Enter, HeadingEngine ]
+			plugins: [ Enter, HeadingEngine ]
 		} )
 		.then( newEditor => {
 			editor = newEditor;

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

@@ -13,7 +13,7 @@ import Paragraph from '/ckeditor5/paragraph/paragraph.js';
 import Undo from '/ckeditor5/undo/undo.js';
 
 ClassicEditor.create( document.querySelector( '#editor' ), {
-	features: [ Enter, Typing, Undo, Heading, Paragraph ],
+	plugins: [ Enter, Typing, Undo, Heading, Paragraph ],
 	toolbar: [ 'headings', 'undo', 'redo' ]
 } )
 .then( editor => {