Skip to content

Commit

Permalink
Update from vk-blocks-pro
Browse files Browse the repository at this point in the history
  • Loading branch information
vektorinc committed Oct 18, 2023
1 parent 0df16b7 commit c2c19ec
Show file tree
Hide file tree
Showing 77 changed files with 20,309 additions and 14,080 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ module.exports = {
camelcase: 'off',
'@wordpress/no-unsafe-wp-apis': 'off',
'@wordpress/i18n-translator-comments': 'off',
'react-hooks/exhaustive-deps': 'off',
},
};
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.20.1
18.18.0
7 changes: 6 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ module.exports = ( api ) => {
api.cache( true );

return {
presets: [ '@wordpress/babel-preset-default' ],
presets: [
['@babel/preset-env', {
"modules": "commonjs"
}],
'@wordpress/babel-preset-default'
],
plugins: [
'@emotion/babel-plugin',
'babel-plugin-inline-json-import'
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
],
"require": {
"vektor-inc/font-awesome-versions": "^0.4.1",
"vektor-inc/font-awesome-versions": "^0.5.0",
"vektor-inc/vk-swiper": "^0.3.3",
"tgmpa/tgm-plugin-activation": "dev-develop",
"yahnis-elsts/plugin-update-checker": "^5.0",
Expand Down
282 changes: 217 additions & 65 deletions composer.lock

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion editor-css/_editor_before.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@
.editor-block-list-item-vk-blocks-accordion:after,
.editor-block-list-item-vk-blocks-animation:after,
.editor-block-list-item-vk-blocks-archive-list:after,
.editor-block-list-item-vk-blocks-blog-card:after,
.editor-block-list-item-vk-blocks-blog-card-excerpt:after,
.editor-block-list-item-vk-blocks-blog-card-site-logo:after,
.editor-block-list-item-vk-blocks-blog-card-featured-image:after,
.editor-block-list-item-vk-blocks-blog-card-site-title:after,
.editor-block-list-item-vk-blocks-blog-card-title:after,
.editor-block-list-item-vk-blocks-breadcrumb:after,
.editor-block-list-item-vk-blocks-button-outer:after,
.editor-block-list-item-vk-blocks-card:after,
.editor-block-list-item-vk-blocks-child-page:after,
.editor-block-list-item-vk-blocks-dynamic-text:after,
.editor-block-list-item-vk-blocks-dynamic-text:after,
.editor-block-list-item-vk-blocks-timeline:after,
.editor-block-list-item-vk-blocks-step:after,
.editor-block-list-item-vk-blocks-outer:after,
.editor-block-list-item-vk-blocks-post-list:after,
.editor-block-list-item-vk-blocks-post-new-badge\/new-badge:after,
.editor-block-list-item-vk-blocks-table-of-contents:after,
.editor-block-list-item-vk-blocks-table-of-contents-new:after,
.editor-block-list-item-vk-blocks-simple-table:after,
Expand Down Expand Up @@ -140,6 +147,8 @@ button.image-button:not(.button-delete) {
@import "./editor_before_gridcolcard";
// edit custom css extension
@import "./editor_before_custom-css-extension";
// edit custom block variation
@import "./editor_before_custom-block-variation";
// archive-list
@import "./editor_before_archive-list";

Expand Down
44 changes: 44 additions & 0 deletions editor-css/_editor_before_custom-block-variation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.custom_block_variation_modal {
.components-modal__content {
padding-bottom: 0;
}
.move-button-container {
display: flex;
flex-direction: column;
.components-button.has-icon {
height: 24px;
padding: 6px;
}
}
.block-mover-button.is-up-button svg {
top: 5px;
flex-shrink: 0;
position: relative;
}

.block-mover-button.is-down-button svg {
bottom: 5px;
flex-shrink: 0;
position: relative;
}
h4 {
margin-top: 0;
margin-bottom: 12px;
}
.block-variation-error-text {
margin-top: 8px;
margin-bottom: 0;
color: #c00;
}
.block-variation-category-list {
.components-base-control {
margin-bottom: 8px;
}
}
.components-base-control + .components-base-control{
margin-top: 8px;
}
.components-form-token-field__label{
font-size: 12px;
}
}
11 changes: 10 additions & 1 deletion editor-css/editor-block-build-marge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,22 @@
.editor-block-list-item-vk-blocks-accordion:after,
.editor-block-list-item-vk-blocks-animation:after,
.editor-block-list-item-vk-blocks-archive-list:after,
.editor-block-list-item-vk-blocks-blog-card:after,
.editor-block-list-item-vk-blocks-blog-card-excerpt:after,
.editor-block-list-item-vk-blocks-blog-card-site-logo:after,
.editor-block-list-item-vk-blocks-blog-card-featured-image:after,
.editor-block-list-item-vk-blocks-blog-card-site-title:after,
.editor-block-list-item-vk-blocks-blog-card-title:after,
.editor-block-list-item-vk-blocks-breadcrumb:after,
.editor-block-list-item-vk-blocks-button-outer:after,
.editor-block-list-item-vk-blocks-card:after,
.editor-block-list-item-vk-blocks-child-page:after,
.editor-block-list-item-vk-blocks-dynamic-text:after,
.editor-block-list-item-vk-blocks-dynamic-text:after,
.editor-block-list-item-vk-blocks-timeline:after,
.editor-block-list-item-vk-blocks-step:after,
.editor-block-list-item-vk-blocks-outer:after,
.editor-block-list-item-vk-blocks-post-list:after,
.editor-block-list-item-vk-blocks-post-new-badge\/new-badge:after,
.editor-block-list-item-vk-blocks-table-of-contents:after,
.editor-block-list-item-vk-blocks-table-of-contents-new:after,
.editor-block-list-item-vk-blocks-simple-table:after,
Expand Down Expand Up @@ -182,6 +189,8 @@ button.image-button:not(.button-delete) {
@import "./editor_before_gridcolcard";
// edit custom css extension
@import "./editor_before_custom-css-extension";
// edit custom block variation
@import "./editor_before_custom-block-variation";
// archive-list
@import "./editor_before_archive-list";

Expand Down
2 changes: 1 addition & 1 deletion inc/admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* The admin notice for VK blocks Pro.
*/
function vk_blocks_admin_notice_pro() {
$plugin_base_dir = dirname( __FILE__ );
$plugin_base_dir = __DIR__;
$lang = ( get_locale() === 'ja' ) ? 'ja' : 'en';
if ( strpos( $plugin_base_dir, 'vk-blocks-pro' ) !== false ) {
return;
Expand Down
2 changes: 1 addition & 1 deletion inc/vk-blocks-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

// Load composer autoload.
require_once dirname( dirname( __FILE__ ) ) . '/vendor/autoload.php';
require_once dirname( __DIR__ ) . '/vendor/autoload.php';

use VektorInc\VK_Color_Palette_Manager\VkColorPaletteManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,4 @@ public function update_vk_blocks_options( $request ) {
)
);
}

}
2 changes: 1 addition & 1 deletion inc/vk-blocks/admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function vk_blocks_options_enqueue_scripts( $hook_suffix ) {
'name' => $block_name,
'title' => $block_type->title,
);
$i++;
++$i;

if ( ! empty( $block_type->editor_script ) ) {
wp_enqueue_script( $block_type->editor_script );
Expand Down
2 changes: 1 addition & 1 deletion inc/vk-blocks/class-vk-blocks-block-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,6 @@ public function load_block( $block_name ) {
* @throws \Exception Exception.
*/
final public function __clone() {
throw new \Exception( sprintf( 'Clone is not allowed: %s', get_class( $this ) ) );
throw new \Exception( sprintf( 'Clone is not allowed: %s', esc_html( get_class( $this ) ) ) );
}
}
29 changes: 28 additions & 1 deletion inc/vk-blocks/class-vk-blocks-global-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,30 @@ public static function blocks() {
'name' => 'breadcrumb',
'is_pro' => true,
),
array(
'name' => 'blog-card',
'is_pro' => true,
),
array(
'name' => 'blog-card-title',
'is_pro' => true,
),
array(
'name' => 'blog-card-featured-image',
'is_pro' => true,
),
array(
'name' => 'blog-card-excerpt',
'is_pro' => true,
),
array(
'name' => 'blog-card-site-logo',
'is_pro' => true,
),
array(
'name' => 'blog-card-site-title',
'is_pro' => true,
),
array(
'name' => 'button-outer',
'is_pro' => true,
Expand Down Expand Up @@ -202,6 +226,10 @@ public static function blocks() {
'name' => 'post-list',
'is_pro' => true,
),
array(
'name' => 'post-new-badge',
'is_pro' => true,
),
array(
'name' => 'select-post-list',
'is_pro' => true,
Expand Down Expand Up @@ -479,5 +507,4 @@ public static function font_sizes() {
);
return $font_sizes;
}

}
39 changes: 39 additions & 0 deletions inc/vk-blocks/class-vk-blocks-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,44 @@ public static function get_vk_blocks_options_properties() {
'icon_custom_lists' => array(
'type' => 'array',
),
'block_variation_lists' => array(
'type' => 'array',
'items' => array(
'type' => 'object',
'properties' => array(
'block_name' => array(
'type' => 'string',
),
'name' => array(
'type' => 'string',
),
'title' => array(
'type' => 'string',
),
'description' => array(
'type' => 'string',
),
'category' => array(
'type' => 'string',
),
'icon' => array(
'type' => 'string',
),
'attributes' => array(
'type' => 'string',
),
'innerBlocks' => array(
'type' => 'string',
),
'scope' => array(
'type' => 'array',
),
'keywords' => array(
'type' => 'array',
),
),
),
),
);
return $properties;
}
Expand Down Expand Up @@ -403,6 +441,7 @@ public static function get_vk_blocks_options_defaults( $activation = false ) {
'balloon_meta_lists' => array(),
'disable_block_style_lists' => array(),
'icon_custom_lists' => array(),
'block_variation_lists' => array(),
);
return $default;
}
Expand Down
1 change: 0 additions & 1 deletion inc/vk-blocks/class-vk-blocks-print-css-variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public static function get_print_css() {
$dynamic_css = vk_blocks_minify_css( $dynamic_css );
return $dynamic_css;
}

}

new Vk_Blocks_Print_CSS_Variables();
2 changes: 1 addition & 1 deletion inc/vk-blocks/font-awesome/font-awesome-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Font Awesome API Load modules
*/
if ( ! class_exists( 'VK_Blocks_Font_Awesome_API' ) ) {
require_once dirname( __FILE__ ) . '/class-vk-blocks-font-awesome-api.php';
require_once __DIR__ . '/class-vk-blocks-font-awesome-api.php';
new VK_Blocks_Font_Awesome_API();
}

Expand Down
4 changes: 2 additions & 2 deletions inc/vk-blocks/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ function vk_blocks_fix_gt_style_errors( $data ) {
// this for vkblocks blocks.
$data['post_content'] = preg_replace_callback(
'%wp:vk-blocks/\w+(.*)?/wp:vk-blocks/\w+%s',
function( $matches ) {
function ( $matches ) {
return preg_replace_callback(
'%(<style[^<>]*>)(.*)</style>%s',
function( $matches ) {
function ( $matches ) {
return $matches[1] . preg_replace( '/&gt;/', '>', $matches[2] ) . '</style>';
},
$matches[0]
Expand Down
1 change: 0 additions & 1 deletion inc/vk-blocks/style/balloon.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ function vk_blocks_balloon_style() {
}
add_action( 'wp_enqueue_scripts', 'vk_blocks_balloon_style' );
add_action( 'enqueue_block_editor_assets', 'vk_blocks_balloon_style' );

2 changes: 1 addition & 1 deletion inc/vk-blocks/view/class-vk-blocks-postlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public static function get_loop_query( $attributes ) {
if ( ! empty( $date_query ) ) {
$args['date_query'] = $date_query;
}
$args = apply_filters( 'vk_blocks_post_list_query_args', $args, $attributes );
return new WP_Query( $args );
}

Expand Down Expand Up @@ -257,5 +258,4 @@ public static function get_render_no_post( $wp_query = null ) {
$html = '<div class="alert alert-warning text-center">' . sprintf( __( 'There are no %ss.', 'vk-blocks' ), $name ) . '</div>';
return apply_filters( 'vk_blocks_post_list_render_no_post', $html, $wp_query );
}

}
Loading

0 comments on commit c2c19ec

Please sign in to comment.