8
0
Kamil Piechaczek 5 лет назад
Родитель
Сommit
d8cf02d489

+ 8 - 8
packages/ckeditor5-list/src/liststyles.js → packages/ckeditor5-list/src/liststyle.js

@@ -4,33 +4,33 @@
  */
 
 /**
- * @module list/liststyles
+ * @module list/liststyle
  */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-import ListStylesEditing from './liststylesediting';
-import ListStylesUI from './liststylesui';
+import ListStyleEditing from './liststyleediting';
+import ListStyleUI from './liststyleui';
 
 /**
  * The list styles feature.
  *
- * This is a "glue" plugin that loads the {@link module:list/liststylesediting~ListStylesEditing list styles editing feature}
- * and the {@link module:list/liststylesui~ListStylesUI list styles UI feature}.
+ * This is a "glue" plugin that loads the {@link module:list/liststyleediting~ListStyleEditing list styles editing feature}
+ * and the {@link module:list/liststyleui~ListStyleUI list styles UI feature}.
  *
  * @extends module:core/plugin~Plugin
  */
-export default class ListStyles extends Plugin {
+export default class ListStyle extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
 	static get requires() {
-		return [ ListStylesEditing, ListStylesUI ];
+		return [ ListStyleEditing, ListStyleUI ];
 	}
 
 	/**
 	 * @inheritDoc
 	 */
 	static get pluginName() {
-		return 'ListStyles';
+		return 'ListStyle';
 	}
 }

+ 3 - 3
packages/ckeditor5-list/src/liststylescommand.js → packages/ckeditor5-list/src/liststylecommand.js

@@ -4,18 +4,18 @@
  */
 
 /**
- * @module list/liststylescommand
+ * @module list/liststylecommand
  */
 
 import Command from '@ckeditor/ckeditor5-core/src/command';
 import TreeWalker from '@ckeditor/ckeditor5-engine/src/model/treewalker';
 
 /**
- * The list style command. It is used by the {@link module:list/liststyles~ListStyles list styles feature}.
+ * The list style command. It is used by the {@link module:list/liststyle~ListStyle list styles feature}.
  *
  * @extends module:core/command~Command
  */
-export default class ListStylesCommand extends Command {
+export default class ListStyleCommand extends Command {
 	/**
 	 * Creates an instance of the command.
 	 *

+ 8 - 6
packages/ckeditor5-list/src/liststylesediting.js → packages/ckeditor5-list/src/liststyleediting.js

@@ -4,12 +4,12 @@
  */
 
 /**
- * @module list/liststylesediting
+ * @module list/liststyleediting
  */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import ListEditing from './listediting';
-import ListStylesCommand from './liststylescommand';
+import ListStyleCommand from './liststylecommand';
 import { getSiblingListItem } from './utils';
 
 const DEFAULT_LIST_TYPE = 'default';
@@ -20,9 +20,11 @@ const DEFAULT_LIST_TYPE = 'default';
  * It sets value for the `listItem` attribute for the {@link module:list/list~List `<listItem>`} element that
  * allows modifying list style type.
  *
+ * It registers the `'listStyle'` command.
+ *
  * @extends module:core/plugin~Plugin
  */
-export default class ListStylesEditing extends Plugin {
+export default class ListStyleEditing extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
@@ -34,7 +36,7 @@ export default class ListStylesEditing extends Plugin {
 	 * @inheritDoc
 	 */
 	static get pluginName() {
-		return 'ListStylesEditing';
+		return 'ListStyleEditing';
 	}
 
 	/**
@@ -54,7 +56,7 @@ export default class ListStylesEditing extends Plugin {
 			isFormatting: true
 		} );
 
-		editor.commands.add( 'listStyles', new ListStylesCommand( editor, DEFAULT_LIST_TYPE ) );
+		editor.commands.add( 'listStyle', new ListStyleCommand( editor, DEFAULT_LIST_TYPE ) );
 
 		// Fix list attributes when modifying their nesting levels (the `listIndent` attribute).
 		this.listenTo( editor.commands.get( 'indentList' ), 'executeCleanup', fixListAfterIndentListCommand( editor ) );
@@ -78,7 +80,7 @@ export default class ListStylesEditing extends Plugin {
 		const editor = this.editor;
 
 		// Enable post-fixer that removes the `listStyle` attribute from to-do list items only if the "TodoList" plugin is on.
-		// We need to registry the hook here since the `TodoList` plugin can be added after the `ListStylesEditing`.
+		// We need to registry the hook here since the `TodoList` plugin can be added after the `ListStyleEditing`.
 		if ( editor.commands.get( 'todoList' ) ) {
 			editor.model.document.registerPostFixer( removeListStyleAttributeFromTodoList( editor ) );
 		}

+ 13 - 13
packages/ckeditor5-list/src/liststylesui.js → packages/ckeditor5-list/src/liststyleui.js

@@ -4,7 +4,7 @@
  */
 
 /**
- * @module list/liststylesui
+ * @module list/liststyleui
  */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
@@ -39,12 +39,12 @@ import '../theme/liststyles.css';
  *
  * @extends module:core/plugin~Plugin
  */
-export default class ListStylesUI extends Plugin {
+export default class ListStyleUI extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
 	static get pluginName() {
-		return 'ListStylesUI';
+		return 'ListStyleUI';
 	}
 
 	init() {
@@ -141,14 +141,14 @@ export default class ListStylesUI extends Plugin {
 // @returns {Function} A function that can be passed straight into {@link module:ui/componentfactory~ComponentFactory#add}.
 function getSplitButtonCreator( { editor, parentCommandName, buttonLabel, buttonIcon, toolbarAriaLabel, styleDefinitions } ) {
 	const parentCommand = editor.commands.get( parentCommandName );
-	const listStylesCommand = editor.commands.get( 'listStyles' );
+	const listStyleCommand = editor.commands.get( 'listStyle' );
 
 	// @param {module:utils/locale~Locale} locale
 	// @returns {module:ui/dropdown/dropdownview~DropdownView}
 	return locale => {
 		const dropdownView = createDropdown( locale, SplitButtonView );
 		const splitButtonView = dropdownView.buttonView;
-		const styleButtonCreator = getStyleButtonCreator( { editor, parentCommandName, listStylesCommand } );
+		const styleButtonCreator = getStyleButtonCreator( { editor, parentCommandName, listStyleCommand } );
 
 		addToolbarToDropdown( dropdownView, styleDefinitions.map( styleButtonCreator ) );
 
@@ -179,11 +179,11 @@ function getSplitButtonCreator( { editor, parentCommandName, buttonLabel, button
 //
 // @param {Object} options
 // @param {module:core/editor/editor~Editor} options.editor
-// @param {module:list/liststylescommand~ListStylesCommand} options.listStylesCommand The instance of the `ListStylesCommand` class.
+// @param {module:list/liststylecommand~ListStylesCommand} options.listStyleCommand The instance of the `ListStylesCommand` class.
 // @param {'bulletedList'|'numberedList'} options.parentCommandName The name of the higher-order command associated with a
 // particular list style (e.g. "bulletedList" is associated with "square" and "numberedList" is associated with "roman").
 // @returns {Function} A function that can be passed straight into {@link module:ui/componentfactory~ComponentFactory#add}.
-function getStyleButtonCreator( { editor, listStylesCommand, parentCommandName } ) {
+function getStyleButtonCreator( { editor, listStyleCommand, parentCommandName } ) {
 	const locale = editor.locale;
 	const parentCommand = editor.commands.get( parentCommandName );
 
@@ -197,8 +197,8 @@ function getStyleButtonCreator( { editor, listStylesCommand, parentCommandName }
 
 		button.set( { label, icon, tooltip } );
 
-		listStylesCommand.on( 'change:value', () => {
-			button.isOn = listStylesCommand.value === type;
+		listStyleCommand.on( 'change:value', () => {
+			button.isOn = listStyleCommand.value === type;
 		} );
 
 		button.on( 'execute', () => {
@@ -206,18 +206,18 @@ function getStyleButtonCreator( { editor, listStylesCommand, parentCommandName }
 			if ( parentCommand.value ) {
 				// If the current list style is not set in the model or the style is different than the
 				// one to be applied, simply apply the new style.
-				if ( listStylesCommand.value !== type ) {
-					editor.execute( 'listStyles', { type } );
+				if ( listStyleCommand.value !== type ) {
+					editor.execute( 'listStyle', { type } );
 				}
 				// If the style was the same, remove it (the button works as an off toggle).
 				else {
-					editor.execute( 'listStyles', { type: 'default' } );
+					editor.execute( 'listStyle', { type: 'default' } );
 				}
 			}
 			// If the content the selection is anchored to is not a list, let's create a list of a desired style.
 			else {
 				editor.execute( parentCommandName );
-				editor.execute( 'listStyles', { type } );
+				editor.execute( 'listStyle', { type } );
 			}
 
 			editor.editing.view.focus();

+ 18 - 0
packages/ckeditor5-list/tests/liststyle.js

@@ -0,0 +1,18 @@
+/**
+ * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+import ListStyle from '../src/liststyle';
+import ListStyleEditing from '../src/liststyleediting';
+import ListStyleUI from '../src/liststyleui';
+
+describe( 'ListStyle', () => {
+	it( 'should be named', () => {
+		expect( ListStyle.pluginName ).to.equal( 'ListStyle' );
+	} );
+
+	it( 'should require ListStyleEditing and ListStyleUI', () => {
+		expect( ListStyle.requires ).to.deep.equal( [ ListStyleEditing, ListStyleUI ] );
+	} );
+} );

+ 32 - 32
packages/ckeditor5-list/tests/liststylescommand.js → packages/ckeditor5-list/tests/liststylecommand.js

@@ -6,15 +6,15 @@
 import { setData, getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
-import ListStylesEditing from '../src/liststylesediting';
+import ListStyleEditing from '../src/liststyleediting';
 
-describe( 'ListStylesCommand', () => {
-	let editor, model, bulletedListCommand, numberedListCommand, listStylesCommand;
+describe( 'ListStyleCommand', () => {
+	let editor, model, bulletedListCommand, numberedListCommand, listStyleCommand;
 
 	beforeEach( () => {
 		return VirtualTestEditor
 			.create( {
-				plugins: [ Paragraph, ListStylesEditing ]
+				plugins: [ Paragraph, ListStyleEditing ]
 			} )
 			.then( newEditor => {
 				editor = newEditor;
@@ -22,7 +22,7 @@ describe( 'ListStylesCommand', () => {
 
 				bulletedListCommand = editor.commands.get( 'bulletedList' );
 				numberedListCommand = editor.commands.get( 'numberedList' );
-				listStylesCommand = editor.commands.get( 'listStyles' );
+				listStyleCommand = editor.commands.get( 'listStyle' );
 			} );
 	} );
 
@@ -34,24 +34,24 @@ describe( 'ListStylesCommand', () => {
 		it( 'should be true if bulletedList or numberedList is enabled', () => {
 			bulletedListCommand.isEnabled = true;
 			numberedListCommand.isEnabled = false;
-			listStylesCommand.refresh();
+			listStyleCommand.refresh();
 
-			expect( listStylesCommand.isEnabled ).to.equal( true );
+			expect( listStyleCommand.isEnabled ).to.equal( true );
 
 			bulletedListCommand.isEnabled = false;
 			numberedListCommand.isEnabled = true;
-			listStylesCommand.refresh();
+			listStyleCommand.refresh();
 
-			expect( listStylesCommand.isEnabled ).to.equal( true );
+			expect( listStyleCommand.isEnabled ).to.equal( true );
 		} );
 
 		it( 'should be false if bulletedList and numberedList are enabled', () => {
 			bulletedListCommand.isEnabled = false;
 			numberedListCommand.isEnabled = false;
 
-			listStylesCommand.refresh();
+			listStyleCommand.refresh();
 
-			expect( listStylesCommand.isEnabled ).to.equal( false );
+			expect( listStyleCommand.isEnabled ).to.equal( false );
 		} );
 	} );
 
@@ -59,7 +59,7 @@ describe( 'ListStylesCommand', () => {
 		it( 'should return null if selected a paragraph', () => {
 			setData( model, '<paragraph>Foo[]</paragraph>' );
 
-			expect( listStylesCommand.value ).to.equal( null );
+			expect( listStyleCommand.value ).to.equal( null );
 		} );
 
 		it( 'should return null if selection starts in a paragraph and ends in a list item', () => {
@@ -68,19 +68,19 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listType="bulleted" listStyle="default">Foo]</listItem>'
 			);
 
-			expect( listStylesCommand.value ).to.equal( null );
+			expect( listStyleCommand.value ).to.equal( null );
 		} );
 
 		it( 'should return the value of `listStyle` attribute if selection is inside a listItem (collapsed selection)', () => {
 			setData( model, '<listItem listIndent="0" listType="bulleted" listStyle="default">Foo[]</listItem>' );
 
-			expect( listStylesCommand.value ).to.equal( 'default' );
+			expect( listStyleCommand.value ).to.equal( 'default' );
 		} );
 
 		it( 'should return the value of `listStyle` attribute if selection is inside a listItem (non-collapsed selection)', () => {
 			setData( model, '<listItem listIndent="0" listType="bulleted" listStyle="default">[Foo]</listItem>' );
 
-			expect( listStylesCommand.value ).to.equal( 'default' );
+			expect( listStyleCommand.value ).to.equal( 'default' );
 		} );
 
 		it( 'should return the value of `listStyle` attribute if selected more elements in the same list', () => {
@@ -90,7 +90,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listType="bulleted" listStyle="square">3.</listItem>'
 			);
 
-			expect( listStylesCommand.value ).to.equal( 'square' );
+			expect( listStyleCommand.value ).to.equal( 'square' );
 		} );
 
 		it( 'should return the value of `listStyle` attribute for the selection inside a nested list', () => {
@@ -100,7 +100,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listType="bulleted" listStyle="square">2.</listItem>'
 			);
 
-			expect( listStylesCommand.value ).to.equal( 'disc' );
+			expect( listStyleCommand.value ).to.equal( 'disc' );
 		} );
 
 		it( 'should return the value of `listStyle` attribute from a list where the selection starts (selection over nested list)', () => {
@@ -110,7 +110,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listType="bulleted" listStyle="square">2.]</listItem>'
 			);
 
-			expect( listStylesCommand.value ).to.equal( 'disc' );
+			expect( listStyleCommand.value ).to.equal( 'disc' );
 		} );
 	} );
 
@@ -120,7 +120,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">1.[]</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<listItem listIndent="0" listStyle="circle" listType="bulleted">1.[]</listItem>'
@@ -132,7 +132,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">[1.]</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<listItem listIndent="0" listStyle="circle" listType="bulleted">[1.]</listItem>'
@@ -146,7 +146,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">3.</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<listItem listIndent="0" listStyle="circle" listType="bulleted">1.[]</listItem>' +
@@ -165,7 +165,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="1" listStyle="default" listType="bulleted">3.1.</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<listItem listIndent="0" listStyle="circle" listType="bulleted">1.[]</listItem>' +
@@ -187,7 +187,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="1" listStyle="default" listType="bulleted">3.1.</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'disc' } );
+			listStyleCommand.execute( { type: 'disc' } );
 
 			expect( getData( model ) ).to.equal(
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">1.</listItem>' +
@@ -207,7 +207,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">3.</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<paragraph>Foo.</paragraph>' +
@@ -225,7 +225,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="default" listType="numbered">1.</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<paragraph>Foo.</paragraph>' +
@@ -243,7 +243,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="disc" listType="bulleted">1.</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<paragraph>Foo.</paragraph>' +
@@ -261,7 +261,7 @@ describe( 'ListStylesCommand', () => {
 				'<paragraph>Foo.]</paragraph>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<listItem listIndent="0" listStyle="circle" listType="bulleted">1.</listItem>' +
@@ -279,7 +279,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">3.</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<paragraph>[Foo.</paragraph>' +
@@ -294,7 +294,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="circle" listType="bulleted">1.[]</listItem>'
 			);
 
-			listStylesCommand.execute();
+			listStyleCommand.execute();
 
 			expect( getData( model ) ).to.equal(
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">1.[]</listItem>'
@@ -306,7 +306,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="circle" listType="bulleted">1.[]</listItem>'
 			);
 
-			listStylesCommand.execute( {} );
+			listStyleCommand.execute( {} );
 
 			expect( getData( model ) ).to.equal(
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">1.[]</listItem>'
@@ -318,7 +318,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="circle" listType="bulleted">1.[]</listItem>'
 			);
 
-			listStylesCommand.execute( { type: null } );
+			listStyleCommand.execute( { type: null } );
 
 			expect( getData( model ) ).to.equal(
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">1.[]</listItem>'
@@ -331,7 +331,7 @@ describe( 'ListStylesCommand', () => {
 				'<listItem listIndent="0" listStyle="default" listType="bulleted">1.</listItem>'
 			);
 
-			listStylesCommand.execute( { type: 'circle' } );
+			listStyleCommand.execute( { type: 'circle' } );
 
 			expect( getData( model ) ).to.equal(
 				'<paragraph>[Foo.]</paragraph>' +

+ 10 - 10
packages/ckeditor5-list/tests/liststylesediting.js → packages/ckeditor5-list/tests/liststyleediting.js

@@ -8,17 +8,17 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import { getData as getModelData, setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 import { getData as getViewData } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';
 import UndoEditing from '@ckeditor/ckeditor5-undo/src/undoediting';
-import ListStylesEditing from '../src/liststylesediting';
+import ListStyleEditing from '../src/liststyleediting';
 import TodoListEditing from '../src/todolistediting';
-import ListStylesCommand from '../src/liststylescommand';
+import ListStyleCommand from '../src/liststylecommand';
 
-describe( 'ListStylesEditing', () => {
+describe( 'ListStyleEditing', () => {
 	let editor, model, view;
 
 	beforeEach( () => {
 		return VirtualTestEditor
 			.create( {
-				plugins: [ Paragraph, ListStylesEditing, UndoEditing ]
+				plugins: [ Paragraph, ListStyleEditing, UndoEditing ]
 			} )
 			.then( newEditor => {
 				editor = newEditor;
@@ -32,11 +32,11 @@ describe( 'ListStylesEditing', () => {
 	} );
 
 	it( 'should have pluginName', () => {
-		expect( ListStylesEditing.pluginName ).to.equal( 'ListStylesEditing' );
+		expect( ListStyleEditing.pluginName ).to.equal( 'ListStyleEditing' );
 	} );
 
 	it( 'should be loaded', () => {
-		expect( editor.plugins.get( ListStylesEditing ) ).to.be.instanceOf( ListStylesEditing );
+		expect( editor.plugins.get( ListStyleEditing ) ).to.be.instanceOf( ListStyleEditing );
 	} );
 
 	describe( 'schema rules', () => {
@@ -53,9 +53,9 @@ describe( 'ListStylesEditing', () => {
 
 	describe( 'command', () => {
 		it( 'should register listStyle command', () => {
-			const command = editor.commands.get( 'listStyles' );
+			const command = editor.commands.get( 'listStyle' );
 
-			expect( command ).to.be.instanceOf( ListStylesCommand );
+			expect( command ).to.be.instanceOf( ListStyleCommand );
 		} );
 	} );
 
@@ -842,8 +842,8 @@ describe( 'ListStylesEditing', () => {
 			beforeEach( () => {
 				return VirtualTestEditor
 					.create( {
-						// TodoListEditing is at the end by design. Check `ListStylesEditing.afterInit()` call.
-						plugins: [ Paragraph, ListStylesEditing, TodoListEditing ]
+						// TodoListEditing is at the end by design. Check `ListStyleEditing.afterInit()` call.
+						plugins: [ Paragraph, ListStyleEditing, TodoListEditing ]
 					} )
 					.then( newEditor => {
 						editor = newEditor;

+ 0 - 18
packages/ckeditor5-list/tests/liststyles.js

@@ -1,18 +0,0 @@
-/**
- * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
-
-import ListStyles from '../src/liststyles';
-import ListStylesEditing from '../src/liststylesediting';
-import ListStylesUI from '../src/liststylesui';
-
-describe( 'ListStyles', () => {
-	it( 'should be named', () => {
-		expect( ListStyles.pluginName ).to.equal( 'ListStyles' );
-	} );
-
-	it( 'should require ListStylesEditing and ListStylesUI', () => {
-		expect( ListStyles.requires ).to.deep.equal( [ ListStylesEditing, ListStylesUI ] );
-	} );
-} );

+ 24 - 24
packages/ckeditor5-list/tests/liststylesui.js → packages/ckeditor5-list/tests/liststyleui.js

@@ -10,8 +10,8 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote';
 import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 import { setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
-import ListStyles from '../src/liststyles';
-import ListStylesUI from '../src/liststylesui';
+import ListStyle from '../src/liststyle';
+import ListStyleUI from '../src/liststyleui';
 import DropdownView from '@ckeditor/ckeditor5-ui/src/dropdown/dropdownview';
 
 import bulletedListIcon from '../theme/icons/bulletedlist.svg';
@@ -27,19 +27,19 @@ import listStyleUpperRomanIcon from '../theme/icons/liststyleupperroman.svg';
 import listStyleLowerLatinIcon from '../theme/icons/liststylelowerlatin.svg';
 import listStyleUpperLatinIcon from '../theme/icons/liststyleupperlatin.svg';
 
-describe( 'ListStylesUI', () => {
-	let editorElement, editor, model, listStylesCommand;
+describe( 'ListStyleUI', () => {
+	let editorElement, editor, model, listStyleCommand;
 
 	beforeEach( () => {
 		editorElement = document.createElement( 'div' );
 		document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, { plugins: [ Paragraph, BlockQuote, ListStyles ] } )
+		return ClassicTestEditor.create( editorElement, { plugins: [ Paragraph, BlockQuote, ListStyle ] } )
 			.then( newEditor => {
 				editor = newEditor;
 				model = editor.model;
 
-				listStylesCommand = editor.commands.get( 'listStyles' );
+				listStyleCommand = editor.commands.get( 'listStyle' );
 			} );
 	} );
 
@@ -50,11 +50,11 @@ describe( 'ListStylesUI', () => {
 	} );
 
 	it( 'should be named', () => {
-		expect( ListStylesUI.pluginName ).to.equal( 'ListStylesUI' );
+		expect( ListStyleUI.pluginName ).to.equal( 'ListStyleUI' );
 	} );
 
 	it( 'should be loaded', () => {
-		expect( editor.plugins.get( ListStylesUI ) ).to.be.instanceOf( ListStylesUI );
+		expect( editor.plugins.get( ListStyleUI ) ).to.be.instanceOf( ListStyleUI );
 	} );
 
 	describe( 'init()', () => {
@@ -182,16 +182,16 @@ describe( 'ListStylesUI', () => {
 						expect( styleButtonView ).to.be.instanceOf( ButtonView );
 					} );
 
-					it( 'should change its #isOn state when the value of the "listStylesCommand" command changes', () => {
+					it( 'should change its #isOn state when the value of the "listStyleCommand" command changes', () => {
 						expect( styleButtonView.isOn ).to.be.false;
 
-						listStylesCommand.value = 'foo';
+						listStyleCommand.value = 'foo';
 						expect( styleButtonView.isOn ).to.be.false;
 
-						listStylesCommand.value = 'circle';
+						listStyleCommand.value = 'circle';
 						expect( styleButtonView.isOn ).to.be.true;
 
-						listStylesCommand.value = null;
+						listStyleCommand.value = null;
 						expect( styleButtonView.isOn ).to.be.false;
 					} );
 
@@ -200,7 +200,7 @@ describe( 'ListStylesUI', () => {
 
 						styleButtonView.fire( 'execute' );
 
-						sinon.assert.calledWithExactly( editor.execute, 'listStyles', { type: 'circle' } );
+						sinon.assert.calledWithExactly( editor.execute, 'listStyle', { type: 'circle' } );
 						sinon.assert.calledOnce( editor.editing.view.focus );
 						sinon.assert.callOrder( editor.execute, editor.editing.view.focus );
 					} );
@@ -210,7 +210,7 @@ describe( 'ListStylesUI', () => {
 
 						styleButtonView.fire( 'execute' );
 
-						sinon.assert.calledWithExactly( editor.execute, 'listStyles', { type: 'circle' } );
+						sinon.assert.calledWithExactly( editor.execute, 'listStyle', { type: 'circle' } );
 						sinon.assert.calledOnce( editor.editing.view.focus );
 						sinon.assert.callOrder( editor.execute, editor.editing.view.focus );
 					} );
@@ -220,7 +220,7 @@ describe( 'ListStylesUI', () => {
 
 						styleButtonView.fire( 'execute' );
 
-						sinon.assert.calledWithExactly( editor.execute, 'listStyles', { type: 'default' } );
+						sinon.assert.calledWithExactly( editor.execute, 'listStyle', { type: 'default' } );
 						sinon.assert.calledOnce( editor.editing.view.focus );
 						sinon.assert.callOrder( editor.execute, editor.editing.view.focus );
 					} );
@@ -230,7 +230,7 @@ describe( 'ListStylesUI', () => {
 
 						styleButtonView.fire( 'execute' );
 
-						sinon.assert.calledWithExactly( editor.execute, 'listStyles', { type: 'circle' } );
+						sinon.assert.calledWithExactly( editor.execute, 'listStyle', { type: 'circle' } );
 						sinon.assert.calledOnce( editor.editing.view.focus );
 						sinon.assert.callOrder( editor.execute, editor.editing.view.focus );
 					} );
@@ -386,16 +386,16 @@ describe( 'ListStylesUI', () => {
 						expect( styleButtonView ).to.be.instanceOf( ButtonView );
 					} );
 
-					it( 'should change its #isOn state when the value of the "listStylesCommand" command changes', () => {
+					it( 'should change its #isOn state when the value of the "listStyleCommand" command changes', () => {
 						expect( styleButtonView.isOn ).to.be.false;
 
-						listStylesCommand.value = 'foo';
+						listStyleCommand.value = 'foo';
 						expect( styleButtonView.isOn ).to.be.false;
 
-						listStylesCommand.value = 'decimal-leading-zero';
+						listStyleCommand.value = 'decimal-leading-zero';
 						expect( styleButtonView.isOn ).to.be.true;
 
-						listStylesCommand.value = null;
+						listStyleCommand.value = null;
 						expect( styleButtonView.isOn ).to.be.false;
 					} );
 
@@ -404,7 +404,7 @@ describe( 'ListStylesUI', () => {
 
 						styleButtonView.fire( 'execute' );
 
-						sinon.assert.calledWithExactly( editor.execute, 'listStyles', { type: 'decimal-leading-zero' } );
+						sinon.assert.calledWithExactly( editor.execute, 'listStyle', { type: 'decimal-leading-zero' } );
 						sinon.assert.calledOnce( editor.editing.view.focus );
 						sinon.assert.callOrder( editor.execute, editor.editing.view.focus );
 					} );
@@ -414,7 +414,7 @@ describe( 'ListStylesUI', () => {
 
 						styleButtonView.fire( 'execute' );
 
-						sinon.assert.calledWithExactly( editor.execute, 'listStyles', { type: 'decimal-leading-zero' } );
+						sinon.assert.calledWithExactly( editor.execute, 'listStyle', { type: 'decimal-leading-zero' } );
 						sinon.assert.calledOnce( editor.editing.view.focus );
 						sinon.assert.callOrder( editor.execute, editor.editing.view.focus );
 					} );
@@ -424,7 +424,7 @@ describe( 'ListStylesUI', () => {
 
 						styleButtonView.fire( 'execute' );
 
-						sinon.assert.calledWithExactly( editor.execute, 'listStyles', { type: 'default' } );
+						sinon.assert.calledWithExactly( editor.execute, 'listStyle', { type: 'default' } );
 						sinon.assert.calledOnce( editor.editing.view.focus );
 						sinon.assert.callOrder( editor.execute, editor.editing.view.focus );
 					} );
@@ -434,7 +434,7 @@ describe( 'ListStylesUI', () => {
 
 						styleButtonView.fire( 'execute' );
 
-						sinon.assert.calledWithExactly( editor.execute, 'listStyles', { type: 'decimal-leading-zero' } );
+						sinon.assert.calledWithExactly( editor.execute, 'listStyle', { type: 'decimal-leading-zero' } );
 						sinon.assert.calledOnce( editor.editing.view.focus );
 						sinon.assert.callOrder( editor.execute, editor.editing.view.focus );
 					} );

+ 0 - 0
packages/ckeditor5-list/tests/manual/list-styles.html → packages/ckeditor5-list/tests/manual/list-style.html


+ 2 - 2
packages/ckeditor5-list/tests/manual/list-styles.js → packages/ckeditor5-list/tests/manual/list-style.js

@@ -14,7 +14,7 @@ import Table from '@ckeditor/ckeditor5-table/src/table';
 import TablePropertiesEditing from '@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesediting';
 import TableCellPropertiesEditing from '@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesediting';
 import List from '../../src/list';
-import ListStyles from '../../src/liststyles';
+import ListStyle from '../../src/liststyle';
 import Indent from '@ckeditor/ckeditor5-indent/src/indent';
 import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
 import TodoList from '../../src/todolist';
@@ -29,7 +29,7 @@ ClassicEditor
 			List,
 			TodoList,
 			Paragraph,
-			ListStyles,
+			ListStyle,
 			Table,
 			TablePropertiesEditing,
 			TableCellPropertiesEditing,

+ 1 - 1
packages/ckeditor5-list/tests/manual/list-styles.md → packages/ckeditor5-list/tests/manual/list-style.md

@@ -1,4 +1,4 @@
-# List Styles feature
+# List Style feature
 
 The editor should display 4 headers and tables.