Skip to content

Commit

Permalink
Merge pull request #859 from publishpress/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
htmgarcia authored Feb 8, 2022
2 parents dec486a + 76e4b73 commit 1e14814
Show file tree
Hide file tree
Showing 22 changed files with 633 additions and 339 deletions.
16 changes: 10 additions & 6 deletions src/advanced-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Plugin Name: PublishPress Blocks
* Plugin URI: https://publishpress.com/blocks/
* Description: PublishPress Blocks has everything you need to build professional websites with the Gutenberg editor.
* Version: 2.11.3
* Tested up to: 5.8.3
* Version: 2.11.4
* Tested up to: 5.9
* Author: PublishPress
* Author URI: https://publishpress.com/
* License: GPL2
Expand Down Expand Up @@ -39,7 +39,7 @@
defined('ABSPATH') || die;

if (! defined('ADVANCED_GUTENBERG_VERSION')) {
define('ADVANCED_GUTENBERG_VERSION', '2.11.3');
define('ADVANCED_GUTENBERG_VERSION', '2.11.4');
}

if (! defined('ADVANCED_GUTENBERG_PLUGIN')) {
Expand All @@ -49,9 +49,13 @@
// Code shared with Pro version
require_once __DIR__ . '/init.php';

// Vendor
if( file_exists(__DIR__ . '/vendor/autoload.php') && !defined('ADVANCED_GUTENBERG_VENDOR_LOADED') && is_admin() ) {

// Vendor and Ask-for-Review
if(
file_exists(__DIR__ . '/vendor/autoload.php')
&& !defined('ADVANCED_GUTENBERG_VENDOR_LOADED')
&& is_admin()
&& !class_exists('PublishPress\WordPressReviews\ReviewsController')
) {
require_once __DIR__ . '/vendor/autoload.php';
define('ADVANCED_GUTENBERG_VENDOR_LOADED', true);

Expand Down
10 changes: 10 additions & 0 deletions src/assets/blocks/advaccordion/frontend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
jQuery(document).ready(function($){
$(".advgb-accordion-wrapper").each(function() {
$(this).accordion({
header: "> div > .advgb-accordion-header",
heightStyle: "content",
collapsible: true,
active: $(this).data("collapsed") ? false : 0,
});
});
});
6 changes: 3 additions & 3 deletions src/assets/blocks/advtabs/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,16 @@
} ) }
</div>
<div className="advgb-tabs-styles">
{TABS_STYLES.map((style, index) => (
{TABS_STYLES.map( (style, index) => (
<Tooltip key={index} text={style.label}>
<Button className="advgb-tabs-style"
<Button className={ 'advgb-tabs-style' + (style.name === attributes[`tabsStyle${deviceLetter}`] ? ' is-style-selected' : '') }
isToggled={ style.name === attributes[`tabsStyle${deviceLetter}`] }
onClick={ () => setAttributes( { [`tabsStyle${deviceLetter}`]: style.name } ) }
>
{style.icon}
</Button>
</Tooltip>
))}
) ) }
{viewport === 'mobile' && (
<Tooltip text={ __( 'Stacked', 'advanced-gutenberg' ) }>
<Button className="advgb-tabs-style"
Expand Down
5 changes: 4 additions & 1 deletion src/assets/blocks/advtabs/frontend.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
jQuery(document).ready(function ($) {
$(".advgb-tab a:not(.ui-tabs-anchor)").unbind("click");
$(".advgb-tabs-block").tabs();

$('.advgb-tabs-wrapper').each(function () {
var activeTab = $(this).data('tab-active');
var tabPanel = $(this).find('.advgb-tab-panel');
Expand Down Expand Up @@ -53,5 +56,5 @@ jQuery(document).ready(function ($) {
bodyWrapper.find('.advgb-tab-body-header').removeClass('header-active');
$(this).addClass('header-active');
tabsPanel.find('.advgb-tab').eq(idx).find('a').trigger('click');
})
});
});
8 changes: 3 additions & 5 deletions src/assets/blocks/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12334,7 +12334,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
{ key: index, text: style.label },
React.createElement(
Button,
{ className: "advgb-tabs-style",
{ className: 'advgb-tabs-style' + (style.name === attributes["tabsStyle" + deviceLetter] ? ' is-style-selected' : ''),
isToggled: style.name === attributes["tabsStyle" + deviceLetter],
onClick: function onClick() {
return setAttributes(_defineProperty({}, "tabsStyle" + deviceLetter, style.name));
Expand Down Expand Up @@ -18219,9 +18219,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
var blockIDX = attributes.blockIDX;


if (!blockIDX) {
setAttributes({ blockIDX: "advgb-infobox-" + clientId });
}
setAttributes({ blockIDX: "advgb-infobox-" + clientId });
}
}, {
key: "componentDidUpdate",
Expand Down Expand Up @@ -29202,7 +29200,7 @@ if (typeof wp !== 'undefined' && typeof wp.domReady !== 'undefined') {
var new_settings = advgb_blocks_vars.original_settings;

// Unregister core blocks to avoid registering twice later through wp.editPost.initializeEditor
var core_blocks = ['core/paragraph', 'core/image', 'core/heading', 'core/list', 'core/quote', 'core/archives', 'core/audio', 'core/button', 'core/buttons', 'core/calendar', 'core/categories', 'core/code', 'core/columns', 'core/column', 'core/cover', 'core/embed', 'core/group', 'core/freeform', 'core/html', 'core/media-text', 'core/latest-comments', 'core/latest-posts', 'core/missing', 'core/more', 'core/nextpage', 'core/page-list', 'core/preformatted', 'core/pullquote', 'core/rss', 'core/search', 'core/separator', 'core/block', 'core/social-links', 'core/social-link', 'core/spacer', 'core/table', 'core/tag-cloud', 'core/text-columns', 'core/verse', 'core/video', 'core/site-logo', 'core/site-tagline', 'core/site-title', 'core/query', 'core/post-template', 'core/query-title', 'core/query-pagination', 'core/query-pagination-next', 'core/query-pagination-numbers', 'core/query-pagination-previous', 'core/post-title', 'core/post-content', 'core/post-date', 'core/post-excerpt', 'core/post-featured-image', 'core/post-terms', 'core/loginout', 'core/legacy-widget', 'core/widget-area', 'core/gallery', 'core/shortcode', 'core/file'];
var core_blocks = ['core/paragraph', 'core/image', 'core/heading', 'core/list', 'core/quote', 'core/archives', 'core/audio', 'core/button', 'core/buttons', 'core/calendar', 'core/categories', 'core/code', 'core/columns', 'core/column', 'core/cover', 'core/embed', 'core/group', 'core/freeform', 'core/html', 'core/media-text', 'core/latest-comments', 'core/latest-posts', 'core/missing', 'core/more', 'core/nextpage', 'core/page-list', 'core/preformatted', 'core/pullquote', 'core/rss', 'core/search', 'core/separator', 'core/block', 'core/social-links', 'core/social-link', 'core/spacer', 'core/table', 'core/tag-cloud', 'core/text-columns', 'core/verse', 'core/video', 'core/site-logo', 'core/site-tagline', 'core/site-title', 'core/query', 'core/post-template', 'core/query-title', 'core/query-pagination', 'core/query-pagination-next', 'core/query-pagination-numbers', 'core/query-pagination-previous', 'core/post-title', 'core/post-content', 'core/post-date', 'core/post-excerpt', 'core/post-featured-image', 'core/post-terms', 'core/loginout', 'core/gallery', 'core/shortcode', 'core/file', 'core/pattern', 'core/navigation', 'core/navigation-link', 'core/navigation-submenu', 'core/template-part', 'core/post-author', 'core/post-navigation-link', 'core/post-comments', 'core/term-description'];

core_blocks.forEach(function (element) {
if (wp.data.select('core/blocks').getBlockType(element)) {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/blocks/contact-form/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jQuery(document).ready(function ($) {
var contactEmail = $(this).find('.advgb-form-input-email').val();
var contactMsg = $(this).find('.advgb-form-input-msg').val();
var date = new Date();
var submitDate = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear() + ' - ' + date.getHours() + ':' + date.getMinutes();
var submitDate = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear() + ' - ' + ( date.getHours() < 10 ? '0' : '' ) + date.getHours() + ':' + ( date.getMinutes() < 10 ? '0' : '' ) + date.getMinutes();
var g_id = parseInt($thisForm.find('.advgb-grecaptcha').data('gid'));

if (contactName === '' || contactEmail === '' || contactMsg === '') {
Expand Down
6 changes: 6 additions & 0 deletions src/assets/blocks/images-slider/frontend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
jQuery(document).ready(function ( $ ) {
$(".advgb-images-slider-block .advgb-images-slider:not(.slick-initialized)").slick({
dots: true,
adaptiveHeight: true,
})
});
6 changes: 2 additions & 4 deletions src/assets/blocks/infobox/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ import {IconListPopupHook} from "../0-adv-components/icon-class.jsx";
const { attributes, setAttributes, clientId } = this.props;
const { blockIDX } = attributes;

if (!blockIDX) {
setAttributes( { blockIDX: `advgb-infobox-${clientId}` } );
}
setAttributes( { blockIDX: `advgb-infobox-${clientId}` } );
}

componentDidUpdate() {
Expand Down Expand Up @@ -1117,4 +1115,4 @@ import {IconListPopupHook} from "../0-adv-components/icon-class.jsx";
}
]
});
}) ( wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components );
}) ( wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components );
2 changes: 1 addition & 1 deletion src/assets/blocks/newsletter/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jQuery(document).ready(function ($) {
var lastName = $(this).find('.advgb-form-input-lname').val();
var email = $(this).find('.advgb-form-input-email').val();
var date = new Date();
var submitDate = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear() + ' - ' + (date.getHours() < 10 ? '0' : '') + date.getHours() + ':' + (date.getMinutes() < 10 ? '0' : '') + date.getMinutes();
var submitDate = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear() + ' - ' + ( date.getHours() < 10 ? '0' : '' ) + date.getHours() + ':' + ( date.getMinutes() < 10 ? '0' : '' ) + date.getMinutes();
var g_id = parseInt($thisForm.find('.advgb-grecaptcha').data('gid'));
var emailValid = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;

Expand Down
11 changes: 11 additions & 0 deletions src/assets/blocks/recent-posts/masonry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
document.addEventListener("DOMContentLoaded", function(){
(function($) {
$('.masonry-view .advgb-recent-posts').isotope({
itemSelector: '.advgb-recent-post',
percentPosition: true
});
$(window).on('load resize', function(){
$('.masonry-view .advgb-recent-posts').isotope();
});
})(jQuery);
});
9 changes: 9 additions & 0 deletions src/assets/blocks/recent-posts/slider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
jQuery(document).ready(function($){
$(".advgb-recent-posts-block.slider-view").find(".advgb-recent-posts:not(.slick-initialized)").each(function() {
$(this).slick({
dots: true,
adaptiveHeight: true,
});
$(this).slick("slickSetOption", "autoplay", $(this).parent().hasClass("slider-autoplay"), true);
});
});
9 changes: 9 additions & 0 deletions src/assets/blocks/woo-products/slider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
jQuery(document).ready(function ($) {
$(".advgb-woo-products.slider-view").on("init", function(event){
$(this).find("div.woocommerce, ul.products").removeClass("columns-1 columns-2 columns-3 columns-4");
});
$(".advgb-woo-products.slider-view .products:not(.slick-initialized)").slick({
dots: true,
adaptiveHeight: true,
})
});
2 changes: 1 addition & 1 deletion src/assets/css/blocks.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/css/editor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/assets/js/disable-blocks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
window.addEventListener('load', function () {
if (typeof wp.blocks !== 'undefined') {
if ( wp.data.select("core/blocks").getBlockType( "advgb/summary" ) ) {
wp.blocks.unregisterBlockType( "advgb/summary" );
}
}
});
13 changes: 10 additions & 3 deletions src/assets/js/editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,18 @@ if (typeof wp !== 'undefined' && typeof wp.domReady !== 'undefined'){
'core/post-featured-image',
'core/post-terms',
'core/loginout',
'core/legacy-widget',
'core/widget-area',
'core/gallery',
'core/shortcode',
'core/file'
'core/file',
'core/pattern',
'core/navigation',
'core/navigation-link',
'core/navigation-submenu',
'core/template-part',
'core/post-author',
'core/post-navigation-link',
'core/post-comments',
'core/term-description'
];

core_blocks.forEach( function( element ) {
Expand Down
2 changes: 2 additions & 0 deletions src/assets/scss/blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ table.advgb-table-frontend td, table.advgb-table-frontend tr {
}

/*Count Up block styles*/
#site-editor,
#widgets-editor,
#editor {

Expand Down Expand Up @@ -1713,6 +1714,7 @@ form .advgb-grecaptcha > div {
.advgb-lores-form-wrapper .advgb-lores-form .advgb-form-inner {
padding: 20px 50px;
width: 100%;
box-sizing: border-box;
}

.advgb-lores-form-wrapper .advgb-lores-form .advgb-form-inner .advgb-login-failed-notice {
Expand Down
21 changes: 6 additions & 15 deletions src/assets/scss/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,6 @@ body.advgb-editor-width-full:not(.advgb-editor-width-default) #editor {
margin: 10px;
}

.advgb-editor-sidebar-content .components-button.advgb-button {

&:focus {

}

&.is-secondary {

}

&.is-primary {

}
}

/* Widgets Customizer */
.customize-control-sidebar_block_editor .block-editor-writing-flow {

Expand All @@ -101,3 +86,9 @@ body.advgb-editor-width-full:not(.advgb-editor-width-default) #editor {
width: 100% !important;
}
}

/* Custom UI */
.components-button.is-style-selected {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
outline: 3px solid transparent;
}
Loading

0 comments on commit 1e14814

Please sign in to comment.