From a843ef6a412e8cada245944a7c8cbda7de1321d3 Mon Sep 17 00:00:00 2001 From: forrestkirby <18228336+forrestkirby@users.noreply.github.com> Date: Thu, 2 Dec 2021 21:12:49 +0100 Subject: [PATCH] 1.5.3 --- CHANGELOG.md | 7 ++ herzogdupont.xml | 2 +- .../elements/elements/hd-flipcard/element.php | 83 ++++++++++++++----- .../hd-flipcard/templates/template.php | 2 + 4 files changed, 74 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ea0838..bdd3030 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 1.5.3 (December 02, 2021) + +### Fixed + +- panel padding update path in flipcard element +- missing classes on cards in flipcard element + ## 1.5.2 (December 02, 2021) ### Fixed diff --git a/herzogdupont.xml b/herzogdupont.xml index 7a50b59..e923871 100644 --- a/herzogdupont.xml +++ b/herzogdupont.xml @@ -15,7 +15,7 @@ Copyright (C) 2021 Thomas Weidlich GNU General Public License version 3, see LICENSE December 02, 2021 - 1.5.2 + 1.5.3 PLG_SYSTEM_HERZOGDUPONT_XML_DESC script.php diff --git a/modules/elements/elements/hd-flipcard/element.php b/modules/elements/elements/hd-flipcard/element.php index d0a765e..0c3835b 100644 --- a/modules/elements/elements/hd-flipcard/element.php +++ b/modules/elements/elements/hd-flipcard/element.php @@ -5,11 +5,8 @@ namespace YOOtheme; return [ - 'transforms' => [ - 'render' => function ($node) { - /** * @var Metadata $metadata */ @@ -19,28 +16,76 @@ $metadata->set('script:builder-hd-flipcard', ['src' => Path::get('./js/hd-flipcard.js'), 'defer' => true]); // Don't render element if content fields are empty - return ( - Str::length($node->props['title']) - || Str::length($node->props['meta']) - || Str::length($node->props['content']) - || $node->props['image'] - || $node->props['icon'] - ) && ( - Str::length($node->props['title_back']) - || Str::length($node->props['meta_back']) - || Str::length($node->props['content_back']) - || $node->props['image_back'] - || $node->props['icon_back'] - ); - + return ( Str::length($node->props['title']) || + Str::length($node->props['meta']) || + Str::length($node->props['content']) || + $node->props['image'] || + $node->props['icon'] ) && ( Str::length($node->props['title_back']) || + Str::length($node->props['meta_back']) || + Str::length($node->props['content_back']) || + $node->props['image_back'] || + $node->props['icon_back'] ); }, - ], 'updates' => [ + '2.7.0-beta.0.5' => function ($node) { + if ( + isset($node->props['panel_style']) && + preg_match('/^card-/', $node->props['panel_style']) + ) { + if (empty($node->props['panel_card_size'])) { + $node->props['panel_card_size'] = 'default'; + } + $node->props['panel_padding'] = $node->props['panel_card_size']; + unset($node->props['panel_card_size']); + } - '2.1.0-beta.0.1' => function ($node) { + if ( + isset($node->props['panel_back_style']) && + preg_match('/^card-/', $node->props['panel_back_style']) + ) { + if (empty($node->props['panel_back_card_size'])) { + $node->props['panel_back_card_size'] = 'default'; + } + $node->props['panel_back_padding'] = $node->props['panel_back_card_size']; + unset($node->props['panel_back_card_size']); + } + }, + '2.7.0-beta.0.1' => function ($node) { + if (isset($node->props['panel_content_padding'])) { + $node->props['panel_padding'] = $node->props['panel_content_padding']; + unset($node->props['panel_content_padding']); + } + + if (isset($node->props['panel_size'])) { + $node->props['panel_card_size'] = $node->props['panel_size']; + unset($node->props['panel_size']); + } + + if (isset($node->props['panel_card_image'])) { + $node->props['panel_image_no_padding'] = $node->props['panel_card_image']; + unset($node->props['panel_card_image']); + } + + if (isset($node->props['panel_back_content_padding'])) { + $node->props['panel_back_padding'] = $node->props['panel_back_content_padding']; + unset($node->props['panel_back_content_padding']); + } + + if (isset($node->props['panel_back_size'])) { + $node->props['panel_back_card_size'] = $node->props['panel_back_size']; + unset($node->props['panel_back_size']); + } + + if (isset($node->props['panel_back_card_image'])) { + $node->props['panel_back_image_no_padding'] = $node->props['panel_back_card_image']; + unset($node->props['panel_back_card_image']); + } + }, + + '2.1.0-beta.0.1' => function ($node) { if (Arr::get($node->props, 'title_grid_width') === 'xxlarge') { $node->props['title_grid_width'] = '2xlarge'; } diff --git a/modules/elements/elements/hd-flipcard/templates/template.php b/modules/elements/elements/hd-flipcard/templates/template.php index e11ce54..9b50982 100644 --- a/modules/elements/elements/hd-flipcard/templates/template.php +++ b/modules/elements/elements/hd-flipcard/templates/template.php @@ -41,6 +41,7 @@ $front = $this->el('div', [ 'class' => [ + 'el-card', 'uk-panel [uk-{panel_style: tile-.*}] {@panel_style: |tile-.*}', 'uk-card uk-{panel_style: card-.*} [uk-card-{!panel_padding: |default}]', 'uk-padding[-{!panel_padding: default}] {@panel_style: |tile-.*} {@panel_padding} {@!has_panel_image_no_padding} {@!has_no_padding}', @@ -168,6 +169,7 @@ $back = $this->el($props['link_back'] && $props['panel_back_link'] ? 'a' : 'div', [ 'class' => [ + 'el-card-back', 'uk-panel [uk-{panel_back_style: tile-.*}] {@panel_back_style: |tile-.*}', 'uk-card uk-{panel_back_style: card-.*} [uk-card-{!panel_back_padding: |default}]', 'uk-tile-hover {@panel_back_style: tile-.*} {@panel_back_link} {@link_back}',