Skip to content

Commit 38d5902

Browse files
release: version 2.0.5
- Fix CSS notifications appearing multiple times - Fix excerptLength not being persistent in Posts Block - Sharing Icons Block Revamp - Fix ACF extension for Posts not working - Fix Icon Block style inheritance issue - Fix Dashboard integration fields losing focus on each keypress - Fix Accordion title going outside the container - Improve Masonry Block responsiveness - Improve Product Review Comparison Block placeholder text
2 parents 36f742c + 5694e1e commit 38d5902

File tree

27 files changed

+801
-333
lines changed

27 files changed

+801
-333
lines changed

development.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// phpcs:ignoreFile
99

1010
if ( ! defined( 'ENABLE_OTTER_PRO_DEV' ) ) {
11-
define( 'ENABLE_OTTER_PRO_DEV', false );
11+
define( 'ENABLE_OTTER_PRO_DEV', true );
1212
}
1313

1414
if ( ENABLE_OTTER_PRO_DEV && defined( 'WPINC' ) && class_exists( '\ThemeIsle\OtterPro\Main' ) ) {

inc/class-base-css.php

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public function autoload_block_classes() {
8484
'\ThemeIsle\GutenbergBlocks\CSS\Blocks\Review_CSS',
8585
'\ThemeIsle\GutenbergBlocks\CSS\Blocks\Tabs_CSS',
8686
'\ThemeIsle\GutenbergBlocks\CSS\Blocks\Posts_CSS',
87+
'\Themeisle\GutenbergBlocks\CSS\Blocks\Sharing_Icons_CSS',
8788
);
8889

8990
self::$blocks_classes = apply_filters( 'otter_blocks_register_css', self::$blocks_classes );
+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
/**
3+
* Css handling logic for blocks.
4+
*
5+
* @package ThemeIsle\GutenbergBlocks\CSS\Blocks
6+
*/
7+
8+
namespace Themeisle\GutenbergBlocks\CSS\Blocks;
9+
10+
use ThemeIsle\GutenbergBlocks\Base_CSS;
11+
use ThemeIsle\GutenbergBlocks\CSS\CSS_Utility;
12+
use ThemeIsle\GutenbergBlocks\Render\Sharing_Icons_Block;
13+
14+
/**
15+
* Class Sharing_Icons_CSS
16+
*/
17+
class Sharing_Icons_CSS extends Base_CSS {
18+
19+
/**
20+
* The namespace under which the blocks are registered.
21+
*
22+
* @var string
23+
*/
24+
public $block_prefix = 'sharing-icons';
25+
26+
/**
27+
* Generate Sharing Icons CSS
28+
*
29+
* @param mixed $block Block data.
30+
* @return string
31+
* @access public
32+
*/
33+
public function render_css( $block ) {
34+
$css = new CSS_Utility( $block );
35+
$social_profiles = Sharing_Icons_Block::get_social_profiles();
36+
37+
foreach ( $social_profiles as $icon => $attrs ) {
38+
$css->add_item(
39+
array(
40+
'selector' => ' .is-' . $icon,
41+
'properties' => array(
42+
array(
43+
'property' => '--iconBgColor',
44+
'value' => $icon,
45+
'format' => function( $value, $attrs ) {
46+
return $value['backgroundColor'];
47+
},
48+
'condition' => function( $attrs ) use ( $icon ) {
49+
return isset( $attrs[ $icon ]['backgroundColor'] );
50+
},
51+
),
52+
array(
53+
'property' => '--textColor',
54+
'value' => $icon,
55+
'format' => function( $value, $attrs ) {
56+
return $value['textColor'];
57+
},
58+
'condition' => function( $attrs ) use ( $icon ) {
59+
return isset( $attrs[ $icon ]['textColor'] );
60+
},
61+
),
62+
),
63+
)
64+
);
65+
}
66+
67+
$css->add_item(
68+
array(
69+
'properties' => array(
70+
array(
71+
'property' => '--iconsGap',
72+
'value' => 'gap',
73+
'unit' => 'px',
74+
),
75+
array(
76+
'property' => '--borderRadius',
77+
'value' => 'borderRadius',
78+
'unit' => 'px',
79+
),
80+
),
81+
)
82+
);
83+
84+
return $css->generate();
85+
}
86+
}

inc/render/class-sharing-icons-block.php

+17-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Sharing_Icons_Block {
1717
*
1818
* @return array
1919
*/
20-
public function get_social_profiles() {
20+
public static function get_social_profiles() {
2121
$social_attributes = array(
2222
'facebook' => array(
2323
'label' => esc_html__( 'Facebook', 'otter-blocks' ),
@@ -59,6 +59,17 @@ public function get_social_profiles() {
5959
return $social_attributes;
6060
}
6161

62+
/**
63+
* Checks if an icon is active and should be visible
64+
*
65+
* @param array $icon Icon to check.
66+
*
67+
* @return bool
68+
*/
69+
private function is_active( $icon ) {
70+
return ( ( isset( $icon['active'] ) && true === filter_var( $icon['active'], FILTER_VALIDATE_BOOLEAN ) ) || 1 == $icon );
71+
}
72+
6273
/**
6374
* Block render function for server-side.
6475
*
@@ -77,20 +88,20 @@ public function render( $attributes ) {
7788
$class .= ' align' . esc_attr( $attributes['align'] );
7889
}
7990

80-
$wrapper_attributes = get_block_wrapper_attributes();
91+
$wrapper_attributes = get_block_wrapper_attributes( isset( $attributes['id'] ) ? [ 'id' => $attributes['id'] ] : [] );
8192

82-
$html = '<div ' . $wrapper_attributes . '>';
93+
$html = '<div ' . $wrapper_attributes . '><div class="social-icons-wrap">';
8394
foreach ( $social_attributes as $key => $icon ) {
84-
if ( 'className' !== $key && 1 == $attributes[ $key ] ) {
95+
if ( 'className' !== $key && $this->is_active( $attributes[ $key ] ) ) {
8596
$html .= '<a class="social-icon is-' . esc_html( $key ) . '" href="' . esc_url( $icon['url'] ) . '" target="_blank">';
86-
$html .= '<i class="fab fa-' . esc_html( $icon['icon'] ) . '"></i>';
97+
$html .= '<i class="fab fa-' . esc_html( $icon['icon'] ) . '"></i><span class="v-line"></span>';
8798
if ( strpos( $wrapper_attributes, 'is-style-icons' ) === false ) {
8899
$html .= esc_html( $icon['label'] );
89100
}
90101
$html .= '</a>';
91102
}
92103
}
93-
$html .= '</div>';
104+
$html .= '</div></div>';
94105
return $html;
95106
}
96107
}

plugins/blocks-animation/readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: themeisle, hardeepasrani, mariamunteanu1
33
Tags: gutenberg, block, block editor, editor, animation, animations, animate, styles, block animations
44
Requires at least: 5.4
5-
Tested up to: 5.8
5+
Tested up to: 6.0
66
Requires PHP: 5.4
77
Stable tag: trunk
88
License: GPLv3

plugins/blocks-css/readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: themeisle, hardeepasrani
33
Tags: gutenberg, block, css, css editor, blocks css
44
Requires at least: 5.2
5-
Tested up to: 5.8
5+
Tested up to: 6.0
66
Requires PHP: 5.4
77
Stable tag: trunk
88
License: GPLv3

plugins/blocks-export-import/readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: themeisle, hardeepasrani
33
Tags: gutenberg, block, blocks, export, import, exporter, importer, block exporter, block export, block import, block importer
44
Requires at least: 5.3
5-
Tested up to: 5.8
5+
Tested up to: 6.0
66
Requires PHP: 5.4
77
Stable tag: trunk
88
License: GPLv3

readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: themeisle, hardeepasrani, soarerobertdaniel7, mariamunteanu1, arinat, uriahs-victor
33
Tags: gutenberg blocks, gutenberg, block,post grid block, google map block, columns block, advanced columns, section, row, layout, templates, lottie, progress bar, product review, review, accordion, tabs, page builder, countdown, contact form, masonry, popup, review builder
44
Requires at least: 5.6
5-
Tested up to: 5.9
5+
Tested up to: 6.0
66
Requires PHP: 5.4
77
Stable tag: trunk
88
License: GPLv3

src/blocks/blocks/accordion/style.scss

+20-20
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
cursor: pointer;
1616
user-select: none;
1717

18+
display: grid;
19+
grid-template-columns: auto min-content;
20+
align-items: center;
21+
padding: 18px 24px;
22+
1823
svg {
1924
width: 24px;
2025
height: 24px;
@@ -24,27 +29,24 @@
2429
filter: brightness( 0.95 );
2530
}
2631

32+
> div {
33+
34+
}
35+
2736
&::-webkit-details-marker,
2837
&::marker {
2938
display: none;
3039
}
3140

32-
> div {
33-
display: grid;
34-
grid-template-columns: max-content auto min-content;
35-
align-items: center;
36-
padding: 18px 24px;
37-
38-
&::after {
39-
content: '';
40-
justify-self: end;
41-
align-self: center;
42-
border-right: 2px solid var( --borderColor );
43-
border-bottom: 2px solid var( --borderColor );
44-
width: 8px;
45-
height: 8px;
46-
transform: rotate(45deg) translate(-25%, 0%);
47-
}
41+
&::after {
42+
content: '';
43+
justify-self: end;
44+
align-self: center;
45+
border-right: 2px solid var( --borderColor );
46+
border-bottom: 2px solid var( --borderColor );
47+
width: 8px;
48+
height: 8px;
49+
transform: rotate(45deg) translate(-25%, 0%);
4850
}
4951
}
5052

@@ -57,10 +59,8 @@
5759

5860
&[open] {
5961
> .wp-block-themeisle-blocks-accordion-item__title {
60-
> div {
61-
&::after {
62-
transform: rotate(225deg) translate(0%, -45%);
63-
}
62+
&::after {
63+
transform: rotate(225deg) translate(0%, -45%);
6464
}
6565
}
6666
}

0 commit comments

Comments
 (0)