Skip to content

Commit

Permalink
Merge branch 'master' into feat/lazy-render
Browse files Browse the repository at this point in the history
  • Loading branch information
kadencewp committed Jul 2, 2024
2 parents 7b81dbf + d3c9dee commit 1756277
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 108 deletions.
2 changes: 1 addition & 1 deletion includes/assets/js/kt-accordion.min.js

Large diffs are not rendered by default.

22 changes: 21 additions & 1 deletion includes/blocks/class-kadence-blocks-column-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,27 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
}
}
if ( isset( $attributes['flexGrow'][0] ) && $css->is_number( $attributes['flexGrow'][0] ) ) {
$css->set_selector( '.kadence-column' . $unique_id );
$css->set_selector( '.kadence-column' . $unique_id . ', .wp-block-kadence-column.kb-section-dir-horizontal > .kt-inside-inner-col > .kadence-column' . $unique_id );
$css->add_property( 'flex-grow', $attributes['flexGrow'][0] );
$css->set_selector( '.kadence-column' . $unique_id . ' > .kt-inside-inner-col' );
$css->add_property( 'height', '100%' );
}
if ( isset( $attributes['flexGrow'][1] ) && $css->is_number( $attributes['flexGrow'][1] ) ) {
$css->set_media_state( 'tablet' );
$css->set_selector( '.kadence-column' . $unique_id . ', .wp-block-kadence-column.kb-section-dir-horizontal > .kt-inside-inner-col > .kadence-column' . $unique_id );
$css->add_property( 'flex-grow', $attributes['flexGrow'][1] );
$css->set_selector( '.kadence-column' . $unique_id . ' > .kt-inside-inner-col' );
$css->add_property( 'height', '100%' );
$css->set_media_state( 'desktop' );
}
if ( isset( $attributes['flexGrow'][2] ) && $css->is_number( $attributes['flexGrow'][2] ) ) {
$css->set_media_state( 'mobile' );
$css->set_selector( '.kadence-column' . $unique_id . ', .wp-block-kadence-column.kb-section-dir-horizontal > .kt-inside-inner-col > .kadence-column' . $unique_id );
$css->add_property( 'flex-grow', $attributes['flexGrow'][2] );
$css->set_selector( '.kadence-column' . $unique_id . ' > .kt-inside-inner-col' );
$css->add_property( 'height', '100%' );
$css->set_media_state( 'desktop' );
}
if ( ! empty( $attributes['maxWidth'][0] ) ) {
$css->set_selector( '.kadence-column' . $unique_id );
$css->add_property( 'max-width', $attributes['maxWidth'][0] . $max_width_unit );
Expand Down Expand Up @@ -677,6 +693,10 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
if ( ( 'horizontal' === $desktop_direction || 'horizontal-reverse' === $desktop_direction ) ) {
$css->add_property( 'flex-wrap', 'nowrap' );
}
if ( ( 'horizontal' === $desktop_direction || 'horizontal-reverse' === $desktop_direction ) ) {
$css->set_selector( '.wp-block-kadence-column.kb-section-dir-horizontal.kadence-column' . $unique_id . ' > .kt-inside-inner-col > *' );
$css->add_property( 'flex', 'unset' );
}
if ( ( 'horizontal' === $desktop_direction || 'horizontal-reverse' === $desktop_direction ) && ! empty( $attributes['flexBasis'][0] ) ) {
$css->set_selector( '.wp-block-kadence-column.kb-section-dir-horizontal.kadence-column' . $unique_id . ' > .kt-inside-inner-col > *' );
$css->add_property( 'flex', '1' );
Expand Down
2 changes: 2 additions & 0 deletions includes/blocks/class-kadence-blocks-infobox-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
$media_number = array();
}
if ( isset( $attributes['mediaType'] ) && 'image' === $attributes['mediaType'] ) {
$css->set_selector( $base_selector . '.wp-block-kadence-infobox' );
$css->add_property( 'max-width', '100%' );
if ( isset( $media_image['maxWidth'] ) && ! empty( $media_image['maxWidth'] ) ) {
$css->set_selector( $base_selector . ' .kadence-info-box-image-inner-intrisic-container' );
$css->add_property( 'max-width', $media_image['maxWidth'] . 'px' );
Expand Down
11 changes: 11 additions & 0 deletions includes/blocks/class-kadence-blocks-row-layout-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,17 @@ public function build_html( $attributes, $unique_id, $content, $block_instance )
if ( ! empty( $attributes['bottomSep'] ) && 'none' !== $attributes['bottomSep'] ) {
$extra_content .= $this->get_divider_render( $attributes['bottomSep'], 'bottom' );
}
if ( ! empty( $attributes['bgImg'] ) && !empty($attributes['bgImgAttachment']) && $attributes['bgImgAttachment'] == 'parallax' ) {
if ( ! empty( $attributes['bgImgPosition'] ) ) {
$wrapper_args['data-img-position'] = $attributes['bgImgPosition'];
}
if ( ! empty( $attributes['bgImgSize'] ) ) {
$wrapper_args['data-img-size'] = $attributes['bgImgSize'];
if ( $attributes['bgImgSize'] !== 'cover' && ! empty( $attributes['bgImgRepeat'] ) ) {
$wrapper_args['data-img-repeat'] = $attributes['bgImgRepeat'];
}
}
}
$wrapper_attributes = get_block_wrapper_attributes( $wrapper_args );
$inner_wrapper_attributes = implode( ' ', $inner_wrap_attributes );
$content = sprintf( '<%1$s %2$s>%3$s<div %4$s>%5$s</div></%1$s>', $html_tag, $wrapper_attributes, $extra_content, $inner_wrapper_attributes, $content );
Expand Down
4 changes: 2 additions & 2 deletions kadence-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Advanced Page Building Blocks for Gutenberg. Create custom column layouts, backgrounds, dual buttons, icons etc.
* Author: Kadence WP
* Author URI: https://www.kadencewp.com
* Version: 3.2.46
* Version: 3.2.48
* Requires PHP: 7.4
* Text Domain: kadence-blocks
* License: GPL2+
Expand All @@ -20,7 +20,7 @@
}
define( 'KADENCE_BLOCKS_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
define( 'KADENCE_BLOCKS_URL', plugin_dir_url( __FILE__ ) );
define( 'KADENCE_BLOCKS_VERSION', '3.2.46' );
define( 'KADENCE_BLOCKS_VERSION', '3.2.48' );

require_once plugin_dir_path( __FILE__ ) . 'vendor/vendor-prefixed/autoload.php';
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
Expand Down
13 changes: 12 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: gutenberg, blocks, page builder, editor, gutenberg blocks
Donate link: https://www.kadencewp.com/about-us/
Requires at least: 6.3
Tested up to: 6.5
Stable tag: 3.2.46
Stable tag: 3.2.48
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -174,6 +174,17 @@ Please report security bugs found in the Kadence Blocks plugin's source code thr

== Changelog ==

= 3.2.48 =
Release Date: June 27th 2024
* Fix: Issue with vertical alignment in tablet for sections.
* Fix: Issue with css priority of flex in sections.

= 3.2.47 =
Release Date: June 27th 2024
* Update: WPML config.
* Fix: Possible issue with editor react error 311.
* Fix: Gallery image control buttons.

= 3.2.46 =
Release Date: June 26th 2024
* Add: Custom column width for 4,5,6 column rows.
Expand Down
23 changes: 2 additions & 21 deletions src/assets/js/kt-accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@
throw new TypeError('Cannot call a class as a function');
}
}
(function () {
if (typeof window.CustomEvent === 'function') return false;

function CustomEvent(event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
const evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}

CustomEvent.prototype = window.Event.prototype;

window.CustomEvent = CustomEvent;
})();

function _defineProperties(target, props) {
for (let i = 0; i < props.length; i++) {
Expand Down Expand Up @@ -454,10 +440,7 @@
value: function _finishInitialization() {
this.container.classList.add(this.settings.initializedClass);
this._setRole('presentation', this.container);
// Create a new event
const event = new CustomEvent('initialized');
// Dispatch the event
this.container.dispatchEvent(event);
this.container.dispatchEvent(new Event('initialized'));
},
/**
* ADD LISTENERS
Expand Down Expand Up @@ -732,9 +715,7 @@
panelToOpen.offsetHeight;
_header.classList.add(this.settings.activeClass); // 4. Set aria attrs
_header.setAttribute('aria-expanded', true); // 5. Resetting toggling so a new event can be fired
const resizeEvent = window.document.createEvent('UIEvents');
resizeEvent.initUIEvent('resize', true, false, window, 0);
window.dispatchEvent(resizeEvent);
window.dispatchEvent(new Event('resize'));
const _transDuration =
1000 * parseFloat(getComputedStyle(panelToOpen).transitionDuration);
setTimeout(function () {
Expand Down
10 changes: 5 additions & 5 deletions src/blocks/column/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ function SectionEdit(props) {
<div {...blockProps}>
<style>
{'' !== previewFlexGrow
? `.kadence-column-${uniqueID} { flex-grow: ${previewFlexGrow} }.kadence-column-${uniqueID} > .kadence-inner-column-inner{height:100%;}`
? `.kadence-column-${uniqueID}, .wp-block-kadence-column > .kadence-inner-column-direction-horizontal > .kadence-column-${uniqueID} { flex-grow: ${previewFlexGrow} }.kadence-column-${uniqueID} > .kadence-inner-column-inner{height:100%;}`
: ''}
{overlayOpacity !== undefined && overlayOpacity !== ''
? `.kadence-column-${uniqueID} > .kadence-inner-column-inner:before { opacity: ${overlayOpacity} }`
Expand Down Expand Up @@ -1697,8 +1697,8 @@ function SectionEdit(props) {
<ResponsiveAlignControls
label={__('Vertical Alignment', 'kadence-blocks')}
value={verticalAlignment ? verticalAlignment : ''}
mobileValue={verticalAlignmentTablet ? verticalAlignmentTablet : ''}
tabletValue={verticalAlignmentMobile ? verticalAlignmentMobile : ''}
tabletValue={verticalAlignmentTablet ? verticalAlignmentTablet : ''}
mobileValue={verticalAlignmentMobile ? verticalAlignmentMobile : ''}
onChange={(value) => {
let tempValue = value;
if ((verticalAlignment ? verticalAlignment : '') === value) {
Expand Down Expand Up @@ -1734,8 +1734,8 @@ function SectionEdit(props) {
<ResponsiveAlignControls
label={__('Vertical Alignment', 'kadence-blocks')}
value={verticalAlignment ? verticalAlignment : ''}
mobileValue={verticalAlignmentTablet ? verticalAlignmentTablet : ''}
tabletValue={verticalAlignmentMobile ? verticalAlignmentMobile : ''}
tabletValue={verticalAlignmentTablet ? verticalAlignmentTablet : ''}
mobileValue={verticalAlignmentMobile ? verticalAlignmentMobile : ''}
onChange={(value) => {
let tempValue = value;
if ((verticalAlignment ? verticalAlignment : '') === value) {
Expand Down
Loading

0 comments on commit 1756277

Please sign in to comment.