Skip to content

Commit

Permalink
Make the line height support flag stable
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Oct 1, 2020
1 parent 1279310 commit 4a49a66
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 32 deletions.
4 changes: 2 additions & 2 deletions lib/block-supports/typography.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function gutenberg_register_typography_support( $block_type ) {

$has_line_height_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
$has_line_height_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalLineHeight' ), false );
$has_line_height_support = gutenberg_experimental_get( $block_type->supports, array( 'lineHeight' ), false );
}

if ( ! $block_type->attributes ) {
Expand Down Expand Up @@ -56,7 +56,7 @@ function gutenberg_apply_typography_support( $attributes, $block_attributes, $bl

$has_line_height_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
$has_line_height_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalLineHeight' ), false );
$has_line_height_support = gutenberg_experimental_get( $block_type->supports, array( 'lineHeight' ), false );
}

// Font Size.
Expand Down
2 changes: 1 addition & 1 deletion lib/global-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function gutenberg_experimental_global_styles_get_support_keys() {
'backgroundColor' => array( 'color' ),
'color' => array( 'color' ),
'fontSize' => array( 'fontSize' ),
'lineHeight' => array( '__experimentalLineHeight' ),
'lineHeight' => array( 'lineHeight' ),
);
}

Expand Down
4 changes: 4 additions & 0 deletions packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ _Related_

- <https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inspector-controls/README.md>

<a name="LineHeightControl" href="#LineHeightControl">#</a> **LineHeightControl**

Undocumented declaration.

<a name="MediaPlaceholder" href="#MediaPlaceholder">#</a> **MediaPlaceholder**

_Related_
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export { default as InnerBlocks } from './inner-blocks';
export { default as InspectorAdvancedControls } from './inspector-advanced-controls';
export { default as InspectorControls } from './inspector-controls';
export { default as __experimentalLinkControl } from './link-control';
export { default as __experimentalLineHeightControl } from './line-height-control';
export { default as LineHeightControl } from './line-height-control';
export { default as MediaReplaceFlow } from './media-replace-flow';
export { default as MediaPlaceholder } from './media-placeholder';
export { default as MediaUpload } from './media-upload';
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export { default as AlignmentToolbar } from './alignment-toolbar';
export { default as InnerBlocks } from './inner-blocks';
export { default as InspectorAdvancedControls } from './inspector-advanced-controls';
export { default as InspectorControls } from './inspector-controls';
export { default as __experimentalLineHeightControl } from './line-height-control';
export { default as LineHeightControl } from './line-height-control';
export { default as PlainText } from './plain-text';
export {
default as RichText,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/line-height.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import LineHeightControl from '../components/line-height-control';
import { cleanEmptyObject } from './utils';
import useEditorFeature from '../components/use-editor-feature';

export const LINE_HEIGHT_SUPPORT_KEY = '__experimentalLineHeight';
export const LINE_HEIGHT_SUPPORT_KEY = 'lineHeight';

/**
* Inspector control panel containing the line height related configuration
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/heading/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"link": true
},
"fontSize": true,
"__experimentalLineHeight": true,
"lineHeight": true,
"__experimentalSelector": {
"core/heading/h1": "h1",
"core/heading/h2": "h2",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/paragraph/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"link": true
},
"fontSize": true,
"__experimentalLineHeight": true,
"lineHeight": true,
"__experimentalSelector": "p",
"__unstablePasteTextInline": true
}
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-author/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"gradients": true,
"link": true
},
"__experimentalLineHeight": true
"lineHeight": true
}
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-comments-count/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"gradients": true
},
"fontSize": true,
"__experimentalLineHeight": true
"lineHeight": true
}
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-comments-form/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"link": true
},
"fontSize": true,
"__experimentalLineHeight": true
"lineHeight": true
}
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-comments/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"gradients": true,
"link": true
},
"__experimentalLineHeight": true
"lineHeight": true
}
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-date/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"gradients": true
},
"fontSize": true,
"__experimentalLineHeight": true
"lineHeight": true
}
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-excerpt/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"gradients": true,
"link": true
},
"__experimentalLineHeight": true
"lineHeight": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"gradients": true,
"link": true
},
"__experimentalLineHeight": true
"lineHeight": true
}
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-tags/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"gradients": true,
"link": true
},
"__experimentalLineHeight": true
"lineHeight": true
}
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"gradients": true
},
"fontSize": true,
"__experimentalLineHeight": true,
"lineHeight": true,
"__experimentalSelector": {
"core/post-title/h1": "h1",
"core/post-title/h2": "h2",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/site-tagline/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"gradients": true
},
"fontSize": true,
"__experimentalLineHeight": true
"lineHeight": true
}
}
2 changes: 1 addition & 1 deletion packages/block-library/src/site-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"gradients": true
},
"fontSize": true,
"__experimentalLineHeight": true
"lineHeight": true
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
* WordPress dependencies
*/
import {
FontSizePicker,
__experimentalLineHeightControl as LineHeightControl,
} from '@wordpress/block-editor';
import { FontSizePicker, LineHeightControl } from '@wordpress/block-editor';
import { PanelBody } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

Expand Down
18 changes: 9 additions & 9 deletions phpunit/class-block-supported-styles-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ function test_line_height() {
$block_type_settings = array(
'attributes' => array(),
'supports' => array(
'__experimentalLineHeight' => true,
'lineHeight' => true,
),
'render_callback' => true,
);
Expand Down Expand Up @@ -570,13 +570,13 @@ function test_all_supported() {
$block_type_settings = array(
'attributes' => array(),
'supports' => array(
'color' => array(
'color' => array(
'gradients' => true,
'link' => true,
),
'fontSize' => true,
'__experimentalLineHeight' => true,
'align' => true,
'fontSize' => true,
'lineHeight' => true,
'align' => true,
),
'render_callback' => true,
);
Expand Down Expand Up @@ -659,13 +659,13 @@ function test_render_callback_required() {
$block_type_settings = array(
'attributes' => array(),
'supports' => array(
'align' => true,
'color' => array(
'align' => true,
'color' => array(
'gradients' => true,
'link' => true,
),
'fontSize' => true,
'__experimentalLineHeight' => true,
'fontSize' => true,
'lineHeight' => true,
),
);
$this->register_block_type( 'core/example', $block_type_settings );
Expand Down

0 comments on commit 4a49a66

Please sign in to comment.