Skip to content

Commit

Permalink
Merge pull request #2318 from vektor-inc/develop
Browse files Browse the repository at this point in the history
[ Change version ] 1.91.0.0
  • Loading branch information
kurudrive authored Nov 13, 2024
2 parents 3eee149 + b3267ce commit dc5b3ae
Show file tree
Hide file tree
Showing 69 changed files with 119 additions and 3,295 deletions.
24 changes: 21 additions & 3 deletions inc/vk-blocks/vk-blocks-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
);
}
}
);

Expand Down
10 changes: 7 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
20 changes: 0 additions & 20 deletions src/blocks/_pro/animation/deprecated/hooks/0.49.7/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/blocks/_pro/animation/deprecated/hooks/0.58.7/index.js

This file was deleted.

9 changes: 1 addition & 8 deletions src/blocks/_pro/animation/deprecated/hooks/index.js
Original file line number Diff line number Diff line change
@@ -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 [];
21 changes: 0 additions & 21 deletions src/blocks/_pro/animation/deprecated/save/0.49.1/save.js

This file was deleted.

21 changes: 0 additions & 21 deletions src/blocks/_pro/animation/deprecated/save/0.58.7/save.js

This file was deleted.

10 changes: 0 additions & 10 deletions src/blocks/_pro/animation/deprecated/save/index.js
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -54,14 +52,6 @@ const deprecated = [
{
attributes: blockAttributes2,
save: save1_34_1
},
{
attributes: blockAttributes2,
save: save0_58_7
},
{
attributes: blockAttributes2,
save: save0_49_1
}
];

Expand Down
13 changes: 11 additions & 2 deletions src/blocks/_pro/animation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,26 @@ 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
);

// 最新版
if (-1 === deprecatedFuncIndex) {
return el;
}

//後方互換
// deprecatedFuncIndex が予期せぬ数値の場合も考慮して、エラーハンドリングを強化
if (
deprecatedFuncIndex >= 0 &&
deprecatedFuncIndex < deprecatedHooks.length &&
deprecatedHooks[deprecatedFuncIndex]
) {
return el;
}

// 後方互換
const DeprecatedHook = deprecatedHooks[deprecatedFuncIndex];
return <DeprecatedHook el={el} attributes={attributes} />;
}
Expand Down
35 changes: 33 additions & 2 deletions src/blocks/_pro/table-of-contents-new/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down Expand Up @@ -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;
}
}
}
27 changes: 20 additions & 7 deletions src/blocks/_pro/table-of-contents-new/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
});
Expand Down
10 changes: 0 additions & 10 deletions src/blocks/alert/deprecated/0.0.0/save.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/blocks/alert/deprecated/index.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -19,9 +18,5 @@ const deprecated = [
migrate: migrate1_79_0,
save: save1_79_0,
},
{
attributes: blockAttributes,
save: save000,
},
];
export default deprecated;
20 changes: 0 additions & 20 deletions src/blocks/faq/deprecated/0.0.0/save.js

This file was deleted.

20 changes: 0 additions & 20 deletions src/blocks/faq/deprecated/0.0.1/save.js

This file was deleted.

17 changes: 0 additions & 17 deletions src/blocks/faq/deprecated/0.0.2/save.js

This file was deleted.

17 changes: 0 additions & 17 deletions src/blocks/faq/deprecated/0.58.6/save.js

This file was deleted.

Loading

0 comments on commit dc5b3ae

Please sign in to comment.