diff --git a/.github/workflows/release-vws.yml b/.github/workflows/release-vws.yml index 9ac71f5bd..b6673ad63 100644 --- a/.github/workflows/release-vws.yml +++ b/.github/workflows/release-vws.yml @@ -64,7 +64,7 @@ jobs: # [ End ] pre_ リリース と 本リリースで同じ処理 ########################################## - name: rsync deployments - uses: burnett01/rsync-deployments@4.1 + uses: burnett01/rsync-deployments@5.2.1 with: switches: -avzr path: ${{ env.plugin_name }}.zip @@ -73,3 +73,4 @@ jobs: remote_port: ${{ secrets.DEPLOY_PORT_VWS }} remote_user: ${{ secrets.DEPLOY_USER_VWS }} remote_key: ${{ secrets.DEPLOY_KEY_VWS }} + remote_key_pass: ${{ secrets.DEPLOY_KEYPASS_VWS }} diff --git a/editor-css/_editor_before.scss b/editor-css/_editor_before.scss index fa333418e..1a68b7a4b 100644 --- a/editor-css/_editor_before.scss +++ b/editor-css/_editor_before.scss @@ -7,7 +7,6 @@ } .editor-block-list-item-vk-blocks-select-post-list:after, .editor-block-list-item-vk-blocks-accordion:after, -.editor-block-list-item-vk-blocks-slider:after, .editor-block-list-item-vk-blocks-animation:after, .editor-block-list-item-vk-blocks-breadcrumb:after, .editor-block-list-item-vk-blocks-button-outer:after, diff --git a/gulpfile.js b/gulpfile.js index 4abeef65f..048b251c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -37,6 +37,10 @@ gulp.task('helper-js', (done) => { .pipe(uglify()) .pipe(rename('vk-faq2.min.js')) .pipe(gulp.dest('./build/')); + gulp.src('src/blocks/slider/view.js') + .pipe(uglify()) + .pipe(rename('vk-slider.min.js')) + .pipe(gulp.dest('./build/')); done(); }); @@ -49,10 +53,6 @@ gulp.task('helper-js-pro', (done) => { .pipe(uglify()) .pipe(rename('vk-animation.min.js')) .pipe(gulp.dest('./build/')); - gulp.src('src/blocks/_pro/slider/view.js') - .pipe(uglify()) - .pipe(rename('vk-slider.min.js')) - .pipe(gulp.dest('./build/')); done(); }); diff --git a/inc/vk-blocks-config.php b/inc/vk-blocks-config.php index e17bd0d5f..2d711239c 100644 --- a/inc/vk-blocks-config.php +++ b/inc/vk-blocks-config.php @@ -48,13 +48,7 @@ } require_once plugin_dir_path( __FILE__ ) . 'admin-notices.php'; - require_once plugin_dir_path( __FILE__ ) . 'vk-blocks/vk-blocks-functions.php'; - - require_once plugin_dir_path( __FILE__ ) . 'vk-blocks/App/RestAPI/BlockMeta/class-vk-blocks-entrypoint.php'; - // BlockMeta用のAPIルートを設定. - new Vk_Blocks_EntryPoint(); - // プロ版の設定ファイルを読み込み. if ( file_exists( plugin_dir_path( __FILE__ ) . 'vk-blocks-pro-config.php' ) ) { require_once plugin_dir_path( __FILE__ ) . 'vk-blocks-pro-config.php'; diff --git a/inc/vk-blocks-pro/vk-blocks-pro-functions.php b/inc/vk-blocks-pro/vk-blocks-pro-functions.php index ee2cf88a0..123099ae9 100644 --- a/inc/vk-blocks-pro/vk-blocks-pro-functions.php +++ b/inc/vk-blocks-pro/vk-blocks-pro-functions.php @@ -29,11 +29,5 @@ function vk_blocks_pro_load_scripts() { // Animation Block wp_enqueue_script( 'vk-blocks-animation', VK_BLOCKS_DIR_URL . 'build/vk-animation.min.js', array(), VK_BLOCKS_VERSION, true ); - - // Slider Block - global $vk_swiper_url; - wp_enqueue_style( 'vk-swiper-style', $vk_swiper_url . 'assets/css/swiper.min.css', array(), SWIPER_VERSION ); - - wp_enqueue_script( 'vk-blocks-slider', VK_BLOCKS_DIR_URL . 'build/vk-slider.min.js', array( 'vk-swiper-script' ), VK_BLOCKS_VERSION, true ); } add_action( 'wp_enqueue_scripts', 'vk_blocks_pro_load_scripts' ); diff --git a/inc/vk-blocks/class-vk-blocks-global-settings.php b/inc/vk-blocks/class-vk-blocks-global-settings.php index 997eb24cf..775b4bfff 100644 --- a/inc/vk-blocks/class-vk-blocks-global-settings.php +++ b/inc/vk-blocks/class-vk-blocks-global-settings.php @@ -93,6 +93,14 @@ public static function blocks() { 'name' => 'pr-content', 'is_pro' => false, ), + array( + 'name' => 'slider', + 'is_pro' => false, + ), + array( + 'name' => 'slider-item', + 'is_pro' => false, + ), array( 'name' => 'spacer', 'is_pro' => false, @@ -189,14 +197,6 @@ public static function blocks() { 'name' => 'select-post-list-item', 'is_pro' => true, ), - array( - 'name' => 'slider', - 'is_pro' => true, - ), - array( - 'name' => 'slider-item', - 'is_pro' => true, - ), array( 'name' => 'step', 'is_pro' => true, diff --git a/inc/vk-blocks/class-vk-blocks-print-css-variables.php b/inc/vk-blocks/class-vk-blocks-print-css-variables.php index 18e7936f7..5c1f83c1c 100644 --- a/inc/vk-blocks/class-vk-blocks-print-css-variables.php +++ b/inc/vk-blocks/class-vk-blocks-print-css-variables.php @@ -38,13 +38,19 @@ public static function print_css() { /** * 出力するCSSを生成 * + * --vk-color-primaryは非推奨css変数 + * cssカスタマイズしているユーザーのために残している + * + * @see https://github.com/vektor-inc/vk-color-palette-manager/pull/19 + * * @return string $dynamic_css 最小化したCSS */ public static function get_print_css() { $dynamic_css = ' :root { --vk-size-text: 16px; - --vk-color-primary:#337ab7; + /* --vk-color-primary is deprecated. */ + --vk-color-primary:#337ab7; }'; /* diff --git a/inc/vk-blocks/languages/vk-blocks-js.pot b/inc/vk-blocks/languages/vk-blocks-js.pot index 2d77cfdcf..75e01340b 100644 --- a/inc/vk-blocks/languages/vk-blocks-js.pot +++ b/inc/vk-blocks/languages/vk-blocks-js.pot @@ -125,7 +125,6 @@ msgstr "" #: src/admin/margin.js:41 #: src/blocks/_pro/outer/edit.js:638 -#: src/blocks/_pro/slider/edit.js:224 #: src/blocks/button/edit.js:526 #: src/components/advanced-viewport-control/index.js:25 msgid "PC" @@ -133,7 +132,6 @@ msgstr "" #: src/admin/margin.js:45 #: src/blocks/_pro/outer/edit.js:623 -#: src/blocks/_pro/slider/edit.js:235 #: src/blocks/button/edit.js:461 #: src/components/advanced-viewport-control/index.js:31 msgid "Tablet" @@ -141,7 +139,6 @@ msgstr "" #: src/admin/margin.js:49 #: src/blocks/_pro/outer/edit.js:608 -#: src/blocks/_pro/slider/edit.js:246 #: src/blocks/button/edit.js:396 #: src/components/advanced-viewport-control/index.js:39 msgid "Mobile" @@ -262,7 +259,6 @@ msgid "Short" msgstr "" #: src/blocks/_pro/animation/edit.js:130 -#: src/blocks/_pro/slider/edit.js:201 #: src/blocks/balloon/edit.js:489 #: src/blocks/button/edit.js:319 #: src/blocks/faq/index.js:26 @@ -459,7 +455,6 @@ msgid "Image Height" msgstr "" #: src/blocks/_pro/card/edit.js:88 -#: src/blocks/_pro/slider/edit.js:220 msgid "Slide Height for each device." msgstr "" @@ -510,7 +505,6 @@ msgstr "" #: src/blocks/_pro/grid-column-item/edit.js:140 #: src/blocks/_pro/outer/edit.js:370 -#: src/blocks/_pro/slider-item/edit.js:120 msgid "Padding (Left and Right)" msgstr "" @@ -623,7 +617,6 @@ msgid "Display" msgstr "" #: src/blocks/_pro/gridcolcard/edit-common.js:147 -#: src/blocks/_pro/slider/edit.js:374 #: src/blocks/heading/edit.js:374 msgid "Hide" msgstr "" @@ -764,40 +757,33 @@ msgid "Text" msgstr "" #: src/blocks/_pro/outer/edit.js:262 -#: src/blocks/_pro/slider-item/edit.js:167 msgid "Background Setting" msgstr "" #: src/blocks/_pro/outer/edit.js:267 -#: src/blocks/_pro/slider-item/edit.js:171 #: src/blocks/pr-content/edit.js:67 msgid "Color Setting" msgstr "" #: src/blocks/_pro/outer/edit.js:268 -#: src/blocks/_pro/slider-item/edit.js:173 msgid "" "Color will overcome background image. If you want to display image, set " "opacity 0." msgstr "" #: src/blocks/_pro/outer/edit.js:276 -#: src/blocks/_pro/slider-item/edit.js:181 msgid "Opacity Setting" msgstr "" #: src/blocks/_pro/outer/edit.js:290 -#: src/blocks/_pro/slider-item/edit.js:216 msgid "Background Image PC" msgstr "" #: src/blocks/_pro/outer/edit.js:306 -#: src/blocks/_pro/slider-item/edit.js:232 msgid "Background Image Tablet" msgstr "" #: src/blocks/_pro/outer/edit.js:316 -#: src/blocks/_pro/slider-item/edit.js:242 msgid "Background Image Mobile" msgstr "" @@ -822,13 +808,11 @@ msgid "Parallax (Non-guaranteed)" msgstr "" #: src/blocks/_pro/outer/edit.js:364 -#: src/blocks/_pro/slider-item/edit.js:115 #: src/blocks/pr-content/edit.js:229 msgid "Layout Setting" msgstr "" #: src/blocks/_pro/outer/edit.js:367 -#: src/blocks/_pro/slider/edit.js:192 #: src/blocks/balloon/edit.js:515 msgid "Width" msgstr "" @@ -1072,127 +1056,6 @@ msgstr "" msgid "Input Internal Post URL" msgstr "" -#: src/blocks/_pro/slider-item/edit.js:124 -msgid "Fit to the Container area" -msgstr "" - -#: src/blocks/_pro/slider-item/edit.js:131 -msgid "Add padding to the Slider area" -msgstr "" - -#: src/blocks/_pro/slider-item/edit.js:138 -msgid "Remove padding from the Slider area" -msgstr "" - -#: src/blocks/_pro/slider-item/edit.js:153 -msgid "Vertical align" -msgstr "" - -#: src/blocks/_pro/slider-item/edit.js:195 -msgid "Background Image Size" -msgstr "" - -#: src/blocks/_pro/slider-item/edit.js:202 -msgid "cover" -msgstr "" - -#: src/blocks/_pro/slider-item/edit.js:206 -msgid "repeat" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:114 -msgid "Multi-image Display Setting" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:118 -msgid "Display Multi Images per View" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:122 -msgid "Images per View" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:133 -msgid "Move Images per Slide" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:209 -msgid "Full Wide" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:215 -msgid "Height" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:259 -msgid "Slider Settings" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:263 -msgid "Effect " -msgstr "" - -#: src/blocks/_pro/slider/edit.js:273 -msgid "Slide" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:277 -msgid "Fade" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:284 -msgid "Loop " -msgstr "" - -#: src/blocks/_pro/slider/edit.js:294 -msgid "AutoPlay" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:304 -msgid "Stop AutoPlay when swipe" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:314 -msgid "Display Time" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:328 -msgid "Change Speed" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:342 -msgid "Pagination Type" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:353 -#: src/blocks/_pro/step-item/edit.js:134 -#: src/blocks/_pro/table-of-contents-new/edit.js:145 -#: src/blocks/_pro/timeline-item/edit.js:103 -#: src/blocks/heading/edit.js:264 -#: src/blocks/staff/edit.js:173 -#: src/extensions/core/heading/style.js:11 -#: src/extensions/core/list/style.js:152 -msgid "Default" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:357 -msgid "Number of slides" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:367 -msgid "Navigation Position" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:378 -#: src/blocks/button/edit.js:354 -#: src/components/display-items-control/index.js:127 -msgid "Center" -msgstr "" - -#: src/blocks/_pro/slider/edit.js:382 -msgid "Bottom on Mobile device" -msgstr "" - #: src/blocks/_pro/step-item/edit.js:102 #: src/blocks/_pro/timeline-item/edit.js:71 #: src/blocks/border-box/edit.js:204 @@ -1215,6 +1078,16 @@ msgstr "" msgid "Outlined" msgstr "" +#: src/blocks/_pro/step-item/edit.js:134 +#: src/blocks/_pro/table-of-contents-new/edit.js:145 +#: src/blocks/_pro/timeline-item/edit.js:103 +#: src/blocks/heading/edit.js:264 +#: src/blocks/staff/edit.js:173 +#: src/extensions/core/heading/style.js:11 +#: src/extensions/core/list/style.js:152 +msgid "Default" +msgstr "" + #: src/blocks/_pro/step-item/edit.js:78 msgid "Step Mark" msgstr "" @@ -1545,6 +1418,11 @@ msgstr "" msgid "Button Position:" msgstr "" +#: src/blocks/button/edit.js:354 +#: src/components/display-items-control/index.js:127 +msgid "Center" +msgstr "" + #: src/blocks/button/edit.js:374 msgid "Wide" msgstr "" diff --git a/inc/vk-blocks/utils/array-merge.php b/inc/vk-blocks/utils/array-merge.php index 47f82581b..fda99a6bb 100644 --- a/inc/vk-blocks/utils/array-merge.php +++ b/inc/vk-blocks/utils/array-merge.php @@ -24,7 +24,7 @@ function vk_blocks_array_merge( $args, $defaults ) { $merged = $defaults; foreach ( $args as $key => $value ) { - if ( is_array( $value ) && isset( $defaults[ $key ] ) && is_array( $defaults[ $key ] ) ) { + if ( is_array( $value ) && isset( $defaults[ $key ] ) && is_array( $defaults[ $key ] ) && ! empty( $value ) ) { $merged[ $key ] = vk_blocks_array_merge( $value, $defaults[ $key ] ); } else { $merged[ $key ] = $value; diff --git a/inc/vk-blocks/vk-blocks-functions.php b/inc/vk-blocks/vk-blocks-functions.php index 3869cc390..d83578eb8 100644 --- a/inc/vk-blocks/vk-blocks-functions.php +++ b/inc/vk-blocks/vk-blocks-functions.php @@ -36,6 +36,8 @@ // VK Blocks の管理画面. require_once dirname( __FILE__ ) . '/admin/admin.php'; +require_once dirname( __FILE__ ) . '/App/RestAPI/BlockMeta/class-vk-blocks-entrypoint.php'; +new Vk_Blocks_EntryPoint(); /** * VK Blocks active @@ -222,3 +224,15 @@ function vk_blocks_set_wp_version() { } add_action( 'admin_head', 'vk_blocks_set_wp_version', 10, 0 ); } + +/** + * スクリプトの読み込み + */ +function vk_blocks_load_scripts() { + // Slider Block + global $vk_swiper_url; + wp_enqueue_style( 'vk-swiper-style', $vk_swiper_url . 'assets/css/swiper.min.css', array(), SWIPER_VERSION ); + + wp_enqueue_script( 'vk-blocks-slider', VK_BLOCKS_DIR_URL . 'build/vk-slider.min.js', array( 'vk-swiper-script' ), VK_BLOCKS_VERSION, true ); +} +add_action( 'wp_enqueue_scripts', 'vk_blocks_load_scripts' ); diff --git a/readme.txt b/readme.txt index d9bc73354..bf856b6cf 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: Tags: Gutenberg,FAQ,alert Requires at least: 5.9 Tested up to: 6.1.0 -Stable tag: 1.44.0.1 +Stable tag: 1.46.0.1 Requires PHP: 7.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -64,6 +64,10 @@ e.g. == Changelog == += 1.47.0 = +[ Other ][ Slider ( Pro ) ] Change Pro to Free. +[ Bug fix ][ Button ] Fixed a bug where the default color was not hit in all themes except Lightning. + = 1.46.0 = [ Add Function ][ Custom CSS (Pro) ] Add custom css extension in inspector controls. [ Specification Change ][ Grid Column (Pro) ] Changed margin setting from 1 to 0.1 separator. diff --git a/src/blocks/bundle-pro.js b/src/blocks/bundle-pro.js index 7e5d73dd9..b5cec5964 100644 --- a/src/blocks/bundle-pro.js +++ b/src/blocks/bundle-pro.js @@ -23,8 +23,6 @@ import * as outer from './_pro/outer'; import * as postList from './_pro/post-list'; import * as selectPostList from './_pro/select-post-list'; import * as selectPostListItem from './_pro/select-post-list-item'; -import * as slider from './_pro/slider'; -import * as sliderItem from './_pro/slider-item'; import * as step from './_pro/step'; import * as stepItem from './_pro/step-item'; import * as tableofContentsNew from './_pro/table-of-contents-new'; @@ -61,8 +59,6 @@ const vkblocksPro = [ selectPostListItem, step, stepItem, - slider, - sliderItem, tableofContentsNew, timeline, timelineItem, diff --git a/src/blocks/bundle.js b/src/blocks/bundle.js index eaf3685e4..489356654 100644 --- a/src/blocks/bundle.js +++ b/src/blocks/bundle.js @@ -30,6 +30,8 @@ import * as iconOuter from './icon-outer'; import * as pageContent from './page-content'; import * as prBlocks from './pr-blocks'; import * as prContent from './pr-content'; +import * as slider from './slider'; +import * as sliderItem from './slider-item'; import * as spacer from './spacer'; import * as staff from './staff'; @@ -64,6 +66,8 @@ const vkBlocks = [ pageContent, prBlocks, prContent, + slider, + sliderItem, spacer, staff, ancestorPageList, diff --git a/src/blocks/button/style.scss b/src/blocks/button/style.scss index 3246c2057..4db8a1450 100644 --- a/src/blocks/button/style.scss +++ b/src/blocks/button/style.scss @@ -26,7 +26,8 @@ a.vk_button_link { :root .editor-styles-wrapper { .has-vk-color-primary-background-color, .has-undefined-background-color { - background-color: var(--wp--preset--color--vk-color-primary); + // has-vk-color-primary-background-colorクラスはデフォルトで設定される。Lightning以外のテーマに対応するため代替値を設定 + background-color: var(--wp--preset--color--vk-color-primary,#337ab7); } .has-vk-color-secondary-background-color { background-color: $vk-color-secondary; diff --git a/src/blocks/_pro/slider-item/GenerateBgImage.js b/src/blocks/slider-item/GenerateBgImage.js similarity index 100% rename from src/blocks/_pro/slider-item/GenerateBgImage.js rename to src/blocks/slider-item/GenerateBgImage.js diff --git a/src/blocks/_pro/slider-item/block.json b/src/blocks/slider-item/block.json similarity index 100% rename from src/blocks/_pro/slider-item/block.json rename to src/blocks/slider-item/block.json diff --git a/src/blocks/_pro/slider-item/deprecated/0.0.0/component.js b/src/blocks/slider-item/deprecated/0.0.0/component.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/0.0.0/component.js rename to src/blocks/slider-item/deprecated/0.0.0/component.js diff --git a/src/blocks/_pro/slider-item/deprecated/0.0.0/save.js b/src/blocks/slider-item/deprecated/0.0.0/save.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/0.0.0/save.js rename to src/blocks/slider-item/deprecated/0.0.0/save.js diff --git a/src/blocks/_pro/slider-item/deprecated/0.60.1/component.js b/src/blocks/slider-item/deprecated/0.60.1/component.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/0.60.1/component.js rename to src/blocks/slider-item/deprecated/0.60.1/component.js diff --git a/src/blocks/_pro/slider-item/deprecated/0.60.1/save.js b/src/blocks/slider-item/deprecated/0.60.1/save.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/0.60.1/save.js rename to src/blocks/slider-item/deprecated/0.60.1/save.js diff --git a/src/blocks/_pro/slider-item/deprecated/1.22.1/save.js b/src/blocks/slider-item/deprecated/1.22.1/save.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/1.22.1/save.js rename to src/blocks/slider-item/deprecated/1.22.1/save.js diff --git a/src/blocks/_pro/slider-item/deprecated/1.27.7/GenerateBgImage.js b/src/blocks/slider-item/deprecated/1.27.7/GenerateBgImage.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/1.27.7/GenerateBgImage.js rename to src/blocks/slider-item/deprecated/1.27.7/GenerateBgImage.js diff --git a/src/blocks/_pro/slider-item/deprecated/1.27.7/save.js b/src/blocks/slider-item/deprecated/1.27.7/save.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/1.27.7/save.js rename to src/blocks/slider-item/deprecated/1.27.7/save.js diff --git a/src/blocks/_pro/slider-item/deprecated/1.34.1/GenerateBgImage.js b/src/blocks/slider-item/deprecated/1.34.1/GenerateBgImage.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/1.34.1/GenerateBgImage.js rename to src/blocks/slider-item/deprecated/1.34.1/GenerateBgImage.js diff --git a/src/blocks/_pro/slider-item/deprecated/1.34.1/save.js b/src/blocks/slider-item/deprecated/1.34.1/save.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/1.34.1/save.js rename to src/blocks/slider-item/deprecated/1.34.1/save.js diff --git a/src/blocks/_pro/slider-item/deprecated/1.9.2/save.js b/src/blocks/slider-item/deprecated/1.9.2/save.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/1.9.2/save.js rename to src/blocks/slider-item/deprecated/1.9.2/save.js diff --git a/src/blocks/_pro/slider-item/deprecated/index.js b/src/blocks/slider-item/deprecated/index.js similarity index 100% rename from src/blocks/_pro/slider-item/deprecated/index.js rename to src/blocks/slider-item/deprecated/index.js diff --git a/src/blocks/_pro/slider-item/edit.js b/src/blocks/slider-item/edit.js similarity index 100% rename from src/blocks/_pro/slider-item/edit.js rename to src/blocks/slider-item/edit.js diff --git a/src/blocks/_pro/slider-item/icon.svg b/src/blocks/slider-item/icon.svg similarity index 100% rename from src/blocks/_pro/slider-item/icon.svg rename to src/blocks/slider-item/icon.svg diff --git a/src/blocks/_pro/slider-item/index.js b/src/blocks/slider-item/index.js similarity index 100% rename from src/blocks/_pro/slider-item/index.js rename to src/blocks/slider-item/index.js diff --git a/src/blocks/_pro/slider-item/index.php b/src/blocks/slider-item/index.php similarity index 90% rename from src/blocks/_pro/slider-item/index.php rename to src/blocks/slider-item/index.php index c7c344da5..538006015 100644 --- a/src/blocks/_pro/slider-item/index.php +++ b/src/blocks/slider-item/index.php @@ -15,7 +15,7 @@ function vk_blocks_register_block_slider_item() { if ( ! is_admin() ) { wp_register_style( 'vk-blocks/slider-item', - VK_BLOCKS_DIR_URL . 'build/_pro/slider-item/style.css', + VK_BLOCKS_DIR_URL . 'build/slider-item/style.css', array(), VK_BLOCKS_VERSION ); diff --git a/src/blocks/_pro/slider-item/save.js b/src/blocks/slider-item/save.js similarity index 100% rename from src/blocks/_pro/slider-item/save.js rename to src/blocks/slider-item/save.js diff --git a/src/blocks/_pro/slider-item/style.scss b/src/blocks/slider-item/style.scss similarity index 100% rename from src/blocks/_pro/slider-item/style.scss rename to src/blocks/slider-item/style.scss diff --git a/src/blocks/_pro/slider/_swiper._scss b/src/blocks/slider/_swiper._scss similarity index 100% rename from src/blocks/_pro/slider/_swiper._scss rename to src/blocks/slider/_swiper._scss diff --git a/src/blocks/_pro/slider/block.json b/src/blocks/slider/block.json similarity index 100% rename from src/blocks/_pro/slider/block.json rename to src/blocks/slider/block.json diff --git a/src/blocks/_pro/slider/deprecated/hooks/0.49.7/index.js b/src/blocks/slider/deprecated/hooks/0.49.7/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/0.49.7/index.js rename to src/blocks/slider/deprecated/hooks/0.49.7/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/0.49.7/utils.js b/src/blocks/slider/deprecated/hooks/0.49.7/utils.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/0.49.7/utils.js rename to src/blocks/slider/deprecated/hooks/0.49.7/utils.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/0.56.4/index.js b/src/blocks/slider/deprecated/hooks/0.56.4/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/0.56.4/index.js rename to src/blocks/slider/deprecated/hooks/0.56.4/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/0.60.1/index.js b/src/blocks/slider/deprecated/hooks/0.60.1/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/0.60.1/index.js rename to src/blocks/slider/deprecated/hooks/0.60.1/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/1.0.16/index.js b/src/blocks/slider/deprecated/hooks/1.0.16/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/1.0.16/index.js rename to src/blocks/slider/deprecated/hooks/1.0.16/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/1.10.0/index.js b/src/blocks/slider/deprecated/hooks/1.10.0/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/1.10.0/index.js rename to src/blocks/slider/deprecated/hooks/1.10.0/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/1.13.1/index.js b/src/blocks/slider/deprecated/hooks/1.13.1/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/1.13.1/index.js rename to src/blocks/slider/deprecated/hooks/1.13.1/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/1.2.1/index.js b/src/blocks/slider/deprecated/hooks/1.2.1/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/1.2.1/index.js rename to src/blocks/slider/deprecated/hooks/1.2.1/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/1.33.2/index.js b/src/blocks/slider/deprecated/hooks/1.33.2/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/1.33.2/index.js rename to src/blocks/slider/deprecated/hooks/1.33.2/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/1.34.1/index.js b/src/blocks/slider/deprecated/hooks/1.34.1/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/1.34.1/index.js rename to src/blocks/slider/deprecated/hooks/1.34.1/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/1.9.1/index.js b/src/blocks/slider/deprecated/hooks/1.9.1/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/1.9.1/index.js rename to src/blocks/slider/deprecated/hooks/1.9.1/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/1.9.2/index.js b/src/blocks/slider/deprecated/hooks/1.9.2/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/1.9.2/index.js rename to src/blocks/slider/deprecated/hooks/1.9.2/index.js diff --git a/src/blocks/_pro/slider/deprecated/hooks/index.js b/src/blocks/slider/deprecated/hooks/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/hooks/index.js rename to src/blocks/slider/deprecated/hooks/index.js diff --git a/src/blocks/_pro/slider/deprecated/save/0.49.1/component.js b/src/blocks/slider/deprecated/save/0.49.1/component.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/0.49.1/component.js rename to src/blocks/slider/deprecated/save/0.49.1/component.js diff --git a/src/blocks/_pro/slider/deprecated/save/0.49.1/save.js b/src/blocks/slider/deprecated/save/0.49.1/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/0.49.1/save.js rename to src/blocks/slider/deprecated/save/0.49.1/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/0.56.3/component.js b/src/blocks/slider/deprecated/save/0.56.3/component.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/0.56.3/component.js rename to src/blocks/slider/deprecated/save/0.56.3/component.js diff --git a/src/blocks/_pro/slider/deprecated/save/0.56.3/save.js b/src/blocks/slider/deprecated/save/0.56.3/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/0.56.3/save.js rename to src/blocks/slider/deprecated/save/0.56.3/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/0.60.1/component.js b/src/blocks/slider/deprecated/save/0.60.1/component.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/0.60.1/component.js rename to src/blocks/slider/deprecated/save/0.60.1/component.js diff --git a/src/blocks/_pro/slider/deprecated/save/0.60.1/save.js b/src/blocks/slider/deprecated/save/0.60.1/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/0.60.1/save.js rename to src/blocks/slider/deprecated/save/0.60.1/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/1.0.16/save.js b/src/blocks/slider/deprecated/save/1.0.16/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/1.0.16/save.js rename to src/blocks/slider/deprecated/save/1.0.16/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/1.10.0/save.js b/src/blocks/slider/deprecated/save/1.10.0/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/1.10.0/save.js rename to src/blocks/slider/deprecated/save/1.10.0/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/1.13.1/save.js b/src/blocks/slider/deprecated/save/1.13.1/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/1.13.1/save.js rename to src/blocks/slider/deprecated/save/1.13.1/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/1.2.1/save.js b/src/blocks/slider/deprecated/save/1.2.1/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/1.2.1/save.js rename to src/blocks/slider/deprecated/save/1.2.1/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/1.33.2/save.js b/src/blocks/slider/deprecated/save/1.33.2/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/1.33.2/save.js rename to src/blocks/slider/deprecated/save/1.33.2/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/1.34.1/save.js b/src/blocks/slider/deprecated/save/1.34.1/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/1.34.1/save.js rename to src/blocks/slider/deprecated/save/1.34.1/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/1.9.1/save.js b/src/blocks/slider/deprecated/save/1.9.1/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/1.9.1/save.js rename to src/blocks/slider/deprecated/save/1.9.1/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/1.9.2/save.js b/src/blocks/slider/deprecated/save/1.9.2/save.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/1.9.2/save.js rename to src/blocks/slider/deprecated/save/1.9.2/save.js diff --git a/src/blocks/_pro/slider/deprecated/save/index.js b/src/blocks/slider/deprecated/save/index.js similarity index 100% rename from src/blocks/_pro/slider/deprecated/save/index.js rename to src/blocks/slider/deprecated/save/index.js diff --git a/src/blocks/_pro/slider/edit.js b/src/blocks/slider/edit.js similarity index 100% rename from src/blocks/_pro/slider/edit.js rename to src/blocks/slider/edit.js diff --git a/src/blocks/_pro/slider/icon.svg b/src/blocks/slider/icon.svg similarity index 100% rename from src/blocks/_pro/slider/icon.svg rename to src/blocks/slider/icon.svg diff --git a/src/blocks/_pro/slider/index.js b/src/blocks/slider/index.js similarity index 100% rename from src/blocks/_pro/slider/index.js rename to src/blocks/slider/index.js diff --git a/src/blocks/_pro/slider/index.php b/src/blocks/slider/index.php similarity index 93% rename from src/blocks/_pro/slider/index.php rename to src/blocks/slider/index.php index ee46eea3c..25ba6b81b 100644 --- a/src/blocks/_pro/slider/index.php +++ b/src/blocks/slider/index.php @@ -15,7 +15,7 @@ function vk_blocks_register_block_slider() { if ( ! is_admin() ) { wp_register_style( 'vk-blocks/slider', - VK_BLOCKS_DIR_URL . 'build/_pro/slider/style.css', + VK_BLOCKS_DIR_URL . 'build/slider/style.css', array( 'vk-swiper-style' ), VK_BLOCKS_VERSION ); diff --git a/src/blocks/_pro/slider/save.js b/src/blocks/slider/save.js similarity index 100% rename from src/blocks/_pro/slider/save.js rename to src/blocks/slider/save.js diff --git a/src/blocks/_pro/slider/style.scss b/src/blocks/slider/style.scss similarity index 100% rename from src/blocks/_pro/slider/style.scss rename to src/blocks/slider/style.scss diff --git a/src/blocks/_pro/slider/view.js b/src/blocks/slider/view.js similarity index 100% rename from src/blocks/_pro/slider/view.js rename to src/blocks/slider/view.js diff --git a/test/integration/full-content/full-content.test.js b/test/integration/full-content/full-content.test.js index 33dbd1ac2..3918b5fcf 100644 --- a/test/integration/full-content/full-content.test.js +++ b/test/integration/full-content/full-content.test.js @@ -27,47 +27,47 @@ import { writeBlockFixtureParsedJSON, writeBlockFixtureJSON, writeBlockFixtureSerializedHTML, -/** - * NOTE: node moudle内から、utils.jsをコピーしてパスを書き換え。 - * 元は、'@wordpress/e2e-tests/fixtures' を参照。 - */ + /** + * NOTE: node moudle内から、utils.jsをコピーしてパスを書き換え。 + * 元は、'@wordpress/e2e-tests/fixtures' を参照。 + */ } from '../../e2e-tests/fixtures/utils'; const blockBasenames = getAvailableBlockFixturesBasenames(); import { registerVKBlocks } from '@vkblocks/blocks/bundle' -function normalizeParsedBlocks( blocks ) { - return blocks.map( ( block, index ) => { +function normalizeParsedBlocks(blocks) { + return blocks.map((block, index) => { // Clone and remove React-instance-specific stuff; also, attribute // values that equal `undefined` will be removed. Validation issues // add too much noise so they get removed as well. block = JSON.parse( - JSON.stringify( omit( block, 'validationIssues' ) ) + JSON.stringify(omit(block, 'validationIssues')) ); // Change client IDs to a predictable value block.clientId = '_clientId_' + index; // Recurse to normalize inner blocks - block.innerBlocks = normalizeParsedBlocks( block.innerBlocks ); + block.innerBlocks = normalizeParsedBlocks(block.innerBlocks); return block; - } ); + }); } -describe( 'full post content fixture', () => { +describe('full post content fixture', () => { - beforeAll( async () => { + beforeAll(async () => { // VK Blocksが出力している wpVersion を定義 - Object.defineProperty( window, 'wpVersion', { + Object.defineProperty(window, 'wpVersion', { value: '5.6', writable: false, - } ); + }); // Load all hooks that modify blocks - require( './../../../src/blocks/_pro/slider' ); + require('./../../../src/blocks/slider'); // ブロックカテゴリー取得 const blockCategories = getCategories(); @@ -75,27 +75,27 @@ describe( 'full post content fixture', () => { // カスタムカテゴリー追加 setCategories([ ...blockCategories, - {slug: 'vk-blocks-cat', title: 'VKBlocks'}, - {slug: 'vk-blocks-cat-layout', title: 'VKBlocks Layout'}, + { slug: 'vk-blocks-cat', title: 'VKBlocks' }, + { slug: 'vk-blocks-cat-layout', title: 'VKBlocks Layout' }, ]) //カスタムブロック登録 registerVKBlocks(); - } ); + }); - blockBasenames.forEach( ( basename ) => { + blockBasenames.forEach((basename) => { - it( basename, () => { + it(basename, () => { // フィクスチャーの元データを取得 const { filename: htmlFixtureFileName, file: htmlFixtureContent, - } = getBlockFixtureHTML( basename ); - if ( htmlFixtureContent === null ) { + } = getBlockFixtureHTML(basename); + if (htmlFixtureContent === null) { throw new Error( - `Missing fixture file: ${ htmlFixtureFileName }` + `Missing fixture file: ${htmlFixtureFileName}` ); } @@ -103,21 +103,21 @@ describe( 'full post content fixture', () => { const { filename: parsedJSONFixtureFileName, file: parsedJSONFixtureContent, - } = getBlockFixtureParsedJSON( basename ); + } = getBlockFixtureParsedJSON(basename); // パースしたブロックを取得 - const parserOutputActual = grammarParse( htmlFixtureContent ); + const parserOutputActual = grammarParse(htmlFixtureContent); let parserOutputExpectedString; //JSON化したブロックがある場合、結果として返す - if ( parsedJSONFixtureContent ) { + if (parsedJSONFixtureContent) { parserOutputExpectedString = parsedJSONFixtureContent; - // 環境変数を渡すと、フィクスチャー生成 - } else if ( process.env.GENERATE_MISSING_FIXTURES ) { + // 環境変数を渡すと、フィクスチャー生成 + } else if (process.env.GENERATE_MISSING_FIXTURES) { parserOutputExpectedString = - JSON.stringify( parserOutputActual, null, 4 ) + '\n'; + JSON.stringify(parserOutputActual, null, 4) + '\n'; //.parsed.json 生成 writeBlockFixtureParsedJSON( basename, @@ -125,7 +125,7 @@ describe( 'full post content fixture', () => { ); } else { throw new Error( - `Missing fixture file: ${ parsedJSONFixtureFileName }` + `Missing fixture file: ${parsedJSONFixtureFileName}` ); } @@ -133,8 +133,8 @@ describe( 'full post content fixture', () => { parserOutputExpectedString ); try { - expect( parserOutputActual ).toEqual( parserOutputExpected ); - } catch ( err ) { + expect(parserOutputActual).toEqual(parserOutputExpected); + } catch (err) { throw new Error( format( "File '%s' does not match expected value:\n\n%s", @@ -144,13 +144,13 @@ describe( 'full post content fixture', () => { ); } - const blocksActual = parse( htmlFixtureContent ); + const blocksActual = parse(htmlFixtureContent); // Block validation may log errors during deprecation migration, // unless explicitly handled from a valid block via isEligible. // Match on basename for deprecated blocks fixtures to allow. - const isDeprecated = /__deprecated([-_]|$)/.test( basename ); - if ( isDeprecated ) { + const isDeprecated = /__deprecated([-_]|$)/.test(basename); + if (isDeprecated) { /* eslint-disable no-console */ console.warn.mockReset(); console.error.mockReset(); @@ -164,32 +164,32 @@ describe( 'full post content fixture', () => { const { filename: jsonFixtureFileName, file: jsonFixtureContent, - } = getBlockFixtureJSON( basename ); + } = getBlockFixtureJSON(basename); let blocksExpectedString; - if ( jsonFixtureContent ) { + if (jsonFixtureContent) { blocksExpectedString = jsonFixtureContent; - // 環境変数を渡すと、フィクスチャー生成 - } else if ( process.env.GENERATE_MISSING_FIXTURES ) { + // 環境変数を渡すと、フィクスチャー生成 + } else if (process.env.GENERATE_MISSING_FIXTURES) { blocksExpectedString = - JSON.stringify( blocksActualNormalized, null, 4 ) + '\n'; + JSON.stringify(blocksActualNormalized, null, 4) + '\n'; //.json 生成 - writeBlockFixtureJSON( basename, blocksExpectedString ); + writeBlockFixtureJSON(basename, blocksExpectedString); } else { throw new Error( - `Missing fixture file: ${ jsonFixtureFileName }` + `Missing fixture file: ${jsonFixtureFileName}` ); } - const blocksExpected = JSON.parse( blocksExpectedString ); + const blocksExpected = JSON.parse(blocksExpectedString); try { - expect( blocksActualNormalized ).toEqual( blocksExpected ); - } catch ( err ) { + expect(blocksActualNormalized).toEqual(blocksExpected); + } catch (err) { throw new Error( format( "File '%s' does not match expected value:\n\n%s", @@ -201,27 +201,27 @@ describe( 'full post content fixture', () => { // `serialize` doesn't have a trailing newline, but the fixture // files should. - const serializedActual = serialize( blocksActual ) + '\n'; + const serializedActual = serialize(blocksActual) + '\n'; const { filename: serializedHTMLFileName, file: serializedHTMLFixtureContent, - } = getBlockFixtureSerializedHTML( basename ); + } = getBlockFixtureSerializedHTML(basename); let serializedExpected; - if ( serializedHTMLFixtureContent ) { + if (serializedHTMLFixtureContent) { serializedExpected = serializedHTMLFixtureContent; - } else if ( process.env.GENERATE_MISSING_FIXTURES ) { + } else if (process.env.GENERATE_MISSING_FIXTURES) { serializedExpected = serializedActual; - writeBlockFixtureSerializedHTML( basename, serializedExpected ); + writeBlockFixtureSerializedHTML(basename, serializedExpected); } else { throw new Error( - `Missing fixture file: ${ serializedHTMLFileName }` + `Missing fixture file: ${serializedHTMLFileName}` ); } try { - expect( serializedActual ).toEqual( serializedExpected ); - } catch ( err ) { + expect(serializedActual).toEqual(serializedExpected); + } catch (err) { throw new Error( format( "File '%s' does not match expected value:\n\n%s", @@ -230,48 +230,48 @@ describe( 'full post content fixture', () => { ) ); } - } ); - } ); + }); + }); /** * テスト実行 * */ - it( 'should be present for each block', () => { + it('should be present for each block', () => { const errors = []; getBlockTypes() - .map( ( block ) => block.name ) + .map((block) => block.name) // We don't want tests for each oembed provider, which all have the same // `save` functions and attributes. // The `core/template` is not worth testing here because it's never saved, it's covered better in e2e tests. .filter( - (name) => !['core/embed', 'core/template', 'vk-blocks/breadcrumb', 'vk-blocks/ancestor-page-list', 'vk-blocks/page-content', 'vk-blocks/post-list', 'vk-blocks/select-post-list-item', 'vk-blocks/child-page', 'vk-blocks/card-item', 'vk-blocks/grid-column-item', 'vk-blocks/gridcolcard-item', 'vk-blocks/gridcolcard-item-body', 'vk-blocks/gridcolcard-item-footer', 'vk-blocks/gridcolcard-item-header', 'vk-blocks/step-item', 'vk-blocks/timeline-item', 'vk-blocks/grid-column-item', 'vk-blocks/icon-card-item', 'vk-blocks/faq2-a', 'vk-blocks/faq2-q', 'vk-blocks/slider-item', 'vk-blocks/accordion-trigger', 'vk-blocks/accordion-target', ].includes( name ) + (name) => !['core/embed', 'core/template', 'vk-blocks/breadcrumb', 'vk-blocks/ancestor-page-list', 'vk-blocks/page-content', 'vk-blocks/post-list', 'vk-blocks/select-post-list-item', 'vk-blocks/child-page', 'vk-blocks/card-item', 'vk-blocks/grid-column-item', 'vk-blocks/gridcolcard-item', 'vk-blocks/gridcolcard-item-body', 'vk-blocks/gridcolcard-item-footer', 'vk-blocks/gridcolcard-item-header', 'vk-blocks/step-item', 'vk-blocks/timeline-item', 'vk-blocks/grid-column-item', 'vk-blocks/icon-card-item', 'vk-blocks/faq2-a', 'vk-blocks/faq2-q', 'vk-blocks/slider-item', 'vk-blocks/accordion-trigger', 'vk-blocks/accordion-target',].includes(name) ) - .forEach( ( name ) => { - const nameToFilename = blockNameToFixtureBasename( name ); + .forEach((name) => { + const nameToFilename = blockNameToFixtureBasename(name); const foundFixtures = blockBasenames .filter( - ( basename ) => + (basename) => basename === nameToFilename || - startsWith( basename, nameToFilename + '__' ) + startsWith(basename, nameToFilename + '__') ) - .map( ( basename ) => { + .map((basename) => { const { filename: htmlFixtureFileName, - } = getBlockFixtureHTML( basename ); + } = getBlockFixtureHTML(basename); const { file: jsonFixtureContent, - } = getBlockFixtureJSON( basename ); + } = getBlockFixtureJSON(basename); // The parser output for this test. For missing files, // JSON.parse( null ) === null. - const parserOutput = JSON.parse( jsonFixtureContent ); + const parserOutput = JSON.parse(jsonFixtureContent); // The name of the first block that this fixture file // contains (if any). const firstBlock = get( parserOutput, - [ '0', 'name' ], + ['0', 'name'], null ); return { @@ -279,10 +279,10 @@ describe( 'full post content fixture', () => { parserOutput, firstBlock, }; - } ) - .filter( ( fixture ) => fixture.parserOutput !== null ); + }) + .filter((fixture) => fixture.parserOutput !== null); - if ( ! foundFixtures.length ) { + if (!foundFixtures.length) { errors.push( format( "Expected a fixture file called '%s.html' or '%s__*.html'.", @@ -292,8 +292,8 @@ describe( 'full post content fixture', () => { ); } - foundFixtures.forEach( ( fixture ) => { - if ( name !== fixture.firstBlock ) { + foundFixtures.forEach((fixture) => { + if (name !== fixture.firstBlock) { errors.push( format( "Expected fixture file '%s' to test the '%s' block.", @@ -302,13 +302,13 @@ describe( 'full post content fixture', () => { ) ); } - } ); - } ); + }); + }); - if ( errors.length ) { + if (errors.length) { throw new Error( - 'Problem(s) with fixture files:\n\n' + errors.join( '\n' ) + 'Problem(s) with fixture files:\n\n' + errors.join('\n') ); } - } ); -} ); + }); +}); diff --git a/test/phpunit/pro/test-array-merge.php b/test/phpunit/pro/test-array-merge.php index 9ca7af0d2..77b05ba5a 100644 --- a/test/phpunit/pro/test-array-merge.php +++ b/test/phpunit/pro/test-array-merge.php @@ -181,6 +181,24 @@ public function test_vk_blocks_array_merge() { ), ), ), + // 配列 空配列であればそのままarray()を返す + array( + 'args' => array( + 'array_key' => array(), + ), + 'defaults' => array( + 'array_key' => array( + array( + 'array_key_1' => 'array_defaults_value_1_1', + 'array_key_2' => 'array_defaults_value_1_2', + 'array_key_3' => 'array_defaults_value_1_3', + ), + ), + ), + 'correct' => array( + 'array_key' => array(), + ), + ), ); print PHP_EOL; print '------------------------------------' . PHP_EOL; diff --git a/vk-blocks.php b/vk-blocks.php index 046f62db5..c54330852 100644 --- a/vk-blocks.php +++ b/vk-blocks.php @@ -3,8 +3,8 @@ * Plugin Name: VK Blocks Pro * Plugin URI: https://github.com/vektor-inc/vk-blocks * Description: This is a plugin that extends Gutenberg's blocks. - * Version: 1.46.0.0 - * Stable tag: 1.44.0.1 + * Version: 1.47.0.0 + * Stable tag: 1.46.0.1 * Requires at least: 5.9 * Author: Vektor,Inc. * Author URI: https://vektor-inc.co.jp