From 7cf77b2f76a9801cf411ed35e8b4cf14a5bb756a Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Mon, 13 Feb 2023 21:13:48 +0900 Subject: [PATCH] Add missin version prop --- packages/block-editor/src/components/plain-text/README.md | 2 ++ packages/block-library/src/html/edit.js | 1 + packages/block-library/src/post-title/edit.js | 4 ++-- packages/block-library/src/shortcode/edit.js | 1 + packages/block-library/src/shortcode/edit.native.js | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/block-editor/src/components/plain-text/README.md b/packages/block-editor/src/components/plain-text/README.md index 64d1c04b5c09bc..5c808edd9018b2 100644 --- a/packages/block-editor/src/components/plain-text/README.md +++ b/packages/block-editor/src/components/plain-text/README.md @@ -35,6 +35,7 @@ wp.blocks.registerBlockType( /* ... */, { edit: function( props ) { return wp.element.createElement( wp.editor.PlainText, { + version: 2, className: props.className, value: props.attributes.content, onChange: function( content ) { @@ -63,6 +64,7 @@ registerBlockType( /* ... */, { edit( { className, attributes, setAttributes } ) { return ( setAttributes( { content } ) } diff --git a/packages/block-library/src/html/edit.js b/packages/block-library/src/html/edit.js index 5cb2b457633b13..d915523de5ddcd 100644 --- a/packages/block-library/src/html/edit.js +++ b/packages/block-library/src/html/edit.js @@ -54,6 +54,7 @@ export default function HTMLEdit( { attributes, setAttributes, isSelected } ) { /> ) : ( <PlainText + version={ 2 } value={ attributes.content } onChange={ ( content ) => setAttributes( { content } ) } placeholder={ __( 'Write HTML…' ) } diff --git a/packages/block-library/src/post-title/edit.js b/packages/block-library/src/post-title/edit.js index 484ad2f041992f..e1dd4e74f9eff3 100644 --- a/packages/block-library/src/post-title/edit.js +++ b/packages/block-library/src/post-title/edit.js @@ -52,11 +52,11 @@ export default function PostTitleEdit( { titleElement = userCanEdit && ! isDescendentOfQueryLoop ? ( <PlainText + version={ 2 } tagName={ TagName } placeholder={ __( 'No Title' ) } value={ rawTitle } onChange={ setTitle } - version={ 2 } { ...blockProps } /> ) : ( @@ -72,6 +72,7 @@ export default function PostTitleEdit( { userCanEdit && ! isDescendentOfQueryLoop ? ( <TagName { ...blockProps }> <PlainText + version={ 2 } tagName="a" href={ link } target={ linkTarget } @@ -81,7 +82,6 @@ export default function PostTitleEdit( { } value={ rawTitle } onChange={ setTitle } - version={ 2 } /> </TagName> ) : ( diff --git a/packages/block-library/src/shortcode/edit.js b/packages/block-library/src/shortcode/edit.js index aecebd115a983f..453df763f5d70d 100644 --- a/packages/block-library/src/shortcode/edit.js +++ b/packages/block-library/src/shortcode/edit.js @@ -20,6 +20,7 @@ export default function ShortcodeEdit( { attributes, setAttributes } ) { { __( 'Shortcode' ) } </label> <PlainText + version={ 2 } className="blocks-shortcode__textarea" id={ inputId } value={ attributes.text } diff --git a/packages/block-library/src/shortcode/edit.native.js b/packages/block-library/src/shortcode/edit.native.js index 165a103035155c..091391779ef005 100644 --- a/packages/block-library/src/shortcode/edit.native.js +++ b/packages/block-library/src/shortcode/edit.native.js @@ -58,7 +58,7 @@ export function ShortcodeEdit( props ) { <Text style={ titleStyle }>{ __( 'Shortcode' ) }</Text> <View style={ shortcodeContainerStyle }> <PlainText - __experimentalVersion={ 2 } + version={ 2 } value={ attributes.text } style={ shortcodeStyle } onChange={ onChange }