diff --git a/composer.json b/composer.json index 1ff983987..6c58c8f13 100644 --- a/composer.json +++ b/composer.json @@ -53,6 +53,7 @@ "codeinwp/themeisle-sdk": "^3.1", "masterminds/html5": "^2.7", "tubalmartin/cssmin": "^4.1", - "wptt/webfont-loader": "^1.1" + "wptt/webfont-loader": "^1.1", + "sabberworm/php-css-parser": "^8.4" } } diff --git a/composer.lock b/composer.lock index f09d80356..199414e61 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f64b6cbffd5da90c359fafb3b08b5659", + "content-hash": "7560a83ace286e5ab63de5fe6ca00321", "packages": [ { "name": "codeinwp/themeisle-sdk", @@ -115,6 +115,59 @@ }, "time": "2021-07-01T14:25:37+00:00" }, + { + "name": "sabberworm/php-css-parser", + "version": "8.4.0", + "source": { + "type": "git", + "url": "https://github.com/sabberworm/PHP-CSS-Parser.git", + "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/e41d2140031d533348b2192a83f02d8dd8a71d30", + "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=5.6.20" + }, + "require-dev": { + "codacy/coverage": "^1.4", + "phpunit/phpunit": "^4.8.36" + }, + "suggest": { + "ext-mbstring": "for parsing UTF-8 CSS" + }, + "type": "library", + "autoload": { + "psr-4": { + "Sabberworm\\CSS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raphael Schweikert" + } + ], + "description": "Parser for CSS Files written in PHP", + "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", + "keywords": [ + "css", + "parser", + "stylesheet" + ], + "support": { + "issues": "https://github.com/sabberworm/PHP-CSS-Parser/issues", + "source": "https://github.com/sabberworm/PHP-CSS-Parser/tree/8.4.0" + }, + "time": "2021-12-11T13:40:54+00:00" + }, { "name": "tubalmartin/cssmin", "version": "v4.1.1", diff --git a/inc/class-base-css.php b/inc/class-base-css.php index e81883820..813e2b171 100644 --- a/inc/class-base-css.php +++ b/inc/class-base-css.php @@ -7,6 +7,12 @@ namespace ThemeIsle\GutenbergBlocks; +use Sabberworm\CSS\Parser; +use Sabberworm\CSS\OutputFormat; +use Sabberworm\CSS\RuleSet\DeclarationBlock; +use Sabberworm\CSS\CSSList\AtRuleBlockList; +use Sabberworm\CSS\CSSList\KeyFrame; + /** * Class Base_CSS */ @@ -207,7 +213,9 @@ public function get_blocks_css( $post_id ) { return; } - return $this->cycle_through_static_blocks( $blocks ); + $animations = boolval( preg_match( '/\banimated\b/', $content ) ); + + return $this->cycle_through_static_blocks( $blocks, $animations ); } } @@ -235,7 +243,9 @@ public function get_widgets_css() { return; } - return $this->cycle_through_static_blocks( $blocks ); + $animations = boolval( preg_match( '/\banimated\b/', $content ) ); + + return $this->cycle_through_static_blocks( $blocks, $animations ); } } @@ -258,21 +268,23 @@ public function get_reusable_block_css( $post_id ) { return; } - $blocks = parse_blocks( $reusable_block->post_content ); + $blocks = parse_blocks( $reusable_block->post_content ); + $animations = boolval( preg_match( '/\banimated\b/', $content ) ); - return $this->cycle_through_static_blocks( $blocks ); + return $this->cycle_through_static_blocks( $blocks, $animations ); } /** * Cycle thorugh Static Blocks * * @param array $blocks List of blocks. + * @param bool $animations To check for animations or not. * * @return string Style. * @since 1.3.0 * @access public */ - public function cycle_through_static_blocks( $blocks ) { + public function cycle_through_static_blocks( $blocks, $animations = true ) { $style = ''; foreach ( $blocks as $block ) { foreach ( self::$blocks_classes as $classname ) { @@ -292,13 +304,277 @@ public function cycle_through_static_blocks( $blocks ) { } if ( isset( $block['innerBlocks'] ) && ! empty( $block['innerBlocks'] ) && is_array( $block['innerBlocks'] ) ) { - $style .= $this->cycle_through_static_blocks( $block['innerBlocks'] ); + $style .= $this->cycle_through_static_blocks( $block['innerBlocks'], false ); } } + if ( true === $animations && class_exists( '\ThemeIsle\GutenbergBlocks\Blocks_Animation' ) && get_option( 'themeisle_blocks_settings_blocks_animation', true ) && get_option( 'themeisle_blocks_settings_optimize_animations_css', true ) ) { + $style .= $this->get_animation_css( $blocks ); + } + return $style; } + /** + * Get Animation CSS + * + * @param array $blocks List of blocks. + * + * @return string CSS. + * @since 2.0.10 + * @access public + */ + public function get_animation_css( $blocks ) { + $style = ''; + $classes = $this->get_animation_classes( $blocks ); + + if ( 0 === count( $classes ) ) { + return $style; + } + + $prepared_classes = array( ':root' ); + + foreach ( $classes as $class ) { + array_push( $prepared_classes, '.' . $class, '.animated.' . $class ); + } + + $classes = $prepared_classes; + + $content = get_transient( 'otter_animations_parsed' ); + + if ( false === $content ) { + $parser = null; + if ( function_exists( 'wpcom_vip_file_get_contents' ) ) { + $parser = new Parser( wpcom_vip_file_get_contents( OTTER_BLOCKS_PATH . '/build/animation/index.css' ) ); + } else { + $parser = new Parser( file_get_contents( OTTER_BLOCKS_PATH . '/build/animation/index.css' ) ); // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown + } + + $content = $parser->parse()->getContents(); + + set_transient( 'otter_animations_parsed', $content, MONTH_IN_SECONDS ); + } + + $format = OutputFormat::createCompact(); + + foreach ( $content as $rule ) { + if ( $rule instanceof DeclarationBlock ) { + foreach ( $rule->getSelectors() as $selector ) { + if ( in_array( $selector, $classes ) ) { + $style .= $rule->render( $format ); + } + } + continue; + } + + /* + * This is used to get the reduced-motion animation styles. + */ + if ( $rule instanceof AtRuleBlockList ) { + if ( false === in_array( $rule->atRuleArgs(), array( '(prefers-reduced-motion:reduce),print', 'screen' ) ) ) { + continue; + } + + $style .= $rule->render( $format ); + continue; + } + + /* + * This is used to get actual animation which is a @keyframe. + */ + if ( $rule instanceof KeyFrame ) { + if ( in_array( '.' . $rule->getAnimationName(), $classes ) ) { + $style .= $rule->render( $format ); + } + continue; + } + } + + return $style; + } + + /** + * Get Animation Classes + * + * @param array $blocks List of blocks. + * + * @return array CSS classes. + * @since 2.0.10 + * @access public + */ + public function get_animation_classes( $blocks ) { + $classes = array(); + + $allowed_classes = array( + 'animated', + 'bounce', + 'flash', + 'pulse', + 'rubberBand', + 'shakeX', + 'shakeY', + 'headShake', + 'swing', + 'tada', + 'wobble', + 'jello', + 'heartBeat', + 'hinge', + 'jackInTheBox', + 'backInDown', + 'backInLeft', + 'backInRight', + 'backInUp', + 'backOutDown', + 'backOutLeft', + 'backOutRight', + 'backOutUp', + 'bounceIn', + 'bounceInDown', + 'bounceInLeft', + 'bounceInRight', + 'bounceInUp', + 'bounceOut', + 'bounceOutDown', + 'bounceOutLeft', + 'bounceOutRight', + 'bounceOutUp', + 'fadeIn', + 'fadeInDown', + 'fadeInDownBig', + 'fadeInLeft', + 'fadeInLeftBig', + 'fadeInRight', + 'fadeInRightBig', + 'fadeInUp', + 'fadeInTopLeft', + 'fadeInTopRight', + 'fadeInBottomLeft', + 'fadeInBottomRight', + 'fadeOut', + 'fadeOutDown', + 'fadeOutDownBig', + 'fadeOutLeft', + 'fadeOutLeftBig', + 'fadeOutRight', + 'fadeOutRightBig', + 'fadeOutUp', + 'fadeOutUpBig', + 'fadeOutTopLeft', + 'fadeOutTopRight', + 'fadeOutBottomRight', + 'fadeOutBottomLeft', + 'flip', + 'flipInX', + 'flipInY', + 'flipOutX', + 'flipOutY', + 'lightSpeedInRight', + 'lightSpeedInLeft', + 'lightSpeedOutRight', + 'lightSpeedOutLeft', + 'rotateIn', + 'rotateInDownLeft', + 'rotateInDownRight', + 'rotateInUpLeft', + 'rotateInUpRight', + 'rotateOut', + 'rotateOutDownLeft', + 'rotateOutDownRight', + 'rotateOutUpLeft', + 'rotateOutUpRight', + 'slideInDown', + 'slideInLeft', + 'slideInRight', + 'slideInUp', + 'slideOutDown', + 'slideOutLeft', + 'slideOutRight', + 'slideOutUp', + 'zoomIn', + 'zoomInDown', + 'zoomInLeft', + 'zoomInRight', + 'zoomInUp', + 'zoomOut', + 'zoomOutDown', + 'zoomOutLeft', + 'zoomOutRight', + 'zoomOutUp', + 'rollIn', + 'rollOut', + 'backOutDown', + 'backOutLeft', + 'backOutRight', + 'backOutUp', + 'bounceOut', + 'bounceOutDown', + 'bounceOutLeft', + 'bounceOutRight', + 'bounceOutUp', + 'fadeOut', + 'fadeOutDown', + 'fadeOutDownBig', + 'fadeOutLeft', + 'fadeOutLeftBig', + 'fadeOutRight', + 'fadeOutRightBig', + 'fadeOutUp', + 'fadeOutUpBig', + 'fadeOutTopLeft', + 'fadeOutTopRight', + 'fadeOutBottomRight', + 'fadeOutBottomLeft', + 'flipOutX', + 'flipOutY', + 'lightSpeedOutRight', + 'lightSpeedOutLeft', + 'rotateOut', + 'rotateOutDownLeft', + 'rotateOutDownRight', + 'rotateOutUpLeft', + 'rotateOutUpRight', + 'slideOutDown', + 'slideOutLeft', + 'slideOutRight', + 'slideOutUp', + 'zoomOut', + 'zoomOutDown', + 'zoomOutLeft', + 'zoomOutRight', + 'zoomOutUp', + 'rollOut', + 'delay-100ms', + 'delay-200ms', + 'delay-500ms', + 'delay-1s', + 'delay-2s', + 'delay-3s', + 'delay-4s', + 'delay-5s', + 'slow', + 'slower', + 'fast', + 'faster', + ); + + foreach ( $blocks as $block ) { + if ( isset( $block['attrs']['className'] ) && ! empty( $block['attrs']['className'] ) ) { + if ( preg_match( '/\banimated\b/', $block['attrs']['className'] ) ) { + $classes = array_merge( $classes, explode( ' ', trim( $block['attrs']['className'] ) ) ); + } + } + + if ( isset( $block['innerBlocks'] ) && ! empty( $block['innerBlocks'] ) && is_array( $block['innerBlocks'] ) ) { + $classes = array_merge( $classes, $this->get_animation_classes( $block['innerBlocks'] ) ); + } + } + + $classes = array_intersect( array_unique( $classes ), $allowed_classes ); + + return $classes; + } + /** * Cycle thorugh Global Styles * diff --git a/inc/class-blocks-animation.php b/inc/class-blocks-animation.php index 3a167c5b0..d447de473 100644 --- a/inc/class-blocks-animation.php +++ b/inc/class-blocks-animation.php @@ -126,20 +126,23 @@ public function enqueue_block_frontend_assets() { * @since 2.0.5 */ public function frontend_load( $block_content, $block ) { + $asset_file = include BLOCKS_ANIMATION_PATH . '/build/animation/frontend.asset.php'; + + wp_register_style( + 'otter-animation', + BLOCKS_ANIMATION_URL . 'build/animation/index.css', + array(), + $asset_file['version'] + ); if ( ! self::$can_load_frontend ) { return $block_content; } if ( ! self::$scripts_loaded['animation'] && strpos( $block_content, 'animated' ) ) { - $asset_file = include BLOCKS_ANIMATION_PATH . '/build/animation/frontend.asset.php'; - - wp_enqueue_style( - 'otter-animation', - BLOCKS_ANIMATION_URL . 'build/animation/index.css', - array(), - $asset_file['version'] - ); + if ( ! defined( 'OTTER_BLOCKS_VERSION' ) || ( defined( 'OTTER_BLOCKS_VERSION' ) && ! get_option( 'themeisle_blocks_settings_optimize_animations_css', true ) ) ) { + wp_enqueue_style( 'otter-animation' ); + } wp_enqueue_script( 'otter-animation-frontend', diff --git a/inc/class-main.php b/inc/class-main.php index 1804b608b..c6b7db1bf 100644 --- a/inc/class-main.php +++ b/inc/class-main.php @@ -270,9 +270,7 @@ public function fix_mime_type_json_svg( $data = null, $file = null, $filename = public function after_update_migration() { $db_version = get_option( 'themeisle_blocks_db_version', 0 ); - // We don't want to regenerate block styles for every update, - // only if user is switching from an older version to 2.0.9 or above. - if ( version_compare( $db_version, '2.0.9', '<' ) ) { + if ( version_compare( $db_version, OTTER_BLOCKS_VERSION, '<' ) ) { Dashboard_Server::regenerate_styles(); } diff --git a/inc/class-pro.php b/inc/class-pro.php index 833c8a32b..af010a25b 100644 --- a/inc/class-pro.php +++ b/inc/class-pro.php @@ -107,6 +107,10 @@ public static function get_docs_url() { public static function should_show_upsell() { $show_upsell = false; + if ( defined( 'OTTER_PRO_VERSION' ) ) { + return $show_upsell; + } + $installed = get_option( 'otter_blocks_install' ); $notifications = get_option( 'themeisle_blocks_settings_notifications', array() ); diff --git a/inc/class-registration.php b/inc/class-registration.php index f590e4627..69000279f 100644 --- a/inc/class-registration.php +++ b/inc/class-registration.php @@ -281,10 +281,6 @@ public function enqueue_block_assets() { return; } - $asset_file = include OTTER_BLOCKS_PATH . '/build/blocks/blocks.asset.php'; - wp_enqueue_style( 'otter-blocks', OTTER_BLOCKS_URL . 'build/blocks/blocks.css', [], $asset_file['version'] ); - wp_style_add_data( 'otter-blocks', 'path', OTTER_BLOCKS_PATH . '/build/blocks/blocks.css' ); - if ( is_singular() ) { $this->enqueue_dependencies(); } else { @@ -815,6 +811,10 @@ public function subscribe_fa( $block_content, $block ) { if ( isset( $block['attrs']['className'] ) && strpos( $block['attrs']['className'], 'fa-' ) !== false ) { self::$is_fa_loaded = true; + // See the src/blocks/plugins/menu-icons/inline.css file for where this comes from. + $styles = '.fab.wp-block-navigation-item,.far.wp-block-navigation-item,.fas.wp-block-navigation-item{-moz-osx-font-smoothing:inherit;-webkit-font-smoothing:inherit;font-weight:inherit}.fab.wp-block-navigation-item:before,.far.wp-block-navigation-item:before,.fas.wp-block-navigation-item:before{font-family:Font Awesome\ 5 Free;margin-right:5px}.fab.wp-block-navigation-item:before,.far.wp-block-navigation-item:before{font-weight:400;padding-right:5px}.fas.wp-block-navigation-item:before{font-weight:900;padding-right:5px}.fab.wp-block-navigation-item:before{font-family:Font Awesome\ 5 Brands}'; + + wp_add_inline_style( 'font-awesome-5', $styles ); return $block_content; } } diff --git a/inc/css/class-block-frontend.php b/inc/css/class-block-frontend.php index 63b2ffbec..11686ab40 100644 --- a/inc/css/class-block-frontend.php +++ b/inc/css/class-block-frontend.php @@ -55,7 +55,7 @@ public function init() { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_google_fonts' ), 19 ); add_action( 'wp_head', array( $this, 'enqueue_google_fonts_backward' ), 19 ); add_filter( 'get_the_excerpt', array( $this, 'get_excerpt_end' ), 20 ); - add_action( 'wp_head', array( $this, 'enqueue_widgets_css' ) ); + add_action( 'wp_footer', array( $this, 'enqueue_widgets_css' ) ); add_action( 'wp_head', array( $this, 'enqueue_assets' ) ); add_action( 'wp_footer', array( $this, 'enqueue_global_styles' ) ); } @@ -242,7 +242,7 @@ function ( $content ) use ( $id ) { return $content; } - $this->enqueue_styles( $post_id, true ); + $this->enqueue_styles( $post_id ); $this->enqueue_google_fonts( $post_id ); return $content; @@ -253,15 +253,13 @@ function ( $content ) use ( $id ) { /** * Enqueue CSS file * - * @param int $post_id Post id. - * @param bool $footer IN footer. + * @param int $post_id Post id. * * @since 1.3.0 * @access public */ - public function enqueue_styles( $post_id = '', $footer = false ) { - $post_id = $post_id ? $post_id : get_the_ID(); - $location = 'wp_head'; + public function enqueue_styles( $post_id = '' ) { + $post_id = $post_id ? $post_id : get_the_ID(); if ( ! function_exists( 'has_blocks' ) ) { return; @@ -271,13 +269,9 @@ public function enqueue_styles( $post_id = '', $footer = false ) { return; } - if ( $footer ) { - $location = 'wp_footer'; - } - if ( is_preview() ) { add_action( - $location, + 'wp_footer', function () use ( $post_id ) { return $this->get_post_css( $post_id ); } @@ -292,7 +286,7 @@ function () use ( $post_id ) { } add_action( - $location, + 'wp_footer', function () use ( $post_id ) { return $this->get_post_css( $post_id ); } @@ -310,7 +304,7 @@ function () use ( $post_id ) { $blocks = parse_blocks( $content ); if ( is_array( $blocks ) || ! empty( $blocks ) ) { - $this->enqueue_reusable_styles( $blocks, $footer ); + $this->enqueue_reusable_styles( $blocks ); } $total_inline_limit = 20000; @@ -321,7 +315,7 @@ function () use ( $post_id ) { $file_path = $basedir . $file_name; $file_size = filesize( $file_path ); - if ( $footer && $this->total_inline_size + $file_size < $total_inline_limit ) { + if ( $this->total_inline_size + $file_size < $total_inline_limit ) { add_action( 'wp_footer', function () use ( $post_id ) { @@ -333,22 +327,10 @@ function () use ( $post_id ) { return; } - if ( $footer ) { - add_action( - 'wp_footer', - function () use ( $post_id, $file_name, $file_url, $file_path ) { - wp_enqueue_style( 'otter-' . $file_name, $file_url, array( 'otter-blocks' ), OTTER_BLOCKS_VERSION ); - } - ); - - return; - } - add_action( - 'wp_enqueue_scripts', - function () use ( $post_id, $file_name, $file_url, $file_path ) { - wp_enqueue_style( 'otter-' . $file_name, $file_url, array( 'otter-blocks' ), OTTER_BLOCKS_VERSION ); - wp_style_add_data( 'otter-' . $file_name, 'path', $file_path ); + 'wp_footer', + function () use ( $file_name, $file_url, $file_path ) { + wp_enqueue_style( 'otter-' . $file_name, $file_url, array(), OTTER_BLOCKS_VERSION ); } ); } @@ -357,19 +339,18 @@ function () use ( $post_id, $file_name, $file_url, $file_path ) { * Enqueue CSS file for Reusable Blocks * * @param array $blocks List of blocks. - * @param bool $footer Should we load on footer. * * @since 1.3.0 * @access public */ - public function enqueue_reusable_styles( $blocks, $footer = false ) { + public function enqueue_reusable_styles( $blocks ) { foreach ( $blocks as $block ) { if ( 'core/block' === $block['blockName'] && ! empty( $block['attrs']['ref'] ) ) { - $this->enqueue_styles( $block['attrs']['ref'], $footer ); + $this->enqueue_styles( $block['attrs']['ref'] ); } if ( isset( $block['innerBlocks'] ) && ! empty( $block['innerBlocks'] ) && is_array( $block['innerBlocks'] ) ) { - $this->enqueue_reusable_styles( $block['innerBlocks'], $footer ); + $this->enqueue_reusable_styles( $block['innerBlocks'] ); } } } @@ -484,7 +465,9 @@ public function get_page_css_inline( $post_id ) { return ''; } - $css = $this->cycle_through_blocks( $blocks ); + $animations = boolval( preg_match( '/\banimated\b/', $content ) ); + + $css = $this->cycle_through_blocks( $blocks, $animations ); } return $css; @@ -494,14 +477,15 @@ public function get_page_css_inline( $post_id ) { * Cycle thorugh Blocks * * @param array $blocks List of blocks. + * @param bool $animations To check for animations or not. * * @return string Block styles. * @since 1.3.0 * @access public */ - public function cycle_through_blocks( $blocks ) { + public function cycle_through_blocks( $blocks, $animations ) { $style = ''; - $style .= $this->cycle_through_static_blocks( $blocks ); + $style .= $this->cycle_through_static_blocks( $blocks, $animations ); $style .= $this->cycle_through_reusable_blocks( $blocks ); return $style; @@ -569,7 +553,7 @@ public function enqueue_widgets_css() { $file_name = basename( $file_url ); $file_path = $basedir . $file_name; - wp_enqueue_style( 'otter-widgets', $file_url, array( 'otter-blocks' ), OTTER_BLOCKS_VERSION ); + wp_enqueue_style( 'otter-widgets', $file_url, array(), OTTER_BLOCKS_VERSION ); wp_style_add_data( 'otter-widgets', 'path', $file_path ); } @@ -606,7 +590,7 @@ public function enqueue_assets() { foreach ( $posts as $post ) { $class = Registration::instance(); $class->enqueue_dependencies( $post ); - $this->enqueue_styles( $post, true ); + $this->enqueue_styles( $post ); } } } diff --git a/inc/plugins/class-options-settings.php b/inc/plugins/class-options-settings.php index 82f8f91e0..dafbe3121 100644 --- a/inc/plugins/class-options-settings.php +++ b/inc/plugins/class-options-settings.php @@ -79,6 +79,17 @@ public function register_settings() { ) ); + register_setting( + 'themeisle_blocks_settings', + 'themeisle_blocks_settings_optimize_animations_css', + array( + 'type' => 'boolean', + 'description' => __( 'Optimize Animations CSS.', 'otter-blocks' ), + 'show_in_rest' => true, + 'default' => true, + ) + ); + register_setting( 'themeisle_blocks_settings', 'otter_blocks_logger_flag', diff --git a/inc/render/class-masonry-variant.php b/inc/render/class-masonry-variant.php index 66a5e8f47..fdaf2c09c 100644 --- a/inc/render/class-masonry-variant.php +++ b/inc/render/class-masonry-variant.php @@ -46,7 +46,7 @@ public function render_blocks( $block_content, $block ) { ); wp_script_add_data( 'macy', 'async', true ); - + + wp_enqueue_script( 'otter-masonry', OTTER_BLOCKS_URL . 'build/blocks/masonry.js', @@ -62,7 +62,9 @@ public function render_blocks( $block_content, $block ) { $margin = isset( $block['attrs']['margin'] ) ? $block['attrs']['margin'] : 10; - $block_content = '
' . $block_content . '
'; + $style = ''; + + $block_content = $style . '
' . $block_content . '
'; return $block_content; } diff --git a/package-lock.json b/package-lock.json index 3fccd74af..54bbe10ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3331,9 +3331,9 @@ } }, "@types/wordpress__components": { - "version": "19.10.0", - "resolved": "https://registry.npmjs.org/@types/wordpress__components/-/wordpress__components-19.10.0.tgz", - "integrity": "sha512-hnJHwYJfjUSJ79ompvBmGWsJdP/P4OGv1Yz2fuFXHYLS7k2eNba31cy51sI/q7+czSb6wG+Y5cssxNcA3Nrxbg==", + "version": "19.10.1", + "resolved": "https://registry.npmjs.org/@types/wordpress__components/-/wordpress__components-19.10.1.tgz", + "integrity": "sha512-zD+lrwMkh8ttnUQb6EUYZ55q6QGIwqqg0SfD8xX0kdinx/1KMKMUgInMkiVQ8ky56BIzADiYH3+A0Pdh76GAxw==", "dev": true, "requires": { "@types/react": "*", @@ -3767,14 +3767,14 @@ } }, "@wordpress/a11y": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-3.12.0.tgz", - "integrity": "sha512-Fu+flXsHwSiQ4fjzTHEVTdKoOzpY8wtQ6YMFZbpIolaAC/I5j1dKHgBAQvHsFyBlg6fHrx0FZV6Xr4DgfW6daA==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-3.14.0.tgz", + "integrity": "sha512-njZSjcgxuRHBaJKlu1sOyQxPxXEECD+RBV+pzlW4ivf3zzImcFfUk+WP7BXwfS48f88VfCevfNkGtiB5Cz3v6A==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/dom-ready": "^3.12.0", - "@wordpress/i18n": "^4.12.0" + "@wordpress/dom-ready": "^3.14.0", + "@wordpress/i18n": "^4.14.0" } }, "@wordpress/api-fetch": { @@ -4460,9 +4460,9 @@ "dev": true }, "@wordpress/components": { - "version": "19.14.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-19.14.0.tgz", - "integrity": "sha512-3RfCCqmgDJ52HW9rSi/EZoxeNdqvqVa3xIoMCN9v9I2BZzRNr+HHvGWIQDL4k3vDd7CcNFlzgZO1zeo3qhxPJg==", + "version": "19.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-19.16.0.tgz", + "integrity": "sha512-7GYIIBGD8Z0xaCw6k6qiWMTMQt8y01IvvKGgzoLYyoZqPwGyPK4DjCJVcILNHOivkI8mi+da3vq1ku9IkMNrPg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -4474,21 +4474,21 @@ "@emotion/utils": "1.0.0", "@floating-ui/react-dom": "0.6.3", "@use-gesture/react": "^10.2.6", - "@wordpress/a11y": "^3.12.0", - "@wordpress/compose": "^5.10.0", - "@wordpress/date": "^4.12.0", - "@wordpress/deprecated": "^3.12.0", - "@wordpress/dom": "^3.12.0", - "@wordpress/element": "^4.10.0", - "@wordpress/escape-html": "^2.12.0", - "@wordpress/hooks": "^3.12.0", - "@wordpress/i18n": "^4.12.0", - "@wordpress/icons": "^9.3.0", - "@wordpress/is-shallow-equal": "^4.12.0", - "@wordpress/keycodes": "^3.12.0", - "@wordpress/primitives": "^3.10.0", - "@wordpress/rich-text": "^5.10.0", - "@wordpress/warning": "^2.12.0", + "@wordpress/a11y": "^3.14.0", + "@wordpress/compose": "^5.12.0", + "@wordpress/date": "^4.14.0", + "@wordpress/deprecated": "^3.14.0", + "@wordpress/dom": "^3.14.0", + "@wordpress/element": "^4.12.0", + "@wordpress/escape-html": "^2.14.0", + "@wordpress/hooks": "^3.14.0", + "@wordpress/i18n": "^4.14.0", + "@wordpress/icons": "^9.5.0", + "@wordpress/is-shallow-equal": "^4.14.0", + "@wordpress/keycodes": "^3.14.0", + "@wordpress/primitives": "^3.12.0", + "@wordpress/rich-text": "^5.12.0", + "@wordpress/warning": "^2.14.0", "classnames": "^2.3.1", "colord": "^2.7.0", "dom-scroll-into-view": "^1.2.1", @@ -4513,84 +4513,55 @@ "integrity": "sha512-mQC2b3XLDs6QCW+pDQDiyO/EdGZYOygE8s5N5rrzjSI4M3IejPE/JPndCBwRT9z982aqQNi6beWs1UeayrQxxA==", "dev": true }, - "@wordpress/deprecated": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.12.0.tgz", - "integrity": "sha512-sep+c2jFwAZ4HTtPgIbNLC0YTz3q9gCH3A82XwY/krkvxhNk3g+mXxPUI2dUoxp7RAeeckqDtKosPvvpqUZWiQ==", + "@wordpress/compose": { + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-5.12.0.tgz", + "integrity": "sha512-ohK+uxazOqWWZ2BUyVFeNDy5/RJasfsnrs00f9O0BohaGUM4bp5daEnYHPMdjUpvzRTDEviiX0IMIEnc97N+JQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.12.0" + "@types/lodash": "^4.14.172", + "@types/mousetrap": "^1.6.8", + "@wordpress/deprecated": "^3.14.0", + "@wordpress/dom": "^3.14.0", + "@wordpress/element": "^4.12.0", + "@wordpress/is-shallow-equal": "^4.14.0", + "@wordpress/keycodes": "^3.14.0", + "@wordpress/priority-queue": "^2.14.0", + "clipboard": "^2.0.8", + "lodash": "^4.17.21", + "mousetrap": "^1.6.5", + "use-memo-one": "^1.1.1" } }, "@wordpress/element": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.10.0.tgz", - "integrity": "sha512-Ddi5nwd8/zPDITo2PCm30ffKxvbOEpW8krXzffnTace7TaqGzz7QuX6yOVdm6xXx3KZH/AADYPzCwthJKbKGEg==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.12.0.tgz", + "integrity": "sha512-QdpqJpdspuqV5qLmoETjZB/kTVqL/wIRJrvfEXJ4ozgIrf9zQaxgiFxwImJ35oXH7HR1iRBd/YBRer/fC93oYw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", - "@wordpress/escape-html": "^2.12.0", + "@wordpress/escape-html": "^2.14.0", "lodash": "^4.17.21", "react": "^17.0.2", "react-dom": "^17.0.2" } }, - "@wordpress/escape-html": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.12.0.tgz", - "integrity": "sha512-kuLtqEOHSIu53+HwHjCiz8THXhnhqFwsfFgr4gkZmv4n4NxLmGsMV2kMMZlRjWbTUSP0YN7Dix4uHx8JWlIRGg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0" - } - }, - "@wordpress/hooks": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.12.0.tgz", - "integrity": "sha512-DTf2VLBfrbuNQvBvz2m5Nbn44KEA4tHjo+1cIeDCZAuqBAKmeBGmJZA76lDs5Qu5nqfaixcOmfeVBEr29npJNg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0" - } - }, - "@wordpress/icons": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.3.0.tgz", - "integrity": "sha512-O07rhQ8H+9QbzeEi3Juf02aVow0Nm/jFFYwquh2mjmwCwqH0nmNi6l+iVipYGvaJUsHBfPnvL7ulD6udQI/9mQ==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0", - "@wordpress/element": "^4.10.0", - "@wordpress/primitives": "^3.10.0" - } - }, - "@wordpress/is-shallow-equal": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.12.0.tgz", - "integrity": "sha512-jlpHXPLJw0mG13bcbZIJwOd1DQozJ5+fbkkKA2JeTO5d5PXs44Rw6EYdGMLUU97B44UxIwVbaui7tJGOvzF8Dw==", + "@wordpress/priority-queue": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.14.0.tgz", + "integrity": "sha512-dXPsHqZQsI2xZ4WGq90iZLHliThbJI6+BF76YksLLYccaUW1LTzkQiEmub2pwdf9liMq/xocN07HdxMiI7HcRw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, - "@wordpress/primitives": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.10.0.tgz", - "integrity": "sha512-Wv11uj0ygb34KEaJHIjyqGrA9QRp3XWaIuW/elkwcl6qBDTmaeAy+hizDh6XVpLp7RaxkAj+dhBhTaH4yT79Kg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0", - "@wordpress/element": "^4.10.0", - "classnames": "^2.3.1" - } - }, "@wordpress/warning": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.12.0.tgz", - "integrity": "sha512-Xus/47T/F5yNjyuJEwBR8A1YSBppS1A8G+zD0Gt5Rn8x/4PAe1b2il8eoW8YIdHAFVM0PpZuWRhmN4f1y8mG7w==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.14.0.tgz", + "integrity": "sha512-qlfSTGkS6ei366OEPNe54DG0O3D/Ta1d4Xalx8Crgxm8xygncuxuuefWKAnnwgXfzsO4d4gs29hnTEzIMIaGcA==", "dev": true }, "dom-scroll-into-view": { @@ -4723,18 +4694,18 @@ } }, "@wordpress/data": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-6.12.0.tgz", - "integrity": "sha512-fnMfbYoGl3GqP7tDaArtRRizQznnh6cVT+tAZV8aDBICNkQ8za7BY+HcxEpviNb+JbHJJk6VEclaLjYhR3jLCQ==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-6.14.0.tgz", + "integrity": "sha512-m0SazQ6zlxRcm8iBcB/K06S4iCW+EZ1EXoEXILoaQ3AC2Kyibs262n/SSer8MRpPuwwOkpvS0ANgubT3MN/0SA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/compose": "^5.10.0", - "@wordpress/deprecated": "^3.12.0", - "@wordpress/element": "^4.10.0", - "@wordpress/is-shallow-equal": "^4.12.0", - "@wordpress/priority-queue": "^2.12.0", - "@wordpress/redux-routine": "^4.12.0", + "@wordpress/compose": "^5.12.0", + "@wordpress/deprecated": "^3.14.0", + "@wordpress/element": "^4.12.0", + "@wordpress/is-shallow-equal": "^4.14.0", + "@wordpress/priority-queue": "^2.14.0", + "@wordpress/redux-routine": "^4.14.0", "equivalent-key-map": "^0.2.2", "is-promise": "^4.0.0", "lodash": "^4.17.21", @@ -4743,64 +4714,104 @@ "use-memo-one": "^1.1.1" }, "dependencies": { + "@wordpress/compose": { + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-5.12.0.tgz", + "integrity": "sha512-ohK+uxazOqWWZ2BUyVFeNDy5/RJasfsnrs00f9O0BohaGUM4bp5daEnYHPMdjUpvzRTDEviiX0IMIEnc97N+JQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0", + "@types/lodash": "^4.14.172", + "@types/mousetrap": "^1.6.8", + "@wordpress/deprecated": "^3.14.0", + "@wordpress/dom": "^3.14.0", + "@wordpress/element": "^4.12.0", + "@wordpress/is-shallow-equal": "^4.14.0", + "@wordpress/keycodes": "^3.14.0", + "@wordpress/priority-queue": "^2.14.0", + "clipboard": "^2.0.8", + "lodash": "^4.17.21", + "mousetrap": "^1.6.5", + "use-memo-one": "^1.1.1" + } + }, "@wordpress/deprecated": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.12.0.tgz", - "integrity": "sha512-sep+c2jFwAZ4HTtPgIbNLC0YTz3q9gCH3A82XwY/krkvxhNk3g+mXxPUI2dUoxp7RAeeckqDtKosPvvpqUZWiQ==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.14.0.tgz", + "integrity": "sha512-Nvx2/sLjzeIcIAJTBwmYxJ1yKkWd+yfZze1bByPkhndo+y0ImNap3NUrl+inOgtNbZiVkj9QafmaCwaogjp9xQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.12.0" + "@wordpress/hooks": "^3.14.0" + } + }, + "@wordpress/dom": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.14.0.tgz", + "integrity": "sha512-U31BuODuyXsllErsURVITJNXdJGmoZoRWwnREOlxLfKZymmFFnNWvSJRqrB2ZLnUMc/qwQoX27LoK76CRl5vzQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0", + "@wordpress/deprecated": "^3.8.0", + "lodash": "^4.17.21" } }, "@wordpress/element": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.10.0.tgz", - "integrity": "sha512-Ddi5nwd8/zPDITo2PCm30ffKxvbOEpW8krXzffnTace7TaqGzz7QuX6yOVdm6xXx3KZH/AADYPzCwthJKbKGEg==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.12.0.tgz", + "integrity": "sha512-QdpqJpdspuqV5qLmoETjZB/kTVqL/wIRJrvfEXJ4ozgIrf9zQaxgiFxwImJ35oXH7HR1iRBd/YBRer/fC93oYw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", - "@wordpress/escape-html": "^2.12.0", + "@wordpress/escape-html": "^2.14.0", "lodash": "^4.17.21", "react": "^17.0.2", "react-dom": "^17.0.2" } }, - "@wordpress/escape-html": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.12.0.tgz", - "integrity": "sha512-kuLtqEOHSIu53+HwHjCiz8THXhnhqFwsfFgr4gkZmv4n4NxLmGsMV2kMMZlRjWbTUSP0YN7Dix4uHx8JWlIRGg==", + "@wordpress/hooks": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.14.0.tgz", + "integrity": "sha512-bcQXql4A1VI6gnTdNzMjdHLGTpnf8oWOQ1r8B8fcvtOF3dKictxJPobarWxFbtVTQoegizZT/lPCMoLsnVJpug==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, - "@wordpress/hooks": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.12.0.tgz", - "integrity": "sha512-DTf2VLBfrbuNQvBvz2m5Nbn44KEA4tHjo+1cIeDCZAuqBAKmeBGmJZA76lDs5Qu5nqfaixcOmfeVBEr29npJNg==", + "@wordpress/i18n": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.14.0.tgz", + "integrity": "sha512-46ryvPbh139RkLXQt8oey4aCcWo6HRKb1NLVHU4a4kJ4HRD/HLhAeTHKAMiZFWTg+QC1HZC32vGdEikqrpnlzQ==", "dev": true, "requires": { - "@babel/runtime": "^7.16.0" + "@babel/runtime": "^7.16.0", + "@wordpress/hooks": "^3.14.0", + "gettext-parser": "^1.3.1", + "lodash": "^4.17.21", + "memize": "^1.1.0", + "sprintf-js": "^1.1.1", + "tannin": "^1.2.0" } }, - "@wordpress/is-shallow-equal": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.12.0.tgz", - "integrity": "sha512-jlpHXPLJw0mG13bcbZIJwOd1DQozJ5+fbkkKA2JeTO5d5PXs44Rw6EYdGMLUU97B44UxIwVbaui7tJGOvzF8Dw==", + "@wordpress/keycodes": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.14.0.tgz", + "integrity": "sha512-hUHRMCWil4eKauzCWtYSry8i1wxa1cegUqjZ3OASzefZvCrMv6TNuRXohp+hNLWGWWMbP0I2Pcrd0WuGcmlSqg==", "dev": true, "requires": { - "@babel/runtime": "^7.16.0" + "@babel/runtime": "^7.16.0", + "@wordpress/i18n": "^4.14.0", + "lodash": "^4.17.21" } } } }, "@wordpress/date": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-4.12.0.tgz", - "integrity": "sha512-WorVLXLjfzfwI7dv9shd+sirym7nsJYAdh82gEJqSb+sY3qabyiPSnTMcfWgN7j+0/jJP9dXFV81hG+DRJgIEQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-4.14.0.tgz", + "integrity": "sha512-HrYZX7pY2yJjsaeAv11aQRqoF2rtVmhoG1X44gL3ddA4kcFBqeBMngKS6WunsS7z/x5lunWv7Kr0iIv05vh6Vw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -4819,19 +4830,19 @@ } }, "@wordpress/deprecated": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.8.0.tgz", - "integrity": "sha512-ObZz2XjYEL/M0izpqvwxwidHZi1uZvGDwhOgvNwCpqfJiN1rA5F0GAVByDu2iOBBw49pSDK/DUn4m0umKoyeCA==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.14.0.tgz", + "integrity": "sha512-Nvx2/sLjzeIcIAJTBwmYxJ1yKkWd+yfZze1bByPkhndo+y0ImNap3NUrl+inOgtNbZiVkj9QafmaCwaogjp9xQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.8.0" + "@wordpress/hooks": "^3.14.0" } }, "@wordpress/dom": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.12.0.tgz", - "integrity": "sha512-OliLqayM41MwfsCzLAg6wZWKnO28fLX50igGODVm5qtZUQMBDNhz3sX0T1OpB7P+UFOx/KffAkuk6HNi2NXKTQ==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.14.0.tgz", + "integrity": "sha512-U31BuODuyXsllErsURVITJNXdJGmoZoRWwnREOlxLfKZymmFFnNWvSJRqrB2ZLnUMc/qwQoX27LoK76CRl5vzQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -4840,36 +4851,35 @@ } }, "@wordpress/dom-ready": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.12.0.tgz", - "integrity": "sha512-+IzRp/Vo2TkBQ72C9t/PETXbyPJPgr9DZmhbaYz8/RuTq/E5GcHPfEkKgjXNhDjOVxtjUb3Ut03EioGI6XFpAg==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.14.0.tgz", + "integrity": "sha512-EftNWZlWN17ghjvCfuCnl/kSl1UdfgnOk92hASI2A+vRE8vsHvdx/d+/jZ9sC6I3QIGE7y1OVAnpWdQpC9m6lg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/element": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.10.0.tgz", - "integrity": "sha512-Ddi5nwd8/zPDITo2PCm30ffKxvbOEpW8krXzffnTace7TaqGzz7QuX6yOVdm6xXx3KZH/AADYPzCwthJKbKGEg==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.12.0.tgz", + "integrity": "sha512-QdpqJpdspuqV5qLmoETjZB/kTVqL/wIRJrvfEXJ4ozgIrf9zQaxgiFxwImJ35oXH7HR1iRBd/YBRer/fC93oYw==", + "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", - "@wordpress/escape-html": "^2.12.0", + "@wordpress/escape-html": "^2.14.0", "lodash": "^4.17.21", "react": "^17.0.2", "react-dom": "^17.0.2" - }, - "dependencies": { - "@wordpress/escape-html": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.12.0.tgz", - "integrity": "sha512-kuLtqEOHSIu53+HwHjCiz8THXhnhqFwsfFgr4gkZmv4n4NxLmGsMV2kMMZlRjWbTUSP0YN7Dix4uHx8JWlIRGg==", - "requires": { - "@babel/runtime": "^7.16.0" - } - } + } + }, + "@wordpress/escape-html": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.14.0.tgz", + "integrity": "sha512-y8wlJuT2ze6bf6a/vW6T1hnUxm8WD8CERYU133NpiNeQV3GJffw2tGimhasHwhN7hCfH1iPkY4od5RkclHxnRw==", + "requires": { + "@babel/runtime": "^7.16.0" } }, "@wordpress/eslint-plugin": { @@ -4927,9 +4937,9 @@ } }, "@wordpress/hooks": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.8.0.tgz", - "integrity": "sha512-PSBFYs7pH6BFcIuUUX6TQThSVSWtFpcYTfyIRVz26FsptRbCOXUzxHVKc5ofawTmcrOPyvAeDpEiVGJ1UOm8Lw==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.14.0.tgz", + "integrity": "sha512-bcQXql4A1VI6gnTdNzMjdHLGTpnf8oWOQ1r8B8fcvtOF3dKictxJPobarWxFbtVTQoegizZT/lPCMoLsnVJpug==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -4945,39 +4955,53 @@ } }, "@wordpress/i18n": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.12.0.tgz", - "integrity": "sha512-UTccrAOZ03nszzlG74G+ZkMR/kK0PoS1fqFa8NRFAhHneYadJOnsgCCd5YgDAsN+tAKA6QM7RPmpQMwujvIbzA==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.14.0.tgz", + "integrity": "sha512-46ryvPbh139RkLXQt8oey4aCcWo6HRKb1NLVHU4a4kJ4HRD/HLhAeTHKAMiZFWTg+QC1HZC32vGdEikqrpnlzQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.12.0", + "@wordpress/hooks": "^3.14.0", "gettext-parser": "^1.3.1", "lodash": "^4.17.21", "memize": "^1.1.0", "sprintf-js": "^1.1.1", "tannin": "^1.2.0" + } + }, + "@wordpress/icons": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.5.0.tgz", + "integrity": "sha512-nwjLoNt7wSQbtz//XkE3zdNY9HRlakAWq0ttauWpV6NwI/Wiz6Bm1+l4v15olWnOh2akikGfc8UFO5M0ZmbQqw==", + "requires": { + "@babel/runtime": "^7.16.0", + "@wordpress/element": "^4.12.0", + "@wordpress/primitives": "^3.12.0" }, "dependencies": { - "@wordpress/hooks": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.12.0.tgz", - "integrity": "sha512-DTf2VLBfrbuNQvBvz2m5Nbn44KEA4tHjo+1cIeDCZAuqBAKmeBGmJZA76lDs5Qu5nqfaixcOmfeVBEr29npJNg==", - "dev": true, + "@wordpress/element": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.12.0.tgz", + "integrity": "sha512-QdpqJpdspuqV5qLmoETjZB/kTVqL/wIRJrvfEXJ4ozgIrf9zQaxgiFxwImJ35oXH7HR1iRBd/YBRer/fC93oYw==", "requires": { - "@babel/runtime": "^7.16.0" + "@babel/runtime": "^7.16.0", + "@types/react": "^17.0.37", + "@types/react-dom": "^17.0.11", + "@wordpress/escape-html": "^2.14.0", + "lodash": "^4.17.21", + "react": "^17.0.2", + "react-dom": "^17.0.2" } } } }, - "@wordpress/icons": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.3.0.tgz", - "integrity": "sha512-O07rhQ8H+9QbzeEi3Juf02aVow0Nm/jFFYwquh2mjmwCwqH0nmNi6l+iVipYGvaJUsHBfPnvL7ulD6udQI/9mQ==", + "@wordpress/is-shallow-equal": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.14.0.tgz", + "integrity": "sha512-FVpuU3GmvZFvjcuIKcraNH46vEZzz+FCpujjqCzcyWNGUsg7wpfGNVoDWs5LWFA4EELHL2+p8Ff9RZX237b5Kg==", + "dev": true, "requires": { - "@babel/runtime": "^7.16.0", - "@wordpress/element": "^4.10.0", - "@wordpress/primitives": "^3.10.0" + "@babel/runtime": "^7.16.0" } }, "@wordpress/jest-console": { @@ -5178,13 +5202,13 @@ } }, "@wordpress/keycodes": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.12.0.tgz", - "integrity": "sha512-wZQa8T2rgJnoJHG9Bmp0E1WNQOKK6awf0elnzEKs8UleauDKHJIMdiILq74bNz3SptVKkehdCsa8wpE9HuB8Kw==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.14.0.tgz", + "integrity": "sha512-hUHRMCWil4eKauzCWtYSry8i1wxa1cegUqjZ3OASzefZvCrMv6TNuRXohp+hNLWGWWMbP0I2Pcrd0WuGcmlSqg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.12.0", + "@wordpress/i18n": "^4.14.0", "lodash": "^4.17.21" } }, @@ -5396,28 +5420,44 @@ "dev": true }, "@wordpress/primitives": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.10.0.tgz", - "integrity": "sha512-Wv11uj0ygb34KEaJHIjyqGrA9QRp3XWaIuW/elkwcl6qBDTmaeAy+hizDh6XVpLp7RaxkAj+dhBhTaH4yT79Kg==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.12.0.tgz", + "integrity": "sha512-/mlWDw9JFFrptAQz6ur9ui9sqFfBbDI79Bm4rJdas0vRxBfUhMNUPKybjCaN/zmalnD1c1lLHuyaOW2ryT1Ivw==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/element": "^4.10.0", + "@wordpress/element": "^4.12.0", "classnames": "^2.3.1" + }, + "dependencies": { + "@wordpress/element": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.12.0.tgz", + "integrity": "sha512-QdpqJpdspuqV5qLmoETjZB/kTVqL/wIRJrvfEXJ4ozgIrf9zQaxgiFxwImJ35oXH7HR1iRBd/YBRer/fC93oYw==", + "requires": { + "@babel/runtime": "^7.16.0", + "@types/react": "^17.0.37", + "@types/react-dom": "^17.0.11", + "@wordpress/escape-html": "^2.14.0", + "lodash": "^4.17.21", + "react": "^17.0.2", + "react-dom": "^17.0.2" + } + } } }, "@wordpress/priority-queue": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.12.0.tgz", - "integrity": "sha512-W/Foka//VcqY1D8fYXUE196tCm4ExH4qo6HFNyQU0VAwMI0ypKH+b9wgybfC7e+Hj2lTFZQVQOJgsGE/qZiufw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.14.0.tgz", + "integrity": "sha512-dXPsHqZQsI2xZ4WGq90iZLHliThbJI6+BF76YksLLYccaUW1LTzkQiEmub2pwdf9liMq/xocN07HdxMiI7HcRw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/redux-routine": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-4.12.0.tgz", - "integrity": "sha512-PLheKMgvYcbOiQzwGQfpbdA04DGWTE08LSrkgM5VWJT8hcoS/RIWvxNph3MXSPx1lXLhN6d0CqjOSkuDI/xbfw==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-4.14.0.tgz", + "integrity": "sha512-vgjR7i+2r69Dp16d11KTVdHEcQTjk7eq6SaUtva3YKs3s2e5CTjDcQKEafSzwWQo5OyHK+wkwnnIsjZ3He9anA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -5427,110 +5467,94 @@ } }, "@wordpress/rich-text": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-5.10.0.tgz", - "integrity": "sha512-9FZbW8/d083IM4pt8Uq89Idn4iFkkXvwLPcKs8QSr5wIjSbGMuCfnKF9UzWC70Hs4dIfIWHxdLiWzQ1+zi9ljw==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-5.12.0.tgz", + "integrity": "sha512-iL9jUF0LJweGCh4SZMB+CLMENUGktgPYHv0tSaX/EjA/Ph80Grz8ah2PH8fQUH4349Zc/+AGXgn/6cUzdvD0WA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.12.0", - "@wordpress/compose": "^5.10.0", - "@wordpress/data": "^6.12.0", - "@wordpress/element": "^4.10.0", - "@wordpress/escape-html": "^2.12.0", - "@wordpress/i18n": "^4.12.0", - "@wordpress/keycodes": "^3.12.0", + "@wordpress/a11y": "^3.14.0", + "@wordpress/compose": "^5.12.0", + "@wordpress/data": "^6.14.0", + "@wordpress/element": "^4.12.0", + "@wordpress/escape-html": "^2.14.0", + "@wordpress/i18n": "^4.14.0", + "@wordpress/keycodes": "^3.14.0", "lodash": "^4.17.21", "memize": "^1.1.0", "rememo": "^4.0.0" }, "dependencies": { - "@wordpress/data": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-6.12.0.tgz", - "integrity": "sha512-fnMfbYoGl3GqP7tDaArtRRizQznnh6cVT+tAZV8aDBICNkQ8za7BY+HcxEpviNb+JbHJJk6VEclaLjYhR3jLCQ==", + "@wordpress/compose": { + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-5.12.0.tgz", + "integrity": "sha512-ohK+uxazOqWWZ2BUyVFeNDy5/RJasfsnrs00f9O0BohaGUM4bp5daEnYHPMdjUpvzRTDEviiX0IMIEnc97N+JQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/compose": "^5.10.0", - "@wordpress/deprecated": "^3.12.0", - "@wordpress/element": "^4.10.0", - "@wordpress/is-shallow-equal": "^4.12.0", - "@wordpress/priority-queue": "^2.12.0", - "@wordpress/redux-routine": "^4.12.0", - "equivalent-key-map": "^0.2.2", - "is-promise": "^4.0.0", + "@types/lodash": "^4.14.172", + "@types/mousetrap": "^1.6.8", + "@wordpress/deprecated": "^3.14.0", + "@wordpress/dom": "^3.14.0", + "@wordpress/element": "^4.12.0", + "@wordpress/is-shallow-equal": "^4.14.0", + "@wordpress/keycodes": "^3.14.0", + "@wordpress/priority-queue": "^2.14.0", + "clipboard": "^2.0.8", "lodash": "^4.17.21", - "redux": "^4.1.2", - "turbo-combine-reducers": "^1.0.2", + "mousetrap": "^1.6.5", "use-memo-one": "^1.1.1" } }, - "@wordpress/deprecated": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.12.0.tgz", - "integrity": "sha512-sep+c2jFwAZ4HTtPgIbNLC0YTz3q9gCH3A82XwY/krkvxhNk3g+mXxPUI2dUoxp7RAeeckqDtKosPvvpqUZWiQ==", + "@wordpress/data": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-6.14.0.tgz", + "integrity": "sha512-m0SazQ6zlxRcm8iBcB/K06S4iCW+EZ1EXoEXILoaQ3AC2Kyibs262n/SSer8MRpPuwwOkpvS0ANgubT3MN/0SA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.12.0" + "@wordpress/compose": "^5.12.0", + "@wordpress/deprecated": "^3.14.0", + "@wordpress/element": "^4.12.0", + "@wordpress/is-shallow-equal": "^4.14.0", + "@wordpress/priority-queue": "^2.14.0", + "@wordpress/redux-routine": "^4.14.0", + "equivalent-key-map": "^0.2.2", + "is-promise": "^4.0.0", + "lodash": "^4.17.21", + "redux": "^4.1.2", + "turbo-combine-reducers": "^1.0.2", + "use-memo-one": "^1.1.1" } }, "@wordpress/element": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.10.0.tgz", - "integrity": "sha512-Ddi5nwd8/zPDITo2PCm30ffKxvbOEpW8krXzffnTace7TaqGzz7QuX6yOVdm6xXx3KZH/AADYPzCwthJKbKGEg==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-4.12.0.tgz", + "integrity": "sha512-QdpqJpdspuqV5qLmoETjZB/kTVqL/wIRJrvfEXJ4ozgIrf9zQaxgiFxwImJ35oXH7HR1iRBd/YBRer/fC93oYw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", - "@wordpress/escape-html": "^2.12.0", + "@wordpress/escape-html": "^2.14.0", "lodash": "^4.17.21", "react": "^17.0.2", "react-dom": "^17.0.2" } }, - "@wordpress/escape-html": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.12.0.tgz", - "integrity": "sha512-kuLtqEOHSIu53+HwHjCiz8THXhnhqFwsfFgr4gkZmv4n4NxLmGsMV2kMMZlRjWbTUSP0YN7Dix4uHx8JWlIRGg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0" - } - }, - "@wordpress/hooks": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.12.0.tgz", - "integrity": "sha512-DTf2VLBfrbuNQvBvz2m5Nbn44KEA4tHjo+1cIeDCZAuqBAKmeBGmJZA76lDs5Qu5nqfaixcOmfeVBEr29npJNg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0" - } - }, - "@wordpress/is-shallow-equal": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.12.0.tgz", - "integrity": "sha512-jlpHXPLJw0mG13bcbZIJwOd1DQozJ5+fbkkKA2JeTO5d5PXs44Rw6EYdGMLUU97B44UxIwVbaui7tJGOvzF8Dw==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0" - } - }, "@wordpress/priority-queue": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.12.0.tgz", - "integrity": "sha512-W/Foka//VcqY1D8fYXUE196tCm4ExH4qo6HFNyQU0VAwMI0ypKH+b9wgybfC7e+Hj2lTFZQVQOJgsGE/qZiufw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.14.0.tgz", + "integrity": "sha512-dXPsHqZQsI2xZ4WGq90iZLHliThbJI6+BF76YksLLYccaUW1LTzkQiEmub2pwdf9liMq/xocN07HdxMiI7HcRw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/redux-routine": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-4.12.0.tgz", - "integrity": "sha512-PLheKMgvYcbOiQzwGQfpbdA04DGWTE08LSrkgM5VWJT8hcoS/RIWvxNph3MXSPx1lXLhN6d0CqjOSkuDI/xbfw==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-4.14.0.tgz", + "integrity": "sha512-vgjR7i+2r69Dp16d11KTVdHEcQTjk7eq6SaUtva3YKs3s2e5CTjDcQKEafSzwWQo5OyHK+wkwnnIsjZ3He9anA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", diff --git a/package.json b/package.json index f9f011f65..d64fe51af 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "lasttranslator": "Themeisle Translate Team " }, "dependencies": { - "@wordpress/icons": "^9.3.0", + "@wordpress/icons": "^9.5.0", "array-move": "^3.0.1", "classnames": "^2.3.1", "currency-symbol-map": "^5.0.1", @@ -56,13 +56,13 @@ "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", "@types/wordpress__block-editor": "^7.0.0", - "@types/wordpress__components": "^19.10.0", + "@types/wordpress__components": "^19.10.1", "@wordpress/block-editor": "^9.4.0", - "@wordpress/components": "^19.14.0", + "@wordpress/components": "^19.16.0", "@wordpress/compose": "^5.10.0", - "@wordpress/data": "^6.12.0", - "@wordpress/dom-ready": "^3.12.0", - "@wordpress/element": "^4.10.0", + "@wordpress/data": "^6.14.0", + "@wordpress/dom-ready": "^3.14.0", + "@wordpress/element": "^4.12.0", "@wordpress/scripts": "^22.5.0", "conventional-changelog-simple-preset": "^1.0.20", "eslint-config-wordpress": "^2.0.0", diff --git a/plugins/otter-pro/inc/render/class-woo-comparison-block.php b/plugins/otter-pro/inc/render/class-woo-comparison-block.php index 88fd651a2..12910c00e 100644 --- a/plugins/otter-pro/inc/render/class-woo-comparison-block.php +++ b/plugins/otter-pro/inc/render/class-woo-comparison-block.php @@ -108,6 +108,7 @@ public function render( $attributes ) { $output = '
'; $output .= ob_get_contents(); $output .= '
'; + $output .= ''; ob_end_clean(); return $output; } diff --git a/src/animation/editor.scss b/src/animation/editor.scss index 1d1a07aad..959abfcf3 100644 --- a/src/animation/editor.scss +++ b/src/animation/editor.scss @@ -118,20 +118,3 @@ top: 16px; } } - -.o-anim-typing-caret::after { - font-weight: 100; - content: '|'; - color: #2E3D48; - animation: 1s blink step-end infinite; - } - - @keyframes blink { - from, to { - color: transparent; - } - 50% { - color: black; - } - } - diff --git a/src/animation/frontend/typing/index.js b/src/animation/frontend/typing/index.js index f8e44a365..b250f1225 100644 --- a/src/animation/frontend/typing/index.js +++ b/src/animation/frontend/typing/index.js @@ -105,9 +105,38 @@ domReady( () => { threshold: [ 0.6 ] }; + let styles = ` + .o-anim-typing-caret::after { + font-weight: 100; + content: '|'; + color: #2E3D48; + animation: 1s blink step-end infinite; + } + + @keyframes blink { + from, to { + color: transparent; + } + 50% { + color: black; + } + } + `; + + styles = styles.replace( /(\r\n|\n|\r|\t)/gm, '' ); + + let hasStyles = false; + setTimeout( () => { const anims = document.querySelectorAll( 'o-anim-typing' ); anims.forEach( ( elem ) => { + if ( ! hasStyles ) { + const styleSheet = document.createElement( 'style' ); + styleSheet.innerText = styles; + document.head.appendChild( styleSheet ); + hasStyles = true; + } + const startTyping = initTyping( elem ); const observer = new IntersectionObserver( ( entries ) => { entries.forEach( entry => { diff --git a/src/blocks/blocks/section/column/inspector.js b/src/blocks/blocks/section/column/inspector.js index 300b6eb90..ab0ef2b87 100644 --- a/src/blocks/blocks/section/column/inspector.js +++ b/src/blocks/blocks/section/column/inspector.js @@ -39,7 +39,10 @@ import ResponsiveControl from '../../../components/responsive-control/index.js'; import BackgroundSelectorControl from '../../../components/background-selector-control/index.js'; import ControlPanelControl from '../../../components/control-panel-control/index.js'; import SyncControl from '../../../components/sync-control/index.js'; -import { isNullObject } from '../../../helpers/helper-functions.js'; +import { + isNullObject, + removeBoxDefaultValues +} from '../../../helpers/helper-functions.js'; /** * @@ -94,9 +97,9 @@ const Inspector = ({ case 'Desktop': return getValue( 'padding' ); case 'Tablet': - return merge( getValue( 'padding' ), getValue( 'paddingTablet' ) ); + return merge({ ...getValue( 'padding' ) }, getValue( 'paddingTablet' ) ); case 'Mobile': - return merge( getValue( 'padding' ), getValue( 'paddingTablet' ), getValue( 'paddingMobile' ) ); + return merge({ ...getValue( 'padding' ) }, getValue( 'paddingTablet' ), getValue( 'paddingMobile' ) ); default: return undefined; } @@ -111,9 +114,9 @@ const Inspector = ({ case 'Desktop': return setAttributes({ padding: value }); case 'Tablet': - return setAttributes({ paddingTablet: value }); + return setAttributes({ paddingTablet: removeBoxDefaultValues( value, attributes.padding ) }); case 'Mobile': - return setAttributes({ paddingMobile: value }); + return setAttributes({ paddingMobile: removeBoxDefaultValues( value, { ...attributes.padding, ...attributes.paddingTablet }) }); default: return undefined; } @@ -137,9 +140,9 @@ const Inspector = ({ case 'Desktop': return getValue( 'margin' ); case 'Tablet': - return merge( getValue( 'margin' ), getValue( 'marginTablet' ) ); + return merge({ ...getValue( 'margin' ) }, getValue( 'marginTablet' ) ); case 'Mobile': - return merge( getValue( 'margin' ), getValue( 'marginTablet' ), getValue( 'marginMobile' ) ); + return merge({ ...getValue( 'margin' ) }, getValue( 'marginTablet' ), getValue( 'marginMobile' ) ); default: return undefined; } @@ -154,9 +157,9 @@ const Inspector = ({ case 'Desktop': return setAttributes({ margin: value }); case 'Tablet': - return setAttributes({ marginTablet: value }); + return setAttributes({ marginTablet: removeBoxDefaultValues( value, attributes.margin ) }); case 'Mobile': - return setAttributes({ marginMobile: value }); + return setAttributes({ marginMobile: removeBoxDefaultValues( value, { ...attributes.margin, ...attributes.marginTablet }) }); default: return undefined; } diff --git a/src/blocks/blocks/section/columns/inspector.js b/src/blocks/blocks/section/columns/inspector.js index e54d156ae..9bb5c08e9 100644 --- a/src/blocks/blocks/section/columns/inspector.js +++ b/src/blocks/blocks/section/columns/inspector.js @@ -44,7 +44,10 @@ import ControlPanelControl from '../../../components/control-panel-control/index import HTMLAnchorControl from '../../../components/html-anchor-control/index.js'; import BackgroundSelectorControl from '../../../components/background-selector-control/index.js'; import SyncControl from '../../../components/sync-control/index.js'; -import { isNullObject } from '../../../helpers/helper-functions.js'; +import { + isNullObject, + removeBoxDefaultValues +} from '../../../helpers/helper-functions.js'; import ToogleGroupControl from '../../../components/toogle-group-control/index.js'; /** @@ -131,9 +134,9 @@ const Inspector = ({ case 'Desktop': return getValue( 'padding' ); case 'Tablet': - return merge( getValue( 'padding' ), getValue( 'paddingTablet' ) ); + return merge({ ...getValue( 'padding' ) }, getValue( 'paddingTablet' ) ); case 'Mobile': - return merge( getValue( 'padding' ), getValue( 'paddingTablet' ), getValue( 'paddingMobile' ) ) ; + return merge({ ...getValue( 'padding' ) }, getValue( 'paddingTablet' ), getValue( 'paddingMobile' ) ) ; default: return undefined; } @@ -148,9 +151,9 @@ const Inspector = ({ case 'Desktop': return setAttributes({ padding: value }); case 'Tablet': - return setAttributes({ paddingTablet: value }); + return setAttributes({ paddingTablet: removeBoxDefaultValues( value, attributes.padding ) }); case 'Mobile': - return setAttributes({ paddingMobile: value }); + return setAttributes({ paddingMobile: removeBoxDefaultValues( value, { ...attributes.padding, ...attributes.paddingTablet }) }); default: return undefined; } @@ -174,9 +177,9 @@ const Inspector = ({ case 'Desktop': return getValue( 'margin' ); case 'Tablet': - return merge( getValue( 'margin' ), getValue( 'marginTablet' ) ); + return merge({ ...getValue( 'margin' ) }, getValue( 'marginTablet' ) ); case 'Mobile': - return merge( getValue( 'margin' ), getValue( 'marginTablet' ), getValue( 'marginMobile' ) ); + return merge({ ...getValue( 'margin' ) }, getValue( 'marginTablet' ), getValue( 'marginMobile' ) ); default: return undefined; } @@ -187,8 +190,6 @@ const Inspector = ({ value = undefined; } - console.log( value ); - if ( 'object' === typeof value ) { value = Object.fromEntries( Object.entries( value ).filter( ([ _, v ]) => null !== v ) ); } @@ -197,9 +198,9 @@ const Inspector = ({ case 'Desktop': return setAttributes({ margin: value }); case 'Tablet': - return setAttributes({ marginTablet: value }); + return setAttributes({ marginTablet: removeBoxDefaultValues( value, attributes.margin ) }); case 'Mobile': - return setAttributes({ marginMobile: value }); + return setAttributes({ marginMobile: removeBoxDefaultValues( value, { ...attributes.margin, ...attributes.marginTablet }) }); default: return undefined; } diff --git a/src/blocks/frontend/sticky/index.js b/src/blocks/frontend/sticky/index.js index 46aede48b..2c606871d 100644 --- a/src/blocks/frontend/sticky/index.js +++ b/src/blocks/frontend/sticky/index.js @@ -446,8 +446,26 @@ domReady( () => { const elems = document.querySelectorAll( '.o-sticky' ); const observer = createObserver(); + let styles = ` + .o-is-sticky { + position: fixed; + z-index: 9999; + } + `; + + styles = styles.replace( /(\r\n|\n|\r|\t)/gm, '' ); + + let hasStyles = false; + detectLoading( () => { elems.forEach( ( elem ) => { + if ( ! hasStyles ) { + const styleSheet = document.createElement( 'style' ); + styleSheet.innerText = styles; + document.head.appendChild( styleSheet ); + hasStyles = true; + } + const config = getConfigOptions( elem ); const container = getStickyContainer( elem, config.scope ); diff --git a/src/blocks/index.js b/src/blocks/index.js index 89774e4e1..8e212ffe8 100644 --- a/src/blocks/index.js +++ b/src/blocks/index.js @@ -14,7 +14,6 @@ import { addFilter } from '@wordpress/hooks'; /** * Internal dependencies */ -import './style.scss'; import './editor.scss'; import { otterIcon, diff --git a/src/blocks/plugins/menu-icons/index.js b/src/blocks/plugins/menu-icons/index.js index 87f6a5a9f..03f1ab0ff 100644 --- a/src/blocks/plugins/menu-icons/index.js +++ b/src/blocks/plugins/menu-icons/index.js @@ -23,7 +23,6 @@ import { addFilter } from '@wordpress/hooks'; /** * Internal dependencies. */ -import './style.scss'; import './editor.scss'; const IconPickerControl = lazy( () => import( '../../components/icon-picker-control/toolbar.js' ) ); diff --git a/src/blocks/plugins/menu-icons/style.scss b/src/blocks/plugins/menu-icons/inline.scss similarity index 78% rename from src/blocks/plugins/menu-icons/style.scss rename to src/blocks/plugins/menu-icons/inline.scss index 3ce22ffbe..aa44afeb0 100644 --- a/src/blocks/plugins/menu-icons/style.scss +++ b/src/blocks/plugins/menu-icons/inline.scss @@ -1,3 +1,7 @@ +// +// Notice: This CSS is added inline in the class-registration.php file using `wp_add_inline_style( 'font-awesome-5', $styles );` function. +// + .fas, .fab, .far { diff --git a/src/blocks/style.scss b/src/blocks/style.scss deleted file mode 100644 index f76dc42b2..000000000 --- a/src/blocks/style.scss +++ /dev/null @@ -1,32 +0,0 @@ -.otter-masonry { - .blocks-gallery-grid { - .blocks-gallery-item { - img { - width: 100%; - } - } - } -} - -.wp-block-themeisle-blocks-woo-comparison { - .nv-ct-layout-row { - tbody { - tr { - td { - &:first-child { - border-left: 1px solid var(--border-color); - } - } - } - } - } -} - -.o-is-sticky { - position: fixed; - z-index: 9999; -} - -.o-woocommerce-builder .woocommerce-product-gallery { - width: 100% !important; -} diff --git a/src/css/editor.js b/src/css/editor.js index c4ec29c28..20b9900e3 100644 --- a/src/css/editor.js +++ b/src/css/editor.js @@ -140,7 +140,7 @@ const CSSEditor = ({ diff --git a/src/dashboard/components/pages/Dashboard.js b/src/dashboard/components/pages/Dashboard.js index 4f3631ff1..f6d6eba97 100644 --- a/src/dashboard/components/pages/Dashboard.js +++ b/src/dashboard/components/pages/Dashboard.js @@ -107,6 +107,16 @@ const Dashboard = ({ /> + + updateOption( 'themeisle_blocks_settings_optimize_animations_css', ! Boolean( getOption( 'themeisle_blocks_settings_optimize_animations_css' ) ) ) } + /> + +