Skip to content

Commit

Permalink
Merge pull request #151 from NHSLeadership/develop
Browse files Browse the repository at this point in the history
Develop v1.3.13
  • Loading branch information
maheshmuralip authored Jan 16, 2024
2 parents 8b346f4 + 27a8fec commit 42db2ea
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react'), 'version' => 'bfb3caf9d37a26f753c4');
<?php return array('dependencies' => array('lodash', 'react'), 'version' => 'd0903bbbefd3a8565b84');
10 changes: 5 additions & 5 deletions build/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions nhsblocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Requires at least: 5.0
* Tested up to: 6.0
*
* Version: 1.3.12
* Stable tag: 1.3.12
* Version: 1.3.13
* Stable tag: 1.3.13
*
* @package nhsblocks
*/
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Plugin Name:: NHS Blocks
Plugin URI: https://digital.leadershipacademy.nhs.uk/digital-capabilities/websites/nhs-blocks-user-guide/
Requires at least: 5.3
Tested up to: 6.0
Stable tag: 1.3.12
Stable tag: 1.3.13
Requires PHP: 5.6
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -55,6 +55,9 @@ This plugin has been built specifically for use in the NHS, but it is open sourc

== Changelog ==

= 1.3.13 =
* Fix for various blocks as part of our ongoing work to support wordpress 6.4

= 1.3.12 =
* Fix for dashboard navigation block as part of our ongoing work to support wordpress 6.4
* Fix for deprecated richText multiline prop in simple reveal block.
Expand Down
7 changes: 5 additions & 2 deletions src/06-promo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const {
InnerBlocks,
MediaUpload,
InspectorControls,
useBlockProps
} = wp.blockEditor;
//@todo add in Promo class variations
//@todo add in width variations
Expand Down Expand Up @@ -70,6 +71,7 @@ registerBlockType('nhsblocks/promo1', {
},

edit: (props) => {
const blockProps = useBlockProps();
// Lift info from props and populate various constants.
const {
attributes: { promoTitle, promoText, promoLink },
Expand Down Expand Up @@ -117,7 +119,7 @@ registerBlockType('nhsblocks/promo1', {
</h2>
<div className="nhsuk-card__description">
<RichText
multiline="p"
{ ...blockProps }
placeholder={__('Promo Contents', 'nhsblocks')}
onChange={onChangePromoText}
value={promoText}
Expand All @@ -128,6 +130,7 @@ registerBlockType('nhsblocks/promo1', {
);
},
save: (props) => {
const blockProps = useBlockProps.save();
const {
attributes: { promoTitle, promoText, promoLink },
} = props;
Expand All @@ -141,7 +144,7 @@ registerBlockType('nhsblocks/promo1', {
</a>
</h2>
<div className="nhsuk-card__description">
<RichText.Content multiline="p" value={promoText} />
<RichText.Content { ...blockProps } value={promoText} />
</div>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/06a-promo-group/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ registerBlockType('nhsblocks/promogroup', {
}
};
const createBlocksFromInnerBlocksTemplate = (innerBlocksTemplate) => {
return map(
innerBlocksTemplate,
return innerBlocksTemplate.map(
([name, attributes, innerBlocks = []]) =>
createBlock(
name,
Expand Down
8 changes: 5 additions & 3 deletions src/07-testimonial/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const { RichText } = wp.blockEditor;
const { RichText, useBlockProps } = wp.blockEditor;
//@todo add in Expander class option
//console.info(wp.components);

Expand Down Expand Up @@ -49,6 +49,7 @@ registerBlockType('nhsblocks/quote1', {
},

edit: (props) => {
const blockProps = useBlockProps();
// Lift info from props and populate various constants.
const {
attributes: { quoteName, quoteText },
Expand All @@ -73,7 +74,7 @@ registerBlockType('nhsblocks/quote1', {
</span>
<div className="nhsuk-inset-text__quote">
<RichText
multiline="p"
{ ...blockProps }
placeholder={__('Quote', 'nhsblocks')}
onChange={onChangeQuoteText}
value={quoteText}
Expand All @@ -90,6 +91,7 @@ registerBlockType('nhsblocks/quote1', {
);
},
save: (props) => {
const blockProps = useBlockProps.save();
const {
attributes: { quoteName, quoteText },
} = props;
Expand All @@ -100,7 +102,7 @@ registerBlockType('nhsblocks/quote1', {
Quote / Testimonial:{' '}
</span>
<div className="nhsuk-inset-text__quote">
<RichText.Content multiline="p" value={quoteText} />
<RichText.Content { ...blockProps } value={quoteText} />
</div>
<span className="nhsuk-inset-text__quote-attribution">
<RichText.Content value={quoteName} />
Expand Down
10 changes: 6 additions & 4 deletions src/08-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const { RichText, InnerBlocks, InspectorControls } = wp.blockEditor;
const { RichText, InnerBlocks, InspectorControls, useBlockProps } = wp.blockEditor;
const { ToggleControl, PanelBody, PanelRow, RadioControl } = wp.components;
const { withState } = wp.compose;
//@todo add in Card class variations
Expand Down Expand Up @@ -60,6 +60,7 @@
},

edit: props => {
const blockProps = useBlockProps();
// Lift info from props and populate various constants.
const {
attributes: {
Expand Down Expand Up @@ -119,7 +120,7 @@
/>
)}
<RichText
multiline="p"
{ ...blockProps }
placeholder={__("Card Contents", "nhsblocks")}
onChange={onChangeCardText}
value={cardText}
Expand All @@ -129,14 +130,15 @@
] );
},
save: props => {
const blockProps = useBlockProps.save();
const {
attributes: {
cardTitle,
cardText,
withImage,
}
} = props;

return (
<div className="nhsuk-grid-column-width nhsuk-care-card nhsuk-care-card--type">
<div className="nhsuk-care-card__heading-container">
Expand All @@ -155,7 +157,7 @@
<InnerBlocks.Content />
)}
<RichText.Content
multiline="p"
{ ...blockProps }
value={cardText}
/>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/09-row-group/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ registerBlockType('nhsblocks/rowgroup', {
}
};
const createBlocksFromInnerBlocksTemplate = (innerBlocksTemplate) => {
return map(
innerBlocksTemplate,
return innerBlocksTemplate.map(
([name, attributes, innerBlocks = []]) =>
createBlock(
name,
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: nhsblocks
Tags: NHS, NHS Digital, NHS Frontend, National Health Service, Leadership Academy
Description: Gutenberg native custom blocks companion plugin for the NHS Nightingale theme (can also be standalone).
Version: 1.3.12
Version: 1.3.13
**********************************************************************************************/
/* stylelint-disable color-no-hex */
Expand Down
2 changes: 1 addition & 1 deletion style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: nhsblocks
Tags: NHS, NHS Digital, NHS Frontend, National Health Service, Leadership Academy
Description: Gutenberg native custom blocks companion plugin for the NHS Nightingale theme (can also be standalone).
Version: 1.3.12
Version: 1.3.13
**********************************************************************************************/

Expand Down

0 comments on commit 42db2ea

Please sign in to comment.