Skip to content

Commit

Permalink
Merge branch 'develop' into feat/repeater-block
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Oct 9, 2024
2 parents ebb1dba + d4f76c7 commit 3905673
Show file tree
Hide file tree
Showing 17 changed files with 1,893 additions and 2,065 deletions.
3,500 changes: 1,750 additions & 1,750 deletions languages/stackable-ultimate-gutenberg-blocks.pot

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stackable",
"version": "3.13.7",
"version": "3.13.9",
"private": true,
"description": "Blocks for everyone",
"author": "Benjamin Intal of Gambit",
Expand Down
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Author: Gambit Technologies, Inc
* Author URI: http://gambit.ph
* Text Domain: stackable-ultimate-gutenberg-blocks
* Version: 3.13.7
* Version: 3.13.9
*
* @package Stackable
*/
Expand All @@ -24,7 +24,7 @@

defined( 'STACKABLE_SHOW_PRO_NOTICES' ) || define( 'STACKABLE_SHOW_PRO_NOTICES', true );
defined( 'STACKABLE_BUILD' ) || define( 'STACKABLE_BUILD', 'free' );
defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '3.13.7' );
defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '3.13.9' );
defined( 'STACKABLE_FILE' ) || define( 'STACKABLE_FILE', __FILE__ );
defined( 'STACKABLE_I18N' ) || define( 'STACKABLE_I18N', 'stackable-ultimate-gutenberg-blocks' ); // Plugin slug.
defined( 'STACKABLE_DESIGN_LIBRARY_URL' ) || define( 'STACKABLE_DESIGN_LIBRARY_URL', 'https://storage.googleapis.com/stackable-plugin-assets' ); // Design Library CDN URL
Expand Down
16 changes: 14 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: bfintal, gambitph, freemius
Tags: blocks, gutenberg, gutenberg blocks, page builder, WordPress blocks
Requires at least: 6.3
Tested up to: 6.6.1
Tested up to: 6.6.2
Requires PHP: 7.3
Stable tag: 3.13.7
Stable tag: 3.13.9
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -295,6 +295,18 @@ Nope. Stackable only works with Gutenberg, the new WordPress editor.

== Changelog ==

= 3.13.9 =
* Fixed: Text blocks: text gradient color doesn't show for misspelled words #3305
* Fixed: Button block: adding a button block now places the cursor inside the button ##3324
* Fixed: Conditional display: inspector options do not re-render when changing values #3342
* Fixed: Optimized CSS: mobile styles can overwrite tablet styles sometimes (to fix, please re-save the page) #3345

= 3.13.8 =
* Fixed: Possible editor freezing when using deprecated icon lists inside patterns #3332
* Fixed: Timeline block: last timeline doesn't cut off in mobile view (part 2 of fix) #3292
* Fixed: Icon List block: can produce an error when migrating from an old version #3334
* Fixed: Prevent possible PHP error when calling kses too early

= 3.13.7 =
* Fixed: Stylesheets can sometimes not load in the frontend
* Fixed: SVG error when using custom SVGs with a use tag #3323
Expand Down
29 changes: 17 additions & 12 deletions src/block/button-group/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
FlexGapControls,
Transform,
} from '~stackable/block-components'
import { useBlockContext, useDeviceType } from '~stackable/hooks'
import { useDeviceType } from '~stackable/hooks'
import {
withBlockAttributeContext,
withBlockWrapperIsHovered,
Expand All @@ -49,6 +49,7 @@ import {
} from '@wordpress/block-editor'
import { sprintf, __ } from '@wordpress/i18n'
import { memo } from '@wordpress/element'
import { useSelect } from '@wordpress/data'

const ALLOWED_INNER_BLOCKS = [ 'stackable/button', 'stackable/icon-button' ]

Expand Down Expand Up @@ -109,7 +110,12 @@ const Edit = props => {
const deviceType = useDeviceType()
const rowClass = getRowClasses( attributes )
const blockAlignmentClass = getAlignmentClasses( attributes )
const { hasInnerBlocks } = useBlockContext()
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 @@ -176,16 +182,15 @@ const Edit = props => {
<CustomCSS mainBlockClass="stk-block-button-group" />

{ ! hasInnerBlocks && <GroupPlaceholder blockName="stackable/button" /> }
{ hasInnerBlocks &&
<div className={ contentClassNames }>
<InnerBlocks
orientation="horizontal"
allowedBlocks={ ALLOWED_INNER_BLOCKS }
template={ TEMPLATE }
templateInsertUpdatesSelection={ true }
/>
</div>
}
<div className={ contentClassNames }>
<InnerBlocks
orientation="horizontal"
allowedBlocks={ ALLOWED_INNER_BLOCKS }
template={ TEMPLATE }
templateInsertUpdatesSelection={ true }
renderAppender={ hasInnerBlocks ? undefined : false }
/>
</div>
</BlockDiv>
{ props.isHovered && hasInnerBlocks && <MarginBottom /> }
</>
Expand Down
7 changes: 1 addition & 6 deletions src/block/button-group/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ const variations = [
'stk-type': 'essential',
'stk-demo': 'https://wpstackable.com/button-block/?utm_source=welcome&utm_medium=settings&utm_campaign=view_demo&utm_content=demolink',
isDefault: true,
innerBlocks: [
[
'stackable/button',
{},
],
],
innerBlocks: [],
example: buttonExample,
},
{
Expand Down
25 changes: 20 additions & 5 deletions src/block/icon-list-item/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ import { useBlockContext } from '~stackable/hooks'
import { __ } from '@wordpress/i18n'
import { compose, createHigherOrderComponent } from '@wordpress/compose'
import { dispatch } from '@wordpress/data'
import { useEffect, memo } from '@wordpress/element'
import {
useEffect, useRef, memo,
} from '@wordpress/element'

const TABS = [ 'style', 'advanced' ]

Expand All @@ -68,15 +70,28 @@ const Edit = props => {
'stackable/uniqueId': parentUniqueId,
} = context

const updateOrderedTimeout = useRef()
const updateUniqueIdTimeout = useRef()

// Set the attributes so they can be used in Save.
useEffect( () => {
dispatch( 'core/block-editor' ).__unstableMarkNextChangeAsNotPersistent()
setAttributes( { ordered } )
clearTimeout( updateOrderedTimeout.current )
if ( ordered !== props.attributes.ordered ) {
updateOrderedTimeout.current = setTimeout( () => {
dispatch( 'core/block-editor' ).__unstableMarkNextChangeAsNotPersistent()
setAttributes( { ordered } )
}, 300 )
}
}, [ ordered ] )

useEffect( () => {
dispatch( 'core/block-editor' ).__unstableMarkNextChangeAsNotPersistent()
setAttributes( { parentUniqueId } )
clearTimeout( updateUniqueIdTimeout.current )
if ( parentUniqueId !== props.attributes.parentUniqueId ) {
updateUniqueIdTimeout.current = setTimeout( () => {
dispatch( 'core/block-editor' ).__unstableMarkNextChangeAsNotPersistent()
setAttributes( { parentUniqueId } )
}, 300 )
}
}, [ parentUniqueId ] )

const blockClassNames = classnames( [
Expand Down
6 changes: 5 additions & 1 deletion src/block/icon-list/deprecated/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
deprecateBlockBackgroundColorOpacity, deprecateContainerBackgroundColorOpacity, deprecateTypographyGradientColor,
deprecateBlockShadowColor, deprecateContainerShadowColor,
} from '~stackable/block-components'
import { createUniqueClass } from '~stackable/util'

import { createBlock } from '@wordpress/blocks'

Expand Down Expand Up @@ -109,10 +110,13 @@ const deprecated = [
} else {
const contents = textToArray( text )
const blocks = contents.map( ( content, index ) => {
return createBlock( 'stackable/icon-list-item', {
const newBlock = createBlock( 'stackable/icon-list-item', {
text: content,
icon: getUniqueIcon( icons, index ),
} )
newBlock.attributes.uniqueId = createUniqueClass( newBlock.clientId )

return newBlock
} )
innerBlocks = blocks
}
Expand Down
7 changes: 1 addition & 6 deletions src/block/icon-list/deprecated/save.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* Internal dependencies
*/
import { IconListStyles } from './style'

/**
* External dependencies
*/
Expand Down Expand Up @@ -44,7 +39,7 @@ export const Save = props => {
attributes={ attributes }
version={ props.version }
>
<IconListStyles.Content version={ props.version } attributes={ attributes } />
{ attributes.generatedCss && <style>{ attributes.generatedCss }</style> }
<CustomCSS.Content attributes={ attributes } />
<Typography.Content
tagName={ tagName }
Expand Down
Loading

0 comments on commit 3905673

Please sign in to comment.