VK Block Patterns - Version 1.25.0

Version Description

[ Add ][ Japanese ] Add combination with X-T9 Patterns. [ Fix ][ Japanese ] Fix API Alert. [ Fix ][ Japanese ] Fix VK Pattern Library Linkage description.

Download this release

Release Info

Developer vektor-inc
Plugin Icon wp plugin VK Block Patterns
Version 1.25.0
Comparing to
See all releases

Code changes from version 1.24.2 to 1.25.0

admin/admin.php CHANGED
@@ -14,7 +14,7 @@ if ( ! function_exists( 'vbp_setting' ) ) {
14
  * Admin Page Setting.
15
  */
16
  function vbp_setting() {
17
- $options = get_option( 'vk_block_patterns_options' );
18
  ?>
19
  <div id="vk_block_patterns_admin"></div>
20
  <?php
@@ -52,9 +52,9 @@ function vbp_setting_page() {
52
  $get_logo_html = '<img src="' . plugin_dir_url( __FILE__ ) . '/images/vk-block-patterns-logo_ol.svg" alt="VK Block Patterns" />';
53
  $get_logo_html = apply_filters( 'vbp_logo_html', $get_logo_html );
54
 
55
- $get_menu_html = '<li><a href="#role-setting">' . __( 'Role Setting', 'vk-block-patterns' ) . '</a></li>';
56
  $get_menu_html .= '<li><a href="#default-patterns-setting">' . __( 'Default Pattern Setting', 'vk-block-patterns' ) . '</a></li>';
57
- $lang = ( get_locale() === 'ja' ) ? 'ja' : 'en';
58
  if ( 'ja' === $lang ) {
59
  $get_menu_html .= '<li><a href="#pattern-library-setting">' . __( 'VK Pattern Library Setting', 'vk-block-patterns' ) . '</a></li>';
60
  }
@@ -89,6 +89,10 @@ function vkp_show_patterns_register_settings() {
89
  'type' => 'boolean',
90
  'default' => false,
91
  ),
 
 
 
 
92
  );
93
 
94
  foreach ( $default_option_settings as $key => $value ) {
@@ -148,6 +152,7 @@ function vbp_admin_enqueue_scripts( $hook_suffix ) {
148
  // boolean は 空 '' false または 1 true を渡す.
149
  $vbp_options = vbp_get_options();
150
  $vbp_options['adminUrl'] = admin_url();
 
151
  wp_localize_script( 'vk-patterns-admin-js', 'vkpOptions', $vbp_options );
152
  }
153
  add_action( 'admin_enqueue_scripts', 'vbp_admin_enqueue_scripts' );
@@ -163,32 +168,45 @@ function vbp_vws_alert_list() {
163
  $url_next = false === strpos( $current_url, '?' ) ? '?' : '&';
164
  $setting_link = admin_url() . 'options-general.php?page=vk_block_patterns_options';
165
 
166
- // 無効なユーザーが設定された場合
167
  $invalid_notice = '<div class="notice notice-warning"><p>';
168
- $invalid_notice .= __( 'The registerd VWS account linkage is invalid. Please change VWS account linkage.', 'vk-block-patterns' );
 
 
 
 
 
 
169
  $invalid_notice .= ' ';
170
  $invalid_notice .= '<a href="' . $setting_link . '" class="button button-primary">' . __( 'Go to VK Block Patterns Setting', 'vk-block-patterns' ) . '</a>';
171
  $invalid_notice .= ' ';
172
  $invalid_notice .= '<a href="' . $current_url . $url_next . 'disable-invalid-notice" class="button button-secondary">' . __( 'Dismiss', 'vk-block-patterns' ) . '</a>';
173
  $invalid_notice .= '</p></div>';
174
 
175
- // 期限切れユーザーが設定された場合
176
  $free_notice = '<div class="notice notice-warning"><p>';
177
- $free_notice .= __( 'Your VWS account linkage is Outdated. Please Update VWS account license.', 'vk-block-patterns' );
 
 
 
178
  $free_notice .= ' ';
179
  $free_notice .= '<a href="' . $current_url . $url_next . 'disable-free-notice" class="button button-secondary">' . __( 'Dismiss', 'vk-block-patterns' ) . '</a>';
180
- $free_notice .= '</p></div>';
 
181
 
182
- // メールアドレスが入力されていない場合
183
- $empty_notice = '<div class="notice notice-warning"><p>';
184
- $empty_notice .= __( 'The VWS account linkage is not registerd. Please register VWS account linkage.', 'vk-block-patterns' );
185
- $empty_notice .= ' ';
 
 
186
  $empty_notice .= '<a href="' . $setting_link . '" class="button button-primary">' . __( 'Go to VK Block Patterns Setting', 'vk-block-patterns' ) . '</a>';
187
  $empty_notice .= ' ';
188
  $empty_notice .= '<a href="' . $current_url . $url_next . 'disable-empty-notice" class="button button-secondary">' . __( 'Dismiss', 'vk-block-patterns' ) . '</a>';
189
- $empty_notice .= '</p></div>';
 
190
 
191
- // 配列に整えて返す
192
  $alert = array(
193
  'invalid-user' => $invalid_notice,
194
  'free-user' => $free_notice,
@@ -202,14 +220,14 @@ function vbp_vws_alert_list() {
202
 
203
  /**
204
  * 警告を追加
205
- *
206
  * @param Array $api API for TEST.
207
  */
208
  function vbp_vws_alert( $api = array() ) {
209
- $options = vbp_get_options();
210
- $alerts = vbp_vws_alert_list();
211
- $notice = '';
212
- $lang = ( get_locale() === 'ja' || get_locale() === 'ja_JP' ) ? 'ja' : 'en';
213
 
214
  if ( 'ja' === $lang ) {
215
  if ( ! empty( $options['VWSMail'] ) ) {
@@ -223,14 +241,14 @@ function vbp_vws_alert( $api = array() ) {
223
  }
224
  }
225
  } elseif ( false === $options['account-check']['disable-empty-notice'] ) {
226
- $notice = $alerts['empty-user'];
227
  }
228
  }
229
- return $notice;
230
  }
231
 
232
  function vbp_display_vws_alert() {
233
- $notice = vbp_vws_alert();
234
  echo $notice;
235
  }
236
  add_action( 'admin_notices', 'vbp_display_vws_alert' );
14
  * Admin Page Setting.
15
  */
16
  function vbp_setting() {
17
+ $options = vbp_get_options();
18
  ?>
19
  <div id="vk_block_patterns_admin"></div>
20
  <?php
52
  $get_logo_html = '<img src="' . plugin_dir_url( __FILE__ ) . '/images/vk-block-patterns-logo_ol.svg" alt="VK Block Patterns" />';
53
  $get_logo_html = apply_filters( 'vbp_logo_html', $get_logo_html );
54
 
55
+ $get_menu_html = '<li><a href="#role-setting">' . __( 'Role Setting', 'vk-block-patterns' ) . '</a></li>';
56
  $get_menu_html .= '<li><a href="#default-patterns-setting">' . __( 'Default Pattern Setting', 'vk-block-patterns' ) . '</a></li>';
57
+ $lang = ( get_locale() === 'ja' ) ? 'ja' : 'en';
58
  if ( 'ja' === $lang ) {
59
  $get_menu_html .= '<li><a href="#pattern-library-setting">' . __( 'VK Pattern Library Setting', 'vk-block-patterns' ) . '</a></li>';
60
  }
89
  'type' => 'boolean',
90
  'default' => false,
91
  ),
92
+ 'disableXT9Pattern' => array(
93
+ 'type' => 'boolean',
94
+ 'default' => false,
95
+ ),
96
  );
97
 
98
  foreach ( $default_option_settings as $key => $value ) {
152
  // boolean は 空 '' false または 1 true を渡す.
153
  $vbp_options = vbp_get_options();
154
  $vbp_options['adminUrl'] = admin_url();
155
+ $vbp_options['template'] = get_template();
156
  wp_localize_script( 'vk-patterns-admin-js', 'vkpOptions', $vbp_options );
157
  }
158
  add_action( 'admin_enqueue_scripts', 'vbp_admin_enqueue_scripts' );
168
  $url_next = false === strpos( $current_url, '?' ) ? '?' : '&';
169
  $setting_link = admin_url() . 'options-general.php?page=vk_block_patterns_options';
170
 
171
+ // 無効なメールアドレス( patterns. に該当アカウントがない )が設定された場合.
172
  $invalid_notice = '<div class="notice notice-warning"><p>';
173
+ $invalid_notice .= '登録されたメールアドレスのユーザーが <a href="https://patterns.vektor-inc.co.jp/" target="_blank" rel="noopener noreferrer">VK Pattern Library</a> に見つかりませんでした。<br />';
174
+ $invalid_notice .= '<a href="https://patterns.vektor-inc.co.jp/my-account/" target="_blank" rel="noopener noreferrer">VK Pattern Library の登録メールアドレス</a> と同じメールアドレスを登録してください。<br />';
175
+ $invalid_notice .= '有料版ユーザーで VK Pattern Library のユーザーアカウントを未発行の場合は <a href="https://vws.vektor-inc.co.jp/my-account" target="_blank" rel="noopener noreferrer">VWS のマイアカウントページ</a> から VK Pattern Library のユーザーを発行してください。</p>';
176
+ $invalid_notice .= '<p>';
177
+ $invalid_notice .= '<a href="https://patterns.vektor-inc.co.jp/about/flow/" class="button button-primary" target="_blank" rel="noopener noreferrer">VK Pattern Library ユーザー登録手順</a>';
178
+ $invalid_notice .= ' ';
179
+ $invalid_notice .= '<a href="https://patterns.vektor-inc.co.jp/about/about-favorite/" class="button button-primary" target="_blank" rel="noopener noreferrer">VK Pattern Library お気に入り設定</a>';
180
  $invalid_notice .= ' ';
181
  $invalid_notice .= '<a href="' . $setting_link . '" class="button button-primary">' . __( 'Go to VK Block Patterns Setting', 'vk-block-patterns' ) . '</a>';
182
  $invalid_notice .= ' ';
183
  $invalid_notice .= '<a href="' . $current_url . $url_next . 'disable-invalid-notice" class="button button-secondary">' . __( 'Dismiss', 'vk-block-patterns' ) . '</a>';
184
  $invalid_notice .= '</p></div>';
185
 
186
+ // 無料版(=有効期限が切れた)ユーザーが設定された場合.
187
  $free_notice = '<div class="notice notice-warning"><p>';
188
+ $free_notice .= '設定されたメールアドレスと連携している <a href="https://vws.vektor-inc.co.jp/my-account/license" target="_blank" rel="noopener noreferrer">VWSアカウント</a> はライセンスの期限が切れているためお気に入り機能などがご利用できなくなっています。ライセンスの再購入をご検討ください。';
189
+ $free_notice .= '</p>';
190
+ $free_notice .= '<p>';
191
+ $free_notice .= '<a href="https://vws.vektor-inc.co.jp/product/lightning-g3-pro-pack" class="button button-primary" target="_blank" rel="noopener noreferrer">Lightning G3 Pro Pack</a>';
192
  $free_notice .= ' ';
193
  $free_notice .= '<a href="' . $current_url . $url_next . 'disable-free-notice" class="button button-secondary">' . __( 'Dismiss', 'vk-block-patterns' ) . '</a>';
194
+ $free_notice .= '</p>';
195
+ $free_notice .= '</div>';
196
 
197
+ // メールアドレスが入力されていない場合.
198
+ $empty_notice = '<div class="notice notice-warning">';
199
+ $empty_notice .= '<p>';
200
+ $empty_notice .= 'VK Pattern Library のアカウント連携が設定されていません。';
201
+ $empty_notice .= '</p>';
202
+ $empty_notice .= '<div style="margin-bottom:10px;">';
203
  $empty_notice .= '<a href="' . $setting_link . '" class="button button-primary">' . __( 'Go to VK Block Patterns Setting', 'vk-block-patterns' ) . '</a>';
204
  $empty_notice .= ' ';
205
  $empty_notice .= '<a href="' . $current_url . $url_next . 'disable-empty-notice" class="button button-secondary">' . __( 'Dismiss', 'vk-block-patterns' ) . '</a>';
206
+ $empty_notice .= '</div>';
207
+ $empty_notice .= '</div>';
208
 
209
+ // 配列に整えて返す.
210
  $alert = array(
211
  'invalid-user' => $invalid_notice,
212
  'free-user' => $free_notice,
220
 
221
  /**
222
  * 警告を追加
223
+ *
224
  * @param Array $api API for TEST.
225
  */
226
  function vbp_vws_alert( $api = array() ) {
227
+ $options = vbp_get_options();
228
+ $alerts = vbp_vws_alert_list();
229
+ $notice = '';
230
+ $lang = ( get_locale() === 'ja' || get_locale() === 'ja_JP' ) ? 'ja' : 'en';
231
 
232
  if ( 'ja' === $lang ) {
233
  if ( ! empty( $options['VWSMail'] ) ) {
241
  }
242
  }
243
  } elseif ( false === $options['account-check']['disable-empty-notice'] ) {
244
+ $notice = $alerts['empty-user'];
245
  }
246
  }
247
+ return $notice;
248
  }
249
 
250
  function vbp_display_vws_alert() {
251
+ $notice = vbp_vws_alert();
252
  echo $notice;
253
  }
254
  add_action( 'admin_notices', 'vbp_display_vws_alert' );
build/admin/index.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-api', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'f22621d4e60aab00e8f7');
1
+ <?php return array('dependencies' => array('wp-api', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'f9b7d6579890233b957f');
build/admin/index.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";var e,t={406:function(e,t,n){var r=window.wp.element,a=window.wp.i18n,l=window.wp.components,o=window.wp.api,i=n.n(o);(0,r.render)((0,r.createElement)((()=>{const e="1"===vkpOptions.showPatternsLink,t="1"===vkpOptions.disableCorePattern,n="1"===vkpOptions.disablePluginPattern,[o,s]=(0,r.useState)({role:vkpOptions.role,showPatternsLink:e,VWSMail:vkpOptions.VWSMail,disableCorePattern:t,disablePluginPattern:n}),c=e=>{s(e)},[u,p]=(0,r.useState)(!1),[k,v]=(0,r.useState)(""),b=(0,a.getLocaleData)()[""].lang,m=vkpOptions.adminUrl+"edit.php?post_type=vk-block-patterns";return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",null,(0,r.createElement)("section",null,(0,r.createElement)("h3",{id:"role-setting"},(0,a.__)("Role Setting","vk-block-patterns")),(0,r.createElement)("p",null,(0,a.__)("User permission to register patterns in VK Block Patterns","vk-block-patterns")," [ ",(0,r.createElement)("a",{href:m},"VK Block Patterns")," ]"),(0,r.createElement)(l.SelectControl,{value:o.role,onChange:e=>{c({...o,role:e})},options:[{label:(0,a.__)("Contributor or higher","vk-block-patterns"),value:"contributor"},{label:(0,a.__)("Author or higher","vk-block-patterns"),value:"author"},{label:(0,a.__)("Editor or higher","vk-block-patterns"),value:"editor"},{label:(0,a.__)("Administrator only","vk-block-patterns"),value:"administrator"}]})),(0,r.createElement)("section",null,(0,r.createElement)("h3",{id:"default-patterns-setting"},(0,a.__)("Default Pattern Setting","vk-block-patterns")),(0,r.createElement)(l.ToggleControl,{label:(0,a.__)("Disable WordPress Core Patterns","vk-block-patterns"),checked:o.disableCorePattern,onChange:e=>{c({...o,disableCorePattern:e})}}),(0,r.createElement)(l.ToggleControl,{label:(0,a.__)("Disable default patterns of this plugin","vk-block-patterns"),checked:o.disablePluginPattern,onChange:e=>{c({...o,disablePluginPattern:e})}})),"ja_JP"===b&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("h3",{id:"pattern-library-setting"},(0,a.__)("VK Pattern Library Setting","vk-block-patterns")),(0,r.createElement)("section",null,(0,r.createElement)("h4",null,(0,a.__)("VWS account linkage","vk-block-patterns")),(0,r.createElement)("p",null,(0,r.createElement)("a",{href:"https://vws.vektor-inc.co.jp/product/lightning-g3-pro-pack?ref=vkbp-admin",target:"_blank"},"Lightning G3 Pro Pack")," のライセンスをお持ちのユーザーは、",(0,r.createElement)("a",{href:"https://vws.vektor-inc.co.jp/my-account",target:"_blank"},"アカウント"),"のメールアドレスを登録してください。",(0,r.createElement)("br",null),(0,r.createElement)("a",{href:"https://patterns.vektor-inc.co.jp/",target:"_blank"},"VK Pattern Library")," でお気に入りに登録したパターンをエディター上で直接呼び出す事ができます。"),(0,r.createElement)(l.TextControl,{type:"email",className:"vws-mail-address",label:(0,a.__)("VWS Account email address","vk-block-patterns"),value:o.VWSMail,onChange:e=>{c({...o,VWSMail:e})}}),(0,r.createElement)("p",null,"お気に入り登録・連携を利用するには VK Pattern Library のユーザーアカウントを発行する必要があります。",(0,r.createElement)("br",null),"[ ",(0,r.createElement)("a",{href:"https://patterns.vektor-inc.co.jp/about/about-favorite/",target:"_blank"},(0,a.__)("Click here for more information on Favorites","vk-block-patterns"))," ]")),(0,r.createElement)("section",null,(0,r.createElement)("h4",null,(0,a.__)("Editor Setting","vk-block-patterns")),(0,r.createElement)(l.ToggleControl,{label:(0,a.__)("Show VK Pattern Library link in editor toolbar","vk-block-patterns"),checked:o.showPatternsLink,onChange:e=>{c({...o,showPatternsLink:e})}}))),(0,r.createElement)(l.Button,{isPrimary:!0,onClick:()=>{p(!0),i().loadPromise.then((()=>{const e=new(i().models.Settings)({vk_block_patterns_options:o}).save();e.success((()=>{setTimeout((()=>{p(!1),v(!0)}),600)})),e.error((()=>{setTimeout((()=>{p(!1),v(!1)}),600)}))}))},isBusy:u},(0,a.__)("Save setting","vk-block-patterns")),u&&(0,r.createElement)(l.Spinner,null),!1===k&&(0,a.__)("Failed to save.","vk-block-patterns")))}),null),document.getElementById("vk_block_patterns_admin"))}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var l=n[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=function(t,n,a,l){if(!n){var o=1/0;for(u=0;u<e.length;u++){n=e[u][0],a=e[u][1],l=e[u][2];for(var i=!0,s=0;s<n.length;s++)(!1&l||o>=l)&&Object.keys(r.O).every((function(e){return r.O[e](n[s])}))?n.splice(s--,1):(i=!1,l<o&&(o=l));if(i){e.splice(u--,1);var c=a();void 0!==c&&(t=c)}}return t}l=l||0;for(var u=e.length;u>0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[n,a,l]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={846:0,966:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,l,o=n[0],i=n[1],s=n[2],c=0;if(o.some((function(t){return 0!==e[t]}))){for(a in i)r.o(i,a)&&(r.m[a]=i[a]);if(s)var u=s(r)}for(t&&t(n);c<o.length;c++)l=o[c],r.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return r.O(u)},n=self.webpackChunkvk_block_patterns=self.webpackChunkvk_block_patterns||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var a=r.O(void 0,[966],(function(){return r(406)}));a=r.O(a)}();
1
+ !function(){"use strict";var e,t={406:function(e,t,n){var r=window.wp.element,a=window.wp.i18n,l=window.wp.components,o=window.wp.api,i=n.n(o);(0,r.render)((0,r.createElement)((()=>{const e="1"===vkpOptions.showPatternsLink,t="1"===vkpOptions.disableCorePattern,n="1"===vkpOptions.disablePluginPattern,[o,s]=(0,r.useState)({role:vkpOptions.role,showPatternsLink:e,VWSMail:vkpOptions.VWSMail,disableCorePattern:t,disablePluginPattern:n}),c=e=>{s(e)},[p,u]=(0,r.useState)(!1),[k,b]=(0,r.useState)(""),v=(0,a.getLocaleData)()[""].lang,m=vkpOptions.adminUrl+"edit.php?post_type=vk-block-patterns",d=vkpOptions.template;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",null,(0,r.createElement)("section",null,(0,r.createElement)("h3",{id:"role-setting"},(0,a.__)("Role Setting","vk-block-patterns")),(0,r.createElement)("p",null,(0,a.__)("User permission to register patterns in VK Block Patterns","vk-block-patterns")," [ ",(0,r.createElement)("a",{href:m},"VK Block Patterns")," ]"),(0,r.createElement)(l.SelectControl,{value:o.role,onChange:e=>{c({...o,role:e})},options:[{label:(0,a.__)("Contributor or higher","vk-block-patterns"),value:"contributor"},{label:(0,a.__)("Author or higher","vk-block-patterns"),value:"author"},{label:(0,a.__)("Editor or higher","vk-block-patterns"),value:"editor"},{label:(0,a.__)("Administrator only","vk-block-patterns"),value:"administrator"}]})),(0,r.createElement)("section",null,(0,r.createElement)("h3",{id:"default-patterns-setting"},(0,a.__)("Default Pattern Setting","vk-block-patterns")),(0,r.createElement)(l.ToggleControl,{label:(0,a.__)("Disable WordPress Core Patterns","vk-block-patterns"),checked:o.disableCorePattern,onChange:e=>{c({...o,disableCorePattern:e})}}),(0,r.createElement)(l.ToggleControl,{label:(0,a.__)("Disable default patterns of this plugin","vk-block-patterns"),checked:o.disablePluginPattern,onChange:e=>{c({...o,disablePluginPattern:e})}}),"ja_JP"===v&&""!==o.VWSMail&&"x-t9"===d&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.ToggleControl,{label:(0,a.__)("Disable X-T9 patterns","vk-block-patterns"),checked:o.disableXT9Pattern,onChange:e=>{c({...o,disableXT9Pattern:e})}}))),"ja_JP"===v&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("h3",{id:"pattern-library-setting"},(0,a.__)("VK Pattern Library Setting","vk-block-patterns")),(0,r.createElement)("section",null,(0,r.createElement)("h4",null,"アカウント連携"),(0,r.createElement)("p",null,(0,r.createElement)("a",{href:"https://vws.vektor-inc.co.jp/product/lightning-g3-pro-pack?ref=vkbp-admin",target:"_blank"},"Lightning G3 Pro Pack")," のライセンスをお持ちのユーザーは ",(0,r.createElement)("a",{href:"https://patterns.vektor-inc.co.jp/",target:"_blank"},"VK Pattern Library")," でお気に入りに登録したパターンをエディター上で直接呼び出す事ができます。"),(0,r.createElement)("p",null,"お気に入り登録・連携を利用するには VK Pattern Library のユーザーアカウントを発行する必要があります。",(0,r.createElement)("br",null),"[ ",(0,r.createElement)("a",{href:"https://patterns.vektor-inc.co.jp/about/about-favorite/",target:"_blank"},(0,a.__)("Click here for more information on Favorites","vk-block-patterns"))," ]"),(0,r.createElement)(l.TextControl,{type:"email",className:"vws-mail-address",label:"VK Pattern Library のアカウントのメールアドレス",value:o.VWSMail,onChange:e=>{c({...o,VWSMail:e})}})),(0,r.createElement)("section",null,(0,r.createElement)("h4",null,(0,a.__)("Editor Setting","vk-block-patterns")),(0,r.createElement)(l.ToggleControl,{label:(0,a.__)("Show VK Pattern Library link in editor toolbar","vk-block-patterns"),checked:o.showPatternsLink,onChange:e=>{c({...o,showPatternsLink:e})}}))),(0,r.createElement)(l.Button,{isPrimary:!0,onClick:()=>{u(!0),i().loadPromise.then((()=>{const e=new(i().models.Settings)({vk_block_patterns_options:o}).save();e.success((()=>{setTimeout((()=>{u(!1),b(!0)}),600)})),e.error((()=>{setTimeout((()=>{u(!1),b(!1)}),600)}))}))},isBusy:p},(0,a.__)("Save setting","vk-block-patterns")),p&&(0,r.createElement)(l.Spinner,null),!1===k&&(0,a.__)("Failed to save.","vk-block-patterns")))}),null),document.getElementById("vk_block_patterns_admin"))}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var l=n[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=function(t,n,a,l){if(!n){var o=1/0;for(p=0;p<e.length;p++){n=e[p][0],a=e[p][1],l=e[p][2];for(var i=!0,s=0;s<n.length;s++)(!1&l||o>=l)&&Object.keys(r.O).every((function(e){return r.O[e](n[s])}))?n.splice(s--,1):(i=!1,l<o&&(o=l));if(i){e.splice(p--,1);var c=a();void 0!==c&&(t=c)}}return t}l=l||0;for(var p=e.length;p>0&&e[p-1][2]>l;p--)e[p]=e[p-1];e[p]=[n,a,l]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={846:0,966:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,l,o=n[0],i=n[1],s=n[2],c=0;if(o.some((function(t){return 0!==e[t]}))){for(a in i)r.o(i,a)&&(r.m[a]=i[a]);if(s)var p=s(r)}for(t&&t(n);c<o.length;c++)l=o[c],r.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return r.O(p)},n=self.webpackChunkvk_block_patterns=self.webpackChunkvk_block_patterns||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var a=r.O(void 0,[966],(function(){return r(406)}));a=r.O(a)}();
favorite-patterns/favorite-patterns.php CHANGED
@@ -1,65 +1,100 @@
1
  <?php
2
  /**
3
  * お気に入りのパターンを呼び出して登録
 
 
4
  */
5
 
6
  /**
7
  * API からデータを読み込み
8
  */
9
  function vbp_get_pattern_api_data() {
10
- $options = get_option( 'vk_block_patterns_options' );
11
- $user_email = ! empty( $options['VWSMail'] ) ? $options['VWSMail'] : '';
12
- $return = '';
13
 
14
- if ( ! empty( $user_email ) ) {
15
- $result = wp_remote_post(
16
- 'https://patterns.vektor-inc.co.jp/wp-json/vk-patterns/v1/status',
17
- array(
18
- 'timeout' => 10,
19
- 'body' => array(
20
- 'login_id' => $user_email,
21
- ),
22
- )
23
- );
24
- if ( ! empty( $result ) && ! is_wp_error( $result ) ) {
25
- $return = json_decode( $result['body'], true );
26
- }
27
- }
28
- return $return;
29
  }
30
 
31
  /**
32
  * パターンを登録
33
  */
34
  function vbp_register_favorite_patterns() {
35
- $pattern_api_data = vbp_get_pattern_api_data();
36
- if ( ! empty( $pattern_api_data ) && is_array( $pattern_api_data ) ) {
37
- $patterns_data = $pattern_api_data['patterns'];
38
-
39
- if ( function_exists( 'mb_convert_encoding' ) ) {
40
- $patterns_data = mb_convert_encoding( $patterns_data, 'UTF8', 'ASCII,JIS,UTF-8,EUC-JP,SJIS-WIN' );
41
- }
42
-
43
- $patterns = json_decode( $patterns_data, true );
44
- register_block_pattern_category(
45
- 'vk-pattern-favorites',
46
- array(
47
- 'label' => __( 'Favorites of VK Pattern Library', 'vk-block-patterns' )
48
- )
49
- );
50
- if ( ! empty( $patterns ) && is_array( $patterns ) ) {
51
- foreach ( $patterns as $pattern ) {
52
- register_block_pattern(
53
- $pattern['post_name'],
54
- array(
55
- 'title' => $pattern['title'],
56
- 'categories' => $pattern['categories'],
57
- 'content' => $pattern['content'],
58
- )
59
- );
60
- }
61
- }
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
  add_action( 'init', 'vbp_register_favorite_patterns' );
65
-
1
  <?php
2
  /**
3
  * お気に入りのパターンを呼び出して登録
4
+ *
5
+ * @package vektor-inc/vk-block-patterns
6
  */
7
 
8
  /**
9
  * API からデータを読み込み
10
  */
11
  function vbp_get_pattern_api_data() {
12
+ $options = vbp_get_options();
13
+ $user_email = ! empty( $options['VWSMail'] ) ? $options['VWSMail'] : '';
14
+ $return = '';
15
 
16
+ if ( ! empty( $user_email ) ) {
17
+ $result = wp_remote_post(
18
+ 'https://patterns.vektor-inc.co.jp/wp-json/vk-patterns/v1/status',
19
+ array(
20
+ 'timeout' => 10,
21
+ 'body' => array(
22
+ 'login_id' => $user_email,
23
+ ),
24
+ )
25
+ );
26
+ if ( ! empty( $result ) && ! is_wp_error( $result ) ) {
27
+ $return = json_decode( $result['body'], true );
28
+ }
29
+ }
30
+ return $return;
31
  }
32
 
33
  /**
34
  * パターンを登録
35
  */
36
  function vbp_register_favorite_patterns() {
37
+ $pattern_api_data = vbp_get_pattern_api_data();
38
+ $current_template = get_template();
39
+ $options = vbp_get_options();
40
+ if ( ! empty( $pattern_api_data ) && is_array( $pattern_api_data ) ) {
41
+ if ( ! empty( $pattern_api_data['patterns'] ) ) {
42
+ $patterns_data = $pattern_api_data['patterns'];
43
+
44
+ if ( function_exists( 'mb_convert_encoding' ) ) {
45
+ $patterns_data = mb_convert_encoding( $patterns_data, 'UTF8', 'ASCII,JIS,UTF-8,EUC-JP,SJIS-WIN' );
46
+ }
47
+
48
+ $patterns = json_decode( $patterns_data, true );
49
+ register_block_pattern_category(
50
+ 'vk-pattern-favorites',
51
+ array(
52
+ 'label' => __( 'Favorites of VK Pattern Library', 'vk-block-patterns' ),
53
+ )
54
+ );
55
+ if ( ! empty( $patterns ) && is_array( $patterns ) ) {
56
+ foreach ( $patterns as $pattern ) {
57
+ register_block_pattern(
58
+ $pattern['post_name'],
59
+ array(
60
+ 'title' => $pattern['title'],
61
+ 'categories' => $pattern['categories'],
62
+ 'content' => $pattern['content'],
63
+ )
64
+ );
65
+ }
66
+ }
67
+ }
68
+
69
+ if ( 'x-t9' === $current_template && false === $options['disableXT9Pattern'] ) {
70
+ if ( ! empty( $pattern_api_data['x-t9'] ) ) {
71
+ $patterns_data = $pattern_api_data['x-t9'];
72
+
73
+ if ( function_exists( 'mb_convert_encoding' ) ) {
74
+ $patterns_data = mb_convert_encoding( $patterns_data, 'UTF8', 'ASCII,JIS,UTF-8,EUC-JP,SJIS-WIN' );
75
+ }
76
+
77
+ $patterns = json_decode( $patterns_data, true );
78
+ register_block_pattern_category(
79
+ 'x-t9',
80
+ array(
81
+ 'label' => __( 'X-T9', 'vk-block-patterns' ),
82
+ )
83
+ );
84
+ if ( ! empty( $patterns ) && is_array( $patterns ) ) {
85
+ foreach ( $patterns as $pattern ) {
86
+ register_block_pattern(
87
+ $pattern['post_name'],
88
+ array(
89
+ 'title' => $pattern['title'],
90
+ 'categories' => $pattern['categories'],
91
+ 'content' => $pattern['content'],
92
+ )
93
+ );
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
  }
100
  add_action( 'init', 'vbp_register_favorite_patterns' );
 
inc/vk-admin/package/_scss/vk_admin.scss CHANGED
@@ -1,5 +1,48 @@
1
  @charset "utf-8";
2
- // @import "compass";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  $text-size : 14px;
5
  $line-height : 1.7;
@@ -264,17 +307,8 @@ body {
264
  }
265
 
266
  .adminMain {
267
- display: block;
268
- overflow: hidden;
269
- width: 74%;
270
- float: left;
271
 
272
  #adminContent_sub {
273
- display: block;
274
- overflow: hidden;
275
- width: 23%;
276
- float: left;
277
- padding-bottom: 10px;
278
 
279
  .notice {
280
  padding-bottom: 10px;
@@ -289,24 +323,9 @@ body {
289
  }
290
 
291
  #adminContent_main {
292
- display: block;
293
- overflow: hidden;
294
- width: 74%;
295
- float: right;
296
- min-height: 300px;
297
-
298
  .form_horizontal_item {
299
  margin-right: 1em;
300
  }
301
-
302
- .setting-content {}
303
-
304
- }
305
-
306
- &.column_2 {
307
- #adminContent_main {
308
- width: 100%;
309
- }
310
  }
311
 
312
  &_main {
@@ -354,12 +373,6 @@ body {
354
  }
355
 
356
  .adminSub {
357
- display: block;
358
- overflow: hidden;
359
- width: 24%;
360
- float: right;
361
- padding-bottom: 10px;
362
-
363
  .infoBox {
364
  display: block;
365
  overflow: hidden;
1
  @charset "utf-8";
2
+
3
+ /*-------------------------------------------*/
4
+ /* Layout
5
+ /*-------------------------------------------*/
6
+ .vk_admin_page {
7
+ --vk-admin-layout-gap: 30px;
8
+
9
+ .adminLayout {
10
+ display: grid;
11
+ grid-template-columns: 70% 1fr;
12
+ gap: var(--vk-admin-layout-gap);
13
+ }
14
+
15
+ .adminMain {
16
+ display: grid;
17
+
18
+ #adminContent_sub {
19
+ padding-bottom: 10px;
20
+ flex-basis: 25%;
21
+
22
+ .vk_option_nav {
23
+ position: sticky;
24
+ top: 50px;
25
+ bottom: 30px;
26
+ }
27
+ }
28
+
29
+ &.column_2 {
30
+ #adminContent_main {
31
+ width: 100%;
32
+ }
33
+ }
34
+
35
+ &.column_3 {
36
+ grid-template-columns: 1fr 70%;
37
+ gap: var(--vk-admin-layout-gap);
38
+ }
39
+ }
40
+ }
41
+
42
+
43
+ /*-------------------------------------------*/
44
+ /* common
45
+ /*-------------------------------------------*/
46
 
47
  $text-size : 14px;
48
  $line-height : 1.7;
307
  }
308
 
309
  .adminMain {
 
 
 
 
310
 
311
  #adminContent_sub {
 
 
 
 
 
312
 
313
  .notice {
314
  padding-bottom: 10px;
323
  }
324
 
325
  #adminContent_main {
 
 
 
 
 
 
326
  .form_horizontal_item {
327
  margin-right: 1em;
328
  }
 
 
 
 
 
 
 
 
 
329
  }
330
 
331
  &_main {
373
  }
374
 
375
  .adminSub {
 
 
 
 
 
 
376
  .infoBox {
377
  display: block;
378
  overflow: hidden;
inc/vk-admin/package/class-vk-admin.php CHANGED
@@ -17,7 +17,7 @@ if ( ! class_exists( 'Vk_Admin' ) ) {
17
  */
18
  class Vk_Admin {
19
 
20
- public static $version = '2.2.0';
21
 
22
  static function init() {
23
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_common_css' ) );
@@ -406,7 +406,7 @@ if ( ! class_exists( 'Vk_Admin' ) ) {
406
  if ( ! $display ) {
407
  return;
408
  }
409
- $adminSub = '<div class="adminSub scrTracking">' . "\n";
410
  if ( 'ja' == get_locale() ) {
411
  $adminSub .= '<div class="infoBox">' . self::get_news_body() . '</div>' . "\n";
412
  }
@@ -422,37 +422,38 @@ if ( ! class_exists( 'Vk_Admin' ) ) {
422
  public static function admin_page_frame( $get_page_title, $the_body_callback, $get_logo_html = '', $get_menu_html = '', $get_layout = 'column_3' ) {
423
  ?>
424
  <div class="wrap vk_admin_page">
425
-
426
- <div class="adminMain <?php echo $get_layout; ?>">
427
-
428
- <?php if ( $get_layout == 'column_3' ) : ?>
429
- <div id="adminContent_sub" class="scrTracking adminMain_sub">
430
- <div class="pageLogo"><?php echo $get_logo_html; ?></div>
431
- <?php if ( $get_page_title ) : ?>
432
- <h2 class="page_title"><?php echo $get_page_title; ?></h2>
433
- <?php endif; ?>
434
- <div class="vk_option_nav">
435
- <ul>
436
- <?php echo $get_menu_html; ?>
437
- </ul>
438
- </div>
439
- </div><!-- [ /#adminContent_sub ] -->
440
- <?php endif; ?>
441
-
442
- <?php if ( $get_layout == 'column_2' ) : ?>
443
  <div class="pageLogo"><?php echo $get_logo_html; ?></div>
444
- <?php if ( $get_page_title ) : ?>
445
  <h1 class="page_title"><?php echo $get_page_title; ?></h1>
446
  <?php endif; ?>
447
  <?php endif; ?>
448
 
449
- <div id="adminContent_main" class="adminMain_main">
450
- <?php call_user_func_array( $the_body_callback, array() ); ?>
451
- </div><!-- [ /#adminContent_main ] -->
452
-
453
- </div><!-- [ /.adminMain ] -->
454
-
455
- <?php echo self::admin_sub(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456
 
457
  </div><!-- [ /.vkExUnit_admin_page ] -->
458
  <?php
17
  */
18
  class Vk_Admin {
19
 
20
+ public static $version = '2.4.0';
21
 
22
  static function init() {
23
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_common_css' ) );
406
  if ( ! $display ) {
407
  return;
408
  }
409
+ $adminSub = '<div class="adminSub">' . "\n";
410
  if ( 'ja' == get_locale() ) {
411
  $adminSub .= '<div class="infoBox">' . self::get_news_body() . '</div>' . "\n";
412
  }
422
  public static function admin_page_frame( $get_page_title, $the_body_callback, $get_logo_html = '', $get_menu_html = '', $get_layout = 'column_3' ) {
423
  ?>
424
  <div class="wrap vk_admin_page">
425
+ <?php if ( $get_layout == 'column_2' ) : ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
  <div class="pageLogo"><?php echo $get_logo_html; ?></div>
427
+ <?php if ( $get_page_title ) : ?>
428
  <h1 class="page_title"><?php echo $get_page_title; ?></h1>
429
  <?php endif; ?>
430
  <?php endif; ?>
431
 
432
+ <div class="adminLayout">
433
+ <div class="adminMain <?php echo $get_layout; ?>">
434
+
435
+ <?php if ( $get_layout == 'column_3' ) : ?>
436
+ <div id="adminContent_sub" class="scrTracking adminMain_sub">
437
+ <div class="pageLogo"><?php echo $get_logo_html; ?></div>
438
+ <?php if ( $get_page_title ) : ?>
439
+ <h2 class="page_title"><?php echo $get_page_title; ?></h2>
440
+ <?php endif; ?>
441
+ <div class="vk_option_nav">
442
+ <ul>
443
+ <?php echo $get_menu_html; ?>
444
+ </ul>
445
+ </div>
446
+ </div><!-- [ /#adminContent_sub ] -->
447
+ <?php endif; ?>
448
+
449
+ <div id="adminContent_main" class="adminMain_main">
450
+ <?php call_user_func_array( $the_body_callback, array() ); ?>
451
+ </div><!-- [ /#adminContent_main ] -->
452
+
453
+ </div><!-- [ /.adminMain ] -->
454
+
455
+ <?php echo self::admin_sub(); ?>
456
+ </div>
457
 
458
  </div><!-- [ /.vkExUnit_admin_page ] -->
459
  <?php
inc/vk-admin/package/css/vk_admin.css CHANGED
@@ -1 +1 @@
1
- body{margin:0}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-warning{color:#a94442}#dashboard-widgets .vk-metabox-sub-title,.vk-metabox-sub-title{display:block;overflow:hidden;border-bottom:1px solid #e5e5e5;margin-top:1em;padding-bottom:.3em}#dashboard-widgets .vk-metabox-sub-title .dashicons,.vk-metabox-sub-title .dashicons{position:relative;top:-2px;margin-left:3px}.vk-metabox-more-link{float:right;font-size:12px}.vk-metabox-post-list{margin-bottom:2em}.vk-metabox-post-list li{border-bottom:1px dotted #ccc;padding-bottom:3px;display:flex}.vk-metabox-post-list li .date{font-size:11px;margin-right:1em;width:75px;white-space:nowrap}.vk-metabox-post-list li a{width:100%}.vk-admin-banner{display:block;overflow:hidden}.vk-admin-banner a.admin_banner{display:block;margin-bottom:1em;border:1px solid #ccc;box-shadow:inset 0 0 0 1px #fff}.vk-admin-banner a.admin_banner img{max-width:100%;height:auto;display:block}.vk-admin-banner a.admin_banner img:hover{opacity:.7}.vk-admin-banner .vektor_logo{margin-top:1em}.vk-admin-banner .vektor_logo img{width:150px;float:right}#vk_dashboard_widget .vk-admin-banner-grid{width:100%;display:flex;flex-wrap:wrap;justify-content:space-between}#vk_dashboard_widget .vk-admin-banner-grid a.admin_banner{width:48%}.wp-core-ui .button-block{display:block;width:100%;text-align:center}.logo_exUnit{display:block;overflow:hidden;text-align:center;margin-bottom:10px;border-bottom:1px solid #ccc}.logo_exUnit img{width:150px;max-width:100%}.vk_option_nav{display:block!important;overflow:hidden}.vk_option_nav ul{display:block;overflow:hidden;margin:0;padding:0}.vk_option_nav ul li{display:block;border:1px solid #ccc;margin-bottom:0;border-bottom:none;background-color:#fff}.vk_option_nav ul li:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.vk_option_nav ul li:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom:1px solid #ccc}.vk_option_nav ul li:hover{background-color:#666}.vk_option_nav ul li a{display:block;overflow:hidden;padding:.5em;text-decoration:none;color:#666;font-size:12px}.vk_option_nav ul li:hover a{color:#fff;border:none}.vk_option_nav ul li.current{background-color:#333;color:#fff}.vk_option_nav ul li.current a{color:#fff}.vk_admin_page{padding-top:1em}.vk_admin_page li,.vk_admin_page p,.vk_admin_page td{line-height:1.7;font-size:14px}.vk_admin_page h2.page_title{font-size:16px;text-align:center;line-height:140%;margin:10px 0 20px}.vk_admin_page h3{background-color:#333;color:#fff;padding:10px 15px;font-size:150%;margin-top:0;border-left:5px solid #e50000;border-radius:4px}.vk_admin_page h5{font-size:16px;margin-bottom:1em}.vk_admin_page .form-table td p,.vk_admin_page p{margin-bottom:1em;font-size:14px;line-height:1.7}.vk_admin_page .form-table td p:last-child,.vk_admin_page p:last-child{margin-bottom:0}.vk_admin_page input[type=text]{width:50%}.vk_admin_page select{width:50%}.vk_admin_page dl{line-height:1.5}.vk_admin_page dl dt{font-weight:700;margin-bottom:5px}.vk_admin_page dl dd{margin-left:0}.vk_admin_page tr.dev_object{display:none}.vk_admin_page .pageLogo{text-align:center}.vk_admin_page .pageLogo img{max-width:150px;margin:0 auto}.vk_admin_page .adminMain{display:block;overflow:hidden;width:74%;float:left}.vk_admin_page .adminMain #adminContent_sub{display:block;overflow:hidden;width:23%;float:left;padding-bottom:10px}.vk_admin_page .adminMain #adminContent_sub .notice{padding-bottom:10px}.vk_admin_page .adminMain #adminContent_sub .button{white-space:normal;margin:5px 0;padding:.5em 1em;line-height:1.4}.vk_admin_page .adminMain #adminContent_main{display:block;overflow:hidden;width:74%;float:right;min-height:300px}.vk_admin_page .adminMain #adminContent_main .form_horizontal_item{margin-right:1em}.vk_admin_page .adminMain.column_2 #adminContent_main{width:100%}.vk_admin_page .adminMain_main ol,.vk_admin_page .adminMain_main ul{margin-top:0;margin-left:1.5em;padding-top:0}.vk_admin_page .adminMain_main ol>li{list-style:decimal}.vk_admin_page .adminMain_main ul>li{list-style:disc}.vk_admin_page .adminMain_main li ol,.vk_admin_page .adminMain_main li ul{margin-top:.5em}.vk_admin_page .adminMain_main ul.no-style{margin-left:0}.vk_admin_page .adminMain_main ul.no-style ul{margin-left:1.5em}.vk_admin_page .adminMain_main ul.no-style li{list-style:none}.vk_admin_page .adminMain_main_content{margin-bottom:3em}.vk_admin_page .adminMain_main input[type=text]{margin-bottom:5px}.vk_admin_page .adminSub{display:block;overflow:hidden;width:24%;float:right;padding-bottom:10px}.vk_admin_page .adminSub .infoBox{display:block;overflow:hidden;padding:1em;margin-bottom:1em;background-color:#fff;border-radius:4px}.vk_admin_page .adminSub .vk-metabox-sub-title{background-color:#ccc;width:auto;padding:5px 10px;border-radius:3px;margin-top:0;margin-bottom:15px}.vk_admin_page .adminSub .vk-metabox-more-link{display:none}.vk_admin_page .alert{border-radius:4px;padding:.8em;font-weight:400}.vk_admin_page .alert-danger{border:1px solid #ebccd1;background-color:#f2dede;color:#a94442}.wp-full-overlay-sidebar{font-size:14px}.admin-custom-section,.admin_widget_section{display:block;overflow:hidden;margin:1.5em 0}.admin-custom-section p,.admin_widget_section p{margin-top:.5em}.admin-custom-h2,.admin_widget_h2{box-sizing:border-box;margin:1em 0 1em;padding:.8em 1em;width:100%;border:solid 1px #ddd;border-radius:5px;background:#555;color:#fff;font-size:1.1em}.admin-custom-h3,.admin_widget_h3{box-sizing:border-box;padding:.4em 0;margin-bottom:.3em;width:100%;border-bottom:solid 1px #ddd;font-size:1em}.admin-custom-discription{margin-top:.5em}input[type=checkbox].admin-custom-input,input[type=checkbox].admin_widget_input,input[type=color].admin-custom-input,input[type=color].admin_widget_input,input[type=date].admin-custom-input,input[type=date].admin_widget_input,input[type=datetime-local].admin-custom-input,input[type=datetime-local].admin_widget_input,input[type=datetime].admin-custom-input,input[type=datetime].admin_widget_input,input[type=email].admin-custom-input,input[type=email].admin_widget_input,input[type=month].admin-custom-input,input[type=month].admin_widget_input,input[type=number].admin-custom-input,input[type=number].admin_widget_input,input[type=password].admin-custom-input,input[type=password].admin_widget_input,input[type=radio].admin-custom-input,input[type=radio].admin_widget_input,input[type=search].admin-custom-input,input[type=search].admin_widget_input,input[type=tel].admin-custom-input,input[type=tel].admin_widget_input,input[type=text].admin-custom-input,input[type=text].admin_widget_input,input[type=time].admin-custom-input,input[type=time].admin_widget_input,input[type=url].admin-custom-input,input[type=url].admin_widget_input,input[type=week].admin-custom-input,input[type=week].admin_widget_input,select.admin-custom-input,select.admin_widget_input,textarea.admin-custom-input,textarea.admin_widget_input{width:100%;margin:.3em 0}.admin-custom-thumb-outer,.admin_widget_thumb_outer{position:relative;overflow:hidden;z-index:2;margin:3px 0;min-height:70px;border:1px solid #e5e5e5;background-color:#f5f5f5;width:100%}.admin-custom-thumb-outer:before,.admin_widget_thumb_outer:before{position:absolute;top:50%;left:50%;z-index:1;margin:-8px 0 0 -30px;color:#999;content:"No Image"}.admin-custom-thumb,.admin_widget_thumb{position:relative;z-index:3;display:block;width:100%;height:auto}.vk_checklist_item-style-vertical{display:flex}.vk_checklist_item .vk_checklist_item_input{margin-top:0}.vk-admin-inline-radio{display:flex;border-radius:3px;overflow:hidden;border:1px solid #b6b6b6}.vk-admin-inline-radio div{position:relative;flex:1}.vk-admin-inline-radio input{width:100%;height:60px;opacity:0}.vk-admin-inline-radio label{position:absolute;top:0;left:0;color:#b6b6b6;width:100%;height:100%;background:#fff;display:flex;align-items:center;justify-content:center;pointer-events:none;border-right:1px solid #b6b6b6}.vk-admin-inline-radio div:last-child label{border-right:0}.vk-admin-inline-radio input:checked+label{background:#d81b60;font-weight:500;color:#fff}@media (max-width:991px){.vk_admin_page .adminSub .adminMain table.form-table td,.vk_admin_page .adminSub .adminMain table.form-table th{display:block}.vk_admin_page .adminSub .adminMain table.form-table th{background-color:#ccc;width:auto;padding:10px;border-radius:3px}}
1
+ .vk_admin_page{--vk-admin-layout-gap:30px}.vk_admin_page .adminLayout{display:grid;grid-template-columns:70% 1fr;gap:var(--vk-admin-layout-gap)}.vk_admin_page .adminMain{display:grid}.vk_admin_page .adminMain #adminContent_sub{padding-bottom:10px;flex-basis:25%}.vk_admin_page .adminMain #adminContent_sub .vk_option_nav{position:sticky;top:50px;bottom:30px}.vk_admin_page .adminMain.column_2 #adminContent_main{width:100%}.vk_admin_page .adminMain.column_3{grid-template-columns:1fr 70%;gap:var(--vk-admin-layout-gap)}body{margin:0}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-warning{color:#a94442}#dashboard-widgets .vk-metabox-sub-title,.vk-metabox-sub-title{display:block;overflow:hidden;border-bottom:1px solid #e5e5e5;margin-top:1em;padding-bottom:.3em}#dashboard-widgets .vk-metabox-sub-title .dashicons,.vk-metabox-sub-title .dashicons{position:relative;top:-2px;margin-left:3px}.vk-metabox-more-link{float:right;font-size:12px}.vk-metabox-post-list{margin-bottom:2em}.vk-metabox-post-list li{border-bottom:1px dotted #ccc;padding-bottom:3px;display:flex}.vk-metabox-post-list li .date{font-size:11px;margin-right:1em;width:75px;white-space:nowrap}.vk-metabox-post-list li a{width:100%}.vk-admin-banner{display:block;overflow:hidden}.vk-admin-banner a.admin_banner{display:block;margin-bottom:1em;border:1px solid #ccc;box-shadow:inset 0 0 0 1px #fff}.vk-admin-banner a.admin_banner img{max-width:100%;height:auto;display:block}.vk-admin-banner a.admin_banner img:hover{opacity:.7}.vk-admin-banner .vektor_logo{margin-top:1em}.vk-admin-banner .vektor_logo img{width:150px;float:right}#vk_dashboard_widget .vk-admin-banner-grid{width:100%;display:flex;flex-wrap:wrap;justify-content:space-between}#vk_dashboard_widget .vk-admin-banner-grid a.admin_banner{width:48%}.wp-core-ui .button-block{display:block;width:100%;text-align:center}.logo_exUnit{display:block;overflow:hidden;text-align:center;margin-bottom:10px;border-bottom:1px solid #ccc}.logo_exUnit img{width:150px;max-width:100%}.vk_option_nav{display:block!important;overflow:hidden}.vk_option_nav ul{display:block;overflow:hidden;margin:0;padding:0}.vk_option_nav ul li{display:block;border:1px solid #ccc;margin-bottom:0;border-bottom:none;background-color:#fff}.vk_option_nav ul li:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.vk_option_nav ul li:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom:1px solid #ccc}.vk_option_nav ul li:hover{background-color:#666}.vk_option_nav ul li a{display:block;overflow:hidden;padding:.5em;text-decoration:none;color:#666;font-size:12px}.vk_option_nav ul li:hover a{color:#fff;border:none}.vk_option_nav ul li.current{background-color:#333;color:#fff}.vk_option_nav ul li.current a{color:#fff}.vk_admin_page{padding-top:1em}.vk_admin_page li,.vk_admin_page p,.vk_admin_page td{line-height:1.7;font-size:14px}.vk_admin_page h2.page_title{font-size:16px;text-align:center;line-height:140%;margin:10px 0 20px}.vk_admin_page h3{background-color:#333;color:#fff;padding:10px 15px;font-size:150%;margin-top:0;border-left:5px solid #e50000;border-radius:4px}.vk_admin_page h5{font-size:16px;margin-bottom:1em}.vk_admin_page .form-table td p,.vk_admin_page p{margin-bottom:1em;font-size:14px;line-height:1.7}.vk_admin_page .form-table td p:last-child,.vk_admin_page p:last-child{margin-bottom:0}.vk_admin_page input[type=text]{width:50%}.vk_admin_page select{width:50%}.vk_admin_page dl{line-height:1.5}.vk_admin_page dl dt{font-weight:700;margin-bottom:5px}.vk_admin_page dl dd{margin-left:0}.vk_admin_page tr.dev_object{display:none}.vk_admin_page .pageLogo{text-align:center}.vk_admin_page .pageLogo img{max-width:150px;margin:0 auto}.vk_admin_page .adminMain #adminContent_sub .notice{padding-bottom:10px}.vk_admin_page .adminMain #adminContent_sub .button{white-space:normal;margin:5px 0;padding:.5em 1em;line-height:1.4}.vk_admin_page .adminMain #adminContent_main .form_horizontal_item{margin-right:1em}.vk_admin_page .adminMain_main ol,.vk_admin_page .adminMain_main ul{margin-top:0;margin-left:1.5em;padding-top:0}.vk_admin_page .adminMain_main ol>li{list-style:decimal}.vk_admin_page .adminMain_main ul>li{list-style:disc}.vk_admin_page .adminMain_main li ol,.vk_admin_page .adminMain_main li ul{margin-top:.5em}.vk_admin_page .adminMain_main ul.no-style{margin-left:0}.vk_admin_page .adminMain_main ul.no-style ul{margin-left:1.5em}.vk_admin_page .adminMain_main ul.no-style li{list-style:none}.vk_admin_page .adminMain_main_content{margin-bottom:3em}.vk_admin_page .adminMain_main input[type=text]{margin-bottom:5px}.vk_admin_page .adminSub .infoBox{display:block;overflow:hidden;padding:1em;margin-bottom:1em;background-color:#fff;border-radius:4px}.vk_admin_page .adminSub .vk-metabox-sub-title{background-color:#ccc;width:auto;padding:5px 10px;border-radius:3px;margin-top:0;margin-bottom:15px}.vk_admin_page .adminSub .vk-metabox-more-link{display:none}.vk_admin_page .alert{border-radius:4px;padding:.8em;font-weight:400}.vk_admin_page .alert-danger{border:1px solid #ebccd1;background-color:#f2dede;color:#a94442}.wp-full-overlay-sidebar{font-size:14px}.admin-custom-section,.admin_widget_section{display:block;overflow:hidden;margin:1.5em 0}.admin-custom-section p,.admin_widget_section p{margin-top:.5em}.admin-custom-h2,.admin_widget_h2{box-sizing:border-box;margin:1em 0 1em;padding:.8em 1em;width:100%;border:solid 1px #ddd;border-radius:5px;background:#555;color:#fff;font-size:1.1em}.admin-custom-h3,.admin_widget_h3{box-sizing:border-box;padding:.4em 0;margin-bottom:.3em;width:100%;border-bottom:solid 1px #ddd;font-size:1em}.admin-custom-discription{margin-top:.5em}input[type=checkbox].admin-custom-input,input[type=checkbox].admin_widget_input,input[type=color].admin-custom-input,input[type=color].admin_widget_input,input[type=date].admin-custom-input,input[type=date].admin_widget_input,input[type=datetime-local].admin-custom-input,input[type=datetime-local].admin_widget_input,input[type=datetime].admin-custom-input,input[type=datetime].admin_widget_input,input[type=email].admin-custom-input,input[type=email].admin_widget_input,input[type=month].admin-custom-input,input[type=month].admin_widget_input,input[type=number].admin-custom-input,input[type=number].admin_widget_input,input[type=password].admin-custom-input,input[type=password].admin_widget_input,input[type=radio].admin-custom-input,input[type=radio].admin_widget_input,input[type=search].admin-custom-input,input[type=search].admin_widget_input,input[type=tel].admin-custom-input,input[type=tel].admin_widget_input,input[type=text].admin-custom-input,input[type=text].admin_widget_input,input[type=time].admin-custom-input,input[type=time].admin_widget_input,input[type=url].admin-custom-input,input[type=url].admin_widget_input,input[type=week].admin-custom-input,input[type=week].admin_widget_input,select.admin-custom-input,select.admin_widget_input,textarea.admin-custom-input,textarea.admin_widget_input{width:100%;margin:.3em 0}.admin-custom-thumb-outer,.admin_widget_thumb_outer{position:relative;overflow:hidden;z-index:2;margin:3px 0;min-height:70px;border:1px solid #e5e5e5;background-color:#f5f5f5;width:100%}.admin-custom-thumb-outer:before,.admin_widget_thumb_outer:before{position:absolute;top:50%;left:50%;z-index:1;margin:-8px 0 0 -30px;color:#999;content:"No Image"}.admin-custom-thumb,.admin_widget_thumb{position:relative;z-index:3;display:block;width:100%;height:auto}.vk_checklist_item-style-vertical{display:flex}.vk_checklist_item .vk_checklist_item_input{margin-top:0}.vk-admin-inline-radio{display:flex;border-radius:3px;overflow:hidden;border:1px solid #b6b6b6}.vk-admin-inline-radio div{position:relative;flex:1}.vk-admin-inline-radio input{width:100%;height:60px;opacity:0}.vk-admin-inline-radio label{position:absolute;top:0;left:0;color:#b6b6b6;width:100%;height:100%;background:#fff;display:flex;align-items:center;justify-content:center;pointer-events:none;border-right:1px solid #b6b6b6}.vk-admin-inline-radio div:last-child label{border-right:0}.vk-admin-inline-radio input:checked+label{background:#d81b60;font-weight:500;color:#fff}@media (max-width:991px){.vk_admin_page .adminSub .adminMain table.form-table td,.vk_admin_page .adminSub .adminMain table.form-table th{display:block}.vk_admin_page .adminSub .adminMain table.form-table th{background-color:#ccc;width:auto;padding:10px;border-radius:3px}}
inc/vk-admin/package/js/vk_admin.js CHANGED
@@ -60,75 +60,6 @@ jQuery(document).ready(function($){
60
  });
61
  });
62
 
63
- /*-------------------------------------------*/
64
- /* スクロール時の位置固定
65
- /*-------------------------------------------*/
66
- jQuery(document).ready(function(){
67
-
68
- // サイドバー要素のデフォルトの絶対位置
69
- var default_offset = jQuery('.scrTracking').offset();
70
-
71
- // コンテンツエリアの高さを取得
72
- var contentHeight = jQuery('.adminMain').height();
73
-
74
- navMove( default_offset, contentHeight );
75
-
76
- // スクロールしたら
77
- jQuery(window).scroll(function () {
78
- navMove( default_offset, contentHeight );
79
- });
80
- jQuery(window).resize(function(){
81
- navMove( default_offset, contentHeight );
82
- });
83
- });
84
-
85
- function navMove( default_offset, contentHeight ){
86
-
87
- // ウィンドウの高さを取得
88
- var windowHeight = jQuery(window).height();
89
-
90
- // スクロール量
91
- var scrollHeight = jQuery(this).scrollTop();
92
-
93
- var marginBottom = 15;
94
-
95
- jQuery('.scrTracking').each(function(i){
96
-
97
- // サイドバー要素の高さ
98
- var itemHeight = jQuery(this).height();
99
-
100
- // ウィンドウサイズからはみ出すサイズ
101
- if ( itemHeight < windowHeight ){
102
- var overHeight = 0;
103
- } else {
104
- var overHeight = itemHeight - windowHeight;
105
- }
106
-
107
- if ( scrollHeight < contentHeight ){ // これがないと延々とスクロールする
108
-
109
- if ( windowHeight < itemHeight ) {
110
- // アイテムがウィンドウサイズより高い場合
111
-
112
- if ( scrollHeight > overHeight ) {
113
- // はみ出してる高さよりスクロールが大きい場合
114
- // スクロール量からはみ出してる高さを引いた余白を追加
115
- var marginTop = scrollHeight - overHeight - default_offset['top'] - marginBottom;
116
- jQuery(this).css({"margin-top":marginTop});
117
- } else {
118
- // はみ出してる高さよりスクロールが小さい場合
119
- jQuery(this).css({"margin-top":0});
120
- }
121
-
122
- } else {
123
- // アイテムがウィンドウサイズより低い場合
124
- jQuery(this).css({ "margin-top" : scrollHeight });
125
- }
126
- }
127
-
128
- });
129
- }
130
-
131
-
132
  /*-------------------------------------------*/
133
  /* ページ内リンクで頭出しの余白を適切にする
134
  /*-------------------------------------------*/
60
  });
61
  });
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  /*-------------------------------------------*/
64
  /* ページ内リンクで頭出しの余白を適切にする
65
  /*-------------------------------------------*/
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: vektor-inc,kurudrive,rickaddison7634,kaorock72,una9,shimotomoki
3
  Donate link:
4
  Tags: Guternberg, Block Pattern
5
  Requires at least: 5.8
6
- Tested up to: 6.0.1
7
- Stable tag: 1.24.2
8
  Requires PHP: 7.2
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -16,6 +16,11 @@ When you activate this plugin that create new custom post type for custom block
16
 
17
  == Changelog ==
18
 
 
 
 
 
 
19
  = 1.24.2 =
20
  [ Other ] Admin text tuning
21
 
3
  Donate link:
4
  Tags: Guternberg, Block Pattern
5
  Requires at least: 5.8
6
+ Tested up to: 6.0.2
7
+ Stable tag: 1.25.0
8
  Requires PHP: 7.2
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
16
 
17
  == Changelog ==
18
 
19
+ = 1.25.0 =
20
+ [ Add ][ Japanese ] Add combination with X-T9 Patterns.
21
+ [ Fix ][ Japanese ] Fix API Alert.
22
+ [ Fix ][ Japanese ] Fix VK Pattern Library Linkage description.
23
+
24
  = 1.24.2 =
25
  [ Other ] Admin text tuning
26
 
vk-block-patterns.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: VK Block Patterns
4
  * Plugin URI: https://github.com/vektor-inc/vk-block-patterns
5
  * Description: You can make and register your original custom block patterns.
6
- * Version: 1.24.2
7
  * Requires at least: 5.8
8
  * Author: Vektor,Inc.
9
  * Author URI: https://vektor-inc.co.jp
@@ -35,6 +35,35 @@ define( 'VBP_URL', plugin_dir_url( __FILE__ ) );
35
  global $vbp_prefix;
36
  $vbp_prefix = apply_filters( 'vbp_prefix', 'VK ' );
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  /**
40
  * Plugin Loaded
@@ -60,28 +89,6 @@ function vbp_set_plugin_meta( $links ) {
60
  }
61
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'vbp_set_plugin_meta', 10, 1 );
62
 
63
-
64
-
65
- function vbp_get_options() {
66
- $default = array(
67
- 'role' => 'author',
68
- 'showPatternsLink' => true,
69
- 'VWSMail' => '',
70
- 'disableCorePattern' => false,
71
- 'disablePluginPattern' => false,
72
- 'account-check' => array(
73
- 'date' => null,
74
- 'disable-empty-notice' => false,
75
- 'disable-invalid-notice' => false,
76
- 'disable-free-notice' => false,
77
- ),
78
- );
79
- $options = get_option( 'vk_block_patterns_options' );
80
- // showPatternsLinkは後から追加したので、option値に保存されてない時にデフォルトとマージする
81
- $options = wp_parse_args( $options, $default );
82
- return $options;
83
- }
84
-
85
  $options = vbp_get_options();
86
  if ( ! empty( $options['disableCorePattern'] ) ) {
87
  remove_theme_support( 'core-block-patterns' );
3
  * Plugin Name: VK Block Patterns
4
  * Plugin URI: https://github.com/vektor-inc/vk-block-patterns
5
  * Description: You can make and register your original custom block patterns.
6
+ * Version: 1.25.0
7
  * Requires at least: 5.8
8
  * Author: Vektor,Inc.
9
  * Author URI: https://vektor-inc.co.jp
35
  global $vbp_prefix;
36
  $vbp_prefix = apply_filters( 'vbp_prefix', 'VK ' );
37
 
38
+ /**
39
+ * オプション値を取得して返す
40
+ *
41
+ * @return $options オプション値の配列
42
+ */
43
+ function vbp_get_options() {
44
+ // デフォルト値.
45
+ // この値を追加した場合は ./test/test-get-options.php のテストを追記する.
46
+ $default = array(
47
+ 'role' => 'author',
48
+ 'showPatternsLink' => true,
49
+ 'VWSMail' => '',
50
+ 'disableCorePattern' => false,
51
+ 'disablePluginPattern' => false,
52
+ 'disableXT9Pattern' => false,
53
+ 'account-check' => array(
54
+ 'date' => null,
55
+ 'disable-empty-notice' => false,
56
+ 'disable-invalid-notice' => false,
57
+ 'disable-free-notice' => false,
58
+ ),
59
+ );
60
+ $options = get_option( 'vk_block_patterns_options' );
61
+ // 後から追加される項目もあるので、option値に保存されてない時にデフォルトとマージする
62
+ // ただし wp_parse_args は1階層目の内容しかきれいにマージしてくれないので注意.
63
+ $options = wp_parse_args( $options, $default );
64
+ return $options;
65
+ }
66
+
67
 
68
  /**
69
  * Plugin Loaded
89
  }
90
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'vbp_set_plugin_meta', 10, 1 );
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  $options = vbp_get_options();
93
  if ( ! empty( $options['disableCorePattern'] ) ) {
94
  remove_theme_support( 'core-block-patterns' );