+ { ! showTemplateSelector && (
+
+
+
+
+ { templates.map( ( template, index ) => ( // eslint-disable-line no-shadow
+ -
+ {
+ setAttributes( {
+ isCustomTemplate: false,
+ } );
+ onTemplateChange( index );
+ } }
+ >
+
{ template.title }
+
+
+ ) ) }
+
+ { enableCustomTemplate && (
+
+ ) }
+
+
+ setAttributes( { noGutters: isChecked } ) }
+ />
+
+
+
+ setAttributes( { alignment: newAlignment } ) }
+ alignmentControls={ alignmentControls }
+ />
+ setAttributes( { verticalAlignment: newVerticalAlignment } ) }
+ alignmentControls={ verticalAlignmentControls }
+ />
+
+
+ ) }
+
+ {
+ if ( nextTemplate === undefined ) {
+ nextTemplate = getColumnsTemplate( customTemplateColumnCount );
+ setAttributes( {
+ isCustomTemplate: true,
+ } );
+ }
+
+ this.setState( {
+ template: nextTemplate,
+ } );
+ } }
+ __experimentalAllowTemplateOptionSkip={ enableCustomTemplate }
+ />
+
+
+ );
+ }
+}
+
+const applyWithSelect = withSelect( ( select, { clientId } ) => {
+ const { getBlocksByClientId } = select( 'core/editor' );
+
+ const columns = getBlocksByClientId( clientId )[ 0 ] ? getBlocksByClientId( clientId )[ 0 ].innerBlocks : [];
+
+ return {
+ columnCount: columns.length,
+ columns,
+ };
+} );
+
+const applyWithDispatch = withDispatch( ( dispatch ) => {
+ const { updateBlockAttributes } = dispatch( 'core/editor' );
+
+ return {
+ updateBlockAttributes,
+ };
+} );
+
+export default compose(
+ applyWithSelect,
+ applyWithDispatch,
+)( BootstrapRowEdit );
diff --git a/src/row/editor.scss b/src/row/editor.scss
index 3636885cc..5c10024e2 100755
--- a/src/row/editor.scss
+++ b/src/row/editor.scss
@@ -95,6 +95,23 @@
}
}
+.wp-bootstrap-blocks-template-selector-list {
+ display: flex;
+ flex-wrap: wrap;
+}
+
+.wp-bootstrap-blocks-template-selector-button {
+ flex: 0 0 50%;
+
+ > .components-icon-button {
+ flex-direction: column;
+ }
+}
+
+.wp-bootstrap-blocks-template-selector-button-label {
+ font-size: 12px;
+}
+
// Column block
[data-type="wp-bootstrap-blocks/column"] {
background-color: rgba(255, 255, 255, .7);
diff --git a/src/row/icons.js b/src/row/icons.js
index 76fc3e5bc..0f08e3568 100644
--- a/src/row/icons.js
+++ b/src/row/icons.js
@@ -25,3 +25,9 @@ export const alignTop = (