Bladeren bron

Features to Plugins migration.

Szymon Kupś 9 jaren geleden
bovenliggende
commit
7365f1476f

+ 4 - 4
packages/ckeditor5-image/src/image.js

@@ -3,19 +3,19 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
-import Feature from '../core/feature.js';
+import Plugin from '../core/plugin.js';
 import ImageEngine from './imageengine.js';
 import ImageEngine from './imageengine.js';
 import Widget from './widget/widget.js';
 import Widget from './widget/widget.js';
 
 
 /**
 /**
- * The image feature.
+ * The image plugin.
  *
  *
  * Uses {@link image.ImageEngine}.
  * Uses {@link image.ImageEngine}.
  *
  *
  * @memberOf image
  * @memberOf image
- * @extends core.Feature
+ * @extends core.Plugin
  */
  */
-export default class Image extends Feature {
+export default class Image extends Plugin {
 	/**
 	/**
 	 * @inheritDoc
 	 * @inheritDoc
 	 */
 	 */

+ 4 - 4
packages/ckeditor5-image/src/imageengine.js

@@ -3,21 +3,21 @@
  * For licensing, see LICENSE.md.
  * 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 buildModelConverter from '../engine/conversion/buildmodelconverter.js';
 import WidgetEngine from './widget/widgetengine.js';
 import WidgetEngine from './widget/widgetengine.js';
 import { modelToViewImage, viewToModelImage, modelToViewSelection } from './converters.js';
 import { modelToViewImage, viewToModelImage, modelToViewSelection } from './converters.js';
 import { toImageWidget } from './utils.js';
 import { toImageWidget } from './utils.js';
 
 
 /**
 /**
- * The image engine feature.
+ * The image engine plugin.
  * Registers `image` as a block element in document's schema and allows it to have two attributes: `src` and `alt`.
  * Registers `image` as a block element in document's schema and allows it to have two attributes: `src` and `alt`.
  * Creates model converter for data and editing pipelines, and view converter for data pipeline.
  * Creates model converter for data and editing pipelines, and view converter for data pipeline.
  *
  *
  * @memberof image
  * @memberof image
- * @extends core.Feature.
+ * @extends core.Plugin.
  */
  */
-export default class ImageEngine extends Feature {
+export default class ImageEngine extends Plugin {
 	/**
 	/**
 	 * @inheritDoc
 	 * @inheritDoc
 	 */
 	 */

+ 4 - 4
packages/ckeditor5-image/src/widget/widget.js

@@ -3,20 +3,20 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
-import Feature from '../../core/feature.js';
+import Plugin from '../../core/plugin.js';
 import WidgetEngine from './widgetengine.js';
 import WidgetEngine from './widgetengine.js';
 import MouseObserver from '../../engine/view/observer/mouseobserver.js';
 import MouseObserver from '../../engine/view/observer/mouseobserver.js';
 import ModelRange from '../../engine/model/range.js';
 import ModelRange from '../../engine/model/range.js';
 import { isWidget } from './utils.js';
 import { isWidget } from './utils.js';
 
 
 /**
 /**
- * The widget feature.
+ * The widget plugin.
  * Adds default {@link engine.view.Document#mousedown mousedown} handling on widget elements.
  * Adds default {@link engine.view.Document#mousedown mousedown} handling on widget elements.
  *
  *
  * @memberOf image.widget
  * @memberOf image.widget
- * @extends core.Feature.
+ * @extends core.Plugin.
  */
  */
-export default class Widget extends Feature {
+export default class Widget extends Plugin {
 	/**
 	/**
 	 * @inheritDoc
 	 * @inheritDoc
 	 */
 	 */

+ 4 - 4
packages/ckeditor5-image/src/widget/widgetengine.js

@@ -3,19 +3,19 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
-import Feature from '../../core/feature.js';
+import Plugin from '../../core/plugin.js';
 import { WIDGET_SELECTED_CLASS_NAME, isWidget } from './utils.js';
 import { WIDGET_SELECTED_CLASS_NAME, isWidget } from './utils.js';
 
 
 /**
 /**
- * The widget engine feature.
+ * The widget engine plugin.
  * Registers model to view selection converter for editing pipeline. It is hooked after default selection conversion.
  * Registers model to view selection converter for editing pipeline. It is hooked after default selection conversion.
  * If converted selection is placed around widget element, selection is marked as fake. Additionally, proper CSS class
  * If converted selection is placed around widget element, selection is marked as fake. Additionally, proper CSS class
  * is added to indicate that widget has been selected.
  * is added to indicate that widget has been selected.
  *
  *
  * @memberOf image.widget
  * @memberOf image.widget
- * @extends core.Feature.
+ * @extends core.Plugin.
  */
  */
-export default class WidgetEngine extends Feature {
+export default class WidgetEngine extends Plugin {
 	/**
 	/**
 	 * @inheritDoc
 	 * @inheritDoc
 	 */
 	 */

+ 1 - 1
packages/ckeditor5-image/tests/image.js

@@ -18,7 +18,7 @@ describe( 'Image', () => {
 		window.document.body.appendChild( editorElement );
 		window.document.body.appendChild( editorElement );
 
 
 		return ClassicTestEditor.create( editorElement, {
 		return ClassicTestEditor.create( editorElement, {
-			features: [ Image ]
+			plugins: [ Image ]
 		} )
 		} )
 		.then( newEditor => {
 		.then( newEditor => {
 			editor = newEditor;
 			editor = newEditor;

+ 1 - 1
packages/ckeditor5-image/tests/imageengine.js

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

+ 7 - 7
packages/ckeditor5-image/tests/manual/image.js

@@ -6,15 +6,15 @@
 /* global document, console, window */
 /* global document, console, window */
 
 
 import ClassicEditor from '/ckeditor5/editor-classic/classic.js';
 import ClassicEditor from '/ckeditor5/editor-classic/classic.js';
-import EnterFeature from '/ckeditor5/enter/enter.js';
-import TypingFeature from '/ckeditor5/typing/typing.js';
-import ParagraphFeature from '/ckeditor5/paragraph/paragraph.js';
-import HeadingFeature from '/ckeditor5/heading/heading.js';
-import ImageFeature from '/ckeditor5/image/image.js';
-import UndoFeature from '/ckeditor5/undo/undo.js';
+import EnterPlugin from '/ckeditor5/enter/enter.js';
+import TypingPlugin from '/ckeditor5/typing/typing.js';
+import ParagraphPlugin from '/ckeditor5/paragraph/paragraph.js';
+import HeadingPlugin from '/ckeditor5/heading/heading.js';
+import ImagePlugin from '/ckeditor5/image/image.js';
+import UndoPlugin from '/ckeditor5/undo/undo.js';
 
 
 ClassicEditor.create( document.querySelector( '#editor' ), {
 ClassicEditor.create( document.querySelector( '#editor' ), {
-	features: [ EnterFeature, TypingFeature, ParagraphFeature, HeadingFeature, ImageFeature, UndoFeature ],
+	plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin ],
 	toolbar: [ 'headings', 'undo', 'redo' ]
 	toolbar: [ 'headings', 'undo', 'redo' ]
 } )
 } )
 .then( editor => {
 .then( editor => {

+ 1 - 1
packages/ckeditor5-image/tests/widget/widget.js

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

+ 1 - 1
packages/ckeditor5-image/tests/widget/widgetengine.js

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