Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/block/blockquote/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Edit = props => {

<ContainerDiv className={ contentClassNames }>
<InnerBlocks
template={ TEMPLATE }
template={ hasInnerBlocks ? undefined : TEMPLATE }
templateLock="all"
/>
</ContainerDiv>
Expand Down
9 changes: 8 additions & 1 deletion src/block/expand/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { InnerBlocks } from '@wordpress/block-editor'
import { __ } from '@wordpress/i18n'
import { addFilter } from '@wordpress/hooks'
import { memo } from '@wordpress/element'
import { useSelect } from '@wordpress/data'

const TEMPLATE = [
[ 'stackable/text', {
Expand Down Expand Up @@ -70,6 +71,12 @@ const Edit = props => {
} = props

const blockAlignmentClass = getAlignmentClasses( props.attributes )
const { hasInnerBlocks } = useSelect( select => {
const { getBlockOrder } = select( 'core/block-editor' )
return {
hasInnerBlocks: getBlockOrder( props.clientId ).length > 0,
}
}, [ props.clientId ] )

const blockClassNames = classnames( [
className,
Expand Down Expand Up @@ -110,7 +117,7 @@ const Edit = props => {
>
<div className={ contentClassNames }>
<InnerBlocks
template={ TEMPLATE }
template={ hasInnerBlocks ? undefined : TEMPLATE }
templateLock="all"
orientation="horizontal"
/>
Expand Down
9 changes: 8 additions & 1 deletion src/block/price/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { InnerBlocks } from '@wordpress/block-editor'
import { __ } from '@wordpress/i18n'
import { addFilter } from '@wordpress/hooks'
import { memo } from '@wordpress/element'
import { useSelect } from '@wordpress/data'

export const defaultIcon = '<svg data-prefix="fas" data-icon="play" class="svg-inline--fa fa-play fa-w-14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true"><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg>'

Expand All @@ -59,6 +60,12 @@ const Edit = props => {

const rowClass = getRowClasses( attributes )
const blockAlignmentClass = getAlignmentClasses( attributes )
const { hasInnerBlocks } = useSelect( select => {
const { getBlockOrder } = select( 'core/block-editor' )
return {
hasInnerBlocks: getBlockOrder( props.clientId ).length > 0,
}
}, [ props.clientId ] )

const blockClassNames = classnames( [
className,
Expand Down Expand Up @@ -92,7 +99,7 @@ const Edit = props => {
className={ blockClassNames }
>
<InnerBlocks
template={ TEMPLATE }
template={ hasInnerBlocks ? undefined : TEMPLATE }
templateLock="all"
/>
</BlockDiv>
Expand Down
9 changes: 8 additions & 1 deletion src/block/video-popup/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { addFilter } from '@wordpress/hooks'
import { memo } from '@wordpress/element'
import { DateTimePicker } from '@wordpress/components'
import { getSettings as getDateSettings } from '@wordpress/date'
import { useSelect } from '@wordpress/data'

export const defaultIcon = '<svg data-prefix="fas" data-icon="play" class="svg-inline--fa fa-play fa-w-14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true"><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg>'

Expand Down Expand Up @@ -80,6 +81,12 @@ const Edit = props => {

const rowClass = getRowClasses( attributes )
const blockAlignmentClass = getAlignmentClasses( attributes )
const { hasInnerBlocks } = useSelect( select => {
const { getBlockOrder } = select( 'core/block-editor' )
return {
hasInnerBlocks: getBlockOrder( props.clientId ).length > 0,
}
}, [ props.clientId ] )

const blockClassNames = classnames( [
className,
Expand Down Expand Up @@ -128,7 +135,7 @@ const Edit = props => {
>
<div className={ contentClassNames }>
<InnerBlocks
template={ TEMPLATE }
template={ hasInnerBlocks ? undefined : TEMPLATE }
templateLock="all"
/>
</div>
Expand Down
Loading