Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stackable",
"version": "3.18.1",
"version": "3.19.0",
"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.18.1
* Version: 3.19.0
*
* @package Stackable
* @fs_premium_only /freemius.php, /freemius/
Expand Down Expand Up @@ -46,7 +46,7 @@ function stackable_multiple_plugins_check() {

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.18.1' );
defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '3.19.0' );
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://stackable-files.pages.dev' ); // Design Library CDN URL
Expand Down
13 changes: 13 additions & 0 deletions src/block/carousel/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ import { Save } from './save'
import { attributes } from './schema'

import { withVersion } from '~stackable/higher-order'
import { addFilter } from '@wordpress/hooks'
import { semverCompare } from '~stackable/util'

addFilter( 'stackable.carousel.save.slider-props', 'stackable/3.19.0', ( sliderProps, version ) => {
if ( semverCompare( version, '<', '3.19.0' ) ) {
return {
...sliderProps,
tabIndex: undefined,
}
}

return sliderProps
} )

const deprecated = [
{
Expand Down
2 changes: 2 additions & 0 deletions src/block/carousel/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export const Save = props => {
role="list"
data-autoplay={ attributes.autoplay ? ( attributes.autoplaySpeed || '4000' ) : undefined }
data-label-slide-of={ attributes.ariaLabelPrev || 'Slide %%d of %%d' }
tabIndex={ 0 }
{ ...applyFilters( 'stackable.carousel.save.slider-props', {}, props.version ) }
>
<InnerBlocks.Content />
</div>
Expand Down
12 changes: 12 additions & 0 deletions src/block/horizontal-scroller/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ import {
} from '~stackable/block-components'
import { addFilter } from '@wordpress/hooks'
import compareVersions from 'compare-versions'
import { semverCompare } from '~stackable/util'

addFilter( 'stackable.horizontal-scroller.save.scroller-props', 'stackable/3.19.0', ( scrollerProps, version ) => {
if ( semverCompare( version, '<', '3.19.0' ) ) {
return {
...scrollerProps,
tabIndex: undefined,
}
}

return scrollerProps
} )

// Previously, our horizontal scroller always had the stk--fit-content class (which was wrong).
addFilter( 'stackable.horizontal-scroller.save.contentClassNames', 'stackable/3_8_0', ( classes, props ) => {
Expand Down
6 changes: 5 additions & 1 deletion src/block/horizontal-scroller/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export const Save = props => {
>
{ attributes.generatedCss && <style>{ attributes.generatedCss }</style> }
<CustomCSS.Content attributes={ attributes } />
<div className={ contentClassNames }>
<div
className={ contentClassNames }
tabIndex={ 0 }
{ ...applyFilters( 'stackable.horizontal-scroller.save.scroller-props', {}, props.version ) }
>
<InnerBlocks.Content />
</div>
</BlockDiv.Content>
Expand Down
14 changes: 14 additions & 0 deletions src/block/notification/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,26 @@ import {
deprecateBlockShadowColor, deprecateContainerShadowColor, deprecateBlockHeight,
deprecateInnerBlockRowGapAndContainerHeight,
} from '~stackable/block-components'
import { semverCompare } from '~stackable/util'

/**
* WordPress dependencies
*/

import { __ } from '@wordpress/i18n'
import { addFilter } from '@wordpress/hooks'

addFilter( 'stackable.notification.save.close-button-props', 'stackable/3.19.0', ( buttonProps, version ) => {
if ( semverCompare( version, '<', '3.19.0' ) ) {
return {
...buttonProps,
'aria-label': undefined,
}
}

return buttonProps
} )

// Version 3.8 added horizontal flex, this changes the stk--block-orientation-* to stk--block-horizontal-flex.
addFilter( 'stackable.notification.save.innerClassNames', 'stackable/3.8.0', ( output, props ) => {
if ( compareVersions( props.version, '3.8.0' ) >= 0 ) {
Expand Down
5 changes: 4 additions & 1 deletion src/block/notification/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SVGCloseIcon from './images/close-icon.svg'
/**
* External dependencies
*/
import { version as VERSION } from 'stackable'
import { version as VERSION, i18n } from 'stackable'
import { withVersion } from '~stackable/higher-order'
import classnames from 'classnames/dedupe'
import {
Expand All @@ -22,6 +22,7 @@ import {
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n'
import { InnerBlocks } from '@wordpress/block-editor'
import { compose } from '@wordpress/compose'
import { applyFilters } from '@wordpress/hooks'
Expand Down Expand Up @@ -78,6 +79,8 @@ export const Save = props => {
{ attributes.isDismissible &&
<button
className="stk-block-notification__close-button"
aria-label={ __( 'Close', i18n ) }
{ ...applyFilters( 'stackable.notification.save.close-button-props', {}, props.version ) }
>
<SVGCloseIcon
width={ attributes.dismissibleSize || 16 }
Expand Down
26 changes: 26 additions & 0 deletions src/block/posts/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
import { createHigherOrderComponent } from '@wordpress/compose'
import { addFilter } from '@wordpress/hooks'
import { select } from '@wordpress/data'
import { semverCompare } from '~stackable/util'

// Version 3.0.2 Deprecations
const addUndefinedAttributes = ( attributes, version ) => {
Expand All @@ -36,10 +37,35 @@ const determineFeatureImage = ( featuredImage, version ) => {
return ( compareVersions( '3.6.3', version ) === -1 ) ? featuredImage : <Image.Content />
}

const fixMetaAccessibility = ( output, metaProps, version ) => {
const {
authorShow,
dateShow,
commentsShow,
author,
date,
comments,
separator,
metaClassNames,
} = metaProps
if ( semverCompare( version, '<', '3.19.0' ) ) {
return ( authorShow || dateShow || commentsShow ) && <aside className={ metaClassNames }>
{ authorShow && author }
{ authorShow && author && ( ( dateShow && date ) || ( commentsShow && comments ) ) && separator }
{ dateShow && date }
{ ( ( authorShow && author ) || ( dateShow && date ) ) && commentsShow && comments && separator }
{ commentsShow && comments }
</aside>
}

return output
}

addFilter( 'stackable.posts.title.typography-content', 'stackable/3_0_2', addUndefinedAttributes )
addFilter( 'stackable.posts.title.category-content', 'stackable/3_0_2', addUndefinedAttributes )
addFilter( 'stackable.posts.title.readmore-content', 'stackable/3_0_2', addUndefinedAttributes )
addFilter( 'stackable.posts.feature-image', 'stackable/3_6_3', determineFeatureImage )
addFilter( 'stackable.posts.meta', 'stackable/3.19.0', fixMetaAccessibility )

const deprecated = [
{
Expand Down
20 changes: 15 additions & 5 deletions src/block/posts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ export const generateRenderPostItem = ( attributes, { isHovered } ) => {
)

const meta = ( authorShow || dateShow || commentsShow ) && (
<aside className={ metaClassNames }>
<div className={ metaClassNames }>
{ authorShow && author }
{ authorShow && author && ( ( dateShow && date ) || ( commentsShow && comments ) ) && separator }
{ dateShow && date }
{ ( ( authorShow && author ) || ( dateShow && date ) ) && commentsShow && comments && separator }
{ commentsShow && comments }
</aside>
</div>
)

const contentFactory = {
Expand Down Expand Up @@ -382,15 +382,25 @@ generateRenderPostItem.save = ( attributes, version = VERSION ) => {
/>
)

const meta = ( authorShow || dateShow || commentsShow ) && (
<aside className={ metaClassNames }>
let meta = ( authorShow || dateShow || commentsShow ) && (
<div className={ metaClassNames }>
{ authorShow && author }
{ authorShow && author && ( ( dateShow && date ) || ( commentsShow && comments ) ) && separator }
{ dateShow && date }
{ ( ( authorShow && author ) || ( dateShow && date ) ) && commentsShow && comments && separator }
{ commentsShow && comments }
</aside>
</div>
)
meta = applyFilters( 'stackable.posts.meta', meta, {
authorShow,
dateShow,
commentsShow,
author,
date,
comments,
separator,
metaClassNames,
}, version )

const contentFactory = {
'featured-image': imageShow && featuredImage,
Expand Down
16 changes: 16 additions & 0 deletions src/block/progress-bar/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ import {
deprecateTypographyShadowColor, deprecateBlockShadowColor, deprecateContainerShadowColor, deprecateTypographyFontSize,
deprecateBlockHeight,
} from '~stackable/block-components'
import { semverCompare } from '~stackable/util'

import { addFilter } from '@wordpress/hooks'

const addAriaLabel = ( divProps, version ) => {
if ( semverCompare( version, '<', '3.19.0' ) ) {
return {
...divProps,
'aria-label': undefined,
}
}

return divProps
}

addFilter( 'stackable.progress-bar.div-props', 'stackable/3.19.0', addAriaLabel )

const deprecated = [
{
Expand Down
3 changes: 3 additions & 0 deletions src/block/progress-bar/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import classnames from 'classnames'
import striptags from 'striptags'

import { compose } from '@wordpress/compose'
import { applyFilters } from '@wordpress/hooks'

export const Save = props => {
const { className, attributes } = props
Expand Down Expand Up @@ -75,6 +76,8 @@ export const Save = props => {
aria-valuemax="100"
aria-valuenow={ progressValue }
aria-valuetext={ derivedAriaValue ? striptags( derivedAriaValue ) : undefined }
aria-label={ derivedAriaValue ? striptags( derivedAriaValue ) : undefined }
{ ...applyFilters( 'stackable.progress-bar.div-props', {}, props.version ) }
>
<div className={ barClassNames }>
{ attributes.showText && (
Expand Down
16 changes: 16 additions & 0 deletions src/block/progress-circle/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ import {
deprecateTypographyShadowColor, deprecateBlockShadowColor, deprecateContainerShadowColor, deprecateTypographyFontSize,
deprecateBlockHeight,
} from '~stackable/block-components'
import { semverCompare } from '~stackable/util'

import { addFilter } from '@wordpress/hooks'

const addAriaLabel = ( divProps, version ) => {
if ( semverCompare( version, '<', '3.19.0' ) ) {
return {
...divProps,
'aria-label': undefined,
}
}

return divProps
}

addFilter( 'stackable.progress-circle.div-props', 'stackable/3.19.0', addAriaLabel )

const deprecated = [
{
Expand Down
3 changes: 3 additions & 0 deletions src/block/progress-circle/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import classnames from 'classnames'
import striptags from 'striptags'

import { compose } from '@wordpress/compose'
import { applyFilters } from '@wordpress/hooks'

export const Save = props => {
const { className, attributes } = props
Expand Down Expand Up @@ -71,6 +72,8 @@ export const Save = props => {
aria-valuemax="100"
aria-valuenow={ progressValue }
aria-valuetext={ attributes.progressAriaValueText ? striptags( attributes.progressAriaValueText ) : undefined }
aria-label={ attributes.progressAriaValueText ? striptags( attributes.progressAriaValueText ) : undefined }
{ ...applyFilters( 'stackable.progress-circle.div-props', {}, props.version ) }
>
<svg>
{ attributes.progressColorType === 'gradient' && (
Expand Down
Loading