8
0
Просмотр исходного кода

Remove ImageEditing from requires method of ImageStyleEditing.

Maciej Gołaszewski 7 лет назад
Родитель
Сommit
d15e5c387c

+ 0 - 8
packages/ckeditor5-image/src/imagestyle/imagestyleediting.js

@@ -9,7 +9,6 @@
 
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import ImageStyleCommand from './imagestylecommand';
 import ImageStyleCommand from './imagestylecommand';
-import ImageEditing from '../image/imageediting';
 import { viewToModelStyleAttribute, modelToViewStyleAttribute } from './converters';
 import { viewToModelStyleAttribute, modelToViewStyleAttribute } from './converters';
 import { normalizeImageStyles } from './utils';
 import { normalizeImageStyles } from './utils';
 
 
@@ -20,13 +19,6 @@ import { normalizeImageStyles } from './utils';
  * @extends {module:core/plugin~Plugin}
  * @extends {module:core/plugin~Plugin}
  */
  */
 export default class ImageStyleEditing extends Plugin {
 export default class ImageStyleEditing extends Plugin {
-	/**
-	 * @inheritDoc
-	 */
-	static get requires() {
-		return [ ImageEditing ];
-	}
-
 	/**
 	/**
 	 * @inheritDoc
 	 * @inheritDoc
 	 */
 	 */

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

@@ -4,6 +4,7 @@
  */
  */
 
 
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
+import Image from '../src/image';
 import ImageStyle from '../src/imagestyle';
 import ImageStyle from '../src/imagestyle';
 import ImageStyleEditing from '../src/imagestyle/imagestyleediting';
 import ImageStyleEditing from '../src/imagestyle/imagestyleediting';
 import ImageStyleUI from '../src/imagestyle/imagestyleui';
 import ImageStyleUI from '../src/imagestyle/imagestyleui';
@@ -18,7 +19,7 @@ describe( 'ImageStyle', () => {
 
 
 		return ClassicTestEditor
 		return ClassicTestEditor
 			.create( editorElement, {
 			.create( editorElement, {
-				plugins: [ ImageStyle ]
+				plugins: [ Image, ImageStyle ]
 			} )
 			} )
 			.then( newEditor => {
 			.then( newEditor => {
 				editor = newEditor;
 				editor = newEditor;

+ 6 - 10
packages/ckeditor5-image/tests/imagestyle/imagestyleediting.js

@@ -32,7 +32,7 @@ describe( 'ImageStyleEditing', () => {
 		beforeEach( () => {
 		beforeEach( () => {
 			return VirtualTestEditor
 			return VirtualTestEditor
 				.create( {
 				.create( {
-					plugins: [ ImageStyleEditing ],
+					plugins: [ ImageEditing, ImageStyleEditing ]
 				} )
 				} )
 				.then( newEditor => {
 				.then( newEditor => {
 					editor = newEditor;
 					editor = newEditor;
@@ -42,17 +42,13 @@ describe( 'ImageStyleEditing', () => {
 		it( 'should be loaded', () => {
 		it( 'should be loaded', () => {
 			expect( editor.plugins.get( ImageStyleEditing ) ).to.be.instanceOf( ImageStyleEditing );
 			expect( editor.plugins.get( ImageStyleEditing ) ).to.be.instanceOf( ImageStyleEditing );
 		} );
 		} );
-
-		it( 'should load image editing', () => {
-			expect( editor.plugins.get( ImageEditing ) ).to.be.instanceOf( ImageEditing );
-		} );
 	} );
 	} );
 
 
 	describe( 'init', () => {
 	describe( 'init', () => {
 		beforeEach( () => {
 		beforeEach( () => {
 			return VirtualTestEditor
 			return VirtualTestEditor
 				.create( {
 				.create( {
-					plugins: [ ImageStyleEditing ],
+					plugins: [ ImageEditing, ImageStyleEditing ],
 					image: {
 					image: {
 						styles: [
 						styles: [
 							{ name: 'fullStyle', title: 'foo', icon: 'object-center', isDefault: true },
 							{ name: 'fullStyle', title: 'foo', icon: 'object-center', isDefault: true },
@@ -72,7 +68,7 @@ describe( 'ImageStyleEditing', () => {
 		it( 'should define image.styles config', () => {
 		it( 'should define image.styles config', () => {
 			return VirtualTestEditor
 			return VirtualTestEditor
 				.create( {
 				.create( {
-					plugins: [ ImageStyleEditing ]
+					plugins: [ ImageEditing, ImageStyleEditing ]
 				} )
 				} )
 				.then( newEditor => {
 				.then( newEditor => {
 					editor = newEditor;
 					editor = newEditor;
@@ -265,7 +261,7 @@ describe( 'ImageStyleEditing', () => {
 		it( 'should fall back to defaults when no image.styles', () => {
 		it( 'should fall back to defaults when no image.styles', () => {
 			return VirtualTestEditor
 			return VirtualTestEditor
 				.create( {
 				.create( {
-					plugins: [ ImageStyleEditing ]
+					plugins: [ ImageEditing, ImageStyleEditing ]
 				} )
 				} )
 				.then( newEditor => {
 				.then( newEditor => {
 					editor = newEditor;
 					editor = newEditor;
@@ -277,7 +273,7 @@ describe( 'ImageStyleEditing', () => {
 		it( 'should not alter the image.styles config', () => {
 		it( 'should not alter the image.styles config', () => {
 			return VirtualTestEditor
 			return VirtualTestEditor
 				.create( {
 				.create( {
-					plugins: [ ImageStyleEditing ],
+					plugins: [ ImageEditing, ImageStyleEditing ],
 					image: {
 					image: {
 						styles: [
 						styles: [
 							'side'
 							'side'
@@ -294,7 +290,7 @@ describe( 'ImageStyleEditing', () => {
 		it( 'should not alter object definitions in the image.styles config', () => {
 		it( 'should not alter object definitions in the image.styles config', () => {
 			return VirtualTestEditor
 			return VirtualTestEditor
 				.create( {
 				.create( {
-					plugins: [ ImageStyleEditing ],
+					plugins: [ ImageEditing, ImageStyleEditing ],
 					image: {
 					image: {
 						styles: [
 						styles: [
 							{ name: 'side' }
 							{ name: 'side' }

+ 4 - 3
packages/ckeditor5-image/tests/imagestyle/imagestyleui.js

@@ -6,6 +6,7 @@
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
 import ImageStyleEditing from '../../src/imagestyle/imagestyleediting';
 import ImageStyleEditing from '../../src/imagestyle/imagestyleediting';
 import ImageStyleUI from '../../src/imagestyle/imagestyleui';
 import ImageStyleUI from '../../src/imagestyle/imagestyleui';
+import ImageEditing from '../../src/image/imageediting';
 import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 import global from '@ckeditor/ckeditor5-utils/src/dom/global';
 import global from '@ckeditor/ckeditor5-utils/src/dom/global';
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
@@ -26,7 +27,7 @@ describe( 'ImageStyleUI', () => {
 
 
 		return ClassicTestEditor
 		return ClassicTestEditor
 			.create( editorElement, {
 			.create( editorElement, {
-				plugins: [ ImageStyleEditing, ImageStyleUI ],
+				plugins: [ ImageEditing, ImageStyleEditing, ImageStyleUI ],
 				image: {
 				image: {
 					styles
 					styles
 				}
 				}
@@ -77,7 +78,7 @@ describe( 'ImageStyleUI', () => {
 
 
 		return ClassicTestEditor
 		return ClassicTestEditor
 			.create( editorElement, {
 			.create( editorElement, {
-				plugins: [ TranslationMock, ImageStyleEditing, ImageStyleUI ],
+				plugins: [ TranslationMock, ImageEditing, ImageStyleEditing, ImageStyleUI ],
 				image: {
 				image: {
 					styles: [
 					styles: [
 						{ name: 'style 1', title: 'Side image', icon: 'style1-icon', isDefault: true }
 						{ name: 'style 1', title: 'Side image', icon: 'style1-icon', isDefault: true }
@@ -99,7 +100,7 @@ describe( 'ImageStyleUI', () => {
 
 
 		return ClassicTestEditor
 		return ClassicTestEditor
 			.create( editorElement, {
 			.create( editorElement, {
-				plugins: [ ImageStyleEditing, ImageStyleUI ],
+				plugins: [ ImageEditing, ImageStyleEditing, ImageStyleUI ],
 				image: {
 				image: {
 					styles,
 					styles,
 					toolbar: [ 'foo', 'bar' ]
 					toolbar: [ 'foo', 'bar' ]