浏览代码

Unified the config.table.tableProperties and tableCellProperties configurations (borders and background colors).

Aleksander Nowodzinski 5 年之前
父节点
当前提交
f2bfe24cbf

+ 8 - 10
packages/ckeditor5-table/src/tablecellproperties.js

@@ -39,20 +39,18 @@ export default class TableCellProperties extends Plugin {
 /**
  * A configuration of the table cell properties user interface (balloon). It allows to define:
  *
- * * the color palette for the cell border color style field (`tableCellProperties.border.colors`),
+ * * the color palette for the cell border color style field (`tableCellProperties.borderColors`),
  * * the color palette for the cell background style field (`tableCellProperties.backgroundColors`).
  *
  *		const tableConfig = {
  *			tableCellProperties: {
- *				border: {
- *					colors: [
- *						{
- *							color: 'hsl(0, 0%, 90%)',
- *							label: 'Light grey'
- *						},
- *						// ...
- *					]
- *				},
+ *				borderColors: [
+ *					{
+ *						color: 'hsl(0, 0%, 90%)',
+ *						label: 'Light grey'
+ *					},
+ *					// ...
+ *				],
  *				backgroundColors: [
  *					{
  *						color: 'hsl(120, 75%, 60%)',

+ 2 - 4
packages/ckeditor5-table/src/tablecellproperties/tablecellpropertiesui.js

@@ -65,9 +65,7 @@ export default class TableCellPropertiesUI extends Plugin {
 		super( editor );
 
 		editor.config.define( 'table.tableCellProperties', {
-			border: {
-				colors: defaultColors
-			},
+			borderColors: defaultColors,
 			backgroundColors: defaultColors
 		} );
 	}
@@ -140,7 +138,7 @@ export default class TableCellPropertiesUI extends Plugin {
 		const editor = this.editor;
 		const viewDocument = editor.editing.view.document;
 		const config = editor.config.get( 'table.tableCellProperties' );
-		const borderColorsConfig = normalizeColorOptions( config.border.colors );
+		const borderColorsConfig = normalizeColorOptions( config.borderColors );
 		const localizedBorderColors = getLocalizedColorOptions( editor.locale, borderColorsConfig );
 		const backgroundColorsConfig = normalizeColorOptions( config.backgroundColors );
 		const localizedBackgroundColors = getLocalizedColorOptions( editor.locale, backgroundColorsConfig );

+ 8 - 10
packages/ckeditor5-table/src/tableproperties.js

@@ -40,20 +40,18 @@ export default class TableProperties extends Plugin {
 /**
  * A configuration of the table properties user interface (balloon). It allows to define:
  *
- * * the color palette for the table border color style field (`tableProperties.border.colors`),
+ * * the color palette for the table border color style field (`tableProperties.borderColors`),
  * * the color palette for the table background style field (`tableProperties.backgroundColors`).
  *
  *		const tableConfig = {
  *			tableProperties: {
- *				border: {
- *					colors: [
- *						{
- *							color: 'hsl(0, 0%, 90%)',
- *							label: 'Light grey'
- *						},
- *						// ...
- *					]
- *				},
+ *				borderColors: [
+ *					{
+ *						color: 'hsl(0, 0%, 90%)',
+ *						label: 'Light grey'
+ *					},
+ *					// ...
+ *				],
  *				backgroundColors: [
  *					{
  *						color: 'hsl(120, 75%, 60%)',

+ 2 - 4
packages/ckeditor5-table/src/tableproperties/tablepropertiesui.js

@@ -64,9 +64,7 @@ export default class TablePropertiesUI extends Plugin {
 		super( editor );
 
 		editor.config.define( 'table.tableProperties', {
-			border: {
-				colors: defaultColors
-			},
+			borderColors: defaultColors,
 			backgroundColors: defaultColors
 		} );
 	}
@@ -139,7 +137,7 @@ export default class TablePropertiesUI extends Plugin {
 		const editor = this.editor;
 		const viewDocument = editor.editing.view.document;
 		const config = editor.config.get( 'table.tableProperties' );
-		const borderColorsConfig = normalizeColorOptions( config.border.colors );
+		const borderColorsConfig = normalizeColorOptions( config.borderColors );
 		const localizedBorderColors = getLocalizedColorOptions( editor.locale, borderColorsConfig );
 		const backgroundColorsConfig = normalizeColorOptions( config.backgroundColors );
 		const localizedBackgroundColors = getLocalizedColorOptions( editor.locale, backgroundColorsConfig );

+ 1 - 3
packages/ckeditor5-table/tests/tablecellproperties/tablecellpropertiesui.js

@@ -72,9 +72,7 @@ describe( 'table cell properties', () => {
 		describe( 'constructor()', () => {
 			it( 'should define table.tableCellProperties config', () => {
 				expect( editor.config.get( 'table.tableCellProperties' ) ).to.deep.equal( {
-					border: {
-						colors: defaultColors
-					},
+					borderColors: defaultColors,
 					backgroundColors: defaultColors
 				} );
 			} );

+ 1 - 3
packages/ckeditor5-table/tests/tableproperties/tablepropertiesui.js

@@ -72,9 +72,7 @@ describe( 'table properties', () => {
 		describe( 'constructor()', () => {
 			it( 'should define table.tableProperties config', () => {
 				expect( editor.config.get( 'table.tableProperties' ) ).to.deep.equal( {
-					border: {
-						colors: defaultColors
-					},
+					borderColors: defaultColors,
 					backgroundColors: defaultColors
 				} );
 			} );