8889841cPK-[6_dist/preview.jsnu[jQuery(document).ready((function(){wp.hooks.addFilter("kirkiPostMessageStylesOutput","kirki",(function(e,t,i,o){var r;return"kirki-dimensions"===o&&(e+=i.element+"{",_.each(t,(function(t,o){i.choice&&o!==i.choice||!1!==(r=kirkiPostMessage.util.processValue(i,t))&&(i.property?(e+=i.property,""===i.property||"top"!==o&&"bottom"!==o&&"left"!==o&&"right"!==o||(e+="-"+o),e+=":"+r+";"):e+=o+":"+r+";")})),e+="}"),e}))})); //# sourceMappingURL=preview.js.map PK-[k!]))dist/control.cssnu[ /*# sourceMappingURL=control.css.map */ PK-[Yy y dist/preview.js.mapnu[{"mappings":"AASAA,OAAQC,UAAWC,OAAK,WACvBC,GAAGC,MAAMC,UAAS,+BACa,SAW3B,SACOC,EAAQC,EAAOC,EAAQC,GAChC,IAAIC,QACF,qBAA0BD,IAC3BH,GAAUE,EAAOG,QAAO,IACxBC,EAAEC,KAAMN,GAAK,SAAYO,EAAKC,GACxBP,EAAOQ,QAAUD,IAAQP,EAAOQ,SAKhC,KAFLN,EAAiBO,iBAAiBC,KAAKC,aAAcX,EAAQM,MAKvDN,EAAOY,UACXd,GAAUE,EAAOY,SACf,KAAUZ,EAAOY,UAAQ,QAAgBL,GAAG,WAAiBA,GAAG,SAAeA,GAAG,UAAgBA,IACnGT,GAAM,IAAUS,GAEjBT,GAAM,IAAUI,EAAc,KAE9BJ,GAAUS,EAAG,IAASL,EAAc,QAIvCJ,GAAM,KAEAA","sources":["src/preview.js"],"sourcesContent":["/* global kirkiPostMessage */\n\nimport \"./control.scss\";\n\n/**\n * Hook in the kirkiPostMessageStylesOutput filter.\n *\n * Handles postMessage styles for typography controls.\n */\njQuery( document ).ready( function() {\n\twp.hooks.addFilter(\n\t\t'kirkiPostMessageStylesOutput',\n\t\t'kirki',\n\n\t\t/**\n\t\t * Append styles for this control.\n\t\t *\n\t\t * @param {string} styles - The styles.\n\t\t * @param {Object} value - The control value.\n\t\t * @param {Object} output - The control's \"output\" argument.\n\t\t * @param {string} controlType - The control type.\n\t\t * @returns {string} - Returns the CSS as a string.\n\t\t */\n\t\tfunction( styles, value, output, controlType ) {\n\t\t\tvar processedValue;\n\t\t\tif ( 'kirki-dimensions' === controlType ) {\n\t\t\t\tstyles += output.element + '{';\n\t\t\t\t_.each( value, function( val, key ) {\n\t\t\t\t\tif ( output.choice && key !== output.choice ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprocessedValue = kirkiPostMessage.util.processValue( output, val );\n\n\t\t\t\t\tif ( false !== processedValue ) {\n\n\t\t\t\t\t\t// Mostly used for padding, margin & position properties.\n\t\t\t\t\t\tif ( output.property ) {\n\t\t\t\t\t\t\tstyles += output.property;\n\t\t\t\t\t\t\tif ( '' !== output.property && ( 'top' === key || 'bottom' === key || 'left' === key || 'right' === key ) ) {\n\t\t\t\t\t\t\t\tstyles += '-' + key;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstyles += ':' + processedValue + ';';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstyles += key + ':' + processedValue + ';';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tstyles += '}';\n\t\t\t}\n\t\t\treturn styles;\n\t\t}\n\t);\n} );\n"],"names":["jQuery","document","ready","wp","hooks","addFilter","styles","value","output","controlType","processedValue","element","_","each","val","key","choice","kirkiPostMessage","util","processValue","property"],"version":3,"file":"preview.js.map"}PK-[Z``dist/control.css.mapnu[{"mappings":"","sources":[],"sourcesContent":[],"names":[],"version":3,"file":"control.css.map"}PK-[#*src/preview.jsnu[/* global kirkiPostMessage */ import "./control.scss"; /** * Hook in the kirkiPostMessageStylesOutput filter. * * Handles postMessage styles for typography controls. */ jQuery( document ).ready( function() { wp.hooks.addFilter( 'kirkiPostMessageStylesOutput', 'kirki', /** * Append styles for this control. * * @param {string} styles - The styles. * @param {Object} value - The control value. * @param {Object} output - The control's "output" argument. * @param {string} controlType - The control type. * @returns {string} - Returns the CSS as a string. */ function( styles, value, output, controlType ) { var processedValue; if ( 'kirki-dimensions' === controlType ) { styles += output.element + '{'; _.each( value, function( val, key ) { if ( output.choice && key !== output.choice ) { return; } processedValue = kirkiPostMessage.util.processValue( output, val ); if ( false !== processedValue ) { // Mostly used for padding, margin & position properties. if ( output.property ) { styles += output.property; if ( '' !== output.property && ( 'top' === key || 'bottom' === key || 'left' === key || 'right' === key ) ) { styles += '-' + key; } styles += ':' + processedValue + ';'; } else { styles += key + ':' + processedValue + ';'; } } } ); styles += '}'; } return styles; } ); } ); PK-[(2"src/Dimensions.phpnu[ esc_html__( 'Left Top', 'kirki' ), 'left-center' => esc_html__( 'Left Center', 'kirki' ), 'left-bottom' => esc_html__( 'Left Bottom', 'kirki' ), 'right-top' => esc_html__( 'Right Top', 'kirki' ), 'right-center' => esc_html__( 'Right Center', 'kirki' ), 'right-bottom' => esc_html__( 'Right Bottom', 'kirki' ), 'center-top' => esc_html__( 'Center Top', 'kirki' ), 'center-center' => esc_html__( 'Center Center', 'kirki' ), 'center-bottom' => esc_html__( 'Center Bottom', 'kirki' ), 'font-size' => esc_html__( 'Font Size', 'kirki' ), 'font-weight' => esc_html__( 'Font Weight', 'kirki' ), 'line-height' => esc_html__( 'Line Height', 'kirki' ), 'font-style' => esc_html__( 'Font Style', 'kirki' ), 'letter-spacing' => esc_html__( 'Letter Spacing', 'kirki' ), 'word-spacing' => esc_html__( 'Word Spacing', 'kirki' ), 'top' => esc_html__( 'Top', 'kirki' ), 'bottom' => esc_html__( 'Bottom', 'kirki' ), 'left' => esc_html__( 'Left', 'kirki' ), 'right' => esc_html__( 'Right', 'kirki' ), 'center' => esc_html__( 'Center', 'kirki' ), 'size' => esc_html__( 'Size', 'kirki' ), 'spacing' => esc_html__( 'Spacing', 'kirki' ), 'width' => esc_html__( 'Width', 'kirki' ), 'height' => esc_html__( 'Height', 'kirki' ), 'invalid-value' => esc_html__( 'Invalid Value', 'kirki' ), ); /** * Add a hidden field, the label & description. */ new \Kirki\Field\Generic( wp_parse_args( array( 'type' => 'kirki-generic', 'default' => '', 'wrapper_opts' => array( 'gap' => 'small', ), 'sanitize_callback' => isset( $args['sanitize_callback'] ) ? $args['sanitize_callback'] : array( __CLASS__, 'sanitize' ), 'choices' => array( 'type' => 'hidden', 'parent_type' => 'kirki-dimensions', ), ), $args ) ); $args['choices'] = isset( $args['choices'] ) ? $args['choices'] : array(); $args['choices']['labels'] = isset( $args['choices']['labels'] ) ? $args['choices']['labels'] : array(); if ( isset( $args['transport'] ) && 'auto' === $args['transport'] ) { $args['transport'] = 'postMessage'; } $total_items = count( $args['default'] ); $item_count = 0; $width = 100; $break_indexes = array(); // The 'kirki-group-break' only supports 12 group items inside a group. if ( 2 === $total_items ) { $width = 50; } elseif ( 3 === $total_items ) { $width = 33; } elseif ( 4 === $total_items ) { $width = 25; } elseif ( 5 === $total_items ) { array_push( $break_indexes, 3 ); $width = 33; } elseif ( 6 === $total_items ) { array_push( $break_indexes, 3 ); $width = 33; } elseif ( 7 === $total_items || 8 === $total_items ) { array_push( $break_indexes, 4 ); $width = 25; } elseif ( 9 === $total_items ) { array_push( $break_indexes, 3, 6 ); $width = 33; } elseif ( $total_items > 9 ) { array_push( $break_indexes, 4, 8 ); $width = 25; } foreach ( $args['default'] as $choice => $default ) { $item_count++; $label = $choice; $label = isset( $labels[ $choice ] ) ? $labels[ $choice ] : $label; $label = isset( $args['choices']['labels'][ $choice ] ) ? $args['choices']['labels'][ $choice ] : $label; $wrapper_attrs = array( 'data-kirki-parent-control-type' => 'kirki-dimensions', 'data-kirki-parent-control-setting' => $args['settings'], 'class' => '{default_class} kirki-group-item kirki-w' . $width, ); if ( $item_count === 1 ) { $wrapper_attrs['class'] .= ' kirki-group-start'; } if ( in_array( $item_count, $break_indexes, true ) ) { $wrapper_attrs['class'] .= ' kirki-group-break'; } if ( $item_count === $total_items ) { $wrapper_attrs['class'] .= ' kirki-group-end'; } new \Kirki\Field\Dimension( wp_parse_args( array( 'type' => 'kirki-dimension', 'settings' => $args['settings'] . '[' . $choice . ']', 'parent_setting' => $args['settings'], 'label' => $label, 'default' => $default, 'wrapper_attrs' => $wrapper_attrs, 'choices' => array( 'label_position' => 'bottom', ), 'js_vars' => array(), 'css_vars' => array(), 'output' => array(), ), $args ) ); } } /** * Sanitizes dimension controls. * * @static * @access public * @since 1.0 * @param array $value The value. * @return array */ public static function sanitize( $value ) { if ( ! is_array( $value ) ) { return array(); } foreach ( $value as $key => $val ) { $value[ $key ] = sanitize_text_field( $val ); } return $value; } /** * Override parent method. No need to register any setting. * * @access public * @since 0.1 * @param WP_Customize_Manager $wp_customize The customizer instance. * @return void */ public function add_setting( $wp_customize ) {} /** * Override the parent method. No need for a control. * * @access public * @since 0.1 * @param WP_Customize_Manager $wp_customize The customizer instance. * @return void */ public function add_control( $wp_customize ) {} /** * Enqueue scripts & styles. * * @access public * @since 1.0 * @return void */ public function enqueue_scripts() { wp_enqueue_style( 'kirki-field-dimensions', URL::get_from_path( dirname( __DIR__ ) . '/dist/control.css' ), array(), '1.0' ); } /** * Enqueue scripts & styles on customize_preview_init. * * @access public * @since 1.0 * @return void */ public function enqueue_customize_preview_scripts() { wp_enqueue_script( 'kirki-field-dimensions', URL::get_from_path( dirname( __DIR__ ) ) . '/dist/preview.js', array( 'wp-hooks' ), '1.0', true ); } /** * Adds a custom output class for typography fields. * * @access public * @since 1.0 * @param array $classnames The array of classnames. * @return array */ public function output_control_classnames( $classnames ) { $classnames['kirki-dimensions'] = '\Kirki\Field\CSS\Dimensions'; return $classnames; } } PK-[jsrc/CSS/Dimensions.phpnu[ '', 'property' => '', 'media_query' => 'global', 'prefix' => '', 'suffix' => '', ] ); if ( ! is_array( $value ) ) { return; } foreach ( array_keys( $value ) as $key ) { $property = ( empty( $output['property'] ) ) ? $key : $output['property'] . '-' . $key; if ( isset( $output['choice'] ) && $output['property'] ) { if ( $key === $output['choice'] ) { $property = $output['property']; } else { continue; } } if ( false !== strpos( $output['property'], '%%' ) ) { $property = str_replace( '%%', $key, $output['property'] ); } $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $key ] ) . $output['suffix']; } } } PK-[TF composer.jsonnu[{ "name": "kirki-framework/field-dimensions", "type": "library", "description": "Dimensions field for the Kirki Customizer framework.", "keywords": [ "wordpress", "customizer", "framework" ], "homepage": "https://kirki.org/", "license": "MIT", "authors": [ { "name": "Kirki Framework", "email": "connect@mapsteps.com" } ], "require": { "php": ">=7.0", "kirki-framework/url-getter": "*", "kirki-framework/control-dimension": "*" }, "autoload": { "psr-4": { "Kirki\\Field\\": "src" } } } PK-[ln00LICENSEnu[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. PK-[6_dist/preview.jsnu[PK-[k!]))dist/control.cssnu[PK-[Yy y odist/preview.js.mapnu[PK-[Z``+ dist/control.css.mapnu[PK-[#* src/preview.jsnu[PK-[(2"src/Dimensions.phpnu[PK-[j/src/CSS/Dimensions.phpnu[PK-[TF 5composer.jsonnu[PK-[ln008LICENSEnu[PK  =