diff --git a/inc/vk-blocks/vk-blocks-functions.php b/inc/vk-blocks/vk-blocks-functions.php index 0af5c2970..01f0ac87c 100644 --- a/inc/vk-blocks/vk-blocks-functions.php +++ b/inc/vk-blocks/vk-blocks-functions.php @@ -55,12 +55,30 @@ function vk_blocks_active() { return true; } +// 翻訳を実行 add_action( 'plugins_loaded', function () { - // Load language files. - $path = dirname( plugin_basename( __FILE__ ) ) . '/languages'; - load_plugin_textdomain( 'vk-blocks-pro', false, $path ); + // サイトのロケールを取得 + $locale = determine_locale(); + // 翻訳ファイルのパスを指定 + $path = plugin_dir_path( __FILE__ ) . 'languages'; + + // 日本語の設定のみ翻訳ファイルを読み込み + if ( strpos( $locale, 'ja' ) === 0 ) { + // PHPファイルの翻訳読み込み + load_textdomain( 'vk-blocks-pro', $path . '/vk-blocks-pro-ja.mo' ); + + // JavaScriptファイルの翻訳設定 + add_action( + 'wp_enqueue_scripts', + function () use ( $path ) { + // スクリプト登録後に翻訳設定 + wp_set_script_translations( 'vk-blocks-build-js', 'vk-blocks-pro', $path ); + wp_set_script_translations( 'vk-blocks-admin-js', 'vk-blocks-pro', $path ); + } + ); + } } ); diff --git a/readme.txt b/readme.txt index 7d967c1c5..55dec11a4 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: vektor-inc,kurudrive,naoki0h,nc30,una9,kaorock72,rickaddison7634,mimitips,mthaichi,shimotomoki,sysbird,chiakikouno,doshimaf,mtdkei Donate link: Tags: Gutenberg,FAQ,alert -Requires at least: 6.3 -Tested up to: 6.6 -Stable tag: 1.90.0.1 +Requires at least: 6.4 +Tested up to: 6.7 +Stable tag: 1.90.1.1 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -106,6 +106,10 @@ e.g. == Changelog == += 1.91.0 = +[ Specification change ] Adjusted translation file loading to comply with changes in WordPress 6.7. +[ Bug fix ][ Table of Contents (Pro) ] Fixed "CLOSE" label not appearing after clicking the "OPEN" button when the initial state is set to "CLOSE". + = 1.90.1 = [ Bug fix ][ Cover ] Fixed inline styles not being retained when adding a link. diff --git a/src/blocks/_pro/animation/deprecated/hooks/0.49.7/index.js b/src/blocks/_pro/animation/deprecated/hooks/0.49.7/index.js deleted file mode 100644 index 9752706c6..000000000 --- a/src/blocks/_pro/animation/deprecated/hooks/0.49.7/index.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function SliderHook0_49_7( {el, attributes}) { - return( -
- - {el} -
- ); -} diff --git a/src/blocks/_pro/animation/deprecated/hooks/0.58.7/index.js b/src/blocks/_pro/animation/deprecated/hooks/0.58.7/index.js deleted file mode 100644 index e6064d816..000000000 --- a/src/blocks/_pro/animation/deprecated/hooks/0.58.7/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function SliderHook0_58_7( {el, attributes}) { - return el; -} diff --git a/src/blocks/_pro/animation/deprecated/hooks/index.js b/src/blocks/_pro/animation/deprecated/hooks/index.js index b68328aa1..d6d1738de 100644 --- a/src/blocks/_pro/animation/deprecated/hooks/index.js +++ b/src/blocks/_pro/animation/deprecated/hooks/index.js @@ -1,8 +1 @@ -import SliderHook0_49_7 from './0.49.7' -import SliderHook0_58_7 from './0.58.7' -export default [ - SliderHook0_58_7, // for 1.46.0 - SliderHook0_58_7, // for 1.34.1 - SliderHook0_58_7, // for 0.58.7 - SliderHook0_49_7 -]; +export default []; diff --git a/src/blocks/_pro/animation/deprecated/save/0.49.1/save.js b/src/blocks/_pro/animation/deprecated/save/0.49.1/save.js deleted file mode 100644 index f9a049aa2..000000000 --- a/src/blocks/_pro/animation/deprecated/save/0.49.1/save.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Animation block - * - */ -import classNames from "classnames"; -import { InnerBlocks } from '@wordpress/block-editor'; - -export default function save ( props ) { - let { effect, speed, range, clientId } = props.attributes; - - //For recovering block. - effect = effect ? effect : "slide-up" - speed = speed ? speed : "fast" - range = range ? range : "short" - - return ( -
- -
- ); -} diff --git a/src/blocks/_pro/animation/deprecated/save/0.58.7/save.js b/src/blocks/_pro/animation/deprecated/save/0.58.7/save.js deleted file mode 100644 index 249438ede..000000000 --- a/src/blocks/_pro/animation/deprecated/save/0.58.7/save.js +++ /dev/null @@ -1,21 +0,0 @@ -import classNames from "classnames"; -import { InnerBlocks } from '@wordpress/block-editor'; - -export default function save( props ) { - let { effect, speed, range, clientId } = props.attributes; - - //For recovering block. - effect = effect ? effect : 'slide-up'; - speed = speed ? speed : 'fast'; - range = range ? range : 'short'; - - return ( -
- -
- ); -} diff --git a/src/blocks/_pro/animation/deprecated/save/index.js b/src/blocks/_pro/animation/deprecated/save/index.js index f160263fa..496f750c3 100644 --- a/src/blocks/_pro/animation/deprecated/save/index.js +++ b/src/blocks/_pro/animation/deprecated/save/index.js @@ -1,5 +1,3 @@ -import save0_49_1 from "./0.49.1/save" -import save0_58_7 from "./0.58.7/save" import save1_34_1 from "./1.34.1/save" import save1_46_0 from "./1.46.0/save" @@ -54,14 +52,6 @@ const deprecated = [ { attributes: blockAttributes2, save: save1_34_1 - }, - { - attributes: blockAttributes2, - save: save0_58_7 - }, - { - attributes: blockAttributes2, - save: save0_49_1 } ]; diff --git a/src/blocks/_pro/animation/index.js b/src/blocks/_pro/animation/index.js index 80f09a16a..279ae82e2 100644 --- a/src/blocks/_pro/animation/index.js +++ b/src/blocks/_pro/animation/index.js @@ -34,7 +34,7 @@ export const settings = { */ const addAnimationActiveClass = (el, type, attributes) => { if ('vk-blocks/animation' === type.name) { - //現在実行されている deprecated内の save関数のindexを取得 + // 現在実行されている deprecated 内の save 関数の index を取得 const deprecatedFuncIndex = deprecated.findIndex( (item) => item.save === type.save ); @@ -42,9 +42,18 @@ const addAnimationActiveClass = (el, type, attributes) => { // 最新版 if (-1 === deprecatedFuncIndex) { return el; + } - //後方互換 + // deprecatedFuncIndex が予期せぬ数値の場合も考慮して、エラーハンドリングを強化 + if ( + deprecatedFuncIndex >= 0 && + deprecatedFuncIndex < deprecatedHooks.length && + deprecatedHooks[deprecatedFuncIndex] + ) { + return el; } + + // 後方互換 const DeprecatedHook = deprecatedHooks[deprecatedFuncIndex]; return ; } diff --git a/src/blocks/_pro/table-of-contents-new/style.scss b/src/blocks/_pro/table-of-contents-new/style.scss index 5b9246bfd..5549ed95d 100644 --- a/src/blocks/_pro/table-of-contents-new/style.scss +++ b/src/blocks/_pro/table-of-contents-new/style.scss @@ -91,7 +91,7 @@ $toc-left-margin: 1rem; width: 100%; overflow: hidden; &_content-open { - max-height: auto; + max-height: 100%; padding: 1em; transition: all 0.35s; } @@ -109,16 +109,30 @@ $toc-left-margin: 1rem; } } // :checked - input:checked { + input:checked~.button_status-open { + ~ .tab_content-open { + max-height: 100%; + padding: 1em; + } + } + .button_status-open { ~ .tab_content-open { max-height: 0; padding: 0 1em; } + } + input:checked~.button_status-close { ~ .tab_content-close { max-height: 100%; padding: 1em; } } + .button_status-close { + ~ .tab_content-close { + max-height: 0; + padding: 0 1em; + } + } .vk_tableOfContents_list { margin-bottom: 0; // for lightning @@ -149,3 +163,20 @@ $toc-left-margin: 1rem; } } } + +/* 編集画面 +/*-------------------------------------------*/ +.editor-styles-wrapper { + input:checked~.button_status-open { + ~ .tab_content-open { + max-height: 0; + padding: 0 1em; + } + } + .button_status-open { + ~ .tab_content-open { + max-height: 100%; + padding: 1em; + } + } +} \ No newline at end of file diff --git a/src/blocks/_pro/table-of-contents-new/view.js b/src/blocks/_pro/table-of-contents-new/view.js index d108d6838..5c3f9d851 100644 --- a/src/blocks/_pro/table-of-contents-new/view.js +++ b/src/blocks/_pro/table-of-contents-new/view.js @@ -7,15 +7,28 @@ document.addEventListener('DOMContentLoaded', () => { // 開/閉 切り替え (:before 疑似要素のアクセシビリティ問題に対応 #2087) document.querySelectorAll('#vk-tab-label').forEach((item) => { + const status = item.previousElementSibling; // チェックボックス + const tabContent = item + .closest('.tab') + .querySelector('.tab_content-open, .tab_content-close'); + const initialStateOpen = + tabContent.classList.contains('tab_content-open'); + + // 初期状態に基づいてボタンのテキストとチェックボックスの状態を設定 + if (initialStateOpen) { + item.textContent = 'CLOSE'; + status.checked = true; + } else { + item.textContent = 'OPEN'; + status.checked = false; + } + + // ボタンクリック時にテキストをトグル item.addEventListener('click', function () { - // 直前にあるチェックボックスで判断する - const status = item.previousElementSibling; if (status && status.type === 'checkbox') { - if (status.checked) { - item.textContent = 'CLOSE'; - } else { - item.textContent = 'OPEN'; - } + setTimeout(() => { + item.textContent = status.checked ? 'CLOSE' : 'OPEN'; + }, 0); } }); }); diff --git a/src/blocks/alert/deprecated/0.0.0/save.js b/src/blocks/alert/deprecated/0.0.0/save.js deleted file mode 100644 index 961cbf5d8..000000000 --- a/src/blocks/alert/deprecated/0.0.0/save.js +++ /dev/null @@ -1,10 +0,0 @@ -import { RichText } from '@wordpress/block-editor'; - -export default function save({ attributes }) { - const { style, content } = attributes; - return ( -
- -
- ); -} diff --git a/src/blocks/alert/deprecated/index.js b/src/blocks/alert/deprecated/index.js index 177fd9f90..4117a2283 100644 --- a/src/blocks/alert/deprecated/index.js +++ b/src/blocks/alert/deprecated/index.js @@ -1,5 +1,4 @@ import { save as save1_79_0, migrate as migrate1_79_0 } from './1.79.0/save'; -import save000 from './0.0.0/save'; const blockAttributes = { style: { @@ -19,9 +18,5 @@ const deprecated = [ migrate: migrate1_79_0, save: save1_79_0, }, - { - attributes: blockAttributes, - save: save000, - }, ]; export default deprecated; diff --git a/src/blocks/faq/deprecated/0.0.0/save.js b/src/blocks/faq/deprecated/0.0.0/save.js deleted file mode 100644 index 892ec2261..000000000 --- a/src/blocks/faq/deprecated/0.0.0/save.js +++ /dev/null @@ -1,20 +0,0 @@ -import { RichText } from '@wordpress/block-editor'; - -export default function save({ attributes, className }) { - const { heading, content } = attributes; - - return ( -
- - -
- ); -} diff --git a/src/blocks/faq/deprecated/0.0.1/save.js b/src/blocks/faq/deprecated/0.0.1/save.js deleted file mode 100644 index 4d5f3b158..000000000 --- a/src/blocks/faq/deprecated/0.0.1/save.js +++ /dev/null @@ -1,20 +0,0 @@ -import { RichText } from '@wordpress/block-editor'; - -export default function save({ attributes }) { - const { heading, content } = attributes; - - return ( -
- - -
- ); -} diff --git a/src/blocks/faq/deprecated/0.0.2/save.js b/src/blocks/faq/deprecated/0.0.2/save.js deleted file mode 100644 index 22ca87f96..000000000 --- a/src/blocks/faq/deprecated/0.0.2/save.js +++ /dev/null @@ -1,17 +0,0 @@ -import { RichText, InnerBlocks } from '@wordpress/block-editor'; - -export default function save({ attributes }) { - const { heading } = attributes; - return ( -
- -
- -
-
- ); -} diff --git a/src/blocks/faq/deprecated/0.58.6/save.js b/src/blocks/faq/deprecated/0.58.6/save.js deleted file mode 100644 index 20a4c424b..000000000 --- a/src/blocks/faq/deprecated/0.58.6/save.js +++ /dev/null @@ -1,17 +0,0 @@ -import { RichText, InnerBlocks } from '@wordpress/block-editor'; - -export default function save({ attributes }) { - const { heading } = attributes; - return ( -
- -
- -
-
- ); -} diff --git a/src/blocks/faq/deprecated/index.js b/src/blocks/faq/deprecated/index.js index 3502275dc..33be628fe 100644 --- a/src/blocks/faq/deprecated/index.js +++ b/src/blocks/faq/deprecated/index.js @@ -1,7 +1,3 @@ -import save000 from './0.0.0/save'; -import save001 from './0.0.1/save'; -import save002 from './0.0.2/save'; -import save0_58_6 from './0.58.6/save'; import save1_76_2 from './1.76.2/save'; const blockAttributes = { @@ -18,26 +14,6 @@ const blockAttributes = { }; const deprecated = [ - { - attributes: blockAttributes, - save: save000, - }, - { - attributes: blockAttributes, - save: save001, - }, - { - attributes: { - ...blockAttributes, - }, - save: save002, - }, - { - attributes: { - ...blockAttributes, - }, - save: save0_58_6, - }, { attributes: { ...blockAttributes, diff --git a/src/blocks/faq2-a/deprecated/0.58.7/save.js b/src/blocks/faq2-a/deprecated/0.58.7/save.js deleted file mode 100644 index 15b616d49..000000000 --- a/src/blocks/faq2-a/deprecated/0.58.7/save.js +++ /dev/null @@ -1,9 +0,0 @@ -import { InnerBlocks } from '@wordpress/block-editor'; - -export default function save() { - return ( -
- -
- ); -} diff --git a/src/blocks/faq2-a/deprecated/index.js b/src/blocks/faq2-a/deprecated/index.js index ebeb98acd..941ba0e2f 100644 --- a/src/blocks/faq2-a/deprecated/index.js +++ b/src/blocks/faq2-a/deprecated/index.js @@ -1,4 +1,3 @@ -import save000 from './0.58.7/save'; import save1_76_2 from './1.76.2/save'; const blockAttributes = {}; @@ -8,9 +7,5 @@ const deprecated = [ attributes: blockAttributes, save: save1_76_2, }, - { - attributes: blockAttributes, - save: save000, - }, ]; export default deprecated; diff --git a/src/blocks/faq2-q/deprecated/0.58.7/save.js b/src/blocks/faq2-q/deprecated/0.58.7/save.js deleted file mode 100644 index 92316bc8c..000000000 --- a/src/blocks/faq2-q/deprecated/0.58.7/save.js +++ /dev/null @@ -1,9 +0,0 @@ -import { InnerBlocks } from '@wordpress/block-editor'; - -export default function save() { - return ( -
- -
- ); -} diff --git a/src/blocks/faq2-q/deprecated/index.js b/src/blocks/faq2-q/deprecated/index.js index 3f13a9046..941ba0e2f 100644 --- a/src/blocks/faq2-q/deprecated/index.js +++ b/src/blocks/faq2-q/deprecated/index.js @@ -1,13 +1,8 @@ -import save000 from './0.58.7/save'; import save1_76_2 from './1.76.2/save'; const blockAttributes = {}; const deprecated = [ - { - attributes: blockAttributes, - save: save000, - }, { attributes: blockAttributes, save: save1_76_2, diff --git a/src/blocks/faq2/deprecated/0.0.0/save.js b/src/blocks/faq2/deprecated/0.0.0/save.js deleted file mode 100644 index bd5defd1c..000000000 --- a/src/blocks/faq2/deprecated/0.0.0/save.js +++ /dev/null @@ -1,9 +0,0 @@ -import { InnerBlocks } from '@wordpress/block-editor'; - -export default function save() { - return ( -
- -
- ); -} diff --git a/src/blocks/faq2/deprecated/index.js b/src/blocks/faq2/deprecated/index.js index 229186b16..047439a9e 100644 --- a/src/blocks/faq2/deprecated/index.js +++ b/src/blocks/faq2/deprecated/index.js @@ -1,4 +1,3 @@ -import save000 from './0.0.0/save'; import save1_3_9 from './1.3.9/save'; import save1_76_2 from './1.76.2/save'; const blockAttributes = { @@ -20,10 +19,6 @@ const deprecated = [ { attributes: blockAttributes, save: save1_3_9, - }, - { - attributes: blockAttributes, - save: save000, } ]; export default deprecated; diff --git a/src/blocks/flow/deprecated/0.0.0/save.js b/src/blocks/flow/deprecated/0.0.0/save.js deleted file mode 100644 index dd913b488..000000000 --- a/src/blocks/flow/deprecated/0.0.0/save.js +++ /dev/null @@ -1,31 +0,0 @@ -import { RichText } from '@wordpress/block-editor'; - -export default function save({ attributes }) { - const { heading, content, insertImage, arrowFlag } = attributes; - - return ( -
-
-
- - -
- {insertImage ? ( -
- -
- ) : ( - '' - )} -
-
- ); -} diff --git a/src/blocks/flow/deprecated/index.js b/src/blocks/flow/deprecated/index.js index 71a087f94..326c60d01 100644 --- a/src/blocks/flow/deprecated/index.js +++ b/src/blocks/flow/deprecated/index.js @@ -1,4 +1,3 @@ -import save000 from './0.0.0/save'; import save1_8_0 from './1.8.0/save'; @@ -28,9 +27,5 @@ const deprecated = [ attributes: blockAttributes, save: save1_8_0, }, - { - attributes: blockAttributes, - save: save000, - }, ]; export default deprecated; diff --git a/src/blocks/pr-content/deprecated/0.0.0/save.js b/src/blocks/pr-content/deprecated/0.0.0/save.js deleted file mode 100644 index e45b7435d..000000000 --- a/src/blocks/pr-content/deprecated/0.0.0/save.js +++ /dev/null @@ -1,229 +0,0 @@ -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component } from '@wordpress/element'; -import { MediaUpload, RichText } from '@wordpress/block-editor'; - -import classNames from 'classnames'; -import { Fontawesome } from '../component-fontawesome-deprecated'; - -class PRContent extends Component { - render() { - const attributes = this.props.attributes; - const { - title, - titleColor, - content, - contentColor, - url, - buttonType, - buttonColor, - buttonColorCustom, - buttonText, - buttonTarget, - Image, - ImageBorderColor, - layout, - } = attributes; - - const setAttributes = this.props.setAttributes; - const className = this.props.className; - const for_ = this.props.for_; - let containerClass = 'vk_prContent'; - let btnClass = 'vk_button'; - let aClass = 'btn btn-block vk_button_link vk_prContent_colTxt_btn'; - let aStyle = {}; - let imageBorderProperty = ''; - - if (layout === 'right') { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageRight' - ); - } else { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageLeft' - ); - } - - if (buttonColorCustom) { - btnClass = `${btnClass} vk_button-color-custom`; - aClass = `${aClass} btn-primary`; - - // 塗り - if (buttonType === '0') { - aStyle = { - backgroundColor: buttonColorCustom, - border: `1px solid ${buttonColorCustom}`, - }; - // 塗りなし - } else if (buttonType === '1') { - aStyle = { - backgroundColor: 'transparent', - border: '1px solid ' + buttonColorCustom, - color: buttonColorCustom, - }; - } - - // カスタムカラーじゃない場合 - } else if (!buttonColorCustom) { - // 塗り - if (buttonType === '0') { - aClass = `${aClass} btn-${buttonColor}`; - aStyle = null; - // 塗りなし - } else if (buttonType === '1') { - aClass = `${aClass} btn-outline-${buttonColor}`; - aStyle = null; - } - } - - //borderColorが指定されなかった場合はボーダーを非表示に - if (ImageBorderColor === null || ImageBorderColor === undefined) { - imageBorderProperty = 'none'; - } else { - imageBorderProperty = `1px solid ${ImageBorderColor}`; - } - - return ( -
-
- {for_ === 'edit' ? ( - - setAttributes({ Image: value.sizes.full.url }) - } - type=" image" - value={Image} - render={({ open }) => ( - - )} - /> - ) : !Image ? ( - __('Select image', 'vk-blocks-pro') - ) : ( - {__('Upload - )} -
-
- {(() => { - if (for_ === 'edit') { - return ( - <> - - setAttributes({ title: value }) - } - value={title} - placeholder={__( - 'Input title.', - 'vk-blocks-pro' - )} - style={{ color: titleColor }} - /> - - setAttributes({ content: value }) - } - value={content} - placeholder={__( - 'Input content.', - 'vk-blocks-pro' - )} - style={{ color: contentColor }} - /> - - ); - } - return ( - <> - - - - ); - })()} - { - //ボタンテキストが入力されるとボタンを表示。 - (() => { - if (buttonText !== '' && buttonText !== undefined) { - return ( -
- - - -
- ); - } - })() - } -
-
- ); - } -} - -export default function save({ attributes, className }) { - return ( - - ); -} diff --git a/src/blocks/pr-content/deprecated/0.0.1/save.js b/src/blocks/pr-content/deprecated/0.0.1/save.js deleted file mode 100644 index 165b5180e..000000000 --- a/src/blocks/pr-content/deprecated/0.0.1/save.js +++ /dev/null @@ -1,205 +0,0 @@ -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component } from '@wordpress/element'; -import { MediaUpload, RichText } from '@wordpress/block-editor'; -import { Fontawesome } from '../component-fontawesome-deprecated'; - -export class PRContent extends Component { - render() { - const attributes = this.props.attributes; - const { - title, - titleColor, - content, - contentColor, - url, - buttonType, - buttonColor, - buttonColorCustom, - buttonText, - buttonTarget, - Image, - ImageBorderColor, - layout, - fontAwesomeIconBefore, - fontAwesomeIconAfter, - } = attributes; - const setAttributes = this.props.setAttributes; - const for_ = this.props.for_; - let containerClass = 'vk_prContent'; - let btnClass = 'vk_button'; - let aClass = 'btn btn-block vk_button_link vk_prContent_colTxt_btn'; - let aStyle = {}; - - if (layout === 'right') { - containerClass = `${containerClass} vk_prContent-layout-imageRight`; - } else { - containerClass = `${containerClass} vk_prContent-layout-imageLeft`; - } - - if (buttonColorCustom) { - btnClass = `${btnClass} vk_button-color-custom`; - aClass = `${aClass} btn-primary`; - - // 塗り - if (buttonType === '0') { - aStyle = { - backgroundColor: buttonColorCustom, - border: `1px solid ${buttonColorCustom}`, - }; - // 塗りなし - } else if (buttonType === '1') { - aStyle = { - backgroundColor: 'transparent', - border: '1px solid ' + buttonColorCustom, - color: buttonColorCustom, - }; - } - - // カスタムカラーじゃない場合 - } else if (!buttonColorCustom) { - // 塗り - if (buttonType === '0') { - aClass = `${aClass} btn-${buttonColor}`; - aStyle = null; - // 塗りなし - } else if (buttonType === '1') { - aClass = `${aClass} btn-outline-${buttonColor}`; - aStyle = null; - } - } - - return ( -
-
- {for_ === 'edit' ? ( - - setAttributes({ Image: value.sizes.full.url }) - } - type=" image" - value={Image} - render={({ open }) => ( - - )} - /> - ) : !Image ? ( - __('Select image', 'vk-blocks-pro') - ) : ( - {__('Upload - )} -
-
- {(() => { - if (for_ === 'edit') { - return ( - <> - - setAttributes({ title: value }) - } - value={title} - placeholder={__( - 'Input title.', - 'vk-blocks-pro' - )} - style={{ color: titleColor }} - /> - - setAttributes({ content: value }) - } - value={content} - placeholder={__( - 'Input content.', - 'vk-blocks-pro' - )} - style={{ color: contentColor }} - /> - - ); - } - return ( - <> - - - - ); - })()} - { - //ボタンテキストが入力されるとボタンを表示。 - (() => { - if (buttonText !== '' && buttonText !== undefined) { - return ( -
- - - -
- ); - } - })() - } -
-
- ); - } -} - -export default function save({ attributes, className }) { - return ; -} diff --git a/src/blocks/pr-content/deprecated/0.0.2/save.js b/src/blocks/pr-content/deprecated/0.0.2/save.js deleted file mode 100644 index 6fcfafdf9..000000000 --- a/src/blocks/pr-content/deprecated/0.0.2/save.js +++ /dev/null @@ -1,328 +0,0 @@ -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component } from '@wordpress/element'; -import { MediaUpload, RichText } from '@wordpress/block-editor'; - -import classNames from 'classnames'; -import { fixBrokenUnicode } from '@vkblocks/utils/fixBrokenUnicode'; - -export class Fontawesome extends Component { - render() { - const { - buttonText, - fontAwesomeIconBefore, - fontAwesomeIconAfter, - } = this.props.attributes; - - let iconBefore = ''; - let iconAfter = ''; - - if (fontAwesomeIconBefore) { - iconBefore = ( - - ); - } - if (fontAwesomeIconAfter) { - iconAfter = ( - - ); - } - - return ( - <> - {iconBefore} - {buttonText} - {iconAfter} - - ); - } -} - -export class PRContent extends Component { - render() { - const attributes = this.props.attributes; - const { - title, - titleColor, - content, - contentColor, - url, - buttonType, - buttonColor, - buttonColorCustom, - buttonText, - buttonTarget, - Image, - ImageBorderColor, - layout, - fontAwesomeIconBefore, - fontAwesomeIconAfter, - } = attributes; - - const setAttributes = this.props.setAttributes; - const className = this.props.className; - const for_ = this.props.for_; - let containerClass = 'vk_prContent'; - let btnClass = 'vk_button'; - let aClass = 'btn btn-block vk_button_link vk_prContent_colTxt_btn'; - let aStyle = {}; - let imageBorderProperty = 'none'; - - if (layout === 'right') { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageRight' - ); - } else { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageLeft' - ); - } - - if (buttonColorCustom) { - btnClass = `${btnClass} vk_button-color-custom`; - aClass = `${aClass} btn-primary`; - - // 塗り - if (buttonType === '0') { - aStyle = { - backgroundColor: buttonColorCustom, - border: `1px solid ${buttonColorCustom}`, - }; - // 塗りなし - } else if (buttonType === '1') { - aStyle = { - backgroundColor: 'transparent', - border: '1px solid ' + buttonColorCustom, - color: buttonColorCustom, - }; - } - - // カスタムカラーじゃない場合 - } else if (!buttonColorCustom) { - // 塗り - if (buttonType === '0') { - aClass = `${aClass} btn-${buttonColor}`; - aStyle = null; - // 塗りなし - } else if (buttonType === '1') { - aClass = `${aClass} btn-outline-${buttonColor}`; - aStyle = null; - } - } - - //borderColorが指定されなかった場合はボーダーを非表示に - if (ImageBorderColor) { - imageBorderProperty = `1px solid ${ImageBorderColor}`; - } else { - imageBorderProperty = `none`; - } - - const saveImage = (value) => { - if (value) { - setAttributes({ Image: JSON.stringify(value) }); - } - }; - - const renderImage = (for_) => { - if (for_ === 'edit') { - if (Image && Image.indexOf('{') === -1) { - return ( - - setAttributes({ Image: value.sizes.full.url }) - } - type=" image" - value={Image} - render={({ open }) => ( - - )} - /> - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - return ( - ( - - )} - /> - ); - } else if (for_ === 'save') { - if (!Image) { - return __('Select image', 'vk-blocks-pro'); - } - if (Image && Image.indexOf('{') === -1) { - return ( - {__('Upload - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - if (ImageParse && typeof ImageParse.sizes !== 'undefined') { - return ( - {ImageParse.alt} - ); - } - return ''; - } - }; - - return ( -
-
- {renderImage(for_)} -
-
- {(() => { - if (for_ === 'edit') { - return ( - <> - - setAttributes({ title: value }) - } - value={title} - placeholder={__( - 'Input title.', - 'vk-blocks-pro' - )} - style={{ color: titleColor }} - /> - - setAttributes({ content: value }) - } - value={content} - placeholder={__( - 'Input content.', - 'vk-blocks-pro' - )} - style={{ color: contentColor }} - /> - - ); - } - return ( - <> - - - - ); - })()} - { - //ボタンテキストが入力されるとボタンを表示。 - (() => { - if (buttonText !== '' && buttonText !== undefined) { - return ( -
- - - -
- ); - } - })() - } -
-
- ); - } -} - -export default function save({ attributes, className }) { - return ( - - ); -} diff --git a/src/blocks/pr-content/deprecated/0.0.3/component-fontawesome.js b/src/blocks/pr-content/deprecated/0.0.3/component-fontawesome.js deleted file mode 100644 index 275a3160a..000000000 --- a/src/blocks/pr-content/deprecated/0.0.3/component-fontawesome.js +++ /dev/null @@ -1,34 +0,0 @@ -import parse from 'html-react-parser'; -import { Component } from '@wordpress/element'; - -export class Fontawesome extends Component { - render() { - let { - buttonText, - fontAwesomeIconAfter, - } = this.props.attributes; - - let iconAfter = ''; - let faIconFragmentAfter; - - //過去バージョンをリカバリーした時にiconを正常に表示する - if (fontAwesomeIconAfter && !fontAwesomeIconAfter.match(/`; - } - - if (fontAwesomeIconAfter) { - //add class and inline css - faIconFragmentAfter = fontAwesomeIconAfter.split(' '); - faIconFragmentAfter[1] = - ' ' + faIconFragmentAfter[1] + ` vk_button_link_after `; - iconAfter = faIconFragmentAfter.join(''); - } - - return ( - <> - {buttonText} - {parse(iconAfter)} - - ); - } -} diff --git a/src/blocks/pr-content/deprecated/0.0.3/component.js b/src/blocks/pr-content/deprecated/0.0.3/component.js deleted file mode 100644 index ec06f7c9c..000000000 --- a/src/blocks/pr-content/deprecated/0.0.3/component.js +++ /dev/null @@ -1,287 +0,0 @@ -import classNames from 'classnames'; -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component } from '@wordpress/element'; -import { MediaUpload, RichText } from '@wordpress/block-editor'; -import { fixBrokenUnicode } from '@vkblocks/utils/fixBrokenUnicode'; -import { Fontawesome } from './component-fontawesome'; - -export class PRcontent extends Component { - render() { - const attributes = this.props.attributes; - const { - title, - titleColor, - content, - contentColor, - url, - buttonType, - buttonColor, - buttonColorCustom, - buttonText, - buttonTarget, - Image, - ImageBorderColor, - layout, - } = attributes; - - const setAttributes = this.props.setAttributes; - const className = this.props.className; - const for_ = this.props.for_; - let containerClass = 'vk_prContent'; - let btnClass = 'vk_button'; - let aClass = 'btn btn-block vk_button_link vk_prContent_colTxt_btn'; - let aStyle = {}; - let imageBorderProperty = 'none'; - - let titleStyle = {} - if(titleColor && titleColor !== "") { - titleStyle = {color:titleColor} - } - let contentStyle = {} - if(contentColor && contentColor !== "") { - contentStyle = {color:contentColor} - } - - if (layout === 'right') { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageRight' - ); - } else { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageLeft' - ); - } - - if (buttonColorCustom) { - btnClass = `${btnClass} vk_button-color-custom`; - aClass = `${aClass} btn-primary`; - - // 塗り - if (buttonType === '0') { - aStyle = { - backgroundColor: buttonColorCustom, - border: `1px solid ${buttonColorCustom}`, - }; - // 塗りなし - } else if (buttonType === '1') { - aStyle = { - backgroundColor: 'transparent', - border: '1px solid ' + buttonColorCustom, - color: buttonColorCustom, - }; - } - - // カスタムカラーじゃない場合 - } else if (!buttonColorCustom) { - // 塗り - if (buttonType === '0') { - aClass = `${aClass} btn-${buttonColor}`; - aStyle = null; - // 塗りなし - } else if (buttonType === '1') { - aClass = `${aClass} btn-outline-${buttonColor}`; - aStyle = null; - } - } - - //borderColorが指定されなかった場合はボーダーを非表示に - if (ImageBorderColor) { - imageBorderProperty = `1px solid ${ImageBorderColor}`; - } else { - imageBorderProperty = `none`; - } - - const saveImage = (value) => { - if (value) { - setAttributes({ Image: JSON.stringify(value) }); - } - }; - - const renderImage = (for_) => { - if (for_ === 'edit') { - if (Image && Image.indexOf('{') === -1) { - return ( - - setAttributes({ Image: value.sizes.full.url }) - } - type=" image" - value={Image} - render={({ open }) => ( - - )} - /> - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - return ( - ( - - )} - /> - ); - } else if (for_ === 'save') { - if (!Image) { - return __('Select image', 'vk-blocks-pro'); - } - if (Image && Image.indexOf('{') === -1) { - return ( - {__('Upload - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - if (ImageParse && typeof ImageParse.sizes !== 'undefined') { - return ( - {ImageParse.alt} - ); - } - return ''; - } - }; - - return ( -
-
- {renderImage(for_)} -
-
- {(() => { - if (for_ === 'edit') { - return ( - <> - - setAttributes({ title: value }) - } - value={title} - placeholder={__( - 'Input title.', - 'vk-blocks-pro' - )} - style={titleStyle} - /> - - setAttributes({ content: value }) - } - value={content} - placeholder={__( - 'Input content.', - 'vk-blocks-pro' - )} - style={contentStyle} - /> - - ); - } - return ( - <> - - - - ); - })()} - { - //ボタンテキストが入力されるとボタンを表示。 - (() => { - if (buttonText !== '' && buttonText !== undefined) { - return ( -
- - - -
- ); - } - })() - } -
-
- ); - } -} diff --git a/src/blocks/pr-content/deprecated/0.0.3/save.js b/src/blocks/pr-content/deprecated/0.0.3/save.js deleted file mode 100644 index bacc07bfc..000000000 --- a/src/blocks/pr-content/deprecated/0.0.3/save.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Pr-Content block type - * - */ -import { PRcontent } from './component'; -export default function save({ attributes, className }) { - return ( - - ); -} diff --git a/src/blocks/pr-content/deprecated/0.43.0/save.js b/src/blocks/pr-content/deprecated/0.43.0/save.js deleted file mode 100644 index f16120d28..000000000 --- a/src/blocks/pr-content/deprecated/0.43.0/save.js +++ /dev/null @@ -1,299 +0,0 @@ -/** - * Pr-Content block type - * - */ -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component } from '@wordpress/element'; -import { MediaUpload, RichText } from '@wordpress/block-editor'; - -import classNames from 'classnames'; -import { fixBrokenUnicode } from '@vkblocks/utils/fixBrokenUnicode'; -import { Fontawesome } from '../component-fontawesome'; - -export class PRcontent extends Component { - render() { - const attributes = this.props.attributes; - const { - title, - titleColor, - content, - contentColor, - url, - buttonType, - buttonColor, - buttonColorCustom, - buttonText, - buttonTarget, - Image, - ImageBorderColor, - layout, - fontAwesomeIconBefore, - fontAwesomeIconAfter, - } = attributes; - - const setAttributes = this.props.setAttributes; - const className = this.props.className; - const for_ = this.props.for_; - let containerClass = 'vk_prContent'; - let btnClass = 'vk_button'; - let aClass = 'btn btn-block vk_button_link vk_prContent_colTxt_btn'; - let aStyle = {}; - let imageBorderProperty = 'none'; - - if (layout === 'right') { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageRight' - ); - } else { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageLeft' - ); - } - - if (buttonColorCustom) { - btnClass = `${btnClass} vk_button-color-custom`; - aClass = `${aClass} btn-primary`; - - // 塗り - if (buttonType === '0') { - aStyle = { - backgroundColor: buttonColorCustom, - border: `1px solid ${buttonColorCustom}`, - }; - // 塗りなし - } else if (buttonType === '1') { - aStyle = { - backgroundColor: 'transparent', - border: '1px solid ' + buttonColorCustom, - color: buttonColorCustom, - }; - } - - // カスタムカラーじゃない場合 - } else if (!buttonColorCustom) { - // 塗り - if (buttonType === '0') { - aClass = `${aClass} btn-${buttonColor}`; - aStyle = null; - // 塗りなし - } else if (buttonType === '1') { - aClass = `${aClass} btn-outline-${buttonColor}`; - aStyle = null; - } - } - - //borderColorが指定されなかった場合はボーダーを非表示に - if (ImageBorderColor) { - imageBorderProperty = `1px solid ${ImageBorderColor}`; - } else { - imageBorderProperty = `none`; - } - - const saveImage = (value) => { - if (value) { - setAttributes({ Image: JSON.stringify(value) }); - } - }; - - const renderImage = (for_) => { - if (for_ === 'edit') { - if (Image && Image.indexOf('{') === -1) { - return ( - - setAttributes({ Image: value.sizes.full.url }) - } - type=" image" - value={Image} - render={({ open }) => ( - - )} - /> - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - return ( - ( - - )} - /> - ); - } else if (for_ === 'save') { - if (!Image) { - return __('Select image', 'vk-blocks-pro'); - } - if (Image && Image.indexOf('{') === -1) { - return ( - {__('Upload - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - if (ImageParse && typeof ImageParse.sizes !== 'undefined') { - return ( - {ImageParse.alt} - ); - } - return ''; - } - }; - - return ( -
-
- {renderImage(for_)} -
-
- {(() => { - if (for_ === 'edit') { - return ( - <> - - setAttributes({ title: value }) - } - value={title} - placeholder={__( - 'Input title.', - 'vk-blocks-pro' - )} - style={{ color: titleColor }} - /> - - setAttributes({ content: value }) - } - value={content} - placeholder={__( - 'Input content.', - 'vk-blocks-pro' - )} - style={{ color: contentColor }} - /> - - ); - } - return ( - <> - - - - ); - })()} - { - //ボタンテキストが入力されるとボタンを表示。 - (() => { - if (buttonText !== '' && buttonText !== undefined) { - return ( -
- - - -
- ); - } - })() - } -
-
- ); - } -} - -export default function save({ attributes, className }) { - return ( - - ); -} diff --git a/src/blocks/pr-content/deprecated/0.5.1/save.js b/src/blocks/pr-content/deprecated/0.5.1/save.js deleted file mode 100644 index b5dca8a06..000000000 --- a/src/blocks/pr-content/deprecated/0.5.1/save.js +++ /dev/null @@ -1,215 +0,0 @@ -/** - * Pr-Content block type - * - */ -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component } from '@wordpress/element'; -import { MediaUpload, RichText } from '@wordpress/block-editor'; -import { Fontawesome } from '../component-fontawesome-deprecated'; - -export class PRcontent extends Component { - render() { - const attributes = this.props.attributes; - const { - title, - titleColor, - content, - contentColor, - url, - buttonType, - buttonColor, - buttonColorCustom, - buttonText, - buttonTarget, - Image, - ImageBorderColor, - layout, - fontAwesomeIconBefore, - fontAwesomeIconAfter, - } = attributes; - const setAttributes = this.props.setAttributes; - const for_ = this.props.for_; - let containerClass = 'vk_prContent'; - let btnClass = 'vk_button'; - let aClass = 'btn btn-block vk_button_link vk_prContent_colTxt_btn'; - let aStyle = {}; - - if (layout === 'right') { - containerClass = `${containerClass} vk_prContent-layout-imageRight`; - } else { - containerClass = `${containerClass} vk_prContent-layout-imageLeft`; - } - - if (buttonColorCustom) { - btnClass = `${btnClass} vk_button-color-custom`; - aClass = `${aClass} btn-primary`; - - // 塗り - if (buttonType === '0') { - aStyle = { - backgroundColor: buttonColorCustom, - border: `1px solid ${buttonColorCustom}`, - }; - // 塗りなし - } else if (buttonType === '1') { - aStyle = { - backgroundColor: 'transparent', - border: '1px solid ' + buttonColorCustom, - color: buttonColorCustom, - }; - } - - // カスタムカラーじゃない場合 - } else if (!buttonColorCustom) { - // 塗り - if (buttonType === '0') { - aClass = `${aClass} btn-${buttonColor}`; - aStyle = null; - // 塗りなし - } else if (buttonType === '1') { - aClass = `${aClass} btn-outline-${buttonColor}`; - aStyle = null; - } - } - - return ( -
-
- {for_ === 'edit' ? ( - - setAttributes({ Image: value.sizes.full.url }) - } - type=" image" - value={Image} - render={({ open }) => ( - - )} - /> - ) : !Image ? ( - __('Select image', 'vk-blocks-pro') - ) : ( - {__('Upload - )} -
-
- {(() => { - if (for_ === 'edit') { - return ( - <> - - setAttributes({ title: value }) - } - value={title} - placeholder={__( - 'Input title.', - 'vk-blocks-pro' - )} - style={{ color: titleColor }} - /> - - setAttributes({ content: value }) - } - value={content} - placeholder={__( - 'Input content.', - 'vk-blocks-pro' - )} - style={{ color: contentColor }} - /> - - ); - } - return ( - <> - - - - ); - })()} - { - //ボタンテキストが入力されるとボタンを表示。 - (() => { - if (buttonText !== '' && buttonText !== undefined) { - return ( -
- - - -
- ); - } - })() - } -
-
- ); - } -} - -export default function save({ attributes, className }) { - return ( - - ); -} diff --git a/src/blocks/pr-content/deprecated/0.56.3/component.js b/src/blocks/pr-content/deprecated/0.56.3/component.js deleted file mode 100644 index 7cbf52442..000000000 --- a/src/blocks/pr-content/deprecated/0.56.3/component.js +++ /dev/null @@ -1,249 +0,0 @@ -import classNames from 'classnames'; -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component, Fragment } from '@wordpress/element'; -import { MediaUpload, RichText } from '@wordpress/block-editor'; -import { fixBrokenUnicode } from '@vkblocks/utils/fixBrokenUnicode'; -import { Fontawesome } from '../component-fontawesome'; - -export class PRcontent extends Component { - render() { - const attributes = this.props.attributes; - let { - title, - titleColor, - content, - contentColor, - url, - buttonType, - buttonColor, - buttonColorCustom, - buttonText, - buttonTarget, - Image, - ImageBorderColor, - layout, - fontAwesomeIconBefore, - fontAwesomeIconAfter - } = attributes; - - const setAttributes = this.props.setAttributes; - const className = this.props.className; - const for_ = this.props.for_; - let containerClass = "vk_prContent"; - let btnClass = "vk_button"; - let aClass = "btn btn-block vk_button_link vk_prContent_colTxt_btn"; - let aStyle = {}; - let imageBorderProperty = "none"; - - if (layout === "right") { - containerClass = classNames( - className, - containerClass, - "vk_prContent-layout-imageRight" - ); - } else { - containerClass = classNames( - className, - containerClass, - "vk_prContent-layout-imageLeft" - ); - } - - if (buttonColorCustom) { - btnClass = `${btnClass} vk_button-color-custom`; - aClass = `${aClass} btn-primary`; - - // 塗り - if (buttonType === "0") { - aStyle = { - backgroundColor: buttonColorCustom, - border: `1px solid ${buttonColorCustom}` - }; - // 塗りなし - } else if (buttonType === "1") { - aStyle = { - backgroundColor: "transparent", - border: "1px solid " + buttonColorCustom, - color: buttonColorCustom - }; - } - - // カスタムカラーじゃない場合 - } else if (!buttonColorCustom) { - // 塗り - if (buttonType === "0") { - aClass = `${aClass} btn-${buttonColor}`; - aStyle = null; - // 塗りなし - } else if (buttonType === "1") { - aClass = `${aClass} btn-outline-${buttonColor}`; - aStyle = null; - } - } - - //borderColorが指定されなかった場合はボーダーを非表示に - if (ImageBorderColor) { - imageBorderProperty = `1px solid ${ImageBorderColor}`; - } else { - imageBorderProperty = `none`; - } - - const saveImage = value => { - if (value) { - setAttributes({ Image: JSON.stringify(value) }); - } - }; - - const renderImage = for_ => { - if (for_ === "edit") { - if (Image && Image.indexOf("{") === -1) { - return ( - setAttributes({ Image: value.sizes.full.url }) } - type=" image" - value={ Image } - render={ ({ open }) => ( - - ) } - /> - ); - } - const ImageParse = JSON.parse( fixBrokenUnicode(Image) ); - return ( - ( - - ) } - /> - ); - - } else if (for_ === "save") { - if (!Image) { - return __("Select image", 'vk-blocks-pro'); - } - if (Image && Image.indexOf("{") === -1) { - return ( - { - ); - } - const ImageParse = JSON.parse( fixBrokenUnicode(Image) ); - if (ImageParse && typeof ImageParse.sizes !== "undefined") { - return ( - { - ); - }else{ - return ""; - } - } - }; - - return ( -
-
{ renderImage(for_) }
-
- { (() => { - if (for_ === "edit") { - return ( - - setAttributes({ title: value }) } - value={ title } - placeholder={ __("Input title.", 'vk-blocks-pro') } - style={ { color: titleColor } } - /> - setAttributes({ content: value }) } - value={ content } - placeholder={ __("Input content.", 'vk-blocks-pro') } - style={ { color: contentColor } } - /> - - ); - } - return ( - - - - - ); - })() } - { //ボタンテキストが入力されるとボタンを表示。 - (() => { - if (buttonText !== "" && buttonText !== undefined) { - return ( -
- - - -
- ); - } - })() } -
-
- ); - } - } diff --git a/src/blocks/pr-content/deprecated/0.56.3/save.js b/src/blocks/pr-content/deprecated/0.56.3/save.js deleted file mode 100644 index 0b7b0bcbd..000000000 --- a/src/blocks/pr-content/deprecated/0.56.3/save.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Pr-Content block type - * - */ -import { PRcontent } from './component'; -export default function save(props) { - const { attributes, className } = props - return ( - - ); -} diff --git a/src/blocks/pr-content/deprecated/0.58.7/component.js b/src/blocks/pr-content/deprecated/0.58.7/component.js deleted file mode 100644 index 9a772da3e..000000000 --- a/src/blocks/pr-content/deprecated/0.58.7/component.js +++ /dev/null @@ -1,281 +0,0 @@ -import classNames from 'classnames'; -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component } from '@wordpress/element'; -import { MediaUpload, RichText } from '@wordpress/block-editor'; -import { fixBrokenUnicode } from '@vkblocks/utils/fixBrokenUnicode'; -import { Fontawesome } from '../component-fontawesome'; - -export class PRcontent extends Component { - render() { - const attributes = this.props.attributes; - const { - title, - titleColor, - content, - contentColor, - url, - buttonType, - buttonColor, - buttonColorCustom, - buttonText, - buttonTarget, - Image, - ImageBorderColor, - layout, - fontAwesomeIconBefore, - fontAwesomeIconAfter, - } = attributes; - - const setAttributes = this.props.setAttributes; - const className = this.props.className; - const for_ = this.props.for_; - let containerClass = 'vk_prContent'; - let btnClass = 'vk_button'; - let aClass = 'btn btn-block vk_button_link vk_prContent_colTxt_btn'; - let aStyle = {}; - let imageBorderProperty = 'none'; - - if (layout === 'right') { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageRight' - ); - } else { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageLeft' - ); - } - - if (buttonColorCustom) { - btnClass = `${btnClass} vk_button-color-custom`; - aClass = `${aClass} btn-primary`; - - // 塗り - if (buttonType === '0') { - aStyle = { - backgroundColor: buttonColorCustom, - border: `1px solid ${buttonColorCustom}`, - }; - // 塗りなし - } else if (buttonType === '1') { - aStyle = { - backgroundColor: 'transparent', - border: '1px solid ' + buttonColorCustom, - color: buttonColorCustom, - }; - } - - // カスタムカラーじゃない場合 - } else if (!buttonColorCustom) { - // 塗り - if (buttonType === '0') { - aClass = `${aClass} btn-${buttonColor}`; - aStyle = null; - // 塗りなし - } else if (buttonType === '1') { - aClass = `${aClass} btn-outline-${buttonColor}`; - aStyle = null; - } - } - - //borderColorが指定されなかった場合はボーダーを非表示に - if (ImageBorderColor) { - imageBorderProperty = `1px solid ${ImageBorderColor}`; - } else { - imageBorderProperty = `none`; - } - - const saveImage = (value) => { - if (value) { - setAttributes({ Image: JSON.stringify(value) }); - } - }; - - const renderImage = (for_) => { - if (for_ === 'edit') { - if (Image && Image.indexOf('{') === -1) { - return ( - - setAttributes({ Image: value.sizes.full.url }) - } - type=" image" - value={Image} - render={({ open }) => ( - - )} - /> - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - return ( - ( - - )} - /> - ); - } else if (for_ === 'save') { - if (!Image) { - return __('Select image', 'vk-blocks-pro'); - } - if (Image && Image.indexOf('{') === -1) { - return ( - {__('Upload - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - if (ImageParse && typeof ImageParse.sizes !== 'undefined') { - return ( - {ImageParse.alt} - ); - } - return ''; - } - }; - - return ( -
-
- {renderImage(for_)} -
-
- {(() => { - if (for_ === 'edit') { - return ( - <> - - setAttributes({ title: value }) - } - value={title} - placeholder={__( - 'Input title.', - 'vk-blocks-pro' - )} - style={{ color: titleColor }} - /> - - setAttributes({ content: value }) - } - value={content} - placeholder={__( - 'Input content.', - 'vk-blocks-pro' - )} - style={{ color: contentColor }} - /> - - ); - } - return ( - <> - - - - ); - })()} - { - //ボタンテキストが入力されるとボタンを表示。 - (() => { - if (buttonText !== '' && buttonText !== undefined) { - return ( -
- - - -
- ); - } - })() - } -
-
- ); - } -} diff --git a/src/blocks/pr-content/deprecated/0.58.7/save.js b/src/blocks/pr-content/deprecated/0.58.7/save.js deleted file mode 100644 index da7310fd0..000000000 --- a/src/blocks/pr-content/deprecated/0.58.7/save.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Pr-Content block type - * - */ -import { PRcontent } from './component'; -export default function save(props) { - const { attributes, className } = props; - return ( - - ); -} diff --git a/src/blocks/pr-content/deprecated/0.58.9/component.js b/src/blocks/pr-content/deprecated/0.58.9/component.js deleted file mode 100644 index 8823ef35b..000000000 --- a/src/blocks/pr-content/deprecated/0.58.9/component.js +++ /dev/null @@ -1,280 +0,0 @@ -import classNames from 'classnames'; -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component } from '@wordpress/element'; -import { MediaUpload, RichText } from '@wordpress/block-editor'; -import { fixBrokenUnicode } from '@vkblocks/utils/fixBrokenUnicode'; -import { Fontawesome } from '../component-fontawesome'; - -export class PRcontent extends Component { - render() { - const attributes = this.props.attributes; - const { - title, - titleColor, - content, - contentColor, - url, - buttonType, - buttonColor, - buttonColorCustom, - buttonText, - buttonTarget, - Image, - ImageBorderColor, - layout, - fontAwesomeIconBefore, - fontAwesomeIconAfter, - } = attributes; - - const setAttributes = this.props.setAttributes; - const className = this.props.className; - const for_ = this.props.for_; - let containerClass = 'vk_prContent'; - let btnClass = 'vk_button'; - let aClass = 'btn btn-block vk_button_link vk_prContent_colTxt_btn'; - let aStyle = {}; - let imageBorderProperty = 'none'; - - if (layout === 'right') { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageRight' - ); - } else { - containerClass = classNames( - className, - containerClass, - 'vk_prContent-layout-imageLeft' - ); - } - - if (buttonColorCustom) { - btnClass = `${btnClass} vk_button-color-custom`; - aClass = `${aClass} btn-primary`; - - // 塗り - if (buttonType === '0') { - aStyle = { - backgroundColor: buttonColorCustom, - border: `1px solid ${buttonColorCustom}`, - }; - // 塗りなし - } else if (buttonType === '1') { - aStyle = { - backgroundColor: 'transparent', - border: '1px solid ' + buttonColorCustom, - color: buttonColorCustom, - }; - } - - // カスタムカラーじゃない場合 - } else if (!buttonColorCustom) { - // 塗り - if (buttonType === '0') { - aClass = `${aClass} btn-${buttonColor}`; - aStyle = null; - // 塗りなし - } else if (buttonType === '1') { - aClass = `${aClass} btn-outline-${buttonColor}`; - aStyle = null; - } - } - - //borderColorが指定されなかった場合はボーダーを非表示に - if (ImageBorderColor) { - imageBorderProperty = `1px solid ${ImageBorderColor}`; - } else { - imageBorderProperty = `none`; - } - - const saveImage = (value) => { - if (value) { - setAttributes({ Image: JSON.stringify(value) }); - } - }; - - const renderImage = (for_) => { - if (for_ === 'edit') { - if (Image && Image.indexOf('{') === -1) { - return ( - - setAttributes({ Image: value.sizes.full.url }) - } - type=" image" - value={Image} - render={({ open }) => ( - - )} - /> - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - return ( - ( - - )} - /> - ); - } else if (for_ === 'save') { - if (!Image) { - return __('Select image', 'vk-blocks-pro'); - } - if (Image && Image.indexOf('{') === -1) { - return ( - {__('Upload - ); - } - const ImageParse = JSON.parse(fixBrokenUnicode(Image)); - if (ImageParse && typeof ImageParse.sizes !== 'undefined') { - return ( - {ImageParse.alt} - ); - } - return ''; - } - }; - - return ( -
-
- {renderImage(for_)} -
-
- {(() => { - if (for_ === 'edit') { - return ( - <> - - setAttributes({ title: value }) - } - value={title} - placeholder={__( - 'Input title.', - 'vk-blocks-pro' - )} - style={{ color: titleColor }} - /> - - setAttributes({ content: value }) - } - value={content} - placeholder={__( - 'Input content.', - 'vk-blocks-pro' - )} - style={{ color: contentColor }} - /> - - ); - } - return ( - <> - - - - ); - })()} - { - //ボタンテキストが入力されるとボタンを表示。 - (() => { - if (buttonText !== '' && buttonText !== undefined) { - return ( -
- - - -
- ); - } - })() - } -
-
- ); - } -} diff --git a/src/blocks/pr-content/deprecated/0.58.9/save.js b/src/blocks/pr-content/deprecated/0.58.9/save.js deleted file mode 100644 index bacc07bfc..000000000 --- a/src/blocks/pr-content/deprecated/0.58.9/save.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Pr-Content block type - * - */ -import { PRcontent } from './component'; -export default function save({ attributes, className }) { - return ( - - ); -} diff --git a/src/blocks/pr-content/deprecated/component-fontawesome-deprecated.js b/src/blocks/pr-content/deprecated/component-fontawesome-deprecated.js deleted file mode 100644 index e3c5f856b..000000000 --- a/src/blocks/pr-content/deprecated/component-fontawesome-deprecated.js +++ /dev/null @@ -1,37 +0,0 @@ -import { Component } from '@wordpress/element'; - -export class Fontawesome extends Component { - render() { - const { - buttonText, - fontAwesomeIconBefore, - fontAwesomeIconAfter, - } = this.props.attributes; - - let iconBefore = ''; - let iconAfter = ''; - - if (fontAwesomeIconBefore) { - iconBefore = ( - - ); - } - if (fontAwesomeIconAfter) { - iconAfter = ( - - ); - } - - return ( - <> - {iconBefore} - {buttonText} - {iconAfter} - - ); - } -} diff --git a/src/blocks/pr-content/deprecated/component-fontawesome.js b/src/blocks/pr-content/deprecated/component-fontawesome.js deleted file mode 100644 index 6ce6f7ac5..000000000 --- a/src/blocks/pr-content/deprecated/component-fontawesome.js +++ /dev/null @@ -1,48 +0,0 @@ -import parse from 'html-react-parser'; -import { Component } from '@wordpress/element'; - -export class Fontawesome extends Component { - render() { - let { - buttonText, - fontAwesomeIconBefore, - fontAwesomeIconAfter, - } = this.props.attributes; - - let iconBefore = ''; - let faIconFragmentBefore; - let iconAfter = ''; - let faIconFragmentAfter; - - //過去バージョンをリカバリーした時にiconを正常に表示する - if (fontAwesomeIconBefore && !fontAwesomeIconBefore.match(/`; - } - if (fontAwesomeIconAfter && !fontAwesomeIconAfter.match(/`; - } - - if (fontAwesomeIconBefore) { - //add class and inline css - faIconFragmentBefore = fontAwesomeIconBefore.split(' '); - faIconFragmentBefore[1] = - ' ' + faIconFragmentBefore[1] + ` vk_button_link_before `; - iconBefore = faIconFragmentBefore.join(''); - } - if (fontAwesomeIconAfter) { - //add class and inline css - faIconFragmentAfter = fontAwesomeIconAfter.split(' '); - faIconFragmentAfter[1] = - ' ' + faIconFragmentAfter[1] + ` vk_button_link_after `; - iconAfter = faIconFragmentAfter.join(''); - } - - return ( - <> - {parse(iconBefore)} - {buttonText} - {parse(iconAfter)} - - ); - } -} diff --git a/src/blocks/pr-content/deprecated/index.js b/src/blocks/pr-content/deprecated/index.js index f2020dbd7..a58bbdc81 100644 --- a/src/blocks/pr-content/deprecated/index.js +++ b/src/blocks/pr-content/deprecated/index.js @@ -1,12 +1,3 @@ -import save000 from './0.0.0/save'; -import save001 from './0.0.1/save'; -import save002 from './0.0.2/save'; -import save003 from './0.0.3/save'; -import save0_5_1 from './0.5.1/save'; -import save0_43_0 from './0.43.0/save'; -import save0_56_3 from './0.56.3/save'; -import save0_58_7 from './0.58.7/save'; -import save0_58_9 from './0.58.9/save'; import save1_7_1 from './1.7.1/save'; const blockAttributes = { @@ -122,44 +113,6 @@ const deprecated = [ attributes: blockAttributes3, save: save1_7_1, }, - //Fix: https://github.com/vektor-inc/vk-blocks-pro/issues/355 - // 独自後方互換で変化したデータ用の後方互換バージョン - { - attributes: blockAttributes3, - save: save003, - }, - { - attributes: blockAttributes3, - save: save0_58_9, - }, - { - attributes: blockAttributes3, - save: save0_58_7, - }, - { - attributes: blockAttributes3, - save: save0_56_3, - }, - { - attributes: blockAttributes3, - save: save0_43_0, - }, - { - attributes: blockAttributes2, - save: save0_5_1, - }, - { - attributes: blockAttributes2, - save: save002, - }, - { - attributes: blockAttributes, - save: save001, - }, - { - attributes: blockAttributes, - save: save000, - }, ]; export default deprecated; diff --git a/src/blocks/spacer/deprecated/0.0.0/component.js b/src/blocks/spacer/deprecated/0.0.0/component.js deleted file mode 100644 index f0ef2a1c7..000000000 --- a/src/blocks/spacer/deprecated/0.0.0/component.js +++ /dev/null @@ -1,21 +0,0 @@ -import { Component } from '@wordpress/element'; - -export class SpacerComponent extends Component { - - render() { - const { - unit, - pc, - tablet, - mobile, - } = this.props.attributes; - - return ( -
-
-
-
-
- ); - } -} diff --git a/src/blocks/spacer/deprecated/0.0.0/save.js b/src/blocks/spacer/deprecated/0.0.0/save.js deleted file mode 100644 index 1fd966da6..000000000 --- a/src/blocks/spacer/deprecated/0.0.0/save.js +++ /dev/null @@ -1,7 +0,0 @@ -import { SpacerComponent } from "./component"; - -export default function save({ attributes }) { - return ( - - ); -} diff --git a/src/blocks/spacer/deprecated/0.0.1/component.js b/src/blocks/spacer/deprecated/0.0.1/component.js deleted file mode 100644 index 83ff6a672..000000000 --- a/src/blocks/spacer/deprecated/0.0.1/component.js +++ /dev/null @@ -1,22 +0,0 @@ -import { Component } from '@wordpress/element'; - -export class SpacerComponent extends Component { - - render() { - const { - unit, - pc, - tablet, - mobile, - } = this.props.attributes; - const className = this.props.className; - - return ( -
-
-
-
-
- ); - } -} diff --git a/src/blocks/spacer/deprecated/0.0.1/save.js b/src/blocks/spacer/deprecated/0.0.1/save.js deleted file mode 100644 index 1fd966da6..000000000 --- a/src/blocks/spacer/deprecated/0.0.1/save.js +++ /dev/null @@ -1,7 +0,0 @@ -import { SpacerComponent } from "./component"; - -export default function save({ attributes }) { - return ( - - ); -} diff --git a/src/blocks/spacer/deprecated/0.0.2/component.js b/src/blocks/spacer/deprecated/0.0.2/component.js deleted file mode 100644 index b08ecb367..000000000 --- a/src/blocks/spacer/deprecated/0.0.2/component.js +++ /dev/null @@ -1,24 +0,0 @@ -import { Component } from '@wordpress/element'; -import classNames from "classnames"; - -export class SpacerComponent extends Component { - - render() { - const { - anchor, - unit, - pc, - tablet, - mobile, - } = this.props.attributes; - const className = this.props.className; - - return ( -
-
-
-
-
- ); - } -} diff --git a/src/blocks/spacer/deprecated/0.0.2/save.js b/src/blocks/spacer/deprecated/0.0.2/save.js deleted file mode 100644 index 1fd966da6..000000000 --- a/src/blocks/spacer/deprecated/0.0.2/save.js +++ /dev/null @@ -1,7 +0,0 @@ -import { SpacerComponent } from "./component"; - -export default function save({ attributes }) { - return ( - - ); -} diff --git a/src/blocks/spacer/deprecated/0.57.4/component.js b/src/blocks/spacer/deprecated/0.57.4/component.js deleted file mode 100644 index cdb88c0e0..000000000 --- a/src/blocks/spacer/deprecated/0.57.4/component.js +++ /dev/null @@ -1,34 +0,0 @@ -import { Component } from '@wordpress/element'; -import classNames from 'classnames'; - -export class SpacerComponent extends Component { - - render() { - const { - anchor, - spaceType, - unit, - pc, - tablet, - mobile, - } = this.props.attributes; - const className = this.props.className; - if ( spaceType === 'height') { - return ( -
-
-
-
-
- ); - } else if ( spaceType === 'margin-top') { - return ( -
-
-
-
-
- ); - } - } -} diff --git a/src/blocks/spacer/deprecated/0.57.4/save.js b/src/blocks/spacer/deprecated/0.57.4/save.js deleted file mode 100644 index 1fd966da6..000000000 --- a/src/blocks/spacer/deprecated/0.57.4/save.js +++ /dev/null @@ -1,7 +0,0 @@ -import { SpacerComponent } from "./component"; - -export default function save({ attributes }) { - return ( - - ); -} diff --git a/src/blocks/spacer/deprecated/0.57.4/schema.js b/src/blocks/spacer/deprecated/0.57.4/schema.js deleted file mode 100644 index 1fede51f3..000000000 --- a/src/blocks/spacer/deprecated/0.57.4/schema.js +++ /dev/null @@ -1,35 +0,0 @@ -export const schema = { - anchor: { - type: 'string', - default: null, - }, - spaceType: { - type: 'string', - default: 'height', - }, - unit: { - type: 'string', - default: 'px', - }, - pc: { - type: 'number', - default: 40, - }, - tablet: { - type: 'number', - default: 30, - }, - mobile: { - type: 'number', - default: 20, - }, -}; - -export const example = { - anchor: null, - spaceType: 'height', - unit: 'px', - pc: 40, - tablet: 30, - mobile: 20 -}; diff --git a/src/blocks/spacer/deprecated/index.js b/src/blocks/spacer/deprecated/index.js index 0b7069ea8..7de01ab43 100644 --- a/src/blocks/spacer/deprecated/index.js +++ b/src/blocks/spacer/deprecated/index.js @@ -1,7 +1,3 @@ -import save000 from './0.0.0/save'; -import save001 from './0.0.1/save'; -import save002 from './0.0.2/save'; -import save0_57_4 from './0.57.4/save'; import save1_3_2 from './1.3.2/save'; import save1_13_2 from './1.13.2/save'; import save1_25_1 from './1.25.1/save'; @@ -80,22 +76,6 @@ const deprecated = [ attributes:blockAttributes2, save: save1_3_2, }, - { - attributes: blockAttributes2, - save: save0_57_4, - }, - { - attributes: blockAttributes2, - save: save002, - }, - { - attributes: blockAttributes, - save: save001, - }, - { - attributes: blockAttributes, - save: save000, - }, ]; export default deprecated; diff --git a/src/blocks/staff/deprecated/0.58/component.js b/src/blocks/staff/deprecated/0.58/component.js deleted file mode 100644 index 731d1c5a8..000000000 --- a/src/blocks/staff/deprecated/0.58/component.js +++ /dev/null @@ -1,153 +0,0 @@ -import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; -import { Component } from '@wordpress/element'; -import { RichText, MediaUpload } from '@wordpress/block-editor'; - -export class NewComponent extends Component { - - render() { - - const { - vk_staff_text_name, - vk_staff_text_caption, - vk_staff_text_role, - vk_staff_text_profileTitle, - vk_staff_text_profileText, - vk_staff_photo_image, - vk_staff_photo_image_alt, - vk_staff_layout, - vk_staff_nameColor, - vk_staff_captionColor, - vk_staff_positionColor, - vk_staff_profileTitleColor, - vk_staff_profileTextColor, - vk_staff_photoBorder, - vk_staff_fontFamily - } = this.props.attributes; - const setAttributes = this.props.setAttributes; - const className = this.props.className; - const for_ = this.props.for_; - let returnELm = ''; - - let staffTextClassName = 'vk_staff_text'; - if (vk_staff_fontFamily === '1') { - staffTextClassName = classnames( - staffTextClassName, - 'vk_staff-headingFont-serif' - ); - } - - if (for_ === 'edit') { - - returnELm =
-
- setAttributes({ vk_staff_text_name: value }) } - value={ vk_staff_text_name } - placeholder={ __('Your Name', 'vk-blocks-pro') } - /> - setAttributes({ vk_staff_text_caption: value }) } - value={ vk_staff_text_caption } - placeholder={ __('Caption', 'vk-blocks-pro') } - /> - setAttributes({ vk_staff_text_role: value }) } - value={ vk_staff_text_role } - placeholder={ __('Role position', 'vk-blocks-pro') } - /> - setAttributes({ vk_staff_text_profileTitle: value }) } - value={ vk_staff_text_profileTitle } - placeholder={ __('Profile title', 'vk-blocks-pro') } - /> - setAttributes({ vk_staff_text_profileText: value }) } - value={ vk_staff_text_profileText } - placeholder={ __('Profile text', 'vk-blocks-pro') } - /> -
-
- setAttributes({ vk_staff_photo_image: value.sizes.full.url }) } - type="image" - className={ 'vk_staff_photo_image' } - value={ vk_staff_photo_image } - render={ ({ open }) => ( - - ) } - /> -
-
; - - } else if (for_ === 'save') { - - returnELm =
-
- - - - - -
- { vk_staff_photo_image ? -
- { -
- : '' - } -
; - } - return (returnELm); - } -} diff --git a/src/blocks/staff/deprecated/0.58/save.js b/src/blocks/staff/deprecated/0.58/save.js deleted file mode 100644 index 3e7f94e24..000000000 --- a/src/blocks/staff/deprecated/0.58/save.js +++ /dev/null @@ -1,12 +0,0 @@ -import { NewComponent } from "./component"; - -export default function save({ attributes }) { - return ( - - ); -} diff --git a/src/blocks/staff/deprecated/index.js b/src/blocks/staff/deprecated/index.js index b29e62dfc..715f504fa 100644 --- a/src/blocks/staff/deprecated/index.js +++ b/src/blocks/staff/deprecated/index.js @@ -1,6 +1,5 @@ import save1_20_2 from './1.20.2/save'; import save1_3_1 from './1.3.1/save'; -import save0_58 from './0.58/save'; export const blockAttributes = { vk_staff_text_name: { @@ -82,10 +81,6 @@ const deprecated = [ { attributes: blockAttributes2, save: save1_3_1 - }, - { - attributes: blockAttributes, - save: save0_58 } ]; diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__alert__deprecated-0-60-1.html b/test/e2e-tests/fixtures/blocks/vk-blocks__alert__deprecated-0-60-1.html deleted file mode 100644 index 004cbc94d..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__alert__deprecated-0-60-1.html +++ /dev/null @@ -1,3 +0,0 @@ - -

Hello World!

- \ No newline at end of file diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__animation__deprecated-0-60-1.html b/test/e2e-tests/fixtures/blocks/vk-blocks__animation__deprecated-0-60-1.html deleted file mode 100644 index 6e58fd725..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__animation__deprecated-0-60-1.html +++ /dev/null @@ -1,6 +0,0 @@ - -
-

Hello World!

-
- - diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__faq2__deprecated-0-60-1.html b/test/e2e-tests/fixtures/blocks/vk-blocks__faq2__deprecated-0-60-1.html deleted file mode 100644 index 20b413dd2..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__faq2__deprecated-0-60-1.html +++ /dev/null @@ -1,13 +0,0 @@ - -
-
-

質問を入力してください

-
- - - -
-

回答を入力してください

-
-
- \ No newline at end of file diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__faq__deprecated-0-60-1.html b/test/e2e-tests/fixtures/blocks/vk-blocks__faq__deprecated-0-60-1.html deleted file mode 100644 index 6f46bd3d9..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__faq__deprecated-0-60-1.html +++ /dev/null @@ -1,5 +0,0 @@ - -
質問を入力
-

回答を入力してください。

-
- \ No newline at end of file diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__flow__deprecated-0-60-1.html b/test/e2e-tests/fixtures/blocks/vk-blocks__flow__deprecated-0-60-1.html deleted file mode 100644 index e6a0a772f..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__flow__deprecated-0-60-1.html +++ /dev/null @@ -1,3 +0,0 @@ - -
タイトルを入力
説明を入力
- \ No newline at end of file diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__pr-content__deprecated-0-60-1.html b/test/e2e-tests/fixtures/blocks/vk-blocks__pr-content__deprecated-0-60-1.html deleted file mode 100644 index d1fb62eef..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__pr-content__deprecated-0-60-1.html +++ /dev/null @@ -1,3 +0,0 @@ - -
VK Blocks

テキスト

テキスト

- \ No newline at end of file diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__pr-content__deprecated-0-60-1__button-color-success.html b/test/e2e-tests/fixtures/blocks/vk-blocks__pr-content__deprecated-0-60-1__button-color-success.html deleted file mode 100644 index 90b7ec3a1..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__pr-content__deprecated-0-60-1__button-color-success.html +++ /dev/null @@ -1,3 +0,0 @@ - -
VK Blocks

テキスト

テキスト

- \ No newline at end of file diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__pr-content__deprecated-0-60-1__button-linkTarget-blank.html b/test/e2e-tests/fixtures/blocks/vk-blocks__pr-content__deprecated-0-60-1__button-linkTarget-blank.html deleted file mode 100644 index 7a72aaf60..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__pr-content__deprecated-0-60-1__button-linkTarget-blank.html +++ /dev/null @@ -1,3 +0,0 @@ - -
VK Blocks

テキスト

テキスト

- \ No newline at end of file diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__spacer__deprecated-0-60-1.html b/test/e2e-tests/fixtures/blocks/vk-blocks__spacer__deprecated-0-60-1.html deleted file mode 100644 index cdf50dd61..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__spacer__deprecated-0-60-1.html +++ /dev/null @@ -1,3 +0,0 @@ - -
- \ No newline at end of file diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__spacer__deprecated-0-60-1__has_ID_margin-top.html b/test/e2e-tests/fixtures/blocks/vk-blocks__spacer__deprecated-0-60-1__has_ID_margin-top.html deleted file mode 100644 index 8f6b61f3e..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__spacer__deprecated-0-60-1__has_ID_margin-top.html +++ /dev/null @@ -1,3 +0,0 @@ - -
- \ No newline at end of file diff --git a/test/e2e-tests/fixtures/blocks/vk-blocks__staff__deprecated-0-60-1.html b/test/e2e-tests/fixtures/blocks/vk-blocks__staff__deprecated-0-60-1.html deleted file mode 100644 index e59b0a27e..000000000 --- a/test/e2e-tests/fixtures/blocks/vk-blocks__staff__deprecated-0-60-1.html +++ /dev/null @@ -1,3 +0,0 @@ - -

山田太郎

Yamada Tarou

代表取締役

プロフィール

名古屋のウェブ制作会社数社に10年程度務めた後、株式会社ベクトル設立。
企画・運営・コンサルティング〜WordPressを中心としたシステム開発まで幅広く携わる。

Profile Picture
- \ No newline at end of file diff --git a/test/e2e/heading-transform.spec.ts b/test/e2e/heading-transform.spec.ts index b06ed9d18..ba868bf92 100644 --- a/test/e2e/heading-transform.spec.ts +++ b/test/e2e/heading-transform.spec.ts @@ -52,7 +52,7 @@ test.describe( 'Block', () => { // 変換内容 await expect( page.locator( '.wp-block-heading' ) ).toHaveClass( - 'block-editor-rich-text__editable block-editor-block-list__block wp-block is-multi-selected wp-elements-0 has-contrast-color has-text-color wp-block-heading rich-text' + 'block-editor-rich-text__editable block-editor-block-list__block wp-block is-multi-selected wp-elements-0 has-accent-1-color has-text-color wp-block-heading rich-text' ); await expect( page.locator( '.wp-block-heading' ) ).toHaveCSS( 'margin-bottom', @@ -60,10 +60,10 @@ test.describe( 'Block', () => { ); await expect( page.locator( 'p.has-text-color' ) ).toHaveCSS( 'font-size', - '32px' + '31.2896px' ); await expect( page.locator( '.wp-block-heading' ) ).toHaveClass( - 'block-editor-rich-text__editable block-editor-block-list__block wp-block is-multi-selected wp-elements-0 has-contrast-color has-text-color wp-block-heading rich-text' + 'block-editor-rich-text__editable block-editor-block-list__block wp-block is-multi-selected wp-elements-0 has-accent-1-color has-text-color wp-block-heading rich-text' ); await expect( page.locator( '.wp-block-heading' ) ).toHaveCSS( 'margin-bottom', @@ -71,7 +71,7 @@ test.describe( 'Block', () => { ); await expect( page.locator( 'p.has-text-color' ) ).toHaveCSS( 'font-size', - '32px' + '31.2896px' ); } ); diff --git a/vk-blocks.php b/vk-blocks.php index 9a64ec0dd..771345bfe 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 Block Editor. - * Version: 1.90.1.0 - * Stable tag: 1.90.0.1 + * Version: 1.91.0.0 + * Stable tag: 1.90.1.1 * Requires at least: 6.3 * Author: Vektor,Inc. * Author URI: https://vektor-inc.co.jp @@ -153,9 +153,26 @@ function vk_blocks_is_pro() { add_action( 'plugins_loaded', function () { - // Load language files. - $path = dirname( plugin_basename( __FILE__ ) ) . '/languages'; - load_plugin_textdomain( 'vk-blocks-pro', false, $path ); + // サイトのロケールを取得 + $locale = determine_locale(); + // 翻訳ファイルのパスを指定 + $path = plugin_dir_path( __FILE__ ) . 'languages'; + + // 日本語の設定のみ翻訳ファイルを読み込み + if ( strpos( $locale, 'ja' ) === 0 ) { + // PHPファイルの翻訳読み込み + load_textdomain( 'vk-blocks-pro', $path . '/vk-blocks-pro-ja.mo' ); + + // JavaScriptファイルの翻訳設定 + add_action( + 'wp_enqueue_scripts', + function () use ( $path ) { + // スクリプト登録後に翻訳設定 + wp_set_script_translations( 'vk-blocks-build-js', 'vk-blocks-pro', $path ); + wp_set_script_translations( 'vk-blocks-admin-js', 'vk-blocks-pro', $path ); + } + ); + } } );