Selaa lähdekoodia

Got rid of Feature class and renamed featureComponents.

Piotrek Koszuliński 9 vuotta sitten
vanhempi
commit
85aabd21a5

+ 4 - 6
packages/ckeditor5-link/src/link.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  */
 
-import Feature from '../core/feature.js';
+import Plugin from '../core/plugin.js';
 import ClickObserver from '../engine/view/observer/clickobserver.js';
 import LinkEngine from './linkengine.js';
 import LinkElement from './linkelement.js';
@@ -24,7 +24,7 @@ import LinkFormView from './ui/linkformview.js';
  * @memberOf link
  * @extends core.Feature
  */
-export default class Link extends Feature {
+export default class Link extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
@@ -71,8 +71,7 @@ export default class Link extends Feature {
 		// Handle `Ctrl+K` keystroke and show panel.
 		editor.keystrokes.set( 'CTRL+K', () => this._showPanel() );
 
-		// Add link button to feature components.
-		editor.ui.featureComponents.add( 'link', ( locale ) => {
+		editor.ui.componentFactory.add( 'link', ( locale ) => {
 			const button = new ButtonView( locale );
 
 			button.isEnabled = true;
@@ -101,8 +100,7 @@ export default class Link extends Feature {
 		const t = editor.t;
 		const unlinkCommand = editor.commands.get( 'unlink' );
 
-		// Add unlink button to feature components.
-		editor.ui.featureComponents.add( 'unlink', ( locale ) => {
+		editor.ui.componentFactory.add( 'unlink', ( locale ) => {
 			const button = new ButtonView( locale );
 
 			button.isEnabled = false;

+ 2 - 2
packages/ckeditor5-link/src/linkengine.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 LinkElement from './linkelement.js';
@@ -18,7 +18,7 @@ import UnlinkCommand from './unlinkcommand.js';
  * @memberOf link
  * @extends core.Feature
  */
-export default class LinkEngine extends Feature {
+export default class LinkEngine extends Plugin {
 	/**
 	 * @inheritDoc
 	 */

+ 1 - 1
packages/ckeditor5-link/src/unlinkcommand.js

@@ -7,7 +7,7 @@ import Command from '../core/command/command.js';
 import findLinkRange from './findlinkrange.js';
 
 /**
- * The unlink command. It is used by the {@link Link.Link link feature}.
+ * The unlink command. It is used by the {@link Link.Link link plugin}.
  *
  * @memberOf link
  * @extends core.command.Command

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

@@ -28,7 +28,7 @@ describe( 'Link', () => {
 		document.body.appendChild( editorElement );
 
 		return ClassicTestEditor.create( editorElement, {
-			features: [ Link ]
+			plugins: [ Link ]
 		} )
 		.then( newEditor => {
 			newEditor.editing.view.attachDomRoot( editorElement );
@@ -36,8 +36,8 @@ describe( 'Link', () => {
 			editor = newEditor;
 
 			linkFeature = editor.plugins.get( Link );
-			linkButton = editor.ui.featureComponents.create( 'link' );
-			unlinkButton = editor.ui.featureComponents.create( 'unlink' );
+			linkButton = editor.ui.componentFactory.create( 'link' );
+			unlinkButton = editor.ui.componentFactory.create( 'unlink' );
 			balloonPanelView = linkFeature.balloonPanelView;
 			formView = linkFeature.formView;
 		} );
@@ -60,7 +60,7 @@ describe( 'Link', () => {
 	} );
 
 	describe( 'link toolbar button', () => {
-		it( 'should register link feature component', () => {
+		it( 'should register link button', () => {
 			expect( linkButton ).to.instanceOf( ButtonView );
 		} );
 
@@ -120,7 +120,7 @@ describe( 'Link', () => {
 	} );
 
 	describe( 'unlink toolbar button', () => {
-		it( 'should register unlink feature component', () => {
+		it( 'should register unlink button', () => {
 			expect( unlinkButton ).to.instanceOf( ButtonView );
 		} );
 

+ 1 - 1
packages/ckeditor5-link/tests/linkengine.js

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

+ 1 - 1
packages/ckeditor5-link/tests/manual/link.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: [ Link, Typing, Paragraph, Undo, Enter ],
+	plugins: [ Link, Typing, Paragraph, Undo, Enter ],
 	toolbar: [ 'link', 'unlink', 'undo', 'redo' ]
 } )
 .then( editor => {