Changeset 3181089
- Timestamp:
- 11/04/2024 07:22:24 AM (17 months ago)
- Location:
- low-key-toolbar
- Files:
-
- 6 edited
- 13 copied
-
tags/1.1.1 (copied) (copied from low-key-toolbar/trunk)
-
tags/1.1.1/admin (copied) (copied from low-key-toolbar/trunk/admin)
-
tags/1.1.1/admin/class-low-key-toolbar-admin.php (copied) (copied from low-key-toolbar/trunk/admin/class-low-key-toolbar-admin.php) (9 diffs)
-
tags/1.1.1/build (copied) (copied from low-key-toolbar/trunk/build)
-
tags/1.1.1/build/index.asset.php (copied) (copied from low-key-toolbar/trunk/build/index.asset.php) (1 diff)
-
tags/1.1.1/build/index.js (copied) (copied from low-key-toolbar/trunk/build/index.js) (1 diff)
-
tags/1.1.1/includes (copied) (copied from low-key-toolbar/trunk/includes)
-
tags/1.1.1/languages (copied) (copied from low-key-toolbar/trunk/languages)
-
tags/1.1.1/low-key-toolbar.php (copied) (copied from low-key-toolbar/trunk/low-key-toolbar.php) (3 diffs)
-
tags/1.1.1/readme.txt (copied) (copied from low-key-toolbar/trunk/readme.txt) (2 diffs)
-
tags/1.1.1/src (copied) (copied from low-key-toolbar/trunk/src)
-
tags/1.1.1/src/sidebar/sidebar.js (copied) (copied from low-key-toolbar/trunk/src/sidebar/sidebar.js) (2 diffs)
-
tags/1.1.1/uninstall.php (copied) (copied from low-key-toolbar/trunk/uninstall.php)
-
trunk/admin/class-low-key-toolbar-admin.php (modified) (9 diffs)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/low-key-toolbar.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/sidebar/sidebar.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
low-key-toolbar/tags/1.1.1/admin/class-low-key-toolbar-admin.php
r2882462 r3181089 51 51 $this->plugin_name = $plugin_name; 52 52 $this->version = $version; 53 54 53 } 55 54 … … 98 97 'show_in_rest' => true, 99 98 'default' => LOW_KEY_TOOLBAR_OPACITY, 100 'sanitize_callback' => function ( $value ) {99 'sanitize_callback' => function ( $value ) { 101 100 return $this->check_number( $value ); 102 101 }, … … 110 109 'show_in_rest' => true, 111 110 'default' => LOW_KEY_TOOLBAR_SCALE, 112 'sanitize_callback' => function ( $value ) {111 'sanitize_callback' => function ( $value ) { 113 112 return $this->check_number( $value ); 114 113 }, … … 122 121 'show_in_rest' => true, 123 122 'default' => LOW_KEY_TOOLBAR_MARGIN, 124 'sanitize_callback' => function ( $value ) {123 'sanitize_callback' => function ( $value ) { 125 124 return $this->check_margin( $value, LOW_KEY_TOOLBAR_MARGIN ); 126 125 }, … … 188 187 wp_register_script( 189 188 $this->plugin_name, 190 plugins_url( '/build/index.js', dirname( __FILE__ )),189 plugins_url( '/build/index.js', __DIR__ ), 191 190 $dependencies, 192 191 filemtime( plugin_dir_path( __DIR__ ) . 'build/index.js' ), … … 200 199 ) 201 200 ); 202 203 201 } 204 202 … … 250 248 */ 251 249 public function inline_css() { 252 global $post, $pagenow;250 global $post, $pagenow; 253 251 254 252 if ( 'post.php' !== $pagenow && 'post-new.php' !== $pagenow ) { … … 258 256 if ( apply_filters( 'replace_editor', false, $post ) === true ) { 259 257 return; 260 } else { 261 if ( function_exists( 'use_block_editor_for_post' ) && ! use_block_editor_for_post( $post ) ) { 258 } elseif ( function_exists( 'use_block_editor_for_post' ) && ! use_block_editor_for_post( $post ) ) { 262 259 return; 263 }264 260 } 265 261 … … 336 332 wp_localize_script( $this->plugin_name, 'lktb_opt', $lktb_var ); 337 333 } 338 339 334 } -
low-key-toolbar/tags/1.1.1/build/index.asset.php
r2882462 r3181089 1 <?php return array('dependencies' => array(' wp-api', 'wp-components', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '443c8dc3ce4db939ac72967b9078fb57');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-api', 'wp-components', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'c7070b9a68fbbef9ccba'); -
low-key-toolbar/tags/1.1.1/build/index.js
r2882462 r3181089 1 (()=>{"use strict";var e={n: t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var o in l)e.o(l,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:l[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,l=window.wp.plugins,o=window.wp.api;var a=e.n(o);const n=window.wp.editPost,r=window.wp.components,c=window.wp.i18n,i=()=>(0,t.createElement)("svg",{width:"24px",viewBox:"0 0 104 50"},(0,t.createElement)("g",null,(0,t.createElement)("path",{d:"M80.815,42.956c-0,-1.242 -1.008,-2.25 -2.25,-2.25l-53.5,-0c-1.242,-0 -2.25,1.008 -2.25,2.25l-0,4.5c-0,1.242 1.008,2.25 2.25,2.25l53.5,-0c1.242,-0 2.25,-1.008 2.25,-2.25l-0,-4.5Z"}),(0,t.createElement)("path",{d:"M54.815,1.497c-0,-0.827 -0.672,-1.5 -1.5,-1.5l-3,0c-0.828,0 -1.5,0.673 -1.5,1.5l-0,13c-0,0.828 0.672,1.5 1.5,1.5l3,0c0.828,0 1.5,-0.672 1.5,-1.5l-0,-13Z"}),(0,t.createElement)("path",{d:"M24.518,8.694c-0.451,-0.695 -1.38,-0.892 -2.075,-0.441l-2.516,1.634c-0.694,0.451 -0.892,1.38 -0.441,2.075l7.08,10.902c0.451,0.695 1.381,0.892 2.075,0.441l2.516,-1.634c0.695,-0.45 0.892,-1.38 0.441,-2.075l-7.08,-10.902Z"}),(0,t.createElement)("path",{d:"M3.474,30.381c-0.75,-0.35 -1.643,-0.025 -1.993,0.726l-1.268,2.718c-0.35,0.751 -0.025,1.644 0.726,1.994l11.782,5.494c0.75,0.35 1.643,0.025 1.993,-0.726l1.268,-2.719c0.35,-0.75 0.025,-1.643 -0.726,-1.993l-11.782,-5.494Z"}),(0,t.createElement)("path",{d:"M84.906,12.532c0.463,-0.686 0.282,-1.619 -0.404,-2.082l-2.487,-1.677c-0.687,-0.463 -1.62,-0.282 -2.083,0.404l-7.269,10.778c-0.463,0.686 -0.282,1.619 0.404,2.082l2.488,1.678c0.686,0.463 1.619,0.281 2.082,-0.405l7.269,-10.778Z"}),(0,t.createElement)("path",{d:"M102.686,35.819c0.751,-0.35 1.076,-1.243 0.726,-1.994l-1.268,-2.718c-0.35,-0.751 -1.243,-1.076 -1.994,-0.726l-11.782,5.494c-0.75,0.35 -1.075,1.243 -0.725,1.993l1.268,2.719c0.35,0.751 1.243,1.076 1.993,0.726l11.782,-5.494Z"})));let s=()=>{let e=parseFloat(lktb_opt.opacity),l=parseFloat(lktb_opt.scale),o=parseFloat(lktb_opt.margin),n=""!==lktb_opt.on_flg&&lktb_opt.on_flg;const[i,s]=(0,t.useState)(e),[m,d]=(0,t.useState)(l),[_,p]=(0,t.useState)(o),[b,w]=(0,t.useState)(n);return(0,t.useEffect)((()=>{document.body.style.setProperty("--toolbar_opacity",String(i)),document.body.style.setProperty("--toolbar_scale",String(m)),document.body.style.setProperty("--toolbar_margin",String(_)),b?document.body.classList.add("is_hover_effect"):document.body.classList.remove("is_hover_effect"),a().loadPromise.then((()=>{new(a().models.Settings)({low_key_toolbar_on_flg:b,low_key_toolbar_opacity:i,low_key_toolbar_scale:m,low_key_toolbar_margin:_}).save()}))})),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.PanelBody,null,(0,t.createElement)(r.RangeControl,{label:(0,c.__)("Opacity","low-key-toolbar"),value:i,initialPosition:e,min:.1,max:1,step:.1,onChange:e=>s(e)}),(0,t.createElement)(r.RangeControl,{label:(0,c.__)("Scale","low-key-toolbar"),value:m,initialPosition:l,min:.1,max:1,step:.1,onChange:e=>d(e)}),(0,t.createElement)(r.RangeControl,{label:(0,c.__)("Margin Bottom (px)","low-key-toolbar"),value:_,initialPosition:o,min:0,max:12,step:1,onChange:e=>p(e)})),(0,t.createElement)(r.PanelBody,null,(0,t.createElement)(r.ToggleControl,{label:(0,c.__)("When hovering, Return to original size","low-key-toolbar"),checked:b,onChange:()=>w(!b)})))};(0,l.registerPlugin)("low-key-toolbar",{icon:(0,t.createElement)(i,null),render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.PluginSidebarMoreMenuItem,{target:"sidebar-name"},(0,c.__)("Low-Key ToolBar setting","low-key-toolbar")),(0,t.createElement)(n.PluginSidebar,{name:"sidebar-name",icon:i,title:(0,c.__)("Low-Key ToolBar","low-key-toolbar")},(0,t.createElement)(s,null)))})})();1 (()=>{"use strict";var e={n:o=>{var t=o&&o.__esModule?()=>o.default:()=>o;return e.d(t,{a:t}),t},d:(o,t)=>{for(var l in t)e.o(t,l)&&!e.o(o,l)&&Object.defineProperty(o,l,{enumerable:!0,get:t[l]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.plugins,t=window.wp.api;var l=e.n(t);const a=window.wp.editor,n=window.wp.components,r=window.wp.element,i=window.wp.i18n,s=window.ReactJSXRuntime,c=()=>(0,s.jsx)("svg",{width:"24px",viewBox:"0 0 104 50",children:(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d:"M80.815,42.956c-0,-1.242 -1.008,-2.25 -2.25,-2.25l-53.5,-0c-1.242,-0 -2.25,1.008 -2.25,2.25l-0,4.5c-0,1.242 1.008,2.25 2.25,2.25l53.5,-0c1.242,-0 2.25,-1.008 2.25,-2.25l-0,-4.5Z"}),(0,s.jsx)("path",{d:"M54.815,1.497c-0,-0.827 -0.672,-1.5 -1.5,-1.5l-3,0c-0.828,0 -1.5,0.673 -1.5,1.5l-0,13c-0,0.828 0.672,1.5 1.5,1.5l3,0c0.828,0 1.5,-0.672 1.5,-1.5l-0,-13Z"}),(0,s.jsx)("path",{d:"M24.518,8.694c-0.451,-0.695 -1.38,-0.892 -2.075,-0.441l-2.516,1.634c-0.694,0.451 -0.892,1.38 -0.441,2.075l7.08,10.902c0.451,0.695 1.381,0.892 2.075,0.441l2.516,-1.634c0.695,-0.45 0.892,-1.38 0.441,-2.075l-7.08,-10.902Z"}),(0,s.jsx)("path",{d:"M3.474,30.381c-0.75,-0.35 -1.643,-0.025 -1.993,0.726l-1.268,2.718c-0.35,0.751 -0.025,1.644 0.726,1.994l11.782,5.494c0.75,0.35 1.643,0.025 1.993,-0.726l1.268,-2.719c0.35,-0.75 0.025,-1.643 -0.726,-1.993l-11.782,-5.494Z"}),(0,s.jsx)("path",{d:"M84.906,12.532c0.463,-0.686 0.282,-1.619 -0.404,-2.082l-2.487,-1.677c-0.687,-0.463 -1.62,-0.282 -2.083,0.404l-7.269,10.778c-0.463,0.686 -0.282,1.619 0.404,2.082l2.488,1.678c0.686,0.463 1.619,0.281 2.082,-0.405l7.269,-10.778Z"}),(0,s.jsx)("path",{d:"M102.686,35.819c0.751,-0.35 1.076,-1.243 0.726,-1.994l-1.268,-2.718c-0.35,-0.751 -1.243,-1.076 -1.994,-0.726l-11.782,5.494c-0.75,0.35 -1.075,1.243 -0.725,1.993l1.268,2.719c0.35,0.751 1.243,1.076 1.993,0.726l11.782,-5.494Z"})]})});let d=()=>{let e=parseFloat(lktb_opt.opacity),o=parseFloat(lktb_opt.scale),t=parseFloat(lktb_opt.margin),a=""!==lktb_opt.on_flg&&lktb_opt.on_flg;const[c,d]=(0,r.useState)(e),[_,p]=(0,r.useState)(o),[w,b]=(0,r.useState)(t),[g,y]=(0,r.useState)(a);return(0,r.useEffect)((()=>{document.body.style.setProperty("--toolbar_opacity",String(c)),document.body.style.setProperty("--toolbar_scale",String(_)),document.body.style.setProperty("--toolbar_margin",String(w)),g?document.body.classList.add("is_hover_effect"):document.body.classList.remove("is_hover_effect"),l().loadPromise.then((()=>{new(l().models.Settings)({low_key_toolbar_on_flg:g,low_key_toolbar_opacity:c,low_key_toolbar_scale:_,low_key_toolbar_margin:w}).save()}))})),(0,s.jsxs)(r.Fragment,{children:[(0,s.jsxs)(n.PanelBody,{children:[(0,s.jsx)(n.RangeControl,{label:(0,i.__)("Opacity","low-key-toolbar"),value:c,initialPosition:e,min:.1,max:1,step:.1,onChange:e=>d(e)}),(0,s.jsx)(n.RangeControl,{label:(0,i.__)("Scale","low-key-toolbar"),value:_,initialPosition:o,min:.1,max:1,step:.1,onChange:e=>p(e)}),(0,s.jsx)(n.RangeControl,{label:(0,i.__)("Margin Bottom (px)","low-key-toolbar"),value:w,initialPosition:t,min:0,max:12,step:1,onChange:e=>b(e)})]}),(0,s.jsx)(n.PanelBody,{children:(0,s.jsx)(n.ToggleControl,{label:(0,i.__)("When hovering, Return to original size","low-key-toolbar"),checked:g,onChange:()=>y(!g)})})]})};(0,o.registerPlugin)("low-key-toolbar",{icon:(0,s.jsx)(c,{}),render:()=>(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)(a.PluginSidebarMoreMenuItem,{target:"sidebar-name",children:(0,i.__)("Low-Key ToolBar setting","low-key-toolbar")}),(0,s.jsx)(a.PluginSidebar,{name:"sidebar-name",icon:c,title:(0,i.__)("Low-Key ToolBar","low-key-toolbar"),children:(0,s.jsx)(d,{})})]})})})(); -
low-key-toolbar/tags/1.1.1/low-key-toolbar.php
r2882462 r3181089 5 5 * Requires at least: 5.7 6 6 * Requires PHP: 7.4 7 * Version: 1.1. 07 * Version: 1.1.1 8 8 * Author: Makoto Nakao 9 9 * License: GPL-2.0-or-later … … 22 22 * Define constant value. 23 23 */ 24 define( 'LOW_KEY_TOOLBAR_VERSION', '1. 0.1' );24 define( 'LOW_KEY_TOOLBAR_VERSION', '1.1.1' ); 25 25 define( 'LOW_KEY_TOOLBAR_OPACITY', 0.4 ); 26 26 define( 'LOW_KEY_TOOLBAR_SCALE', 0.6 ); … … 51 51 $plugin = new Low_Key_Toolbar(); 52 52 $plugin->run(); 53 54 53 } 55 54 run_low_key_toolbar(); -
low-key-toolbar/tags/1.1.1/readme.txt
r2882462 r3181089 2 2 Contributors: freeleaf 3 3 Tags: editor,gutenberg,toolbar 4 Stable tag: 1.1. 05 Tested up to: 6. 26 Requires at least: 5.74 Stable tag: 1.1.1 5 Tested up to: 6.7 6 Requires at least: 6.0 7 7 Requires PHP: 7.4 8 8 License: GPL-2.0-or-later … … 39 39 40 40 == Changelog == 41 42 = 1.1.1 = 43 * Fixed deprecation warning. 44 41 45 = 1.1.0 = 42 46 * Now available for all post types. -
low-key-toolbar/tags/1.1.1/src/sidebar/sidebar.js
r2882462 r3181089 1 1 import { registerPlugin } from "@wordpress/plugins"; 2 2 import api from "@wordpress/api"; 3 import { PluginSidebar, PluginSidebarMoreMenuItem } from "@wordpress/edit -post";3 import { PluginSidebar, PluginSidebarMoreMenuItem } from "@wordpress/editor"; 4 4 import { PanelBody, ToggleControl, RangeControl } from "@wordpress/components"; 5 5 import { useState, useEffect, Fragment } from "@wordpress/element"; … … 105 105 label={__( 106 106 "When hovering, Return to original size", 107 "low-key-toolbar" 107 "low-key-toolbar", 108 108 )} 109 109 checked={showFlg} -
low-key-toolbar/trunk/admin/class-low-key-toolbar-admin.php
r2882462 r3181089 51 51 $this->plugin_name = $plugin_name; 52 52 $this->version = $version; 53 54 53 } 55 54 … … 98 97 'show_in_rest' => true, 99 98 'default' => LOW_KEY_TOOLBAR_OPACITY, 100 'sanitize_callback' => function ( $value ) {99 'sanitize_callback' => function ( $value ) { 101 100 return $this->check_number( $value ); 102 101 }, … … 110 109 'show_in_rest' => true, 111 110 'default' => LOW_KEY_TOOLBAR_SCALE, 112 'sanitize_callback' => function ( $value ) {111 'sanitize_callback' => function ( $value ) { 113 112 return $this->check_number( $value ); 114 113 }, … … 122 121 'show_in_rest' => true, 123 122 'default' => LOW_KEY_TOOLBAR_MARGIN, 124 'sanitize_callback' => function ( $value ) {123 'sanitize_callback' => function ( $value ) { 125 124 return $this->check_margin( $value, LOW_KEY_TOOLBAR_MARGIN ); 126 125 }, … … 188 187 wp_register_script( 189 188 $this->plugin_name, 190 plugins_url( '/build/index.js', dirname( __FILE__ )),189 plugins_url( '/build/index.js', __DIR__ ), 191 190 $dependencies, 192 191 filemtime( plugin_dir_path( __DIR__ ) . 'build/index.js' ), … … 200 199 ) 201 200 ); 202 203 201 } 204 202 … … 250 248 */ 251 249 public function inline_css() { 252 global $post, $pagenow;250 global $post, $pagenow; 253 251 254 252 if ( 'post.php' !== $pagenow && 'post-new.php' !== $pagenow ) { … … 258 256 if ( apply_filters( 'replace_editor', false, $post ) === true ) { 259 257 return; 260 } else { 261 if ( function_exists( 'use_block_editor_for_post' ) && ! use_block_editor_for_post( $post ) ) { 258 } elseif ( function_exists( 'use_block_editor_for_post' ) && ! use_block_editor_for_post( $post ) ) { 262 259 return; 263 }264 260 } 265 261 … … 336 332 wp_localize_script( $this->plugin_name, 'lktb_opt', $lktb_var ); 337 333 } 338 339 334 } -
low-key-toolbar/trunk/build/index.asset.php
r2882462 r3181089 1 <?php return array('dependencies' => array(' wp-api', 'wp-components', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '443c8dc3ce4db939ac72967b9078fb57');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-api', 'wp-components', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'c7070b9a68fbbef9ccba'); -
low-key-toolbar/trunk/build/index.js
r2882462 r3181089 1 (()=>{"use strict";var e={n: t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var o in l)e.o(l,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:l[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,l=window.wp.plugins,o=window.wp.api;var a=e.n(o);const n=window.wp.editPost,r=window.wp.components,c=window.wp.i18n,i=()=>(0,t.createElement)("svg",{width:"24px",viewBox:"0 0 104 50"},(0,t.createElement)("g",null,(0,t.createElement)("path",{d:"M80.815,42.956c-0,-1.242 -1.008,-2.25 -2.25,-2.25l-53.5,-0c-1.242,-0 -2.25,1.008 -2.25,2.25l-0,4.5c-0,1.242 1.008,2.25 2.25,2.25l53.5,-0c1.242,-0 2.25,-1.008 2.25,-2.25l-0,-4.5Z"}),(0,t.createElement)("path",{d:"M54.815,1.497c-0,-0.827 -0.672,-1.5 -1.5,-1.5l-3,0c-0.828,0 -1.5,0.673 -1.5,1.5l-0,13c-0,0.828 0.672,1.5 1.5,1.5l3,0c0.828,0 1.5,-0.672 1.5,-1.5l-0,-13Z"}),(0,t.createElement)("path",{d:"M24.518,8.694c-0.451,-0.695 -1.38,-0.892 -2.075,-0.441l-2.516,1.634c-0.694,0.451 -0.892,1.38 -0.441,2.075l7.08,10.902c0.451,0.695 1.381,0.892 2.075,0.441l2.516,-1.634c0.695,-0.45 0.892,-1.38 0.441,-2.075l-7.08,-10.902Z"}),(0,t.createElement)("path",{d:"M3.474,30.381c-0.75,-0.35 -1.643,-0.025 -1.993,0.726l-1.268,2.718c-0.35,0.751 -0.025,1.644 0.726,1.994l11.782,5.494c0.75,0.35 1.643,0.025 1.993,-0.726l1.268,-2.719c0.35,-0.75 0.025,-1.643 -0.726,-1.993l-11.782,-5.494Z"}),(0,t.createElement)("path",{d:"M84.906,12.532c0.463,-0.686 0.282,-1.619 -0.404,-2.082l-2.487,-1.677c-0.687,-0.463 -1.62,-0.282 -2.083,0.404l-7.269,10.778c-0.463,0.686 -0.282,1.619 0.404,2.082l2.488,1.678c0.686,0.463 1.619,0.281 2.082,-0.405l7.269,-10.778Z"}),(0,t.createElement)("path",{d:"M102.686,35.819c0.751,-0.35 1.076,-1.243 0.726,-1.994l-1.268,-2.718c-0.35,-0.751 -1.243,-1.076 -1.994,-0.726l-11.782,5.494c-0.75,0.35 -1.075,1.243 -0.725,1.993l1.268,2.719c0.35,0.751 1.243,1.076 1.993,0.726l11.782,-5.494Z"})));let s=()=>{let e=parseFloat(lktb_opt.opacity),l=parseFloat(lktb_opt.scale),o=parseFloat(lktb_opt.margin),n=""!==lktb_opt.on_flg&&lktb_opt.on_flg;const[i,s]=(0,t.useState)(e),[m,d]=(0,t.useState)(l),[_,p]=(0,t.useState)(o),[b,w]=(0,t.useState)(n);return(0,t.useEffect)((()=>{document.body.style.setProperty("--toolbar_opacity",String(i)),document.body.style.setProperty("--toolbar_scale",String(m)),document.body.style.setProperty("--toolbar_margin",String(_)),b?document.body.classList.add("is_hover_effect"):document.body.classList.remove("is_hover_effect"),a().loadPromise.then((()=>{new(a().models.Settings)({low_key_toolbar_on_flg:b,low_key_toolbar_opacity:i,low_key_toolbar_scale:m,low_key_toolbar_margin:_}).save()}))})),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.PanelBody,null,(0,t.createElement)(r.RangeControl,{label:(0,c.__)("Opacity","low-key-toolbar"),value:i,initialPosition:e,min:.1,max:1,step:.1,onChange:e=>s(e)}),(0,t.createElement)(r.RangeControl,{label:(0,c.__)("Scale","low-key-toolbar"),value:m,initialPosition:l,min:.1,max:1,step:.1,onChange:e=>d(e)}),(0,t.createElement)(r.RangeControl,{label:(0,c.__)("Margin Bottom (px)","low-key-toolbar"),value:_,initialPosition:o,min:0,max:12,step:1,onChange:e=>p(e)})),(0,t.createElement)(r.PanelBody,null,(0,t.createElement)(r.ToggleControl,{label:(0,c.__)("When hovering, Return to original size","low-key-toolbar"),checked:b,onChange:()=>w(!b)})))};(0,l.registerPlugin)("low-key-toolbar",{icon:(0,t.createElement)(i,null),render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.PluginSidebarMoreMenuItem,{target:"sidebar-name"},(0,c.__)("Low-Key ToolBar setting","low-key-toolbar")),(0,t.createElement)(n.PluginSidebar,{name:"sidebar-name",icon:i,title:(0,c.__)("Low-Key ToolBar","low-key-toolbar")},(0,t.createElement)(s,null)))})})();1 (()=>{"use strict";var e={n:o=>{var t=o&&o.__esModule?()=>o.default:()=>o;return e.d(t,{a:t}),t},d:(o,t)=>{for(var l in t)e.o(t,l)&&!e.o(o,l)&&Object.defineProperty(o,l,{enumerable:!0,get:t[l]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.plugins,t=window.wp.api;var l=e.n(t);const a=window.wp.editor,n=window.wp.components,r=window.wp.element,i=window.wp.i18n,s=window.ReactJSXRuntime,c=()=>(0,s.jsx)("svg",{width:"24px",viewBox:"0 0 104 50",children:(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d:"M80.815,42.956c-0,-1.242 -1.008,-2.25 -2.25,-2.25l-53.5,-0c-1.242,-0 -2.25,1.008 -2.25,2.25l-0,4.5c-0,1.242 1.008,2.25 2.25,2.25l53.5,-0c1.242,-0 2.25,-1.008 2.25,-2.25l-0,-4.5Z"}),(0,s.jsx)("path",{d:"M54.815,1.497c-0,-0.827 -0.672,-1.5 -1.5,-1.5l-3,0c-0.828,0 -1.5,0.673 -1.5,1.5l-0,13c-0,0.828 0.672,1.5 1.5,1.5l3,0c0.828,0 1.5,-0.672 1.5,-1.5l-0,-13Z"}),(0,s.jsx)("path",{d:"M24.518,8.694c-0.451,-0.695 -1.38,-0.892 -2.075,-0.441l-2.516,1.634c-0.694,0.451 -0.892,1.38 -0.441,2.075l7.08,10.902c0.451,0.695 1.381,0.892 2.075,0.441l2.516,-1.634c0.695,-0.45 0.892,-1.38 0.441,-2.075l-7.08,-10.902Z"}),(0,s.jsx)("path",{d:"M3.474,30.381c-0.75,-0.35 -1.643,-0.025 -1.993,0.726l-1.268,2.718c-0.35,0.751 -0.025,1.644 0.726,1.994l11.782,5.494c0.75,0.35 1.643,0.025 1.993,-0.726l1.268,-2.719c0.35,-0.75 0.025,-1.643 -0.726,-1.993l-11.782,-5.494Z"}),(0,s.jsx)("path",{d:"M84.906,12.532c0.463,-0.686 0.282,-1.619 -0.404,-2.082l-2.487,-1.677c-0.687,-0.463 -1.62,-0.282 -2.083,0.404l-7.269,10.778c-0.463,0.686 -0.282,1.619 0.404,2.082l2.488,1.678c0.686,0.463 1.619,0.281 2.082,-0.405l7.269,-10.778Z"}),(0,s.jsx)("path",{d:"M102.686,35.819c0.751,-0.35 1.076,-1.243 0.726,-1.994l-1.268,-2.718c-0.35,-0.751 -1.243,-1.076 -1.994,-0.726l-11.782,5.494c-0.75,0.35 -1.075,1.243 -0.725,1.993l1.268,2.719c0.35,0.751 1.243,1.076 1.993,0.726l11.782,-5.494Z"})]})});let d=()=>{let e=parseFloat(lktb_opt.opacity),o=parseFloat(lktb_opt.scale),t=parseFloat(lktb_opt.margin),a=""!==lktb_opt.on_flg&&lktb_opt.on_flg;const[c,d]=(0,r.useState)(e),[_,p]=(0,r.useState)(o),[w,b]=(0,r.useState)(t),[g,y]=(0,r.useState)(a);return(0,r.useEffect)((()=>{document.body.style.setProperty("--toolbar_opacity",String(c)),document.body.style.setProperty("--toolbar_scale",String(_)),document.body.style.setProperty("--toolbar_margin",String(w)),g?document.body.classList.add("is_hover_effect"):document.body.classList.remove("is_hover_effect"),l().loadPromise.then((()=>{new(l().models.Settings)({low_key_toolbar_on_flg:g,low_key_toolbar_opacity:c,low_key_toolbar_scale:_,low_key_toolbar_margin:w}).save()}))})),(0,s.jsxs)(r.Fragment,{children:[(0,s.jsxs)(n.PanelBody,{children:[(0,s.jsx)(n.RangeControl,{label:(0,i.__)("Opacity","low-key-toolbar"),value:c,initialPosition:e,min:.1,max:1,step:.1,onChange:e=>d(e)}),(0,s.jsx)(n.RangeControl,{label:(0,i.__)("Scale","low-key-toolbar"),value:_,initialPosition:o,min:.1,max:1,step:.1,onChange:e=>p(e)}),(0,s.jsx)(n.RangeControl,{label:(0,i.__)("Margin Bottom (px)","low-key-toolbar"),value:w,initialPosition:t,min:0,max:12,step:1,onChange:e=>b(e)})]}),(0,s.jsx)(n.PanelBody,{children:(0,s.jsx)(n.ToggleControl,{label:(0,i.__)("When hovering, Return to original size","low-key-toolbar"),checked:g,onChange:()=>y(!g)})})]})};(0,o.registerPlugin)("low-key-toolbar",{icon:(0,s.jsx)(c,{}),render:()=>(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)(a.PluginSidebarMoreMenuItem,{target:"sidebar-name",children:(0,i.__)("Low-Key ToolBar setting","low-key-toolbar")}),(0,s.jsx)(a.PluginSidebar,{name:"sidebar-name",icon:c,title:(0,i.__)("Low-Key ToolBar","low-key-toolbar"),children:(0,s.jsx)(d,{})})]})})})(); -
low-key-toolbar/trunk/low-key-toolbar.php
r2882462 r3181089 5 5 * Requires at least: 5.7 6 6 * Requires PHP: 7.4 7 * Version: 1.1. 07 * Version: 1.1.1 8 8 * Author: Makoto Nakao 9 9 * License: GPL-2.0-or-later … … 22 22 * Define constant value. 23 23 */ 24 define( 'LOW_KEY_TOOLBAR_VERSION', '1. 0.1' );24 define( 'LOW_KEY_TOOLBAR_VERSION', '1.1.1' ); 25 25 define( 'LOW_KEY_TOOLBAR_OPACITY', 0.4 ); 26 26 define( 'LOW_KEY_TOOLBAR_SCALE', 0.6 ); … … 51 51 $plugin = new Low_Key_Toolbar(); 52 52 $plugin->run(); 53 54 53 } 55 54 run_low_key_toolbar(); -
low-key-toolbar/trunk/readme.txt
r2882462 r3181089 2 2 Contributors: freeleaf 3 3 Tags: editor,gutenberg,toolbar 4 Stable tag: 1.1. 05 Tested up to: 6. 26 Requires at least: 5.74 Stable tag: 1.1.1 5 Tested up to: 6.7 6 Requires at least: 6.0 7 7 Requires PHP: 7.4 8 8 License: GPL-2.0-or-later … … 39 39 40 40 == Changelog == 41 42 = 1.1.1 = 43 * Fixed deprecation warning. 44 41 45 = 1.1.0 = 42 46 * Now available for all post types. -
low-key-toolbar/trunk/src/sidebar/sidebar.js
r2882462 r3181089 1 1 import { registerPlugin } from "@wordpress/plugins"; 2 2 import api from "@wordpress/api"; 3 import { PluginSidebar, PluginSidebarMoreMenuItem } from "@wordpress/edit -post";3 import { PluginSidebar, PluginSidebarMoreMenuItem } from "@wordpress/editor"; 4 4 import { PanelBody, ToggleControl, RangeControl } from "@wordpress/components"; 5 5 import { useState, useEffect, Fragment } from "@wordpress/element"; … … 105 105 label={__( 106 106 "When hovering, Return to original size", 107 "low-key-toolbar" 107 "low-key-toolbar", 108 108 )} 109 109 checked={showFlg}
Note: See TracChangeset
for help on using the changeset viewer.