Skip to content

Commit 27c7021

Browse files
committed
Merge remote-tracking branch 'origin/release'
2 parents 7e9283c + cccf202 commit 27c7021

File tree

65 files changed

+859
-248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+859
-248
lines changed

languages/stackable-ultimate-gutenberg-blocks.pot

Lines changed: 156 additions & 133 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stackable",
3-
"version": "3.1.1",
3+
"version": "3.1.2",
44
"private": true,
55
"description": "Blocks for everyone",
66
"author": "Benjamin Intal of Gambit",

plugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Author: Gambit Technologies, Inc
77
* Author URI: http://gambit.ph
88
* Text Domain: stackable-ultimate-gutenberg-blocks
9-
* Version: 3.1.1
9+
* Version: 3.1.2
1010
*
1111
* @package Stackable
1212
*/
@@ -23,7 +23,7 @@
2323
}
2424

2525
defined( 'STACKABLE_SHOW_PRO_NOTICES' ) || define( 'STACKABLE_SHOW_PRO_NOTICES', true );
26-
defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '3.1.1' );
26+
defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '3.1.2' );
2727
defined( 'STACKABLE_FILE' ) || define( 'STACKABLE_FILE', __FILE__ );
2828
defined( 'STACKABLE_I18N' ) || define( 'STACKABLE_I18N', 'stackable-ultimate-gutenberg-blocks' ); // Plugin slug.
2929
defined( 'STACKABLE_CLOUDFRONT_URL' ) || define( 'STACKABLE_CLOUDFRONT_URL', 'https://d3gt1urn7320t9.cloudfront.net' ); // CloudFront CDN URL

readme.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
=== Stackable - Page Builder Gutenberg Blocks ===
22
Contributors: bfintal, gambitph, freemius
33
Tags: blocks, gutenberg, gutenberg blocks, page builder, WordPress blocks
4-
Requires at least: 5.6.5
5-
Tested up to: 5.8.2
4+
Requires at least: 5.8.2
5+
Tested up to: 5.9
66
Requires PHP: 5.6
7-
Stable tag: 3.1.1
7+
Stable tag: 3.1.2
88
License: GPLv3
99
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1010

@@ -238,6 +238,14 @@ Nope. Stackable only works with Gutenberg, the new WordPress editor.
238238

239239
== Changelog ==
240240

241+
= 3.1.2 =
242+
* New: WordPress 5.9 compatibility & FSE compatibility
243+
* New: Added Overlay Colors to the Image block - now you can add solid or gradient colored overlays!
244+
* Fixed: Clicking the expand block link scrolls the screen down
245+
* Fixed: Inspector tabs went behind the visible area when scrolling down
246+
* Fixed: Clearing a text highlight color, resets the highlight type.
247+
* Fixed: Possible PHP error when a custom post used in Dynamic Content becomes unavailable
248+
241249
= 3.1.1 =
242250
* New: Added link option to the Image Block
243251
* New: Added back ability to change the column order when columns collapse in mobile (premium)

src/block-components/icon/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const Icon = props => {
7171
if ( event.target.closest( '.stk--inner-svg' ) ) {
7272
event.stopPropagation()
7373
}
74-
if ( ! isElementDescendant( popoverEl.current, event.target ) && ! event.target.closest( '.components-popover' ) ) {
74+
if ( ! event.target.closest( '.stk--inner-svg' ) && ! isElementDescendant( popoverEl.current, event.target ) && ! event.target.closest( '.components-popover' ) ) {
7575
setIsOpen( false )
7676
}
7777
}

src/block-components/image/attributes.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,46 @@ export const addAttributes = ( attrObject, options = {} ) => {
4646
type: 'number',
4747
default: '',
4848
},
49+
50+
imageOverlayColorType: {
51+
type: 'string',
52+
default: '',
53+
},
54+
imageOverlayColor: {
55+
type: 'string',
56+
default: '',
57+
stkHover: true,
58+
},
59+
imageOverlayColor2: {
60+
type: 'string',
61+
default: '',
62+
stkHover: true,
63+
},
64+
imageOverlayOpacity: {
65+
type: 'number',
66+
default: '',
67+
stkHover: true,
68+
},
69+
imageOverlayBlendMode: {
70+
type: 'string',
71+
default: '',
72+
},
73+
imageOverlayGradientDirection: {
74+
type: 'number',
75+
default: '',
76+
stkHover: true,
77+
},
78+
imageOverlayGradientLocation1: {
79+
type: 'number',
80+
default: '',
81+
stkHover: true,
82+
},
83+
imageOverlayGradientLocation2: {
84+
type: 'number',
85+
default: '',
86+
stkHover: true,
87+
},
88+
4989
imageFocalPoint: {
5090
stkResponsive: true,
5191
stkHover: true,

src/block-components/image/edit.js

Lines changed: 131 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,24 @@ import {
1616
InspectorStyleControls,
1717
PanelAdvancedSettings,
1818
ShadowControl,
19+
ColorPaletteControl,
20+
AdvancedToolbarControl,
21+
BlendModeControl,
22+
ControlSeparator,
1923
} from '~stackable/components'
2024
import {
21-
useBlockAttributes,
25+
useBlockAttributes, useBlockHoverState,
2226
} from '~stackable/hooks'
27+
import { getAttributeName } from '~stackable/util'
2328

2429
/**
2530
* WordPress dependencies
2631
*/
2732
import { useBlockEditContext } from '@wordpress/block-editor'
2833
import { useDispatch, useSelect } from '@wordpress/data'
29-
import { __ } from '@wordpress/i18n'
34+
import {
35+
sprintf, _x, __,
36+
} from '@wordpress/i18n'
3037
import { applyFilters } from '@wordpress/hooks'
3138
import { useMemo } from '@wordpress/element'
3239

@@ -49,6 +56,7 @@ const Controls = props => {
4956

5057
const { updateBlockAttributes } = useDispatch( 'core/block-editor' )
5158
const attributes = useBlockAttributes( clientId )
59+
const [ state ] = useBlockHoverState()
5260

5361
// Get the image size urls.
5462
const { imageData } = useSelect( select => {
@@ -204,6 +212,127 @@ const Controls = props => {
204212
/>
205213
}
206214

215+
<ControlSeparator />
216+
217+
<AdvancedToolbarControl
218+
controls={ [
219+
{
220+
value: '',
221+
title: __( 'Single', i18n ),
222+
},
223+
{
224+
value: 'gradient',
225+
title: __( 'Gradient', i18n ),
226+
},
227+
] }
228+
attribute="imageOverlayColorType"
229+
fullwidth={ false }
230+
isSmall={ true }
231+
/>
232+
233+
<ColorPaletteControl
234+
label={
235+
attributes.imageOverlayColorType === 'gradient'
236+
? sprintf( _x( '%s #%d', 'option title', i18n ), __( 'Overlay Color', i18n ), 1 )
237+
: __( 'Overlay Color', i18n )
238+
}
239+
attribute="imageOverlayColor"
240+
hover="all"
241+
hasTransparent={ attributes.imageOverlayColorType === 'gradient' }
242+
/>
243+
{ attributes.imageOverlayColorType === 'gradient' && (
244+
<ColorPaletteControl
245+
label={ sprintf( _x( '%s #%d', 'option title', i18n ), __( 'Overlay Color', i18n ), 2 ) }
246+
attribute="imageOverlayColor2"
247+
hover="all"
248+
hasTransparent={ true }
249+
/>
250+
) }
251+
252+
<AdvancedRangeControl
253+
label={ __( 'Overlay Opacity', i18n ) }
254+
attribute="imageOverlayOpacity"
255+
hover="all"
256+
min={ 0 }
257+
max={ 1 }
258+
step={ 0.1 }
259+
placeholder="0.3"
260+
/>
261+
262+
<BlendModeControl
263+
label={ __( 'Overlay Blend Mode', i18n ) }
264+
attribute="imageOverlayBlendMode"
265+
className="ugb--help-tip-background-blend-mode"
266+
/>
267+
268+
{ attributes.imageOverlayColorType === 'gradient' && (
269+
<ButtonIconPopoverControl
270+
label={ __( 'Gradient Overlay Settings', i18n ) }
271+
onReset={ () => {
272+
updateBlockAttributes( clientId, {
273+
[ getAttributeName( 'imageOverlayGradientDirection', 'desktop', state ) ]: '',
274+
[ getAttributeName( 'imageOverlayGradientLocation1', 'desktop', state ) ]: '',
275+
[ getAttributeName( 'imageOverlayGradientLocation2', 'desktop', state ) ]: '',
276+
[ getAttributeName( 'imageOverlayGradientDirection', 'tablet', state ) ]: '',
277+
[ getAttributeName( 'imageOverlayGradientLocation1', 'tablet', state ) ]: '',
278+
[ getAttributeName( 'imageOverlayGradientLocation2', 'tablet', state ) ]: '',
279+
[ getAttributeName( 'imageOverlayGradientDirection', 'mobile', state ) ]: '',
280+
[ getAttributeName( 'imageOverlayGradientLocation1', 'mobile', state ) ]: '',
281+
[ getAttributeName( 'imageOverlayGradientLocation2', 'mobile', state ) ]: '',
282+
} )
283+
} }
284+
allowReset={
285+
attributes[ getAttributeName( 'imageOverlayGradientDirection', 'desktop', state ) ] ||
286+
attributes[ getAttributeName( 'imageOverlayGradientLocation1', 'desktop', state ) ] ||
287+
attributes[ getAttributeName( 'imageOverlayGradientLocation2', 'desktop', state ) ] ||
288+
attributes[ getAttributeName( 'imageOverlayGradientDirection', 'tablet', state ) ] ||
289+
attributes[ getAttributeName( 'imageOverlayGradientLocation1', 'tablet', state ) ] ||
290+
attributes[ getAttributeName( 'imageOverlayGradientLocation2', 'tablet', state ) ] ||
291+
attributes[ getAttributeName( 'imageOverlayGradientDirection', 'mobile', state ) ] ||
292+
attributes[ getAttributeName( 'imageOverlayGradientLocation1', 'mobile', state ) ] ||
293+
attributes[ getAttributeName( 'imageOverlayGradientLocation2', 'mobile', state ) ]
294+
}
295+
>
296+
<AdvancedRangeControl
297+
label={ __( 'Gradient Direction (degrees)', i18n ) }
298+
attribute="imageOverlayGradientDirection"
299+
hover="all"
300+
min={ 0 }
301+
max={ 360 }
302+
step={ 10 }
303+
allowReset={ true }
304+
placeholder="90"
305+
className="ugb--help-tip-gradient-direction"
306+
/>
307+
308+
<AdvancedRangeControl
309+
label={ sprintf( __( 'Color %d Location', i18n ), 1 ) }
310+
attribute="imageOverlayGradientLocation1"
311+
hover="all"
312+
sliderMin={ 0 }
313+
max={ 100 }
314+
step={ 1 }
315+
allowReset={ true }
316+
placeholder="0"
317+
className="ugb--help-tip-gradient-location"
318+
/>
319+
320+
<AdvancedRangeControl
321+
label={ sprintf( __( 'Color %d Location', i18n ), 2 ) }
322+
attribute="imageOverlayGradientLocation2"
323+
hover="all"
324+
sliderMin={ 0 }
325+
max={ 100 }
326+
step={ 1 }
327+
allowReset={ true }
328+
placeholder="100"
329+
className="ugb--help-tip-gradient-location"
330+
/>
331+
</ButtonIconPopoverControl>
332+
) }
333+
334+
<ControlSeparator />
335+
207336
<AdvancedFocalPointControl
208337
attribute="imageFocalPoint"
209338
label={ __( 'Focal point', i18n ) }

src/block-components/image/editor.scss

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,34 @@
212212
}
213213
// Shapes.
214214
&.stk-img--shape .stk-img-resizer-wrapper {
215-
mask-mode: alpha;
216-
mask-repeat: no-repeat;
217-
mask-size: contain;
218-
mask-position: center;
219-
border-radius: none;
215+
&,
216+
&::after {
217+
mask-mode: alpha;
218+
mask-repeat: no-repeat;
219+
mask-size: contain;
220+
mask-position: center;
221+
border-radius: none;
222+
}
223+
}
224+
225+
.stk-img-resizer-wrapper::after,
226+
&.stk-img--gradient-overlay .stk-img-resizer-wrapper::before {
227+
content: "";
228+
position: absolute;
229+
inset: 0;
230+
opacity: var(--stk-gradient-overlay, 0.3);
231+
z-index: 1;
232+
}
233+
}
234+
235+
// Don't do the hover effect when adjusting the hover effect.
236+
.stk-block:not(.stk--is-hovered) > .stk-img-wrapper {
237+
// If not hovered, hide the overlay hover state.
238+
&.stk-img--gradient-overlay:not(:hover) .stk-img-resizer-wrapper::before {
239+
opacity: 0 !important;
240+
}
241+
&.stk-img--gradient-overlay:hover .stk-img-resizer-wrapper::after {
242+
opacity: 0 !important;
220243
}
221244
// Firefox doesn't stretch SVG masks via attributes, stretching is done here. Fixes #246.
222245
&.stk-image--shape-stretch .stk-img-resizer-wrapper {

src/block-components/image/image.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const getImageWrapperClasses = props => {
4545

4646
// Shadow is only available when there is no shape.
4747
[ `stk--shadow-${ props.shadow }` ]: ! props.shape && props.shadow,
48+
49+
'stk-img--gradient-overlay': props.hasGradientOverlay,
4850
} )
4951
}
5052

@@ -164,7 +166,8 @@ const Image = memo( props => {
164166
if ( props.enableClickToEdit ) {
165167
if ( event.target?.classList?.contains( 'stk-img' ) ||
166168
event.target?.classList?.contains( 'stk-img-placeholder' ) ||
167-
event.target?.classList?.contains( 'stk-img-resizer-wrapper' )
169+
event.target?.classList?.contains( 'stk-img-resizer-wrapper' ) ||
170+
event.target?.classList?.contains( 'stk-img-resizer' )
168171
) {
169172
obj.open()
170173
}
@@ -350,6 +353,7 @@ Image.defaultProps = {
350353
heightResizePosition: 'bottom',
351354
allowReset: true,
352355

356+
hasGradientOverlay: false,
353357
hasRemove: true,
354358
hasTooltip: true,
355359
onChange: () => {},
@@ -481,6 +485,7 @@ ImageContent.defaultProps = {
481485
shapeStretch: false,
482486
shadow: '',
483487

488+
hasGradientOverlay: false,
484489
customWrapper: null,
485490
}
486491

0 commit comments

Comments
 (0)