mirror of
https://ghproxy.net/https://github.com/AlxMedia/featureon.git
synced 2025-08-28 07:31:00 +08:00
Update to Kirki 4.2.0
This commit is contained in:
parent
0185d24e05
commit
2880533a51
440 changed files with 6230 additions and 5211 deletions
21
functions/kirki/kirki-packages/control-dashicons/LICENSE
Normal file
21
functions/kirki/kirki-packages/control-dashicons/LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2019 kirki-framework
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
2
functions/kirki/kirki-packages/control-dashicons/dist/control.css
vendored
Normal file
2
functions/kirki/kirki-packages/control-dashicons/dist/control.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.customize-control-kirki-dashicons{position:relative}.customize-control-kirki-dashicons label{display:inline-block;position:relative}.customize-control-kirki-dashicons .icons-wrapper{max-height:300px;overflow-y:scroll}.customize-control-kirki-dashicons .icons-wrapper h4{font-weight:300;margin:.7em 0}.customize-control-kirki-dashicons .icons-wrapper .dashicons{border:1px solid transparent;font-size:25px;height:25px;padding:3px;width:25px}.customize-control-kirki-dashicons .icons-wrapper input{display:none}.customize-control-kirki-dashicons .icons-wrapper input:checked+label .dashicons{border:1px solid #3498db;color:#000}
|
||||
/*# sourceMappingURL=control.css.map */
|
1
functions/kirki/kirki-packages/control-dashicons/dist/control.css.map
vendored
Normal file
1
functions/kirki/kirki-packages/control-dashicons/dist/control.css.map
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"mappings":"AAAA,mCACE,iBCCF,CDCE,yCAEE,oBAAA,CADA,iBCEJ,CDEE,kDACE,gBAAA,CACA,iBCAJ,CDEI,qDACE,eAAA,CACA,aCAN,CDGI,6DAKE,4BAAA,CAHA,cAAA,CAEA,WAAA,CAHA,WAAA,CAEA,UCCN,CDII,wDACE,YCFN,CDMU,iFACE,wBAAA,CACA,UCJZ","sources":["src/control.scss","%3Cinput%20css%20xiOUbS%3E"],"sourcesContent":[".customize-control-kirki-dashicons {\r\n position: relative;\r\n\r\n label {\r\n position: relative;\r\n display: inline-block;\r\n }\r\n\r\n .icons-wrapper {\r\n max-height: 300px;\r\n overflow-y: scroll;\r\n\r\n h4 {\r\n font-weight: 300;\r\n margin: 0.7em 0;\r\n }\r\n\r\n .dashicons {\r\n padding: 3px;\r\n font-size: 25px;\r\n width: 25px;\r\n height: 25px;\r\n border: 1px solid transparent;\r\n }\r\n\r\n input {\r\n display: none;\r\n\r\n &:checked {\r\n + label {\r\n .dashicons {\r\n border: 1px solid #3498DB;\r\n color: #000;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n",".customize-control-kirki-dashicons {\n position: relative;\n}\n.customize-control-kirki-dashicons label {\n position: relative;\n display: inline-block;\n}\n.customize-control-kirki-dashicons .icons-wrapper {\n max-height: 300px;\n overflow-y: scroll;\n}\n.customize-control-kirki-dashicons .icons-wrapper h4 {\n font-weight: 300;\n margin: 0.7em 0;\n}\n.customize-control-kirki-dashicons .icons-wrapper .dashicons {\n padding: 3px;\n font-size: 25px;\n width: 25px;\n height: 25px;\n border: 1px solid transparent;\n}\n.customize-control-kirki-dashicons .icons-wrapper input {\n display: none;\n}\n.customize-control-kirki-dashicons .icons-wrapper input:checked + label .dashicons {\n border: 1px solid #3498DB;\n color: #000;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"}
|
2
functions/kirki/kirki-packages/control-dashicons/dist/control.js
vendored
Normal file
2
functions/kirki/kirki-packages/control-dashicons/dist/control.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
wp.customize.controlConstructor["kirki-dashicons"]=wp.customize.kirkiDynamicControl.extend({});
|
||||
//# sourceMappingURL=control.js.map
|
1
functions/kirki/kirki-packages/control-dashicons/dist/control.js.map
vendored
Normal file
1
functions/kirki/kirki-packages/control-dashicons/dist/control.js.map
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"mappings":"AAEAA,GAAGC,UAAUC,mBAAkB,mBAAsBF,GAAGC,UAAUE,oBAAoBC,OAAM","sources":["src/control.js"],"sourcesContent":["import \"./control.scss\";\n\nwp.customize.controlConstructor['kirki-dashicons'] = wp.customize.kirkiDynamicControl.extend( {} );\n"],"names":["wp","customize","controlConstructor","kirkiDynamicControl","extend"],"version":3,"file":"control.js.map"}
|
|
@ -0,0 +1,140 @@
|
|||
<?php
|
||||
/**
|
||||
* Customizer Control: dashicons.
|
||||
*
|
||||
* @package kirki-framework/control-dashicons
|
||||
* @copyright Copyright (c) 2023, Themeum
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
namespace Kirki\Control;
|
||||
|
||||
use Kirki\URL;
|
||||
use Kirki\Control\Base;
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dashicons control (modified radio).
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
class Dashicons extends Base {
|
||||
|
||||
/**
|
||||
* The control type.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'kirki-dashicons';
|
||||
|
||||
/**
|
||||
* The version. Used in scripts & styles for cache-busting.
|
||||
*
|
||||
* @static
|
||||
* @access public
|
||||
* @since 1.0.2
|
||||
* @var string
|
||||
*/
|
||||
public static $control_ver = '1.0';
|
||||
|
||||
/**
|
||||
* Enqueue control related scripts/styles.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
* @return void
|
||||
*/
|
||||
public function enqueue() {
|
||||
parent::enqueue();
|
||||
|
||||
// Enqueue the script.
|
||||
wp_enqueue_script( 'kirki-control-dashicons', URL::get_from_path( dirname(dirname( __DIR__ )) . '/dist/control.js' ), [ 'jquery', 'customize-base', 'kirki-control-base' ], self::$control_ver, false );
|
||||
|
||||
// Enqueue the style.
|
||||
wp_enqueue_style( 'kirki-control-dashicons-style', URL::get_from_path( dirname(dirname( __DIR__ )) . '/dist/control.css' ), [ 'dashicons' ], self::$control_ver );
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the parameters passed to the JavaScript via JSON.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
* @return void
|
||||
*/
|
||||
public function to_json() {
|
||||
parent::to_json();
|
||||
$this->json['icons'] = \Kirki\Util\Dashicons::get_icons();
|
||||
}
|
||||
|
||||
/**
|
||||
* An Underscore (JS) template for this control's content (but not its container).
|
||||
*
|
||||
* Class variables for this control class are available in the `data` JS object;
|
||||
* export custom variables by overriding {@see WP_Customize_Control::to_json()}.
|
||||
*
|
||||
* @see WP_Customize_Control::print_template()
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.0
|
||||
* @return void
|
||||
*/
|
||||
protected function content_template() {
|
||||
?>
|
||||
<# if ( data.label ) { #><span class="customize-control-title">{{{ data.label }}}</span><# } #>
|
||||
<# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><# } #>
|
||||
<div class="icons-wrapper">
|
||||
<# if ( ! _.isUndefined( data.choices ) && 1 < _.size( data.choices ) ) { #>
|
||||
<# for ( key in data.choices ) { #>
|
||||
<input {{{ data.inputAttrs }}} class="dashicons-select" type="radio" value="{{ key }}" name="_customize-dashicons-radio-{{ data.id }}" id="{{ data.id }}{{ key }}" {{{ data.link }}}<# if ( data.value === key ) { #> checked="checked"<# } #>>
|
||||
<label for="{{ data.id }}{{ key }}"><span class="dashicons dashicons-{{ data.choices[ key ] }}"></span></label>
|
||||
</input>
|
||||
<# } #>
|
||||
<# } else { #>
|
||||
<#
|
||||
var dashiconSections = {
|
||||
'admin-menu': '<?php esc_html_e( 'Admin Menu', 'kirki' ); ?>',
|
||||
'welcome-screen': '<?php esc_html_e( 'Welcome Screen', 'kirki' ); ?>',
|
||||
'post-formats': '<?php esc_html_e( 'Post Formats', 'kirki' ); ?>',
|
||||
'media': '<?php esc_html_e( 'Media', 'kirki' ); ?>',
|
||||
'image-editing': '<?php esc_html_e( 'Image Editing', 'kirki' ); ?>',
|
||||
'tinymce': 'TinyMCE',
|
||||
'posts': '<?php esc_html_e( 'Posts', 'kirki' ); ?>',
|
||||
'sorting': '<?php esc_html_e( 'Sorting', 'kirki' ); ?>',
|
||||
'social': '<?php esc_html_e( 'Social', 'kirki' ); ?>',
|
||||
'wordpress_org': 'WordPress',
|
||||
'products': '<?php esc_html_e( 'Products', 'kirki' ); ?>',
|
||||
'taxonomies': '<?php esc_html_e( 'Taxonomies', 'kirki' ); ?>',
|
||||
'widgets': '<?php esc_html_e( 'Widgets', 'kirki' ); ?>',
|
||||
'notifications': '<?php esc_html_e( 'Notifications', 'kirki' ); ?>',
|
||||
'misc': '<?php esc_html_e( 'Miscelaneous', 'kirki' ); ?>'
|
||||
};
|
||||
#>
|
||||
<# _.each( dashiconSections, function( sectionLabel, sectionKey ) { #>
|
||||
<h4>{{ sectionLabel }}</h4>
|
||||
<# for ( key in data.icons[ sectionKey ] ) { #>
|
||||
<input {{{ data.inputAttrs }}}
|
||||
class="dashicons-select"
|
||||
type="radio"
|
||||
value="{{ data.icons[ sectionKey ][ key ] }}"
|
||||
name="_customize-dashicons-radio-{{ data.id }}"
|
||||
id="{{ data.id }}{{ data.icons[ sectionKey ][ key ] }}"
|
||||
{{{ data.link }}}
|
||||
<# if ( data.value === data.icons[ sectionKey ][ key ] ) { #> checked="checked"<# } #>>
|
||||
<label for="{{ data.id }}{{ data.icons[ sectionKey ][ key ] }}">
|
||||
<span class="dashicons dashicons-{{ data.icons[ sectionKey ][ key ] }}"></span>
|
||||
</label>
|
||||
</input>
|
||||
<# } #>
|
||||
<# }); #>
|
||||
<# } #>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
/**
|
||||
* Override field methods
|
||||
*
|
||||
* @package kirki-framework/control-dashicons
|
||||
* @copyright Copyright (c) 2023, Themeum
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
namespace Kirki\Field;
|
||||
|
||||
use Kirki\Field;
|
||||
|
||||
/**
|
||||
* Field overrides.
|
||||
*/
|
||||
class Dashicons extends Field {
|
||||
|
||||
/**
|
||||
* The field type.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'kirki-dashicons';
|
||||
|
||||
/**
|
||||
* The control class-name.
|
||||
*
|
||||
* @access protected
|
||||
* @since 0.1
|
||||
* @var string
|
||||
*/
|
||||
protected $control_class = '\Kirki\Control\Dashicons';
|
||||
|
||||
/**
|
||||
* Whether we should register the control class for JS-templating or not.
|
||||
*
|
||||
* @access protected
|
||||
* @since 0.1
|
||||
* @var bool
|
||||
*/
|
||||
protected $control_has_js_template = true;
|
||||
|
||||
/**
|
||||
* Filter arguments before creating the setting.
|
||||
*
|
||||
* @access public
|
||||
* @since 0.1
|
||||
* @param array $args The field arguments.
|
||||
* @param WP_Customize_Manager $wp_customize The customizer instance.
|
||||
* @return array
|
||||
*/
|
||||
public function filter_setting_args( $args, $wp_customize ) {
|
||||
if ( $args['settings'] === $this->args['settings'] ) {
|
||||
$args = parent::filter_setting_args( $args, $wp_customize );
|
||||
|
||||
// Set the sanitize-callback if none is defined.
|
||||
if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) {
|
||||
$args['sanitize_callback'] = 'sanitize_text_field';
|
||||
}
|
||||
}
|
||||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter arguments before creating the control.
|
||||
*
|
||||
* @access public
|
||||
* @since 0.1
|
||||
* @param array $args The field arguments.
|
||||
* @param WP_Customize_Manager $wp_customize The customizer instance.
|
||||
* @return array
|
||||
*/
|
||||
public function filter_control_args( $args, $wp_customize ) {
|
||||
if ( $args['settings'] === $this->args['settings'] ) {
|
||||
$args = parent::filter_control_args( $args, $wp_customize );
|
||||
$args['type'] = 'kirki-dashicons';
|
||||
}
|
||||
return $args;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
/**
|
||||
* Helper methods for dashicons.
|
||||
*
|
||||
* @package kirki-framework/control-dashicons
|
||||
* @category Core
|
||||
* @author Themeum
|
||||
* @copyright Copyright (c) 2023, Themeum
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
namespace Kirki\Util;
|
||||
|
||||
/**
|
||||
* A simple object containing static methods.
|
||||
*/
|
||||
class Dashicons {
|
||||
|
||||
/**
|
||||
* Get an array of all available dashicons.
|
||||
*
|
||||
* @static
|
||||
* @access public
|
||||
* @since 1.0
|
||||
* @return array
|
||||
*/
|
||||
public static function get_icons() {
|
||||
return [
|
||||
'admin-menu' => [ 'menu', 'menu-alt', 'menu-alt2', 'menu-alt3', 'admin-site', 'admin-site-alt', 'admin-site-alt2', 'admin-site-alt3', 'dashboard', 'admin-post', 'admin-media', 'admin-links', 'admin-page', 'admin-comments', 'admin-appearance', 'admin-plugins', 'plugins-checked', 'admin-users', 'admin-tools', 'admin-settings', 'admin-network', 'admin-home', 'admin-generic', 'admin-collapse', 'filter', 'admin-customizer', 'admin-multisite' ],
|
||||
'welcome-screen' => [ 'welcome-write-blog', 'welcome-add-page', 'welcome-view-site', 'welcome-widgets-menus', 'welcome-comments', 'welcome-learn-more' ],
|
||||
'post-formats' => [ 'format-aside', 'format-image', 'format-gallery', 'format-video', 'format-status', 'format-quote', 'format-chat', 'format-audio', 'camera', 'camera-alt', 'images-alt', 'images-alt2', 'video-alt', 'video-alt2', 'video-alt3' ],
|
||||
'media' => [ 'media-archive', 'media-audio', 'media-code', 'media-default', 'media-document', 'media-interactive', 'media-spreadsheet', 'media-text', 'media-video', 'playlist-audio', 'playlist-video', 'controls-play', 'controls-pause', 'controls-forward', 'controls-skipforward', 'controls-back', 'controls-skipback', 'controls-repeat', 'controls-volumeon', 'controls-volumeoff' ],
|
||||
'image-editing' => [ 'image-crop', 'image-rotate', 'image-rotate-left', 'image-rotate-right', 'image-flip-vertical', 'image-flip-horizontal', 'image-filter', 'undo', 'redo' ],
|
||||
'tinymce' => [ 'editor-bold', 'editor-italic', 'editor-ul', 'editor-ol', 'editor-ol-rtl', 'editor-quote', 'editor-alignleft', 'editor-aligncenter', 'editor-alignright', 'editor-insertmore', 'editor-spellcheck', 'editor-expand', 'editor-contract', 'editor-kitchensink', 'editor-underline', 'editor-justify', 'editor-textcolor', 'editor-paste-word', 'editor-paste-text', 'editor-removeformatting', 'editor-video', 'editor-customchar', 'editor-outdent', 'editor-indent', 'editor-help', 'editor-strikethrough', 'editor-unlink', 'editor-rtl', 'editor-ltr', 'editor-break', 'editor-code', 'editor-paragraph', 'editor-table' ],
|
||||
'posts' => [ 'align-left', 'align-right', 'align-center', 'align-none', 'lock', 'unlock', 'calendar', 'calendar-alt', 'visibility', 'hidden', 'post-status', 'edit', 'trash', 'sticky' ],
|
||||
'sorting' => [ 'external', 'arrow-up', 'arrow-down', 'arrow-right', 'arrow-left', 'arrow-up-alt', 'arrow-down-alt', 'arrow-right-alt', 'arrow-left-alt', 'arrow-up-alt2', 'arrow-down-alt2', 'arrow-right-alt2', 'arrow-left-alt2', 'sort', 'leftright', 'randomize', 'list-view', 'exerpt-view', 'grid-view', 'move' ],
|
||||
'social' => [ 'share', 'share-alt', 'share-alt2', 'twitter', 'rss', 'email', 'email-alt', 'email-alt2', 'facebook', 'facebook-alt', 'googleplus', 'networking', 'instagram' ],
|
||||
'wordpress_org' => [ 'hammer', 'art', 'migrate', 'performance', 'universal-access', 'universal-access-alt', 'tickets', 'nametag', 'clipboard', 'heart', 'megaphone', 'schedule', 'tide', 'rest-api', 'code-standards' ],
|
||||
'products' => [ 'wordpress', 'wordpress-alt', 'pressthis', 'update', 'update-alt', 'screenoptions', 'info', 'cart', 'feedback', 'cloud', 'translation' ],
|
||||
'taxonomies' => [ 'tag', 'category' ],
|
||||
'widgets' => [ 'archive', 'tagcloud', 'text' ],
|
||||
'notifications' => [ 'yes', 'yes-alt', 'no', 'no-alt', 'plus', 'plus-alt', 'minus', 'dismiss', 'marker', 'star-filled', 'star-half', 'star-empty', 'flag', 'warning' ],
|
||||
'misc' => [ 'location', 'location-alt', 'vault', 'shield', 'shield-alt', 'sos', 'search', 'slides', 'text-page', 'analytics', 'chart-pie', 'chart-bar', 'chart-line', 'chart-area', 'groups', 'businessman', 'businesswoman', 'businessperson', 'id', 'id-alt', 'products', 'awards', 'forms', 'testimonial', 'portfolio', 'book', 'book-alt', 'download', 'upload', 'backup', 'clock', 'lightbulb', 'microphone', 'desktop', 'tablet', 'smartphone', 'phone', 'index-card', 'carrot', 'building', 'store', 'album', 'palmtree', 'tickets-alt', 'money', 'smiley', 'thumbs-up', 'thumbs-down', 'layout', 'paperclip' ],
|
||||
];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import "./control.scss";
|
||||
|
||||
wp.customize.controlConstructor['kirki-dashicons'] = wp.customize.kirkiDynamicControl.extend( {} );
|
|
@ -0,0 +1,39 @@
|
|||
.customize-control-kirki-dashicons {
|
||||
position: relative;
|
||||
|
||||
label {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.icons-wrapper {
|
||||
max-height: 300px;
|
||||
overflow-y: scroll;
|
||||
|
||||
h4 {
|
||||
font-weight: 300;
|
||||
margin: 0.7em 0;
|
||||
}
|
||||
|
||||
.dashicons {
|
||||
padding: 3px;
|
||||
font-size: 25px;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
input {
|
||||
display: none;
|
||||
|
||||
&:checked {
|
||||
+ label {
|
||||
.dashicons {
|
||||
border: 1px solid #3498DB;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue