Файловый менеджер - Редактировать - /home/beautybuzzbeyond/public_html/private/pro-src.tar
Назад
packages/kirki-pro-responsive/composer.lock 0000644 00000001124 14717762257 0015145 0 ustar 00 { "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "57c9607478ff8a15c9c697d2397f187f", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } packages/kirki-pro-responsive/readme.txt 0000644 00000000540 14717762257 0014443 0 ustar 00 === Kirki Responsive Control === Contributors: davidvongries Tags: kirki-responsive-control Requires at least: 5.2 Tested up to: 5.9 Requires PHP: 7.0 License: GPL-3.0 License License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=kirki%20pro%20responsive == Description == Responsive extension for Kirki Customizer Framework. packages/kirki-pro-responsive/vendor/autoload.php 0000644 00000001403 14717762257 0016262 0 ustar 00 <?php // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, $err); } elseif (!headers_sent()) { echo $err; } } trigger_error( $err, E_USER_ERROR ); } require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInitfce553b9a6fa4102465a84b7e770c06c::getLoader(); packages/kirki-pro-responsive/vendor/composer/autoload_namespaces.php 0000644 00000000213 14717762257 0022306 0 ustar 00 <?php // autoload_namespaces.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( ); packages/kirki-pro-responsive/vendor/composer/LICENSE 0000644 00000002056 14717762257 0016602 0 ustar 00 Copyright (c) Nils Adermann, Jordi Boggiano 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. packages/kirki-pro-responsive/vendor/composer/autoload_psr4.php 0000644 00000000477 14717762257 0021073 0 ustar 00 <?php // autoload_psr4.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Kirki\\Pro\\Responsive\\' => array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); packages/kirki-pro-responsive/vendor/composer/autoload_real.php 0000644 00000002161 14717762257 0021116 0 ustar 00 <?php // autoload_real.php @generated by Composer class ComposerAutoloaderInitfce553b9a6fa4102465a84b7e770c06c { private static $loader; public static function loadClassLoader($class) { if ('Composer\Autoload\ClassLoader' === $class) { require __DIR__ . '/ClassLoader.php'; } } /** * @return \Composer\Autoload\ClassLoader */ public static function getLoader() { if (null !== self::$loader) { return self::$loader; } require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInitfce553b9a6fa4102465a84b7e770c06c', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInitfce553b9a6fa4102465a84b7e770c06c', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInitfce553b9a6fa4102465a84b7e770c06c::getInitializer($loader)); $loader->register(true); return $loader; } } packages/kirki-pro-responsive/vendor/composer/platform_check.php 0000644 00000001635 14717762257 0021271 0 ustar 00 <?php // platform_check.php @generated by Composer $issues = array(); if (!(PHP_VERSION_ID >= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); } elseif (!headers_sent()) { echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; } } trigger_error( 'Composer detected issues in your platform: ' . implode(' ', $issues), E_USER_ERROR ); } packages/kirki-pro-responsive/vendor/composer/ClassLoader.php 0000644 00000040220 14717762257 0020475 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Autoload; /** * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. * * $loader = new \Composer\Autoload\ClassLoader(); * * // register classes with namespaces * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * * // activate the autoloader * $loader->register(); * * // to enable searching the include path (eg. for PEAR packages) * $loader->setUseIncludePath(true); * * In this example, if you try to use a class in the Symfony\Component * namespace or one of its children (Symfony\Component\Console for instance), * the autoloader will first look for the class under the component/ * directory, and it will then fallback to the framework/ directory if not * found before giving up. * * This class is loosely based on the Symfony UniversalClassLoader. * * @author Fabien Potencier <fabien@symfony.com> * @author Jordi Boggiano <j.boggiano@seld.be> * @see https://www.php-fig.org/psr/psr-0/ * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { /** @var \Closure(string):void */ private static $includeFile; /** @var ?string */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array<string, array<string, int>> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array<string, array<int, string>> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array<string, array<string, string[]>> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array<string, string> */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array<string, bool> */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array<string, array<int, string>> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array<string, string> */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array<string, string> $classMap * * @return void */ public function addClassMap(array $classMap) { if ($this->classMap) { $this->classMap = array_merge($this->classMap, $classMap); } else { $this->classMap = $classMap; } } /** * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 root directories * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $paths ); } } /** * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { // Register directories for a new namespace. $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $paths ); } } /** * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 base directories * * @return void */ public function set($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr0 = (array) $paths; } else { $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; } } /** * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * * @return void */ public function setPsr4($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr4 = (array) $paths; } else { $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } } /** * Turns on searching the include path for class files. * * @param bool $useIncludePath * * @return void */ public function setUseIncludePath($useIncludePath) { $this->useIncludePath = $useIncludePath; } /** * Can be used to check if the autoloader uses the include path to check * for classes. * * @return bool */ public function getUseIncludePath() { return $this->useIncludePath; } /** * Turns off searching the prefix and fallback directories for classes * that have not been registered with the class map. * * @param bool $classMapAuthoritative * * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { $this->classMapAuthoritative = $classMapAuthoritative; } /** * Should class lookup fail if not found in the current class map? * * @return bool */ public function isClassMapAuthoritative() { return $this->classMapAuthoritative; } /** * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix * * @return void */ public function setApcuPrefix($apcuPrefix) { $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** * The APCu prefix in use, or null if APCu caching is not enabled. * * @return string|null */ public function getApcuPrefix() { return $this->apcuPrefix; } /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not * * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { return; } if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); self::$registeredLoaders[$this->vendorDir] = $this; } } /** * Unregisters this instance as an autoloader. * * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); if (null !== $this->vendorDir) { unset(self::$registeredLoaders[$this->vendorDir]); } } /** * Loads the given class or interface. * * @param string $class The name of the class * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { $includeFile = self::$includeFile; $includeFile($file); return true; } return null; } /** * Finds the path to the file where the class is defined. * * @param string $class The name of the class * * @return string|false The path if found, false otherwise */ public function findFile($class) { // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } if (null !== $this->apcuPrefix) { $file = apcu_fetch($this->apcuPrefix.$class, $hit); if ($hit) { return $file; } } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM if (false === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } if (null !== $this->apcuPrefix) { apcu_add($this->apcuPrefix.$class, $file); } if (false === $file) { // Remember that this class does not exist. $this->missingClasses[$class] = true; } return $file; } /** * Returns the currently registered loaders indexed by their corresponding vendor directories. * * @return self[] */ public static function getRegisteredLoaders() { return self::$registeredLoaders; } /** * @param string $class * @param string $ext * @return string|false */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { if (file_exists($file = $dir . $pathEnd)) { return $file; } } } } } // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } // PSR-0 lookup if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); } else { // PEAR-like class name $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; } if (isset($this->prefixesPsr0[$first])) { foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } } } } // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } // PSR-0 include paths. if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } return false; } /** * @return void */ private static function initializeIncludeClosure() { if (self::$includeFile !== null) { return; } /** * Scope isolated include. * * Prevents access to $this/self from included files. * * @param string $file * @return void */ self::$includeFile = \Closure::bind(static function($file) { include $file; }, null, null); } } packages/kirki-pro-responsive/vendor/composer/autoload_classmap.php 0000644 00000000336 14717762257 0022000 0 ustar 00 <?php // autoload_classmap.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-responsive/vendor/composer/autoload_static.php 0000644 00000002562 14717762257 0021467 0 ustar 00 <?php // autoload_static.php @generated by Composer namespace Composer\Autoload; class ComposerStaticInitfce553b9a6fa4102465a84b7e770c06c { public static $prefixLengthsPsr4 = array ( 'K' => array ( 'Kirki\\Pro\\Responsive\\' => 21, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\Responsive\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInitfce553b9a6fa4102465a84b7e770c06c::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitfce553b9a6fa4102465a84b7e770c06c::$prefixDirsPsr4; $loader->classMap = ComposerStaticInitfce553b9a6fa4102465a84b7e770c06c::$classMap; }, null, ClassLoader::class); } } packages/kirki-pro-responsive/vendor/composer/InstalledVersions.php 0000644 00000037417 14717762257 0021767 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; /** * This class is copied in every Composer installed project and available to all * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` * * @final */ class InstalledVersions { /** * @var mixed[]|null * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static $installedByVendor = array(); /** * Returns a list of all package names which are present, either by being installed, replaced or provided * * @return string[] * @psalm-return list<string> */ public static function getInstalledPackages() { $packages = array(); foreach (self::getInstalled() as $installed) { $packages[] = array_keys($installed['versions']); } if (1 === \count($packages)) { return $packages[0]; } return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); } /** * Returns a list of all package names with a specific type e.g. 'library' * * @param string $type * @return string[] * @psalm-return list<string> */ public static function getInstalledPackagesByType($type) { $packagesByType = array(); foreach (self::getInstalled() as $installed) { foreach ($installed['versions'] as $name => $package) { if (isset($package['type']) && $package['type'] === $type) { $packagesByType[] = $name; } } } return $packagesByType; } /** * Checks whether the given package is installed * * This also returns true if the package name is provided or replaced by another package * * @param string $packageName * @param bool $includeDevRequirements * @return bool */ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } return false; } /** * Checks whether the given package satisfies a version constraint * * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: * * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') * * @param VersionParser $parser Install composer/semver to have access to this class and functionality * @param string $packageName * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package * @return bool */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); } /** * Returns a version constraint representing all the range(s) which are installed for a given package * * It is easier to use this via isInstalled() with the $constraint argument if you need to check * whether a given version of a package is installed, and not just whether it exists * * @param string $packageName * @return string Version constraint usable with composer/semver */ public static function getVersionRanges($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } $ranges = array(); if (isset($installed['versions'][$packageName]['pretty_version'])) { $ranges[] = $installed['versions'][$packageName]['pretty_version']; } if (array_key_exists('aliases', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); } if (array_key_exists('replaced', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); } if (array_key_exists('provided', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); } return implode(' || ', $ranges); } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['version'])) { return null; } return $installed['versions'][$packageName]['version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getPrettyVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['pretty_version'])) { return null; } return $installed['versions'][$packageName]['pretty_version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference */ public static function getReference($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['reference'])) { return null; } return $installed['versions'][$packageName]['reference']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. */ public static function getInstallPath($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @return array * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { $installed = self::getInstalled(); return $installed[0]['root']; } /** * Returns the raw installed.php data for custom implementations * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} */ public static function getRawData() { @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { self::$installed = include __DIR__ . '/installed.php'; } else { self::$installed = array(); } } return self::$installed; } /** * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ public static function getAllRawData() { return self::getInstalled(); } /** * Lets you reload the static array from another file * * This is only useful for complex integrations in which a project needs to use * this class but then also needs to execute another project's autoloader in process, * and wants to ensure both projects have access to their version of installed.php. * * A typical case would be PHPUnit, where it would need to make sure it reads all * the data it needs from this class, then call reload() with * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure * the project in which it runs can then also use this class safely, without * interference between PHPUnit's dependencies and the project's dependencies. * * @param array[] $data A vendor/composer/installed.php data set * @return void * * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static function getInstalled() { if (null === self::$canGetVendors) { self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); } $installed = array(); if (self::$canGetVendors) { foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require $vendorDir.'/composer/installed.php'; $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } } } } if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } packages/kirki-pro-responsive/vendor/composer/installed.json 0000644 00000000105 14717762257 0020440 0 ustar 00 { "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-responsive/vendor/composer/installed.php 0000644 00000001344 14717762257 0020264 0 ustar 00 <?php return array( 'root' => array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); packages/kirki-pro-responsive/src/Init.php 0000644 00000025620 14717762257 0014656 0 ustar 00 <?php /** * Init the Kirki PRO's responsive package. * * @package kirki-pro-responsive * @since 1.0.0 */ namespace Kirki\Pro\Responsive; use Kirki\Pro\Field\Responsive; /** * Manage the responsive package. */ class Init { /** * Control types with horizontal layout. * * @var array */ private $horizontal_types = [ 'kirki-checkbox', 'kirki-toggle', 'kirki-react-colorful', ]; /** * The class constructor. */ public function __construct() { add_action( 'customize_register', [ $this, 'register_control_type' ] ); add_filter( 'kirki_control_types', [ $this, 'control_type' ] ); add_filter( 'kirki_field_exclude_init', array( $this, 'exclude_init' ), 99999, 4 ); add_action( 'kirki_field_custom_init', [ $this, 'field_init' ], 99999, 3 ); /** * We use 8 as the priority because we want this to run before "kirki_get_value" method * in wp-content/plugins/kirki-dev/packages/kirki-framework/data-option/src/Option.php file. */ add_filter( 'kirki_get_value', [ $this, 'kirki_get_value' ], 8, 4 ); } /** * Register control type. * * @param WP_Customize_Manager $wp_customize Instance of WP_Customize_Manager. */ public function register_control_type( $wp_customize ) { $wp_customize->register_control_type( '\Kirki\Pro\Control\Responsive' ); } /** * The control type. * * @param array $control_types The existing control types. */ public function control_type( $control_types ) { $control_types['kirki-responsive'] = 'Kirki\Pro\Control\Responsive'; return $control_types; } /** * Parse the "default" argument. * This method will format the "default" argument to contains the devices that wraps the default value. * * @since 1.0.0 * * @param array $args The field arguments. * @return array $args The modifiled field arguments. */ public function parse_default_arg( $args ) { $has_responsive_default = true; if ( isset( $args['default'] ) ) { if ( is_array( $args['default'] ) ) { if ( ! isset( $args['default']['desktop'] ) && ! isset( $args['default']['tablet'] ) && ! isset( $args['default']['mobile'] ) ) { $has_responsive_default = false; } } else { $has_responsive_default = false; } } if ( ! $has_responsive_default ) { if ( isset( $args['default'] ) ) { $args['default'] = array( 'desktop' => $args['default'], ); } else { $args['default'] = array( 'desktop' => '', ); } } return $args; } /** * Parse the output argument. * This method will format the "output" argument to modify the "media_query" based on the targetted device. * This method will be called inside of "default" argument loop when the control is using responsive mode. * * @since 1.0.0 * * @param array $args The field arguments. * @param string $device The targetted device. * * @return array $args The modified field arguments. */ public function parse_output_arg( $args, $device ) { if ( isset( $args['output'] ) && ! empty( $args['output'] ) ) { foreach ( $args['output'] as $index => $output ) { if ( isset( $output['media_query'] ) ) { if ( isset( $output['media_query'][ $device ] ) ) { $args['output'][ $index ]['media_query'] = $output['media_query'][ $device ]; } else { // If current device is not set in the "media_query", then the output won't work. unset( $args['output'][ $index ] ); } } else { // If "media_query" is not provided in the "output" arg, then the output won't work. unset( $args['output'][ $index ] ); } } } return $args; } /** * Exclude responsive field (field here means group of controls) from default field's init call. * * @see wp-content/plugins/kirki-dev/packages/kirki-framework/field/src/Field.php * @since 1.0.0 * * @param bool $condition The existing condition. * @param Object $field The field object. * @param array $args The field args. * * @return bool */ public function exclude_init( $condition, $field, $args ) { if ( isset( $args['responsive'] ) && $args['responsive'] ) { return true; } return $condition; } /** * Replace the default field init with custom init. * * @see wp-content/plugins/kirki-dev/packages/kirki-framework/field/src/Field.php * @since 1.0.0 * * @param Object $field The field object. * @param array $args The Kirki field args. * @param string $control_class The control class name if it exists. */ public function field_init( $field, $args, $control_class ) { // Stop if this field doesn't have the "responsive" argument. if ( ! isset( $args['responsive'] ) || ! $args['responsive'] ) { return; } $this->register_real_controls( $field, $args, $control_class ); } /** * Register the real controls. * * @since 1.0.0 * * @param Object $field The field object. * @param array $args The Kirki field args. * @param string $control_class The control class name if it exists. */ public function register_real_controls( $field, $args, $control_class = '' ) { $defaults = $this->parse_default_arg( $args ); $defaults = $defaults['default']; $defaults = array_reverse( $defaults ); $devices = []; $inside_horizontal_layout = property_exists( $field, 'type' ) && in_array( $field->type, $this->horizontal_types, true ) ? true : false; foreach ( $defaults as $device => $value ) { array_push( $devices, $device ); } $devices = array_reverse( $devices ); $devices_control_id = 'kirki_responsive__' . $args['settings']; $loop_count = 0; foreach ( $defaults as $device => $value ) { $loop_count++; if ( ! $inside_horizontal_layout && 1 === $loop_count ) { $this->add_devices_control( $devices_control_id, $args, $devices, $inside_horizontal_layout ); } $new_control_args = $args; $new_control_args['default'] = $value; $new_control_args['settings'] = $args['settings'] . '[' . $device . ']'; $new_control_args['device'] = $device; if ( ! isset( $new_control_args['wrapper_attrs'] ) ) { $new_control_args['wrapper_attrs'] = []; } $new_control_args['wrapper_attrs']['data-kirki-parent-responsive-id'] = $devices_control_id; $new_control_args['wrapper_attrs']['data-kirki-device-preview'] = $device; if ( isset( $new_control_args['label'] ) ) { unset( $new_control_args['label'] ); } if ( isset( $new_control_args['description'] ) ) { unset( $new_control_args['description'] ); } if ( isset( $new_control_args['responsive'] ) ) { unset( $new_control_args['responsive'] ); } $wrapper_class = ''; /** * If `$control_class` is empty, then we assume this is a "parent field" and not the "real controls". * A "parent field" here means: a parent of group of controls such as field-dimensions, field-typography, etc. */ if ( ! $control_class ) { $wrapper_class .= ' customize-control-kirki-hidden-field'; } if ( $inside_horizontal_layout ) { $wrapper_class .= ' customize-control-kirki-responsive-horizontal'; } if ( ! empty( $wrapper_class ) ) { if ( isset( $new_control_args['wrapper_attrs']['class'] ) ) { $new_control_args['wrapper_attrs']['class'] .= $wrapper_class; } else { $new_control_args['wrapper_attrs']['class'] = '{default_class}' . $wrapper_class; } } $new_control_args = $this->parse_output_arg( $new_control_args, $device ); $field_classname = get_class( $field ); new $field_classname( $new_control_args ); if ( $inside_horizontal_layout && count( $devices ) === $loop_count ) { $this->add_devices_control( $devices_control_id, $args, $devices, $inside_horizontal_layout ); } } } /** * Add devices control via $wp_customize. * * @param string $id The control's ID. * @param array $args The control arguments. * @param array $devices The specified devices. * @param bool $inside_horizontal_layout Whether or not this control is inside a horizontal layout. */ public function add_devices_control( $id, $args, $devices, $inside_horizontal_layout = false ) { unset( $args['responsive'] ); if ( isset( $args['default'] ) ) { unset( $args['default'] ); } if ( isset( $args['transport'] ) ) { unset( $args['transport'] ); } if ( isset( $args['output'] ) ) { unset( $args['output'] ); } if ( isset( $args['wrapper_attrs'] ) ) { if ( isset( $args['wrapper_attrs']['data-kirki-parent-responsive-id'] ) ) { unset( $args['wrapper_attrs']['data-kirki-parent-responsive-id'] ); } if ( isset( $args['wrapper_attrs']['data-kirki-device-preview'] ) ) { unset( $args['wrapper_attrs']['data-kirki-device-preview'] ); } } $args['settings'] = $id; $args['type'] = 'kirki-responsive'; if ( ! $inside_horizontal_layout ) { if ( ! isset( $args['wrapper_opts'] ) ) { $args['wrapper_opts'] = []; } $args['wrapper_opts']['gap'] = 'small'; } $args['choices'] = [ 'devices' => $devices, ]; new Responsive( $args ); } /** * Filter the value for responsive fields. * * @see wp-content/plugins/kirki-dev/packages/kirki-framework/data-option/src/Option.php * * @param mixed $value The field value. * @param string $field_name The field name. * @param mixed $default The default value. * @param string $type The option type (theme_mod or option). * * @return mixed The filtered value. */ public function kirki_get_value( $value = '', $field_name = '', $default = '', $type = 'theme_mod' ) { /** * The "option" will be handled by "kirki_get_value" method in * wp-content/plugins/kirki-dev/packages/kirki-framework/data-option/src/Option.php file. */ if ( 'option' === $type ) { return $value; } // If the field name doesn't contain a '[', then it's not a sub-item of another field. if ( false === strpos( $field_name, '[' ) ) { return $value; } // If this is not part of a responsive field, then return the value. if ( ! in_array( $field_name, Responsive::$sub_field_names, true ) ) { return $value; } /** * If we got here then this is part of an option array. * We need to get the 1st level, and then find the item inside that array. */ $parts = \explode( '[', $field_name ); $value = get_theme_mod( $parts[0], [] ); foreach ( $parts as $key => $part ) { /** * Skip the 1st item, it's already been dealt with * when we got the value initially right before this loop. */ if ( 0 === $key ) { continue; } $part = str_replace( ']', '', $part ); /** * If the item exists in the value, then change $value to the item. * This runs recursively for all parts until we get to the end. */ if ( is_array( $value ) && isset( $value[ $part ] ) ) { $value = $value[ $part ]; continue; } /** * If we got here, the item was not found in the value. * We need to change the value accordingly depending on whether * this is the last item in the loop or not. */ $value = ( isset( $parts[ $key + 1 ] ) ) ? [] : ''; } $value = empty( $value ) ? $default : $value; return $value; } } packages/kirki-pro-responsive/src/control.js 0000644 00000007210 14717762257 0015253 0 ustar 00 import "./control.scss"; (function ($) { const api = wp.customize; const setupDevices = () => { // Get all controls which are responsive-able (not the device control it self). const childControls = document.querySelectorAll( "[data-kirki-parent-responsive-id]" ); if (!childControls.length) return; // Responsive ids are collection of the id of the responsive controls (the device controls). let responsiveIds = []; [].slice.call(childControls).forEach(function (childControl) { const parentResponsiveId = childControl.dataset.kirkiParentResponsiveId; const device = childControl.dataset.kirkiDevicePreview; const setting = childControl.dataset.kirkiSetting; if (!responsiveIds.includes(parentResponsiveId)) { responsiveIds.push(parentResponsiveId); } /** * Grouped controls are collection of control which contains some child-controls. * Example of grouped controls: field-dimensions, field-typography, field-multicolor. */ const groupedControls = document.querySelectorAll( '[data-kirki-parent-control-setting="' + setting + '"]' ); // Check if childControl is a field that groups other controls. if (groupedControls.length) { [].slice.call(groupedControls).forEach(function (groupedControl) { // Inherit the parentResponsiveId & device from the group's parent. groupedControl.dataset.kirkiParentResponsiveId = parentResponsiveId; groupedControl.dataset.kirkiDevicePreview = device; }); } }); // Move the device icons next to the control's title. responsiveIds.forEach(function (responsiveId) { const $deviceButtons = $( "#customize-control-" + responsiveId + " .kirki-device-buttons" ); $deviceButtons.attr("data-kirki-devices-for", responsiveId); $deviceButtons.appendTo( "#customize-control-" + responsiveId + " .customize-control-title" ); }); }; const setupPreview = () => { function init() { switchDevice("desktop"); // Initial state. setupDeviceClicks(); syncPreviewButtons(); } function setupDeviceClicks() { const deviceButtons = document.querySelectorAll(".kirki-device-button"); if (!deviceButtons.length) return; // Loop through Kirki device buttons and assign the click event. [].slice.call(deviceButtons).forEach(function (deviceButton) { deviceButton.addEventListener("click", function (e) { var device = this.getAttribute("data-kirki-device"); // Trigger WordPress device event. api.previewedDevice.set(device); }); }); } /** * Sync device preview button from WordPress to Kirki and vice versa. */ function syncPreviewButtons() { // Bind device changes from WordPress default. api.previewedDevice.bind(function (newDevice) { switchDevice(newDevice); }); } /** * Setup device preview. * * @param string device The device (mobile, tablet, or desktop). */ function switchDevice(device) { $(".kirki-device-button").removeClass("is-active"); $(".kirki-device-button-" + device).addClass("is-active"); $("[data-kirki-device-preview]").addClass("kirki-responsive-item-hidden"); $('[data-kirki-device-preview="' + device + '"]').removeClass( "kirki-responsive-item-hidden" ); } init(); }; // Run setupDevices & setupPreview after the customizer is ready. wp.customize.bind("ready", function () { setTimeout(function () { setupDevices(); setupPreview(); }, 250); }); })(jQuery); packages/kirki-pro-responsive/src/control.scss 0000644 00000004101 14717762257 0015606 0 ustar 00 .customize-control-kirki-responsive { position: relative; z-index: 1; // Make it above it's children control. .customize-control-title { display: flex; } } .kirki-responsive { .kirki-device-buttons, .kirki-device-button { list-style: none; margin: 0; padding: 0; } .kirki-device-buttons { display: flex; top: 3px; justify-content: flex-start; position: relative; margin-left: 12px; font-weight: 600; font-size: 14px; } .kirki-device-button { display: flex; align-items: center; justify-content: center; position: relative; margin-right: 3px; width: 22px; height: 22px; background-color: #eee; border-radius: 50%; cursor: pointer; transition: all 0.2s; i { width: 11px; height: 11px; font-size: 11px; } &.is-active, &:hover { background-color: #ddd; } } } [data-kirki-parent-responsive-id] { &.customize-control-kirki-switch { top: -5px; .kirki-switch { .kirki-toggle-switch-label { padding-top: 0; } .toggle-on, .toggle-off { bottom: -5px; } } } } .customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] { margin-bottom: -35px; &.customize-control-kirki-react-colorful { margin-bottom: -30px; .kirki-trigger-circle-wrapper { z-index: 2; // Make it above the responsive devices. } } &.customize-control-kirki-checkbox { display: flex; justify-content: flex-end; top: 9px; [data-customize-setting-link] { z-index: 2; } } &.customize-control-kirki-toggle { top: 14px; .kirki-toggle { display: flex; justify-content: flex-end; .kirki-control-form { display: inline-block; display: inline-flex; } } .kirki-control-form { z-index: 2; // Make it above the responsive devices. } } .customize-control-title, .customize-control-description { padding-right: 25px; } } .kirki-responsive-item-hidden { display: none !important; } packages/kirki-pro-responsive/src/Field/Responsive.php 0000644 00000005034 14717762257 0017130 0 ustar 00 <?php // phpcs:disable PHPCompatibility.FunctionDeclarations.NewClosure /** * Override field methods * * @package kirki-pro-responsive * @since 1.0 */ namespace Kirki\Pro\Field; use Kirki\Field; /** * Field overrides. * * @since 1.0 */ class Responsive extends Field { /** * The field type. * * @since 1.0 * @var string */ public $type = 'kirki-responsive'; /** * The control class-name. * * @since 1.0 * @var string */ protected $control_class = '\Kirki\Pro\Control\Responsive'; /** * Collection of the connected field names. * * @var array */ public static $sub_field_names = []; /** * Whether we should register the control class for JS-templating or not. * * @access protected * @since 1.0 * @var bool */ protected $control_has_js_template = true; /** * Class constructor. * * @param array $args The field arguments. */ public function __construct( $args ) { $field_name = str_ireplace( 'kirki_responsive__', '', $args['settings'] ); if ( isset( $args['choices'] ) && isset( $args['choices']['devices'] ) && ! empty( $args['choices']['devices'] ) ) { foreach ( $args['choices']['devices'] as $device ) { $sub_field_name = $field_name . '[' . $device . ']'; if ( ! in_array( $sub_field_name, self::$sub_field_names, true ) ) { array_push( self::$sub_field_names, $sub_field_name ); } } } parent::__construct( $args ); } /** * Filter arguments before creating the setting. * * @since 1.0 * * @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'] = '__return_null'; } } return $args; } /** * Filter arguments before creating the control. * * @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-responsive'; } return $args; } } packages/kirki-pro-responsive/src/Control/Responsive.php 0000644 00000005451 14717762257 0017530 0 ustar 00 <?php /** * Customizer Control: kirki-responsive. * * @package kirki-pro-responsive * @since 1.0 */ namespace Kirki\Pro\Control; use Kirki\Control\Base; use Kirki\URL; // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Responsive control */ class Responsive extends Base { /** * The control type. * * @since 1.0 * @var string */ public $type = 'kirki-responsive'; /** * The version. Used in scripts & styles for cache-busting. * * @since 1.0 * @var string */ public static $control_ver = '1.0.0'; /** * Enqueue control related styles/scripts. * * @since 1.0 * @access public */ public function enqueue() { parent::enqueue(); // Enqueue the style. wp_enqueue_style( 'kirki-control-responsive', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver ); // Enqueue the script. wp_enqueue_script( 'kirki-control-responsive', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'jquery', 'customize-base', 'customize-controls' ], self::$control_ver, true ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @access public * @since 1.0 * @see WP_Customize_Control::to_json() * @return void */ public function to_json() { // Get the basics from the parent class. parent::to_json(); $device_icons = [ 'desktop' => 'dashicons-desktop', 'tablet' => 'dashicons-tablet', 'mobile' => 'dashicons-smartphone', ]; $devices = isset( $this->choices['devices'] ) ? $this->choices['devices'] : []; $device_menu = ''; $loop_index = 0; foreach ( $devices as $device ) { $loop_index++; $device_menu .= ' <li class="kirki-device-button kirki-device-button-' . $device . ( 1 === $loop_index ? ' is-active' : '' ) . '" data-kirki-device="' . esc_attr( $device ) . '"> <i class="dashicons ' . esc_html( $device_icons[ $device ] ) . '"></i> </li> '; } $this->json['deviceMenu'] = $device_menu; } /** * 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() * @since 1.0 */ protected function content_template() { ?> <div class="kirki-responsive" data-kirki-responsive-id="{{{ data.settings.default }}}"> <div class="kirki-control-label"> <div class="customize-control-title"> <span>{{{ data.label }}}</span> </div> <# if (data.description) { #> <div class="customize-control-description">{{{ data.description }}}</div> <# } #> </div> <ul class="kirki-device-buttons"> {{{ data.deviceMenu }}} </ul> </div> <?php } } packages/kirki-pro-responsive/package.json 0000644 00000001403 14717762257 0014732 0 ustar 00 { "name": "kirki-pro-responsive", "version": "1.1", "description": "Dev toolkit for kirki-pro-responsive", "keywords": [ "kirki-pro-responsive" ], "author": "Kirki", "license": "MIT", "bugs": { "url": "https://www.themeum.com/" }, "homepage": "https://www.themeum.com/", "devDependencies": { "@parcel/transformer-sass": "^2.2.1", "parcel": "^2.2.1" }, "source": "src/control.js", "scripts": { "build": "parcel build", "dev": "parcel build --no-optimize" }, "alias": { "jquery": { "global": "jQuery" }, "wp": { "global": "wp" }, "react": { "global": "React" }, "react-dom": { "global": "ReactDOM" } }, "browserslist": "> 0.5%, last 2 versions, not dead" } packages/kirki-pro-responsive/dist/control.js 0000644 00000002542 14717762257 0015432 0 ustar 00 !function(){var e,i,t;e=jQuery,i=wp.customize,t=function(){function t(i){e(".kirki-device-button").removeClass("is-active"),e(".kirki-device-button-"+i).addClass("is-active"),e("[data-kirki-device-preview]").addClass("kirki-responsive-item-hidden"),e('[data-kirki-device-preview="'+i+'"]').removeClass("kirki-responsive-item-hidden")}var r;t("desktop"),(r=document.querySelectorAll(".kirki-device-button")).length&&[].slice.call(r).forEach((function(e){e.addEventListener("click",(function(e){var t=this.getAttribute("data-kirki-device");i.previewedDevice.set(t)}))})),i.previewedDevice.bind((function(e){t(e)}))},wp.customize.bind("ready",(function(){setTimeout((function(){!function(){var i=document.querySelectorAll("[data-kirki-parent-responsive-id]");if(i.length){var t=[];[].slice.call(i).forEach((function(e){var i=e.dataset.kirkiParentResponsiveId,r=e.dataset.kirkiDevicePreview,n=e.dataset.kirkiSetting;t.includes(i)||t.push(i);var c=document.querySelectorAll('[data-kirki-parent-control-setting="'+n+'"]');c.length&&[].slice.call(c).forEach((function(e){e.dataset.kirkiParentResponsiveId=i,e.dataset.kirkiDevicePreview=r}))})),t.forEach((function(i){var t=e("#customize-control-"+i+" .kirki-device-buttons");t.attr("data-kirki-devices-for",i),t.appendTo("#customize-control-"+i+" .customize-control-title")}))}}(),t()}),250)}))}(); //# sourceMappingURL=control.js.map packages/kirki-pro-responsive/dist/control.css.map 0000644 00000014507 14717762257 0016366 0 ustar 00 {"mappings":"AAAA,oCACE,iBAAA,CACA,SCCF,CDCE,6DACE,YCCJ,CDIE,+EAEE,eAAA,CACA,QAAA,CACA,SCDJ,CDIE,wCACE,YAAA,CAMA,cAAA,CADA,eAAA,CAHA,0BAAA,CAEA,gBAAA,CADA,iBAAA,CAFA,OCGJ,CDKE,uCAEE,kBAAA,CAMA,qBAAA,CACA,iBAAA,CACA,cAAA,CATA,YAAA,CAMA,WAAA,CAJA,sBAAA,CAEA,gBAAA,CADA,iBAAA,CAOA,kBAAA,CALA,UCEJ,CDKI,yCAGE,cAAA,CADA,WAAA,CADA,UCDN,CDMI,8FAEE,qBCLN,CDWE,iEACE,QCRJ,CDWM,0GACE,aCTR,CDYM,qLAEE,WCVR,CDgBA,gFACE,mBCbF,CDeE,uHACE,mBCbJ,CDeI,qJACE,SCbN,CDiBE,iHACE,YAAA,CACA,wBAAA,CACA,OCfJ,CDiBI,+IACE,SCfN,CDmBE,+GACE,QCjBJ,CDmBI,6HACE,YAAA,CACA,wBCjBN,CDmBM,iJACE,oBAAA,CACA,mBCjBR,CDqBI,mIACE,SCnBN,CDuBE,wNAEE,kBCrBJ,CDyBA,8BACE,sBCtBF","sources":["src/control.scss","%3Cinput%20css%20xEGFL3%3E"],"sourcesContent":[".customize-control-kirki-responsive {\r\n position: relative;\r\n z-index: 1; // Make it above it's children control.\r\n\r\n .customize-control-title {\r\n display: flex;\r\n }\r\n}\r\n\r\n.kirki-responsive {\r\n .kirki-device-buttons,\r\n .kirki-device-button {\r\n list-style: none;\r\n margin: 0;\r\n padding: 0;\r\n }\r\n\r\n .kirki-device-buttons {\r\n display: flex;\r\n top: 3px;\r\n justify-content: flex-start;\r\n position: relative;\r\n margin-left: 12px;\r\n font-weight: 600;\r\n font-size: 14px;\r\n }\r\n\r\n .kirki-device-button {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n margin-right: 3px;\r\n width: 22px;\r\n height: 22px;\r\n background-color: #eee;\r\n border-radius: 50%;\r\n cursor: pointer;\r\n transition: all 0.2s;\r\n\r\n i {\r\n width: 11px;\r\n height: 11px;\r\n font-size: 11px;\r\n }\r\n\r\n &.is-active,\r\n &:hover {\r\n background-color: #ddd;\r\n }\r\n }\r\n}\r\n\r\n[data-kirki-parent-responsive-id] {\r\n &.customize-control-kirki-switch {\r\n top: -5px;\r\n\r\n .kirki-switch {\r\n .kirki-toggle-switch-label {\r\n padding-top: 0;\r\n }\r\n\r\n .toggle-on,\r\n .toggle-off {\r\n bottom: -5px;\r\n }\r\n }\r\n }\r\n}\r\n\r\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] {\r\n margin-bottom: -35px;\r\n\r\n &.customize-control-kirki-react-colorful {\r\n margin-bottom: -30px;\r\n\r\n .kirki-trigger-circle-wrapper {\r\n z-index: 2; // Make it above the responsive devices.\r\n }\r\n }\r\n\r\n &.customize-control-kirki-checkbox {\r\n display: flex;\r\n justify-content: flex-end;\r\n top: 9px;\r\n\r\n [data-customize-setting-link] {\r\n z-index: 2;\r\n }\r\n }\r\n\r\n &.customize-control-kirki-toggle {\r\n top: 14px;\r\n\r\n .kirki-toggle {\r\n display: flex;\r\n justify-content: flex-end;\r\n\r\n .kirki-control-form {\r\n display: inline-block;\r\n display: inline-flex;\r\n }\r\n }\r\n\r\n .kirki-control-form {\r\n z-index: 2; // Make it above the responsive devices.\r\n }\r\n }\r\n\r\n .customize-control-title,\r\n .customize-control-description {\r\n padding-right: 25px;\r\n }\r\n}\r\n\r\n.kirki-responsive-item-hidden {\r\n display: none !important;\r\n}\r\n",".customize-control-kirki-responsive {\n position: relative;\n z-index: 1;\n}\n.customize-control-kirki-responsive .customize-control-title {\n display: flex;\n}\n\n.kirki-responsive .kirki-device-buttons,\n.kirki-responsive .kirki-device-button {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.kirki-responsive .kirki-device-buttons {\n display: flex;\n top: 3px;\n justify-content: flex-start;\n position: relative;\n margin-left: 12px;\n font-weight: 600;\n font-size: 14px;\n}\n.kirki-responsive .kirki-device-button {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n margin-right: 3px;\n width: 22px;\n height: 22px;\n background-color: #eee;\n border-radius: 50%;\n cursor: pointer;\n transition: all 0.2s;\n}\n.kirki-responsive .kirki-device-button i {\n width: 11px;\n height: 11px;\n font-size: 11px;\n}\n.kirki-responsive .kirki-device-button.is-active, .kirki-responsive .kirki-device-button:hover {\n background-color: #ddd;\n}\n\n[data-kirki-parent-responsive-id].customize-control-kirki-switch {\n top: -5px;\n}\n[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .kirki-toggle-switch-label {\n padding-top: 0;\n}\n[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .toggle-on,\n[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .toggle-off {\n bottom: -5px;\n}\n\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] {\n margin-bottom: -35px;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-react-colorful {\n margin-bottom: -30px;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-react-colorful .kirki-trigger-circle-wrapper {\n z-index: 2;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-checkbox {\n display: flex;\n justify-content: flex-end;\n top: 9px;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-checkbox [data-customize-setting-link] {\n z-index: 2;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle {\n top: 14px;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-toggle {\n display: flex;\n justify-content: flex-end;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-toggle .kirki-control-form {\n display: inline-block;\n display: inline-flex;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-control-form {\n z-index: 2;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] .customize-control-title,\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] .customize-control-description {\n padding-right: 25px;\n}\n\n.kirki-responsive-item-hidden {\n display: none !important;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"} packages/kirki-pro-responsive/dist/control.js.map 0000644 00000012753 14717762257 0016213 0 ustar 00 {"mappings":"gBAEWA,EACHC,IADGD,SACHC,EAAMC,GAAGC,YAwDX,WAgDD,SAAUC,EAAYC,GACvBL,EAAA,wBAAwBM,YAAA,aACtBN,EAAA,wBAAYK,GAAAE,SAAA,aACZP,EAAA,+BAAYO,SAAA,gCACXP,EAAG,+BAAAK,EAAA,MAAAC,YAAA,oCA3CDE,EAPJJ,EAAA,YAOII,EAAWC,SAAeC,iBAAkB,yBAChCC,iBAGXC,KAAkCJ,GAAAK,SAAA,SAAAC,KAC9BC,iBAAoB,SAAM,SAAAC,GAC/B,IAAAX,EAAAY,KAAAC,aAAA,qBAEJjB,EAAAkB,gBAAAC,IAAAf,SAkBCJ,EAAwBkB,gBAAAE,MAAA,SAAEC,GACDlB,EAAAkB,qEA1FR,WAEnB,IAAMC,EAAgBd,SAASC,iBAC7B,qCAEF,GAAKa,EAAcZ,OAAnB,CAGA,IAAIa,EAAgB,GAEpB,GAAGC,MAAMb,KAAKW,GAAeV,SAAQ,SAAUa,GAC7C,IAAMC,EAAqBD,EAAaE,QAAQC,wBAC1CxB,EAASqB,EAAaE,QAAQE,mBAC9BC,EAAUL,EAAaE,QAAQI,aAEhCR,EAAcS,SAASN,IAC1BH,EAAcU,KAAKP,SAckDlB,SAAAC,iBAAA,uCAAAqB,EAAA,MAEnEI,EAAexB,QAAQ,GAAAc,MAAAb,KAAAuB,GAA2BtB,SAAA,SAAAuB,GAGvDA,EAAAR,QAAAC,wBAAAF,EAEoDS,EAAAR,QAAAE,mBAAAzB,UAQnDQ,SAAe,SACQwB,GAExB,IAAAC,EAAAtC,EAAA,sBAAAqC,EAAA,0BACFC,EAAAC,KAAA,yBAAAF,GAEKC,EAAeE,SAAO,sBAAAH,EAAA","sources":["src/control.js"],"sourcesContent":["import \"./control.scss\";\r\n\r\n(function ($) {\r\n const api = wp.customize;\r\n\r\n const setupDevices = () => {\r\n // Get all controls which are responsive-able (not the device control it self).\r\n const childControls = document.querySelectorAll(\r\n \"[data-kirki-parent-responsive-id]\"\r\n );\r\n if (!childControls.length) return;\r\n\r\n // Responsive ids are collection of the id of the responsive controls (the device controls).\r\n let responsiveIds = [];\r\n\r\n [].slice.call(childControls).forEach(function (childControl) {\r\n const parentResponsiveId = childControl.dataset.kirkiParentResponsiveId;\r\n const device = childControl.dataset.kirkiDevicePreview;\r\n const setting = childControl.dataset.kirkiSetting;\r\n\r\n if (!responsiveIds.includes(parentResponsiveId)) {\r\n responsiveIds.push(parentResponsiveId);\r\n }\r\n\r\n /**\r\n * Grouped controls are collection of control which contains some child-controls.\r\n * Example of grouped controls: field-dimensions, field-typography, field-multicolor.\r\n */\r\n const groupedControls = document.querySelectorAll(\r\n '[data-kirki-parent-control-setting=\"' + setting + '\"]'\r\n );\r\n\r\n // Check if childControl is a field that groups other controls.\r\n if (groupedControls.length) {\r\n [].slice.call(groupedControls).forEach(function (groupedControl) {\r\n // Inherit the parentResponsiveId & device from the group's parent.\r\n groupedControl.dataset.kirkiParentResponsiveId = parentResponsiveId;\r\n groupedControl.dataset.kirkiDevicePreview = device;\r\n });\r\n }\r\n });\r\n\r\n // Move the device icons next to the control's title.\r\n responsiveIds.forEach(function (responsiveId) {\r\n const $deviceButtons = $(\r\n \"#customize-control-\" + responsiveId + \" .kirki-device-buttons\"\r\n );\r\n\r\n $deviceButtons.attr(\"data-kirki-devices-for\", responsiveId);\r\n\r\n $deviceButtons.appendTo(\r\n \"#customize-control-\" + responsiveId + \" .customize-control-title\"\r\n );\r\n });\r\n };\r\n\r\n const setupPreview = () => {\r\n function init() {\r\n switchDevice(\"desktop\"); // Initial state.\r\n setupDeviceClicks();\r\n syncPreviewButtons();\r\n }\r\n\r\n function setupDeviceClicks() {\r\n const deviceButtons = document.querySelectorAll(\".kirki-device-button\");\r\n if (!deviceButtons.length) return;\r\n\r\n // Loop through Kirki device buttons and assign the click event.\r\n [].slice.call(deviceButtons).forEach(function (deviceButton) {\r\n deviceButton.addEventListener(\"click\", function (e) {\r\n var device = this.getAttribute(\"data-kirki-device\");\r\n\r\n // Trigger WordPress device event.\r\n api.previewedDevice.set(device);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Sync device preview button from WordPress to Kirki and vice versa.\r\n */\r\n function syncPreviewButtons() {\r\n // Bind device changes from WordPress default.\r\n api.previewedDevice.bind(function (newDevice) {\r\n switchDevice(newDevice);\r\n });\r\n }\r\n\r\n /**\r\n * Setup device preview.\r\n *\r\n * @param string device The device (mobile, tablet, or desktop).\r\n */\r\n function switchDevice(device) {\r\n $(\".kirki-device-button\").removeClass(\"is-active\");\r\n $(\".kirki-device-button-\" + device).addClass(\"is-active\");\r\n\r\n $(\"[data-kirki-device-preview]\").addClass(\"kirki-responsive-item-hidden\");\r\n $('[data-kirki-device-preview=\"' + device + '\"]').removeClass(\r\n \"kirki-responsive-item-hidden\"\r\n );\r\n }\r\n\r\n init();\r\n };\r\n\r\n // Run setupDevices & setupPreview after the customizer is ready.\r\n wp.customize.bind(\"ready\", function () {\r\n setTimeout(function () {\r\n setupDevices();\r\n setupPreview();\r\n }, 250);\r\n });\r\n})(jQuery);\r\n"],"names":["$","api","wp","customize","switchDevice","device","removeClass","addClass","deviceButtons","document","querySelectorAll","length","call","forEach","deviceButton","addEventListener","e","this","getAttribute","previewedDevice","set","bind","newDevice","childControls","responsiveIds","slice","childControl","parentResponsiveId","dataset","kirkiParentResponsiveId","kirkiDevicePreview","setting","kirkiSetting","includes","push","groupedControls","groupedControl","responsiveId","$deviceButtons","attr","appendTo"],"version":3,"file":"control.js.map"} packages/kirki-pro-responsive/dist/control.css 0000644 00000005457 14717762257 0015616 0 ustar 00 .customize-control-kirki-responsive{position:relative;z-index:1}.customize-control-kirki-responsive .customize-control-title{display:flex}.kirki-responsive .kirki-device-button,.kirki-responsive .kirki-device-buttons{list-style:none;margin:0;padding:0}.kirki-responsive .kirki-device-buttons{display:flex;font-size:14px;font-weight:600;justify-content:flex-start;margin-left:12px;position:relative;top:3px}.kirki-responsive .kirki-device-button{align-items:center;background-color:#eee;border-radius:50%;cursor:pointer;display:flex;height:22px;justify-content:center;margin-right:3px;position:relative;transition:all .2s;width:22px}.kirki-responsive .kirki-device-button i{font-size:11px;height:11px;width:11px}.kirki-responsive .kirki-device-button.is-active,.kirki-responsive .kirki-device-button:hover{background-color:#ddd}[data-kirki-parent-responsive-id].customize-control-kirki-switch{top:-5px}[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .kirki-toggle-switch-label{padding-top:0}[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .toggle-off,[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .toggle-on{bottom:-5px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id]{margin-bottom:-35px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-react-colorful{margin-bottom:-30px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-react-colorful .kirki-trigger-circle-wrapper{z-index:2}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-checkbox{display:flex;justify-content:flex-end;top:9px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-checkbox [data-customize-setting-link]{z-index:2}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle{top:14px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-toggle{display:flex;justify-content:flex-end}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-toggle .kirki-control-form{display:inline-block;display:inline-flex}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-control-form{z-index:2}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] .customize-control-description,.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] .customize-control-title{padding-right:25px}.kirki-responsive-item-hidden{display:none!important} /*# sourceMappingURL=control.css.map */ packages/kirki-pro-responsive/composer.json 0000644 00000000300 14717762257 0015161 0 ustar 00 { "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\Responsive\\": "src" } } } packages/kirki-pro-responsive/kirki-pro-responsive.php 0000644 00000002644 14717762257 0017267 0 ustar 00 <?php /** * Plugin Name: Kirki PRO Responsive * Plugin URI: https://www.themeum.com/ * Description: Responsive control for Kirki Customizer Framework. * Version: 1.1 * Author: Themeum * Author URI: https://themeum.com/ * License: GPL-3.0 * License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=control%20input%20slider * Text Domain: kirki-pro-responsive * Domain Path: /languages * * @package kirki-pro-responsive */ defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'kirki_pro_load_responsive_control' ) ) { /** * Load responsive control. */ function kirki_pro_load_responsive_control() { // Stop, if Kirki is not installed. if ( ! defined( 'KIRKI_VERSION' ) ) { return; } // Stop, if Kirki PRO (bundle) is already installed. if ( defined( 'KIRKI_PRO_VERSION' ) ) { return; } // Stop, if Kirki Pro Responsive is already installed. if ( class_exists( '\Kirki\Pro\Responsive\Init' ) ) { return; } if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugin_data = get_plugin_data( __FILE__ ); define( 'KIRKI_PRO_RESPONSIVE_VERSION', $plugin_data['Version'] ); define( 'KIRKI_PRO_RESPONSIVE_PLUGIN_FILE', __FILE__ ); require_once __DIR__ . '/vendor/autoload.php'; new \Kirki\Pro\Responsive\Init(); } add_action( 'plugins_loaded', 'kirki_pro_load_responsive_control' ); } packages/kirki-pro-responsive/.gitignore 0000644 00000000063 14717762257 0014435 0 ustar 00 node_modules package-lock.json .parcel-cache builds packages/kirki-pro-tabs/edd/EDD_SL_Plugin_Updater.php 0000644 00000045025 14717762257 0016451 0 ustar 00 <?php defined( 'ABSPATH' ) || exit; /** * Allows plugins to use their own update API. * * @author Easy Digital Downloads * @version 1.9.1 */ class EDD_SL_Plugin_Updater { private $api_url = ''; private $api_data = array(); private $plugin_file = ''; private $name = ''; private $slug = ''; private $version = ''; private $wp_override = false; private $beta = false; private $failed_request_cache_key; /** * Class constructor. * * @uses plugin_basename() * @uses hook() * * @param string $_api_url The URL pointing to the custom API endpoint. * @param string $_plugin_file Path to the plugin file. * @param array $_api_data Optional data to send with API calls. */ public function __construct( $_api_url, $_plugin_file, $_api_data = null ) { global $edd_plugin_data; $this->api_url = trailingslashit( $_api_url ); $this->api_data = $_api_data; $this->plugin_file = $_plugin_file; $this->name = plugin_basename( $_plugin_file ); $this->slug = basename( $_plugin_file, '.php' ); $this->version = $_api_data['version']; $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false; $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; $this->failed_request_cache_key = 'edd_sl_failed_http_' . md5( $this->api_url ); $edd_plugin_data[ $this->slug ] = $this->api_data; /** * Fires after the $edd_plugin_data is setup. * * @since x.x.x * * @param array $edd_plugin_data Array of EDD SL plugin data. */ do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data ); // Set up hooks. $this->init(); } /** * Set up WordPress filters to hook into WP's update process. * * @uses add_filter() * * @return void */ public function init() { add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) ); add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 ); add_action( 'after_plugin_row', array( $this, 'show_update_notification' ), 10, 2 ); add_action( 'admin_init', array( $this, 'show_changelog' ) ); } /** * Check for Updates at the defined API endpoint and modify the update array. * * This function dives into the update API just when WordPress creates its update array, * then adds a custom API call and injects the custom plugin data retrieved from the API. * It is reassembled from parts of the native WordPress plugin update code. * See wp-includes/update.php line 121 for the original wp_update_plugins() function. * * @uses api_request() * * @param array $_transient_data Update array build by WordPress. * @return array Modified update array with custom plugin data. */ public function check_update( $_transient_data ) { global $pagenow; if ( ! is_object( $_transient_data ) ) { $_transient_data = new stdClass(); } if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { return $_transient_data; } $current = $this->get_repo_api_data(); if ( false !== $current && is_object( $current ) && isset( $current->new_version ) ) { if ( version_compare( $this->version, $current->new_version, '<' ) ) { $_transient_data->response[ $this->name ] = $current; } else { // Populating the no_update information is required to support auto-updates in WordPress 5.5. $_transient_data->no_update[ $this->name ] = $current; } } $_transient_data->last_checked = time(); $_transient_data->checked[ $this->name ] = $this->version; return $_transient_data; } /** * Get repo API data from store. * Save to cache. * * @return \stdClass */ public function get_repo_api_data() { $version_info = $this->get_cached_version_info(); if ( false === $version_info ) { $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta, ) ); if ( ! $version_info ) { return false; } // This is required for your plugin to support auto-updates in WordPress 5.5. $version_info->plugin = $this->name; $version_info->id = $this->name; $this->set_version_info_cache( $version_info ); } return $version_info; } /** * Show the update notification on multisite subsites. * * @param string $file * @param array $plugin */ public function show_update_notification( $file, $plugin ) { // Return early if in the network admin, or if this is not a multisite install. if ( is_network_admin() || ! is_multisite() ) { return; } // Allow single site admins to see that an update is available. if ( ! current_user_can( 'activate_plugins' ) ) { return; } if ( $this->name !== $file ) { return; } // Do not print any message if update does not exist. $update_cache = get_site_transient( 'update_plugins' ); if ( ! isset( $update_cache->response[ $this->name ] ) ) { if ( ! is_object( $update_cache ) ) { $update_cache = new stdClass(); } $update_cache->response[ $this->name ] = $this->get_repo_api_data(); } // Return early if this plugin isn't in the transient->response or if the site is running the current or newer version of the plugin. if ( empty( $update_cache->response[ $this->name ] ) || version_compare( $this->version, $update_cache->response[ $this->name ]->new_version, '>=' ) ) { return; } printf( '<tr class="plugin-update-tr %3$s" id="%1$s-update" data-slug="%1$s" data-plugin="%2$s">', $this->slug, $file, in_array( $this->name, $this->get_active_plugins(), true ) ? 'active' : 'inactive' ); echo '<td colspan="3" class="plugin-update colspanchange">'; echo '<div class="update-message notice inline notice-warning notice-alt"><p>'; $changelog_link = ''; if ( ! empty( $update_cache->response[ $this->name ]->sections->changelog ) ) { $changelog_link = add_query_arg( array( 'edd_sl_action' => 'view_plugin_changelog', 'plugin' => urlencode( $this->name ), 'slug' => urlencode( $this->slug ), 'TB_iframe' => 'true', 'width' => 77, 'height' => 911, ), self_admin_url( 'index.php' ) ); } $update_link = add_query_arg( array( 'action' => 'upgrade-plugin', 'plugin' => urlencode( $this->name ), ), self_admin_url( 'update.php' ) ); printf( /* translators: the plugin name. */ esc_html__( 'There is a new version of %1$s available.', 'easy-digital-downloads' ), esc_html( $plugin['Name'] ) ); if ( ! current_user_can( 'update_plugins' ) ) { echo ' '; esc_html_e( 'Contact your network administrator to install the update.', 'easy-digital-downloads' ); } elseif ( empty( $update_cache->response[ $this->name ]->package ) && ! empty( $changelog_link ) ) { echo ' '; printf( /* translators: 1. opening anchor tag, do not translate 2. the new plugin version 3. closing anchor tag, do not translate. */ __( '%1$sView version %2$s details%3$s.', 'easy-digital-downloads' ), '<a target="_blank" class="thickbox open-plugin-details-modal" href="' . esc_url( $changelog_link ) . '">', esc_html( $update_cache->response[ $this->name ]->new_version ), '</a>' ); } elseif ( ! empty( $changelog_link ) ) { echo ' '; printf( __( '%1$sView version %2$s details%3$s or %4$supdate now%5$s.', 'easy-digital-downloads' ), '<a target="_blank" class="thickbox open-plugin-details-modal" href="' . esc_url( $changelog_link ) . '">', esc_html( $update_cache->response[ $this->name ]->new_version ), '</a>', '<a target="_blank" class="update-link" href="' . esc_url( wp_nonce_url( $update_link, 'upgrade-plugin_' . $file ) ) . '">', '</a>' ); } else { printf( ' %1$s%2$s%3$s', '<a target="_blank" class="update-link" href="' . esc_url( wp_nonce_url( $update_link, 'upgrade-plugin_' . $file ) ) . '">', esc_html__( 'Update now.', 'easy-digital-downloads' ), '</a>' ); } do_action( "in_plugin_update_message-{$file}", $plugin, $plugin ); echo '</p></div></td></tr>'; } /** * Gets the plugins active in a multisite network. * * @return array */ private function get_active_plugins() { $active_plugins = (array) get_option( 'active_plugins' ); $active_network_plugins = (array) get_site_option( 'active_sitewide_plugins' ); return array_merge( $active_plugins, array_keys( $active_network_plugins ) ); } /** * Updates information on the "View version x.x details" page with custom data. * * @uses api_request() * * @param mixed $_data * @param string $_action * @param object $_args * @return object $_data */ public function plugins_api_filter( $_data, $_action = '', $_args = null ) { if ( 'plugin_information' !== $_action ) { return $_data; } if ( ! isset( $_args->slug ) || ( $_args->slug !== $this->slug ) ) { return $_data; } $to_send = array( 'slug' => $this->slug, 'is_ssl' => is_ssl(), 'fields' => array( 'banners' => array(), 'reviews' => false, 'icons' => array(), ), ); // Get the transient where we store the api request for this plugin for 24 hours $edd_api_request_transient = $this->get_cached_version_info(); // If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now. if ( empty( $edd_api_request_transient ) ) { $api_response = $this->api_request( 'plugin_information', $to_send ); // Expires in 3 hours $this->set_version_info_cache( $api_response ); if ( false !== $api_response ) { $_data = $api_response; } } else { $_data = $edd_api_request_transient; } // Convert sections into an associative array, since we're getting an object, but Core expects an array. if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { $_data->sections = $this->convert_object_to_array( $_data->sections ); } // Convert banners into an associative array, since we're getting an object, but Core expects an array. if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { $_data->banners = $this->convert_object_to_array( $_data->banners ); } // Convert icons into an associative array, since we're getting an object, but Core expects an array. if ( isset( $_data->icons ) && ! is_array( $_data->icons ) ) { $_data->icons = $this->convert_object_to_array( $_data->icons ); } // Convert contributors into an associative array, since we're getting an object, but Core expects an array. if ( isset( $_data->contributors ) && ! is_array( $_data->contributors ) ) { $_data->contributors = $this->convert_object_to_array( $_data->contributors ); } if ( ! isset( $_data->plugin ) ) { $_data->plugin = $this->name; } return $_data; } /** * Convert some objects to arrays when injecting data into the update API * * Some data like sections, banners, and icons are expected to be an associative array, however due to the JSON * decoding, they are objects. This method allows us to pass in the object and return an associative array. * * @since 3.6.5 * * @param stdClass $data * * @return array */ private function convert_object_to_array( $data ) { if ( ! is_array( $data ) && ! is_object( $data ) ) { return array(); } $new_data = array(); foreach ( $data as $key => $value ) { $new_data[ $key ] = is_object( $value ) ? $this->convert_object_to_array( $value ) : $value; } return $new_data; } /** * Disable SSL verification in order to prevent download update failures * * @param array $args * @param string $url * @return object $array */ public function http_request_args( $args, $url ) { if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) { $args['sslverify'] = $this->verify_ssl(); } return $args; } /** * Calls the API and, if successfull, returns the object delivered by the API. * * @uses get_bloginfo() * @uses wp_remote_post() * @uses is_wp_error() * * @param string $_action The requested action. * @param array $_data Parameters for the API action. * @return false|object|void */ private function api_request( $_action, $_data ) { $data = array_merge( $this->api_data, $_data ); if ( $data['slug'] !== $this->slug ) { return; } // Don't allow a plugin to ping itself if ( trailingslashit( home_url() ) === $this->api_url ) { return false; } if ( $this->request_recently_failed() ) { return false; } return $this->get_version_from_remote(); } /** * Determines if a request has recently failed. * * @since 1.9.1 * * @return bool */ private function request_recently_failed() { $failed_request_details = get_option( $this->failed_request_cache_key ); // Request has never failed. if ( empty( $failed_request_details ) || ! is_numeric( $failed_request_details ) ) { return false; } /* * Request previously failed, but the timeout has expired. * This means we're allowed to try again. */ if ( time() > $failed_request_details ) { delete_option( $this->failed_request_cache_key ); return false; } return true; } /** * Logs a failed HTTP request for this API URL. * We set a timestamp for 1 hour from now. This prevents future API requests from being * made to this domain for 1 hour. Once the timestamp is in the past, API requests * will be allowed again. This way if the site is down for some reason we don't bombard * it with failed API requests. * * @see EDD_SL_Plugin_Updater::request_recently_failed * * @since 1.9.1 */ private function log_failed_request() { update_option( $this->failed_request_cache_key, strtotime( '+1 hour' ) ); } /** * If available, show the changelog for sites in a multisite install. */ public function show_changelog() { if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { return; } if ( empty( $_REQUEST['plugin'] ) ) { return; } if ( empty( $_REQUEST['slug'] ) || $this->slug !== $_REQUEST['slug'] ) { return; } if ( ! current_user_can( 'update_plugins' ) ) { wp_die( esc_html__( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); } $version_info = $this->get_repo_api_data(); if ( isset( $version_info->sections ) ) { $sections = $this->convert_object_to_array( $version_info->sections ); if ( ! empty( $sections['changelog'] ) ) { echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>'; } } exit; } /** * Gets the current version information from the remote site. * * @return array|false */ private function get_version_from_remote() { $api_params = array( 'edd_action' => 'get_version', 'license' => ! empty( $this->api_data['license'] ) ? $this->api_data['license'] : '', 'item_name' => isset( $this->api_data['item_name'] ) ? $this->api_data['item_name'] : false, 'item_id' => isset( $this->api_data['item_id'] ) ? $this->api_data['item_id'] : false, 'version' => isset( $this->api_data['version'] ) ? $this->api_data['version'] : false, 'slug' => $this->slug, 'author' => $this->api_data['author'], 'url' => home_url(), 'beta' => $this->beta, 'php_version' => phpversion(), 'wp_version' => get_bloginfo( 'version' ), ); /** * Filters the parameters sent in the API request. * * @param array $api_params The array of data sent in the request. * @param array $this->api_data The array of data set up in the class constructor. * @param string $this->plugin_file The full path and filename of the file. */ $api_params = apply_filters( 'edd_sl_plugin_updater_api_params', $api_params, $this->api_data, $this->plugin_file ); $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $this->verify_ssl(), 'body' => $api_params, ) ); if ( is_wp_error( $request ) || ( 200 !== wp_remote_retrieve_response_code( $request ) ) ) { $this->log_failed_request(); return false; } $request = json_decode( wp_remote_retrieve_body( $request ) ); if ( $request && isset( $request->sections ) ) { $request->sections = maybe_unserialize( $request->sections ); } else { $request = false; } if ( $request && isset( $request->banners ) ) { $request->banners = maybe_unserialize( $request->banners ); } if ( $request && isset( $request->icons ) ) { $request->icons = maybe_unserialize( $request->icons ); } if ( ! empty( $request->sections ) ) { foreach ( $request->sections as $key => $section ) { $request->$key = (array) $section; } } return $request; } /** * Get the version info from the cache, if it exists. * * @param string $cache_key * @return object */ public function get_cached_version_info( $cache_key = '' ) { if ( empty( $cache_key ) ) { $cache_key = $this->get_cache_key(); } $cache = get_option( $cache_key ); // Cache is expired if ( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) { return false; } // We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point. $cache['value'] = json_decode( $cache['value'] ); if ( ! empty( $cache['value']->icons ) ) { $cache['value']->icons = (array) $cache['value']->icons; } return $cache['value']; } /** * Adds the plugin version information to the database. * * @param string $value * @param string $cache_key */ public function set_version_info_cache( $value = '', $cache_key = '' ) { if ( empty( $cache_key ) ) { $cache_key = $this->get_cache_key(); } $data = array( 'timeout' => strtotime( '+3 hours', time() ), 'value' => wp_json_encode( $value ), ); update_option( $cache_key, $data, 'no' ); // Delete the duplicate option delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) ); } /** * Returns if the SSL of the store should be verified. * * @since 1.6.13 * @return bool */ private function verify_ssl() { return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this ); } /** * Gets the unique key (option name) for a plugin. * * @since 1.9.0 * @return string */ private function get_cache_key() { $string = $this->slug . $this->api_data['license'] . $this->beta; return 'edd_sl_' . md5( serialize( $string ) ); } } packages/kirki-pro-tabs/composer.lock 0000644 00000001124 14717762257 0013701 0 ustar 00 { "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "8181a175698d243d8d964c66dc8e9b4c", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } packages/kirki-pro-tabs/kirki-pro-tabs.php 0000644 00000002637 14717762257 0014561 0 ustar 00 <?php /** * Plugin Name: Kirki PRO Tabs * Plugin URI: https://www.themeum.com/ * Description: Tab control for Kirki Customizer Framework. * Version: 1.1 * Author: Themeum * Author URI: https://themeum.com/ * License: GPL-3.0 * License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=control%20tab * Text Domain: kirki-pro-tabs * Domain Path: /languages * * @package kirki-pro-tabs */ defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'kirki_pro_load_tab_control' ) ) { /** * Load tab control inside "plugins_loaded" hook. * This is necessary to check if Kirki plugin is installed. */ function kirki_pro_load_tab_control() { // Stop, if Kirki is not installed. if ( ! defined( 'KIRKI_VERSION' ) ) { return; } // Stop, if Kirki PRO (bundle) is already installed. if ( defined( 'KIRKI_PRO_VERSION' ) ) { return; } // Stop, if Kirki Pro Tabs is already installed. if ( class_exists( '\Kirki\Pro\Tabs\Init' ) ) { return; } if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugin_data = get_plugin_data( __FILE__ ); define( 'KIRKI_PRO_TAB_VERSION', $plugin_data['Version'] ); define( 'KIRKI_PRO_TAB_PLUGIN_FILE', __FILE__ ); require_once __DIR__ . '/vendor/autoload.php'; new \Kirki\Pro\Tabs\Init(); } add_action( 'plugins_loaded', 'kirki_pro_load_tab_control' ); } packages/kirki-pro-tabs/readme.txt 0000644 00000000505 14717762257 0013200 0 ustar 00 === Kirki Tab Control === Contributors: davidvongries Tags: kirki-tabs-module Requires at least: 5.2 Tested up to: 5.9 Requires PHP: 7.0 License: GPL-3.0 License License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=kirki%20pro%20tabs == Description == Tab extension for Kirki Customizer Framework. packages/kirki-pro-tabs/vendor/autoload.php 0000644 00000001403 14717762257 0015016 0 ustar 00 <?php // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, $err); } elseif (!headers_sent()) { echo $err; } } trigger_error( $err, E_USER_ERROR ); } require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit56a8a99d8c63b9f1227717dc63c34409::getLoader(); packages/kirki-pro-tabs/vendor/composer/autoload_namespaces.php 0000644 00000000213 14717762257 0021042 0 ustar 00 <?php // autoload_namespaces.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( ); packages/kirki-pro-tabs/vendor/composer/LICENSE 0000644 00000002056 14717762257 0015336 0 ustar 00 Copyright (c) Nils Adermann, Jordi Boggiano 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. packages/kirki-pro-tabs/vendor/composer/autoload_psr4.php 0000644 00000000471 14717762257 0017621 0 ustar 00 <?php // autoload_psr4.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Kirki\\Pro\\Tabs\\' => array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); packages/kirki-pro-tabs/vendor/composer/autoload_real.php 0000644 00000002161 14717762257 0017652 0 ustar 00 <?php // autoload_real.php @generated by Composer class ComposerAutoloaderInit56a8a99d8c63b9f1227717dc63c34409 { private static $loader; public static function loadClassLoader($class) { if ('Composer\Autoload\ClassLoader' === $class) { require __DIR__ . '/ClassLoader.php'; } } /** * @return \Composer\Autoload\ClassLoader */ public static function getLoader() { if (null !== self::$loader) { return self::$loader; } require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit56a8a99d8c63b9f1227717dc63c34409', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit56a8a99d8c63b9f1227717dc63c34409', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInit56a8a99d8c63b9f1227717dc63c34409::getInitializer($loader)); $loader->register(true); return $loader; } } packages/kirki-pro-tabs/vendor/composer/platform_check.php 0000644 00000001635 14717762257 0020025 0 ustar 00 <?php // platform_check.php @generated by Composer $issues = array(); if (!(PHP_VERSION_ID >= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); } elseif (!headers_sent()) { echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; } } trigger_error( 'Composer detected issues in your platform: ' . implode(' ', $issues), E_USER_ERROR ); } packages/kirki-pro-tabs/vendor/composer/ClassLoader.php 0000644 00000040220 14717762257 0017231 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Autoload; /** * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. * * $loader = new \Composer\Autoload\ClassLoader(); * * // register classes with namespaces * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * * // activate the autoloader * $loader->register(); * * // to enable searching the include path (eg. for PEAR packages) * $loader->setUseIncludePath(true); * * In this example, if you try to use a class in the Symfony\Component * namespace or one of its children (Symfony\Component\Console for instance), * the autoloader will first look for the class under the component/ * directory, and it will then fallback to the framework/ directory if not * found before giving up. * * This class is loosely based on the Symfony UniversalClassLoader. * * @author Fabien Potencier <fabien@symfony.com> * @author Jordi Boggiano <j.boggiano@seld.be> * @see https://www.php-fig.org/psr/psr-0/ * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { /** @var \Closure(string):void */ private static $includeFile; /** @var ?string */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array<string, array<string, int>> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array<string, array<int, string>> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array<string, array<string, string[]>> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array<string, string> */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array<string, bool> */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array<string, array<int, string>> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array<string, string> */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array<string, string> $classMap * * @return void */ public function addClassMap(array $classMap) { if ($this->classMap) { $this->classMap = array_merge($this->classMap, $classMap); } else { $this->classMap = $classMap; } } /** * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 root directories * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $paths ); } } /** * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { // Register directories for a new namespace. $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $paths ); } } /** * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 base directories * * @return void */ public function set($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr0 = (array) $paths; } else { $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; } } /** * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * * @return void */ public function setPsr4($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr4 = (array) $paths; } else { $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } } /** * Turns on searching the include path for class files. * * @param bool $useIncludePath * * @return void */ public function setUseIncludePath($useIncludePath) { $this->useIncludePath = $useIncludePath; } /** * Can be used to check if the autoloader uses the include path to check * for classes. * * @return bool */ public function getUseIncludePath() { return $this->useIncludePath; } /** * Turns off searching the prefix and fallback directories for classes * that have not been registered with the class map. * * @param bool $classMapAuthoritative * * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { $this->classMapAuthoritative = $classMapAuthoritative; } /** * Should class lookup fail if not found in the current class map? * * @return bool */ public function isClassMapAuthoritative() { return $this->classMapAuthoritative; } /** * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix * * @return void */ public function setApcuPrefix($apcuPrefix) { $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** * The APCu prefix in use, or null if APCu caching is not enabled. * * @return string|null */ public function getApcuPrefix() { return $this->apcuPrefix; } /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not * * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { return; } if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); self::$registeredLoaders[$this->vendorDir] = $this; } } /** * Unregisters this instance as an autoloader. * * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); if (null !== $this->vendorDir) { unset(self::$registeredLoaders[$this->vendorDir]); } } /** * Loads the given class or interface. * * @param string $class The name of the class * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { $includeFile = self::$includeFile; $includeFile($file); return true; } return null; } /** * Finds the path to the file where the class is defined. * * @param string $class The name of the class * * @return string|false The path if found, false otherwise */ public function findFile($class) { // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } if (null !== $this->apcuPrefix) { $file = apcu_fetch($this->apcuPrefix.$class, $hit); if ($hit) { return $file; } } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM if (false === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } if (null !== $this->apcuPrefix) { apcu_add($this->apcuPrefix.$class, $file); } if (false === $file) { // Remember that this class does not exist. $this->missingClasses[$class] = true; } return $file; } /** * Returns the currently registered loaders indexed by their corresponding vendor directories. * * @return self[] */ public static function getRegisteredLoaders() { return self::$registeredLoaders; } /** * @param string $class * @param string $ext * @return string|false */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { if (file_exists($file = $dir . $pathEnd)) { return $file; } } } } } // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } // PSR-0 lookup if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); } else { // PEAR-like class name $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; } if (isset($this->prefixesPsr0[$first])) { foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } } } } // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } // PSR-0 include paths. if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } return false; } /** * @return void */ private static function initializeIncludeClosure() { if (self::$includeFile !== null) { return; } /** * Scope isolated include. * * Prevents access to $this/self from included files. * * @param string $file * @return void */ self::$includeFile = \Closure::bind(static function($file) { include $file; }, null, null); } } packages/kirki-pro-tabs/vendor/composer/autoload_classmap.php 0000644 00000000336 14717762257 0020534 0 ustar 00 <?php // autoload_classmap.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-tabs/vendor/composer/autoload_static.php 0000644 00000002546 14717762257 0020225 0 ustar 00 <?php // autoload_static.php @generated by Composer namespace Composer\Autoload; class ComposerStaticInit56a8a99d8c63b9f1227717dc63c34409 { public static $prefixLengthsPsr4 = array ( 'K' => array ( 'Kirki\\Pro\\Tabs\\' => 15, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\Tabs\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit56a8a99d8c63b9f1227717dc63c34409::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit56a8a99d8c63b9f1227717dc63c34409::$prefixDirsPsr4; $loader->classMap = ComposerStaticInit56a8a99d8c63b9f1227717dc63c34409::$classMap; }, null, ClassLoader::class); } } packages/kirki-pro-tabs/vendor/composer/InstalledVersions.php 0000644 00000037417 14717762257 0020523 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; /** * This class is copied in every Composer installed project and available to all * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` * * @final */ class InstalledVersions { /** * @var mixed[]|null * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static $installedByVendor = array(); /** * Returns a list of all package names which are present, either by being installed, replaced or provided * * @return string[] * @psalm-return list<string> */ public static function getInstalledPackages() { $packages = array(); foreach (self::getInstalled() as $installed) { $packages[] = array_keys($installed['versions']); } if (1 === \count($packages)) { return $packages[0]; } return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); } /** * Returns a list of all package names with a specific type e.g. 'library' * * @param string $type * @return string[] * @psalm-return list<string> */ public static function getInstalledPackagesByType($type) { $packagesByType = array(); foreach (self::getInstalled() as $installed) { foreach ($installed['versions'] as $name => $package) { if (isset($package['type']) && $package['type'] === $type) { $packagesByType[] = $name; } } } return $packagesByType; } /** * Checks whether the given package is installed * * This also returns true if the package name is provided or replaced by another package * * @param string $packageName * @param bool $includeDevRequirements * @return bool */ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } return false; } /** * Checks whether the given package satisfies a version constraint * * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: * * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') * * @param VersionParser $parser Install composer/semver to have access to this class and functionality * @param string $packageName * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package * @return bool */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); } /** * Returns a version constraint representing all the range(s) which are installed for a given package * * It is easier to use this via isInstalled() with the $constraint argument if you need to check * whether a given version of a package is installed, and not just whether it exists * * @param string $packageName * @return string Version constraint usable with composer/semver */ public static function getVersionRanges($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } $ranges = array(); if (isset($installed['versions'][$packageName]['pretty_version'])) { $ranges[] = $installed['versions'][$packageName]['pretty_version']; } if (array_key_exists('aliases', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); } if (array_key_exists('replaced', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); } if (array_key_exists('provided', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); } return implode(' || ', $ranges); } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['version'])) { return null; } return $installed['versions'][$packageName]['version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getPrettyVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['pretty_version'])) { return null; } return $installed['versions'][$packageName]['pretty_version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference */ public static function getReference($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['reference'])) { return null; } return $installed['versions'][$packageName]['reference']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. */ public static function getInstallPath($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @return array * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { $installed = self::getInstalled(); return $installed[0]['root']; } /** * Returns the raw installed.php data for custom implementations * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} */ public static function getRawData() { @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { self::$installed = include __DIR__ . '/installed.php'; } else { self::$installed = array(); } } return self::$installed; } /** * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ public static function getAllRawData() { return self::getInstalled(); } /** * Lets you reload the static array from another file * * This is only useful for complex integrations in which a project needs to use * this class but then also needs to execute another project's autoloader in process, * and wants to ensure both projects have access to their version of installed.php. * * A typical case would be PHPUnit, where it would need to make sure it reads all * the data it needs from this class, then call reload() with * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure * the project in which it runs can then also use this class safely, without * interference between PHPUnit's dependencies and the project's dependencies. * * @param array[] $data A vendor/composer/installed.php data set * @return void * * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static function getInstalled() { if (null === self::$canGetVendors) { self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); } $installed = array(); if (self::$canGetVendors) { foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require $vendorDir.'/composer/installed.php'; $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } } } } if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } packages/kirki-pro-tabs/vendor/composer/installed.json 0000644 00000000105 14717762257 0017174 0 ustar 00 { "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-tabs/vendor/composer/installed.php 0000644 00000001344 14717762257 0017020 0 ustar 00 <?php return array( 'root' => array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); packages/kirki-pro-tabs/src/Init.php 0000644 00000004020 14717762257 0013401 0 ustar 00 <?php /** * Init the Kirki PRO's tab package. * * @package kirki-pro-tabs * @since 1.0.0 */ namespace Kirki\Pro\Tabs; use Kirki\Pro\Field\Tabs; /** * Manage the tabs package. */ class Init { /** * The class constructor. */ public function __construct() { add_filter( 'kirki_control_types', [ $this, 'control_type' ] ); add_filter( 'kirki_field_add_control_args', array( $this, 'filter_control_args' ), 10, 2 ); add_action( 'kirki_section_init', [ $this, 'add_tab' ], 10, 2 ); } /** * The control type. * * @param array $control_types The existing control types. */ public function control_type( $control_types ) { $control_types['kirki-tab'] = 'Kirki\Pro\Control\Tabs'; return $control_types; } /** * Filter customizer's control arguments. * * @since 1.0.0 * * @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 ( isset( $args['tab'] ) ) { $tabs = Tabs::$tabs; $section = $args['section']; if ( isset( $tabs[ $section ] ) ) { $tab_wrapper_attrs = array( 'data-kirki-parent-tab-id' => $section, 'data-kirki-parent-tab-item' => isset( $args['tab'] ) ? $args['tab'] : '', ); if ( isset( $args['wrapper_attrs'] ) ) { $args['wrapper_attrs'] = array_merge( $args['wrapper_attrs'], $tab_wrapper_attrs ); } else { $args['wrapper_attrs'] = $tab_wrapper_attrs; } } } return $args; } /** * Add the tab by creating custom control using Kirki API. * * @since 1.0.0 * * @param string $section_id The The section id. * @param array $args The section args. */ public function add_tab( $section_id, $args ) { if ( ! isset( $args['tabs'] ) ) { return; } new \Kirki\Pro\Field\Tabs( [ 'settings' => 'kirki_tabs_' . $section_id, 'section' => $section_id, 'priority' => 0, 'choices' => [ 'tabs' => $args['tabs'], ], ] ); } } packages/kirki-pro-tabs/src/control.js 0000644 00000004444 14717762257 0014015 0 ustar 00 import "./control.scss"; (function ($) { const setupTabs = () => { const childControls = document.querySelectorAll( "[data-kirki-parent-tab-id]" ); if (!childControls.length) return; let tabIds = []; [].slice.call(childControls).forEach(function (childControl) { const parentTabId = childControl.dataset.kirkiParentTabId; if (!tabIds.includes(parentTabId)) { tabIds.push(parentTabId); } }); const switchTabs = (tabId, tabItemName) => { $('[data-kirki-tab-id="' + tabId + '"] .kirki-tab-menu-item').removeClass( "is-active" ); const tabMenuItem = document.querySelector( '[data-kirki-tab-id="' + tabId + '"] [data-kirki-tab-menu-id="' + tabItemName + '"]' ); if (tabMenuItem) tabMenuItem.classList.add("is-active"); const tabItems = document.querySelectorAll( '[data-kirki-parent-tab-id="' + tabId + '"]' ); [].slice.call(tabItems).forEach(function (tabItem) { if (tabItem.dataset.kirkiParentTabItem === tabItemName) { tabItem.classList.remove("kirki-tab-item-hidden"); } else { tabItem.classList.add("kirki-tab-item-hidden"); } }); }; const setupTabClicks = () => { $(document).on("click", ".kirki-tab-menu-item a", function (e) { e.preventDefault(); const tabId = this.parentNode.parentNode.parentNode.dataset.kirkiTabId; const tabItemName = this.parentNode.dataset.kirkiTabMenuId; switchTabs(tabId, tabItemName); }); }; const setupBindings = () => { tabIds.forEach(function (tabId) { wp.customize.section(tabId, function (section) { section.expanded.bind(function (isExpanded) { if (isExpanded) { const activeTabMenu = document.querySelector( '[data-kirki-tab-id="' + tabId + '"] .kirki-tab-menu-item.is-active' ); if (activeTabMenu) { switchTabs(tabId, activeTabMenu.dataset.kirkiTabMenuId); } } }); }); }); }; setupTabClicks(); setupBindings(); }; wp.customize.bind("ready", function () { setupTabs(); }); })(jQuery); packages/kirki-pro-tabs/src/control.scss 0000644 00000002055 14717762257 0014350 0 ustar 00 .rtl { .customize-control-kirki-tab { left: 0; right: -24px; } } .customize-control-kirki-tab { position: relative; left: -24px; width: calc(100% + 48px); } .kirki-tab { .kirki-tab-menu, .kirki-tab-menu-item { list-style: none; margin: 0; padding: 0; } .kirki-tab-menu { display: flex; flex-wrap: wrap; position: relative; margin-bottom: 12px; font-weight: 600; font-size: 14px; border-bottom: 1px solid #ddd; } .kirki-tab-menu-item { position: relative; flex-grow: 1; a { display: flex; align-items: center; justify-content: center; padding-left: 15px; padding-right: 15px; height: 50px; position: relative; border-bottom: 2px solid transparent; text-decoration: none; &:focus { box-shadow: none; } &:active, &:focus { color: #2271b1; } } &.is-active { a { border-color: #2271b1; } } } } .kirki-tab-item-hidden { display: none !important; } packages/kirki-pro-tabs/src/Field/Tabs.php 0000644 00000004232 14717762257 0014417 0 ustar 00 <?php // phpcs:disable PHPCompatibility.FunctionDeclarations.NewClosure /** * Override field methods * * @package kirki-pro-tabs * @since 1.0 */ namespace Kirki\Pro\Field; use Kirki\Field; /** * Field overrides. * * @since 1.0 */ class Tabs extends Field { /** * The field type. * * @since 1.0 * @var string */ public $type = 'kirki-tab'; /** * The control class-name. * * @since 1.0 * @var string */ protected $control_class = '\Kirki\Pro\Control\Tabs'; /** * Whether we should register the control class for JS-templating or not. * * @access protected * @since 1.0 * @var bool */ protected $control_has_js_template = true; /** * Array of tabs collection. * * @since 1.0.0 * @var array */ public static $tabs = []; /** * Constructor. * Registers any hooks we need to run. * * @since 1.0.0 * @param array $args The field arguments. */ public function __construct( $args ) { parent::__construct( $args ); self::$tabs[ $args['section'] ] = $args['choices']['tabs']; } /** * Filter arguments before creating the setting. * * @since 1.0 * * @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'] = '__return_null'; } } return $args; } /** * Filter arguments before creating the control. * * @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-tab'; } return $args; } } packages/kirki-pro-tabs/src/Control/Tabs.php 0000644 00000004547 14717762257 0015025 0 ustar 00 <?php /** * Customizer Control: kirki-tab. * * @package kirki-pro-tabs * @since 1.0 */ namespace Kirki\Pro\Control; use Kirki\Control\Base; use Kirki\URL; // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Tab control */ class Tabs extends Base { /** * The control type. * * @since 1.0 * @var string */ public $type = 'kirki-tab'; /** * The version. Used in scripts & styles for cache-busting. * * @since 1.0 * @var string */ public static $control_ver = '1.0.0.1'; /** * Enqueue control related styles/scripts. * * @since 1.0 * @access public */ public function enqueue() { parent::enqueue(); // Enqueue the style. wp_enqueue_style( 'kirki-control-tabs', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver ); // Enqueue the script. wp_enqueue_script( 'kirki-control-tabs', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'jquery', 'customize-base', 'customize-controls' ], self::$control_ver, true ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @access public * @since 1.0 * @see WP_Customize_Control::to_json() * @return void */ public function to_json() { // Get the basics from the parent class. parent::to_json(); $tabs = isset( $this->choices['tabs'] ) ? $this->choices['tabs'] : []; $tab_menu = ''; $loop_index = 0; foreach ( $tabs as $tab_id => $tab_args ) { $loop_index++; $tab_menu .= ' <li class="kirki-tab-menu-item' . ( 1 === $loop_index ? ' is-active' : '' ) . '" data-kirki-tab-menu-id="' . esc_attr( $tab_id ) . '"> <a href="#" class="kirki-tab-link">' . esc_html( $tab_args['label'] ) . '</a> </li> '; } $this->json['choices']['section'] = $this->section; $this->json['tabMenu'] = $tab_menu; } /** * 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() * @since 1.0 */ protected function content_template() { ?> <div class="kirki-tab" data-kirki-tab-id="{{{ data.section }}}"> <ul class="kirki-tab-menu"> {{{ data.tabMenu }}} </ul> </div> <?php } } packages/kirki-pro-tabs/package.json 0000644 00000001267 14717762257 0013476 0 ustar 00 { "name": "kirki-pro-tabs", "version": "1.1", "description": "Dev toolkit for kirki-pro-tabs", "keywords": [ "kirki-pro-tabs" ], "author": "Kirki", "license": "MIT", "bugs": { "url": "https://www.themeum.com/" }, "homepage": "https://www.themeum.com/", "devDependencies": { "@parcel/transformer-sass": "^2.2.1", "parcel": "^2.2.1" }, "source": "src/control.js", "scripts": { "build": "parcel build", "dev": "parcel build --no-optimize" }, "alias": { "jquery": { "global": "jQuery" }, "wp": { "global": "wp" }, "react": { "global": "React" }, "react-dom": { "global": "ReactDOM" } }, "browserslist": "> 0.5%, last 2 versions, not dead" } packages/kirki-pro-tabs/dist/control.js 0000644 00000002237 14717762257 0014167 0 ustar 00 !function(){var i;i=jQuery,wp.customize.bind("ready",(function(){!function(){var t=document.querySelectorAll("[data-kirki-parent-tab-id]");if(t.length){var a=[];[].slice.call(t).forEach((function(i){var t=i.dataset.kirkiParentTabId;a.includes(t)||a.push(t)}));var e=function(t,a){i('[data-kirki-tab-id="'+t+'"] .kirki-tab-menu-item').removeClass("is-active");var e=document.querySelector('[data-kirki-tab-id="'+t+'"] [data-kirki-tab-menu-id="'+a+'"]');e&&e.classList.add("is-active");var n=document.querySelectorAll('[data-kirki-parent-tab-id="'+t+'"]');[].slice.call(n).forEach((function(i){i.dataset.kirkiParentTabItem===a?i.classList.remove("kirki-tab-item-hidden"):i.classList.add("kirki-tab-item-hidden")}))};i(document).on("click",".kirki-tab-menu-item a",(function(i){i.preventDefault();var t=this.parentNode.parentNode.parentNode.dataset.kirkiTabId,a=this.parentNode.dataset.kirkiTabMenuId;e(t,a)})),a.forEach((function(i){wp.customize.section(i,(function(t){t.expanded.bind((function(t){if(t){var a=document.querySelector('[data-kirki-tab-id="'+i+'"] .kirki-tab-menu-item.is-active');a&&e(i,a.dataset.kirkiTabMenuId)}}))}))}))}}()}))}(); //# sourceMappingURL=control.js.map packages/kirki-pro-tabs/dist/control.css.map 0000644 00000005633 14717762257 0015122 0 ustar 00 {"mappings":"AACE,kCACE,MAAA,CACA,WCAJ,CDIA,6BAEE,UAAA,CADA,iBAAA,CAEA,uBCDF,CDKE,2DAEE,eAAA,CACA,QAAA,CACA,SCFJ,CDKE,2BAOE,4BAAA,CANA,YAAA,CACA,cAAA,CAIA,cAAA,CADA,eAAA,CADA,kBAAA,CADA,iBCCJ,CDME,gCAEE,WAAA,CADA,iBCHJ,CDMI,kCAEE,kBAAA,CAMA,mCAAA,CAPA,YAAA,CAKA,WAAA,CAHA,sBAAA,CACA,iBAAA,CACA,kBAAA,CAEA,iBAAA,CAEA,oBCJN,CDMM,wCACE,eCJR,CDOM,iFAEE,aCNR,CDWM,4CACE,oBCTR,CDeA,uBACE,sBCZF","sources":["src/control.scss","%3Cinput%20css%201ae8rn%3E"],"sourcesContent":[".rtl {\r\n .customize-control-kirki-tab {\r\n left: 0;\r\n right: -24px;\r\n }\r\n}\r\n\r\n.customize-control-kirki-tab {\r\n position: relative;\r\n left: -24px;\r\n width: calc(100% + 48px);\r\n}\r\n\r\n.kirki-tab {\r\n .kirki-tab-menu,\r\n .kirki-tab-menu-item {\r\n list-style: none;\r\n margin: 0;\r\n padding: 0;\r\n }\r\n\r\n .kirki-tab-menu {\r\n display: flex;\r\n flex-wrap: wrap;\r\n position: relative;\r\n margin-bottom: 12px;\r\n font-weight: 600;\r\n font-size: 14px;\r\n border-bottom: 1px solid #ddd;\r\n }\r\n\r\n .kirki-tab-menu-item {\r\n position: relative;\r\n flex-grow: 1;\r\n\r\n a {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n padding-left: 15px;\r\n padding-right: 15px;\r\n height: 50px;\r\n position: relative;\r\n border-bottom: 2px solid transparent;\r\n text-decoration: none;\r\n\r\n &:focus {\r\n box-shadow: none;\r\n }\r\n\r\n &:active,\r\n &:focus {\r\n color: #2271b1;\r\n }\r\n }\r\n\r\n &.is-active {\r\n a {\r\n border-color: #2271b1;\r\n }\r\n }\r\n }\r\n}\r\n\r\n.kirki-tab-item-hidden {\r\n display: none !important;\r\n}\r\n",".rtl .customize-control-kirki-tab {\n left: 0;\n right: -24px;\n}\n\n.customize-control-kirki-tab {\n position: relative;\n left: -24px;\n width: calc(100% + 48px);\n}\n\n.kirki-tab .kirki-tab-menu,\n.kirki-tab .kirki-tab-menu-item {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.kirki-tab .kirki-tab-menu {\n display: flex;\n flex-wrap: wrap;\n position: relative;\n margin-bottom: 12px;\n font-weight: 600;\n font-size: 14px;\n border-bottom: 1px solid #ddd;\n}\n.kirki-tab .kirki-tab-menu-item {\n position: relative;\n flex-grow: 1;\n}\n.kirki-tab .kirki-tab-menu-item a {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: 15px;\n padding-right: 15px;\n height: 50px;\n position: relative;\n border-bottom: 2px solid transparent;\n text-decoration: none;\n}\n.kirki-tab .kirki-tab-menu-item a:focus {\n box-shadow: none;\n}\n.kirki-tab .kirki-tab-menu-item a:active, .kirki-tab .kirki-tab-menu-item a:focus {\n color: #2271b1;\n}\n.kirki-tab .kirki-tab-menu-item.is-active a {\n border-color: #2271b1;\n}\n\n.kirki-tab-item-hidden {\n display: none !important;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"} packages/kirki-pro-tabs/dist/control.js.map 0000644 00000010062 14717762257 0014736 0 ustar 00 {"mappings":"gBAEWA,EAAAA,EAmFRC,OAHDC,GAAGC,UAAUC,KAAK,SAAS,YA/ET,WAChB,IAAMC,EAAgBC,SAASC,iBAC7B,8BAEF,GAAKF,EAAcG,OAAnB,CAEA,IAAIC,EAAS,GAEb,GAAGC,MAAMC,KAAKN,GAAeO,SAAQ,SAAUC,GAC7C,IAAMC,EAAcD,EAAaE,QAAQC,iBAEpCP,EAAOQ,SAASH,IACnBL,EAAOS,KAAKJ,MAIhB,IAAMK,EAAa,SAACC,EAAOC,GACzBrB,EAAE,uBAAyBoB,EAAQ,2BAA2BE,YAC5D,aAGF,IAAMC,EAAcjB,SAASkB,cAC3B,uBACEJ,EACA,+BACAC,EACA,MAGAE,GAAaA,EAAYE,UAAUC,IAAI,aAE3C,IAAMC,EAAWrB,SAASC,iBACxB,8BAAgCa,EAAQ,MAG1C,GAAGV,MAAMC,KAAKgB,GAAUf,SAAQ,SAAUgB,GACpCA,EAAQb,QAAQc,qBAAuBR,EACzCO,EAAQH,UAAUK,OAAO,yBAEzBF,EAAQH,UAAUC,IAAI,6BAM1B1B,EAAEM,UAAUyB,GAAG,QAAS,0BAA0B,SAAUC,GAC1DA,EAAEC,iBAEF,IAAMb,EAAQc,KAAKC,WAAWA,WAAWA,WAAWpB,QAAQqB,WACtDf,EAAca,KAAKC,WAAWpB,QAAQsB,eAE5ClB,EAAWC,EAAOC,MAKpBZ,EAAOG,SAAQ,SAAUQ,GACvBlB,GAAGC,UAAUmC,QAAQlB,GAAO,SAAUkB,GACpCA,EAAQC,SAASnC,MAAK,SAAUoC,GAC9B,GAAIA,EAAY,CACd,IAAMC,EAAgBnC,SAASkB,cAC7B,uBACEJ,EACA,qCAGAqB,GACFtB,EAAWC,EAAOqB,EAAc1B,QAAQsB,2BAapDK","sources":["src/control.js"],"sourcesContent":["import \"./control.scss\";\r\n\r\n(function ($) {\r\n const setupTabs = () => {\r\n const childControls = document.querySelectorAll(\r\n \"[data-kirki-parent-tab-id]\"\r\n );\r\n if (!childControls.length) return;\r\n\r\n let tabIds = [];\r\n\r\n [].slice.call(childControls).forEach(function (childControl) {\r\n const parentTabId = childControl.dataset.kirkiParentTabId;\r\n\r\n if (!tabIds.includes(parentTabId)) {\r\n tabIds.push(parentTabId);\r\n }\r\n });\r\n\r\n const switchTabs = (tabId, tabItemName) => {\r\n $('[data-kirki-tab-id=\"' + tabId + '\"] .kirki-tab-menu-item').removeClass(\r\n \"is-active\"\r\n );\r\n\r\n const tabMenuItem = document.querySelector(\r\n '[data-kirki-tab-id=\"' +\r\n tabId +\r\n '\"] [data-kirki-tab-menu-id=\"' +\r\n tabItemName +\r\n '\"]'\r\n );\r\n\r\n if (tabMenuItem) tabMenuItem.classList.add(\"is-active\");\r\n\r\n const tabItems = document.querySelectorAll(\r\n '[data-kirki-parent-tab-id=\"' + tabId + '\"]'\r\n );\r\n\r\n [].slice.call(tabItems).forEach(function (tabItem) {\r\n if (tabItem.dataset.kirkiParentTabItem === tabItemName) {\r\n tabItem.classList.remove(\"kirki-tab-item-hidden\");\r\n } else {\r\n tabItem.classList.add(\"kirki-tab-item-hidden\");\r\n }\r\n });\r\n };\r\n\r\n const setupTabClicks = () => {\r\n $(document).on(\"click\", \".kirki-tab-menu-item a\", function (e) {\r\n e.preventDefault();\r\n\r\n const tabId = this.parentNode.parentNode.parentNode.dataset.kirkiTabId;\r\n const tabItemName = this.parentNode.dataset.kirkiTabMenuId;\r\n\r\n switchTabs(tabId, tabItemName);\r\n });\r\n };\r\n\r\n const setupBindings = () => {\r\n tabIds.forEach(function (tabId) {\r\n wp.customize.section(tabId, function (section) {\r\n section.expanded.bind(function (isExpanded) {\r\n if (isExpanded) {\r\n const activeTabMenu = document.querySelector(\r\n '[data-kirki-tab-id=\"' +\r\n tabId +\r\n '\"] .kirki-tab-menu-item.is-active'\r\n );\r\n\r\n if (activeTabMenu) {\r\n switchTabs(tabId, activeTabMenu.dataset.kirkiTabMenuId);\r\n }\r\n }\r\n });\r\n });\r\n });\r\n };\r\n\r\n setupTabClicks();\r\n setupBindings();\r\n };\r\n\r\n wp.customize.bind(\"ready\", function () {\r\n setupTabs();\r\n });\r\n})(jQuery);\r\n"],"names":["$","jQuery","wp","customize","bind","childControls","document","querySelectorAll","length","tabIds","slice","call","forEach","childControl","parentTabId","dataset","kirkiParentTabId","includes","push","switchTabs","tabId","tabItemName","removeClass","tabMenuItem","querySelector","classList","add","tabItems","tabItem","kirkiParentTabItem","remove","on","e","preventDefault","this","parentNode","kirkiTabId","kirkiTabMenuId","section","expanded","isExpanded","activeTabMenu","setupTabs"],"version":3,"file":"control.js.map"} packages/kirki-pro-tabs/dist/control.css 0000644 00000001677 14717762257 0014352 0 ustar 00 .rtl .customize-control-kirki-tab{left:0;right:-24px}.customize-control-kirki-tab{left:-24px;position:relative;width:calc(100% + 48px)}.kirki-tab .kirki-tab-menu,.kirki-tab .kirki-tab-menu-item{list-style:none;margin:0;padding:0}.kirki-tab .kirki-tab-menu{border-bottom:1px solid #ddd;display:flex;flex-wrap:wrap;font-size:14px;font-weight:600;margin-bottom:12px;position:relative}.kirki-tab .kirki-tab-menu-item{flex-grow:1;position:relative}.kirki-tab .kirki-tab-menu-item a{align-items:center;border-bottom:2px solid transparent;display:flex;height:50px;justify-content:center;padding-left:15px;padding-right:15px;position:relative;text-decoration:none}.kirki-tab .kirki-tab-menu-item a:focus{box-shadow:none}.kirki-tab .kirki-tab-menu-item a:active,.kirki-tab .kirki-tab-menu-item a:focus{color:#2271b1}.kirki-tab .kirki-tab-menu-item.is-active a{border-color:#2271b1}.kirki-tab-item-hidden{display:none!important} /*# sourceMappingURL=control.css.map */ packages/kirki-pro-tabs/composer.json 0000644 00000000272 14717762257 0013725 0 ustar 00 { "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\Tabs\\": "src" } } } packages/kirki-pro-tabs/.gitignore 0000644 00000000063 14717762257 0013171 0 ustar 00 node_modules package-lock.json .parcel-cache builds packages/kirki-pro-input-slider/composer.lock 0000644 00000001124 14717762257 0015367 0 ustar 00 { "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "b7c0bf1ec14636d40821afb93874266e", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } packages/kirki-pro-input-slider/readme.txt 0000644 00000000552 14717762257 0014670 0 ustar 00 === Kirki Input Slider Control === Contributors: davidvongries Tags: kirki-input-slider-control Requires at least: 5.2 Tested up to: 5.9 Requires PHP: 7.0 License: GPL-3.0 License License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=kirki%20pro%20input%20slider == Description == Input slider extension for Kirki Customizer Framework. packages/kirki-pro-input-slider/vendor/autoload.php 0000644 00000001403 14717762257 0016504 0 ustar 00 <?php // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, $err); } elseif (!headers_sent()) { echo $err; } } trigger_error( $err, E_USER_ERROR ); } require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInitaa7362cafc4023cfd44d39ecfc30cc1d::getLoader(); packages/kirki-pro-input-slider/vendor/composer/autoload_namespaces.php 0000644 00000000213 14717762257 0022530 0 ustar 00 <?php // autoload_namespaces.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( ); packages/kirki-pro-input-slider/vendor/composer/LICENSE 0000644 00000002056 14717762257 0017024 0 ustar 00 Copyright (c) Nils Adermann, Jordi Boggiano 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. packages/kirki-pro-input-slider/vendor/composer/autoload_psr4.php 0000644 00000000500 14717762257 0021300 0 ustar 00 <?php // autoload_psr4.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Kirki\\Pro\\InputSlider\\' => array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); packages/kirki-pro-input-slider/vendor/composer/autoload_real.php 0000644 00000002161 14717762257 0021340 0 ustar 00 <?php // autoload_real.php @generated by Composer class ComposerAutoloaderInitaa7362cafc4023cfd44d39ecfc30cc1d { private static $loader; public static function loadClassLoader($class) { if ('Composer\Autoload\ClassLoader' === $class) { require __DIR__ . '/ClassLoader.php'; } } /** * @return \Composer\Autoload\ClassLoader */ public static function getLoader() { if (null !== self::$loader) { return self::$loader; } require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInitaa7362cafc4023cfd44d39ecfc30cc1d', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInitaa7362cafc4023cfd44d39ecfc30cc1d', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInitaa7362cafc4023cfd44d39ecfc30cc1d::getInitializer($loader)); $loader->register(true); return $loader; } } packages/kirki-pro-input-slider/vendor/composer/platform_check.php 0000644 00000001635 14717762257 0021513 0 ustar 00 <?php // platform_check.php @generated by Composer $issues = array(); if (!(PHP_VERSION_ID >= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); } elseif (!headers_sent()) { echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; } } trigger_error( 'Composer detected issues in your platform: ' . implode(' ', $issues), E_USER_ERROR ); } packages/kirki-pro-input-slider/vendor/composer/ClassLoader.php 0000644 00000040220 14717762257 0020717 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Autoload; /** * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. * * $loader = new \Composer\Autoload\ClassLoader(); * * // register classes with namespaces * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * * // activate the autoloader * $loader->register(); * * // to enable searching the include path (eg. for PEAR packages) * $loader->setUseIncludePath(true); * * In this example, if you try to use a class in the Symfony\Component * namespace or one of its children (Symfony\Component\Console for instance), * the autoloader will first look for the class under the component/ * directory, and it will then fallback to the framework/ directory if not * found before giving up. * * This class is loosely based on the Symfony UniversalClassLoader. * * @author Fabien Potencier <fabien@symfony.com> * @author Jordi Boggiano <j.boggiano@seld.be> * @see https://www.php-fig.org/psr/psr-0/ * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { /** @var \Closure(string):void */ private static $includeFile; /** @var ?string */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array<string, array<string, int>> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array<string, array<int, string>> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array<string, array<string, string[]>> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array<string, string> */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array<string, bool> */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array<string, array<int, string>> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array<string, string> */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array<string, string> $classMap * * @return void */ public function addClassMap(array $classMap) { if ($this->classMap) { $this->classMap = array_merge($this->classMap, $classMap); } else { $this->classMap = $classMap; } } /** * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 root directories * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $paths ); } } /** * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { // Register directories for a new namespace. $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $paths ); } } /** * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 base directories * * @return void */ public function set($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr0 = (array) $paths; } else { $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; } } /** * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * * @return void */ public function setPsr4($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr4 = (array) $paths; } else { $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } } /** * Turns on searching the include path for class files. * * @param bool $useIncludePath * * @return void */ public function setUseIncludePath($useIncludePath) { $this->useIncludePath = $useIncludePath; } /** * Can be used to check if the autoloader uses the include path to check * for classes. * * @return bool */ public function getUseIncludePath() { return $this->useIncludePath; } /** * Turns off searching the prefix and fallback directories for classes * that have not been registered with the class map. * * @param bool $classMapAuthoritative * * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { $this->classMapAuthoritative = $classMapAuthoritative; } /** * Should class lookup fail if not found in the current class map? * * @return bool */ public function isClassMapAuthoritative() { return $this->classMapAuthoritative; } /** * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix * * @return void */ public function setApcuPrefix($apcuPrefix) { $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** * The APCu prefix in use, or null if APCu caching is not enabled. * * @return string|null */ public function getApcuPrefix() { return $this->apcuPrefix; } /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not * * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { return; } if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); self::$registeredLoaders[$this->vendorDir] = $this; } } /** * Unregisters this instance as an autoloader. * * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); if (null !== $this->vendorDir) { unset(self::$registeredLoaders[$this->vendorDir]); } } /** * Loads the given class or interface. * * @param string $class The name of the class * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { $includeFile = self::$includeFile; $includeFile($file); return true; } return null; } /** * Finds the path to the file where the class is defined. * * @param string $class The name of the class * * @return string|false The path if found, false otherwise */ public function findFile($class) { // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } if (null !== $this->apcuPrefix) { $file = apcu_fetch($this->apcuPrefix.$class, $hit); if ($hit) { return $file; } } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM if (false === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } if (null !== $this->apcuPrefix) { apcu_add($this->apcuPrefix.$class, $file); } if (false === $file) { // Remember that this class does not exist. $this->missingClasses[$class] = true; } return $file; } /** * Returns the currently registered loaders indexed by their corresponding vendor directories. * * @return self[] */ public static function getRegisteredLoaders() { return self::$registeredLoaders; } /** * @param string $class * @param string $ext * @return string|false */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { if (file_exists($file = $dir . $pathEnd)) { return $file; } } } } } // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } // PSR-0 lookup if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); } else { // PEAR-like class name $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; } if (isset($this->prefixesPsr0[$first])) { foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } } } } // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } // PSR-0 include paths. if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } return false; } /** * @return void */ private static function initializeIncludeClosure() { if (self::$includeFile !== null) { return; } /** * Scope isolated include. * * Prevents access to $this/self from included files. * * @param string $file * @return void */ self::$includeFile = \Closure::bind(static function($file) { include $file; }, null, null); } } packages/kirki-pro-input-slider/vendor/composer/autoload_classmap.php 0000644 00000000336 14717762257 0022222 0 ustar 00 <?php // autoload_classmap.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-input-slider/vendor/composer/autoload_static.php 0000644 00000002564 14717762257 0021713 0 ustar 00 <?php // autoload_static.php @generated by Composer namespace Composer\Autoload; class ComposerStaticInitaa7362cafc4023cfd44d39ecfc30cc1d { public static $prefixLengthsPsr4 = array ( 'K' => array ( 'Kirki\\Pro\\InputSlider\\' => 22, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\InputSlider\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInitaa7362cafc4023cfd44d39ecfc30cc1d::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitaa7362cafc4023cfd44d39ecfc30cc1d::$prefixDirsPsr4; $loader->classMap = ComposerStaticInitaa7362cafc4023cfd44d39ecfc30cc1d::$classMap; }, null, ClassLoader::class); } } packages/kirki-pro-input-slider/vendor/composer/InstalledVersions.php 0000644 00000037417 14717762257 0022211 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; /** * This class is copied in every Composer installed project and available to all * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` * * @final */ class InstalledVersions { /** * @var mixed[]|null * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static $installedByVendor = array(); /** * Returns a list of all package names which are present, either by being installed, replaced or provided * * @return string[] * @psalm-return list<string> */ public static function getInstalledPackages() { $packages = array(); foreach (self::getInstalled() as $installed) { $packages[] = array_keys($installed['versions']); } if (1 === \count($packages)) { return $packages[0]; } return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); } /** * Returns a list of all package names with a specific type e.g. 'library' * * @param string $type * @return string[] * @psalm-return list<string> */ public static function getInstalledPackagesByType($type) { $packagesByType = array(); foreach (self::getInstalled() as $installed) { foreach ($installed['versions'] as $name => $package) { if (isset($package['type']) && $package['type'] === $type) { $packagesByType[] = $name; } } } return $packagesByType; } /** * Checks whether the given package is installed * * This also returns true if the package name is provided or replaced by another package * * @param string $packageName * @param bool $includeDevRequirements * @return bool */ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } return false; } /** * Checks whether the given package satisfies a version constraint * * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: * * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') * * @param VersionParser $parser Install composer/semver to have access to this class and functionality * @param string $packageName * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package * @return bool */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); } /** * Returns a version constraint representing all the range(s) which are installed for a given package * * It is easier to use this via isInstalled() with the $constraint argument if you need to check * whether a given version of a package is installed, and not just whether it exists * * @param string $packageName * @return string Version constraint usable with composer/semver */ public static function getVersionRanges($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } $ranges = array(); if (isset($installed['versions'][$packageName]['pretty_version'])) { $ranges[] = $installed['versions'][$packageName]['pretty_version']; } if (array_key_exists('aliases', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); } if (array_key_exists('replaced', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); } if (array_key_exists('provided', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); } return implode(' || ', $ranges); } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['version'])) { return null; } return $installed['versions'][$packageName]['version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getPrettyVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['pretty_version'])) { return null; } return $installed['versions'][$packageName]['pretty_version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference */ public static function getReference($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['reference'])) { return null; } return $installed['versions'][$packageName]['reference']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. */ public static function getInstallPath($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @return array * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { $installed = self::getInstalled(); return $installed[0]['root']; } /** * Returns the raw installed.php data for custom implementations * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} */ public static function getRawData() { @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { self::$installed = include __DIR__ . '/installed.php'; } else { self::$installed = array(); } } return self::$installed; } /** * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ public static function getAllRawData() { return self::getInstalled(); } /** * Lets you reload the static array from another file * * This is only useful for complex integrations in which a project needs to use * this class but then also needs to execute another project's autoloader in process, * and wants to ensure both projects have access to their version of installed.php. * * A typical case would be PHPUnit, where it would need to make sure it reads all * the data it needs from this class, then call reload() with * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure * the project in which it runs can then also use this class safely, without * interference between PHPUnit's dependencies and the project's dependencies. * * @param array[] $data A vendor/composer/installed.php data set * @return void * * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static function getInstalled() { if (null === self::$canGetVendors) { self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); } $installed = array(); if (self::$canGetVendors) { foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require $vendorDir.'/composer/installed.php'; $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } } } } if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } packages/kirki-pro-input-slider/vendor/composer/installed.json 0000644 00000000105 14717762257 0020662 0 ustar 00 { "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-input-slider/vendor/composer/installed.php 0000644 00000001344 14717762257 0020506 0 ustar 00 <?php return array( 'root' => array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); packages/kirki-pro-input-slider/src/KirkiInputSliderControl.js 0000644 00000006460 14717762257 0020620 0 ustar 00 import KirkiInputSliderForm from "./KirkiInputSliderForm"; /** * KirkiInputSliderControl. * * Global objects brought: * - wp * - jQuery * - React * - ReactDOM * * @class * @augments wp.customize.Control * @augments wp.customize.Class */ const KirkiInputSliderControl = wp.customize.Control.extend({ /** * Initialize. * * @param {string} id - Control ID. * @param {object} params - Control params. */ initialize: function (id, params) { const control = this; // Bind functions to this control context for passing as React props. control.setNotificationContainer = control.setNotificationContainer.bind(control); wp.customize.Control.prototype.initialize.call(control, id, params); // The following should be eliminated with <https://core.trac.wordpress.org/ticket/31334>. function onRemoved(removedControl) { if (control === removedControl) { control.destroy(); control.container.remove(); wp.customize.control.unbind("removed", onRemoved); } } wp.customize.control.bind("removed", onRemoved); }, /** * Set notification container and render. * * This is called when the React component is mounted. * * @param {Element} element - Notification container. * @returns {void} */ setNotificationContainer: function setNotificationContainer(element) { const control = this; control.notifications.container = jQuery(element); control.notifications.render(); }, /** * Render the control into the DOM. * * This is called from the Control#embed() method in the parent class. * * @returns {void} */ renderContent: function renderContent() { const control = this; ReactDOM.render( <KirkiInputSliderForm {...control.params} control={control} customizerSetting={control.setting} setNotificationContainer={control.setNotificationCotainer} value={control.params.value} />, control.container[0] ); if (false !== control.params.choices.allowCollapse) { control.container.addClass("allowCollapse"); } }, /** * After control has been first rendered, start re-rendering when setting changes. * * React is able to be used here instead of the wp.customize.Element abstraction. * * @returns {void} */ ready: function ready() { const control = this; /** * Update component value's state when customizer setting's value is changed. */ control.setting.bind((val) => { control.updateComponentState(val); }); }, /** * This method will be overriden by the rendered component. */ updateComponentState: (val) => {}, /** * Handle removal/de-registration of the control. * * This is essentially the inverse of the Control#embed() method. * * @link https://core.trac.wordpress.org/ticket/31334 * @returns {void} */ destroy: function destroy() { const control = this; // Garbage collection: undo mounting that was done in the embed/renderContent method. ReactDOM.unmountComponentAtNode(control.container[0]); // Call destroy method in parent if it exists (as of #31334). if (wp.customize.Control.prototype.destroy) { wp.customize.Control.prototype.destroy.call(control); } }, }); export default KirkiInputSliderControl; packages/kirki-pro-input-slider/src/KirkiInputSliderForm.js 0000644 00000007723 14717762257 0020106 0 ustar 00 import { useRef } from "react"; const KirkiInputSliderForm = (props) => { const { control, customizerSetting, choices } = props; let trigger = ""; const validateValue = (value) => { if (value < choices.min) value = choices.min; if (value > choices.max) value = choices.max; return value; }; const getValueObject = (value) => { value = "string" !== typeof value ? value.toString() : value; const valueUnit = value.replace(/\d+/g, ""); let valueNumber = value.replace(valueUnit, ""); valueNumber = parseFloat(valueNumber.trim()); valueNumber = validateValue(valueNumber); return { number: valueNumber, unit: valueUnit, }; }; const getValueForInput = (value) => { const valueObject = getValueObject(value); return valueObject.number + valueObject.unit; }; const getValueForSlider = (value) => { return getValueObject(value).number; }; control.updateComponentState = (val) => { if ("slider" === trigger) { valueRef.current.value = getValueForInput(val); } else if ("input" === trigger) { sliderRef.current.value = getValueForSlider(val); } else if ("reset" === trigger) { valueRef.current.value = val; sliderRef.current.value = val; } }; const handleInputChange = (e) => { trigger = "input"; customizerSetting.set(getValueForInput(e.target.value)); }; const handleSliderChange = (e) => { trigger = "slider"; let value = parseFloat(e.target.value); value = validateValue(value); const inputValueObj = getValueObject(valueRef.current.value); // We're going to use the unit. const valueForInput = value + inputValueObj.unit; customizerSetting.set(valueForInput); }; const handleReset = (e) => { if ("" !== props.default && "undefined" !== typeof props.default) { sliderRef.current.value = props.default; valueRef.current.value = props.default; } else { if ("" !== props.value) { sliderRef.current.value = props.value; valueRef.current.value = props.value; } else { sliderRef.current.value = choices.min; valueRef.current.value = ""; } } trigger = "reset"; customizerSetting.set(sliderRef.current.value); }; // Preparing for the template. const fieldId = `kirki-control-input-${customizerSetting.id}`; const sliderValue = getValueForSlider(props.value); const inputValue = getValueForInput(props.value); const sliderRef = useRef(null); const valueRef = useRef(null); return ( <div className="kirki-control-form" tabIndex="1"> <label className="kirki-control-label" htmlFor={fieldId}> <span className="customize-control-title">{props.label}</span> <span className="customize-control-description description" dangerouslySetInnerHTML={{ __html: props.description }} /> </label> <div className="customize-control-notifications-container" ref={props.setNotificationContainer} ></div> <button type="button" className="kirki-control-reset" onClick={handleReset} > <i className="dashicons dashicons-image-rotate"></i> </button> <div className="kirki-control-cols"> <div className="kirki-control-left-col"> <input ref={sliderRef} type="range" id={fieldId} defaultValue={sliderValue} min={choices.min} max={choices.max} step={choices.step} className="kirki-control-input-slider kirki-pro-control-input-slider" onChange={handleSliderChange} /> </div> <div className="kirki-control-right-col"> <input ref={valueRef} type="text" defaultValue={inputValue} className="kirki-control-input" onChange={handleInputChange} /> </div> </div> </div> ); }; export default KirkiInputSliderForm; packages/kirki-pro-input-slider/src/Init.php 0000644 00000001212 14717762257 0015067 0 ustar 00 <?php /** * Init the Kirki PRO's slider package. * * @package kirki-pro-input-slider * @since 1.0.0 */ namespace Kirki\Pro\InputSlider; /** * Manage the tabs package. * * @since 1.0.0 */ class Init { /** * The class constructor. * * @since 1.0.0 */ public function __construct() { add_filter( 'kirki_control_types', [ $this, 'control_type' ] ); } /** * The control type. * * @since 1.0.0 * * @param array $control_types The existing control types. */ public function control_type( $control_types ) { $control_types['kirki-input-slider'] = 'Kirki\Pro\Control\InputSlider'; return $control_types; } } packages/kirki-pro-input-slider/src/control.js 0000644 00000000327 14717762257 0015477 0 ustar 00 import "./control.scss"; import KirkiInputSliderControl from './KirkiInputSliderControl'; // Register control type with Customizer. wp.customize.controlConstructor['kirki-input-slider'] = KirkiInputSliderControl; packages/kirki-pro-input-slider/src/control.scss 0000644 00000006400 14717762257 0016034 0 ustar 00 // Range slider control. .customize-control-kirki-input-slider { .kirki-control-label { position: relative; display: block; } .customize-control-description { padding-right: 30px; } .kirki-control-form { position: relative; margin-bottom: 12px; &:hover { .kirki-control-reset { opacity: 1; } } } .kirki-control-reset { display: flex; align-items: center; justify-content: center; bottom: 36px; right: 0; position: absolute; padding: 0; width: 16px; height: 16px; color: #50575e; background-color: transparent; border-radius: 50%; border-width: 0; opacity: 0; cursor: pointer; transition: all 0.3s; z-index: 3; // a11y: support tab focus. &:focus { opacity: 1; } } .kirki-control-reset:hover i { color: #f00; transform: rotate(-45deg); } .kirki-control-reset i { font-size: 12px; width: auto; height: auto; transform: rotate(45deg); transition: transform 0.3s; } .kirki-control-cols { display: flex; align-items: center; justify-content: space-between; } .kirki-control-left-col { width: 75%; padding-right: 13px; } .kirki-control-right-col { width: 25%; text-align: right; } .kirki-control-input:focus { background-color: #fff; } .kirki-control-input { font-size: 12px; text-align: center; background-color: #f7f7f7; border-color: #bbb; border-radius: 4px; z-index: 2; transition: box-shadow 0.15s; } .kirki-control-input-slider { position: relative; top: -1px; padding: 0; margin: 0; width: 100%; height: 5px; border-radius: 2.5px; background-color: #bdc3c7; outline: none; -webkit-appearance: none; } .kirki-control-input-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background-color: #f0f0f0; cursor: pointer; border: 1px solid #999; box-shadow: none; -webkit-transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; } .kirki-control-input-slider::-webkit-slider-thumb:hover, .kirki-control-input-slider::-webkit-slider-thumb:focus { background-color: #e7e7e7; } .kirki-control-input-slider:active::-webkit-slider-thumb { background-color: #e7e7e7; } .kirki-control-input-slider::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background-color: #f0f0f0; cursor: pointer; border: 1px solid #999; box-shadow: none; -moz-transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; } .kirki-control-input-slider::-moz-range-thumb:hover, .kirki-control-input-slider::-moz-range-thumb:focus { background-color: #e7e7e7; } ::-moz-range-track { background-color: #bdc3c7; border: 0; } input::-moz-focus-inner, input::-moz-focus-outer { border: 0; } } packages/kirki-pro-input-slider/src/Field/InputSlider.php 0000644 00000004201 14717762257 0017452 0 ustar 00 <?php /** * Override field methods. * * @package kirki-pro-input-slider */ namespace Kirki\Pro\Field; use Kirki\Field; /** * Field overrides. * * @since 1.0 */ class InputSlider extends Field { /** * The field type. * * @since 1.0 * * @var string */ public $type = 'kirki-input-slider'; /** * The control class-name. * * @since 1.0 * * @var string */ protected $control_class = '\Kirki\Pro\Control\InputSlider'; /** * Whether we should register the control class for JS-templating or not. * * @since 1.0 * * @var bool */ protected $control_has_js_template = false; /** * Filter arguments before creating the setting. * * @since 1.0.0 * * @param array $args The field arguments. * @param \WP_Customize_Manager $wp_customize The customizer instance. * * @return array $args The maybe-filtered arguments. */ 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'] = [ __CLASS__, 'sanitize' ]; } } return $args; } /** * Sanitize the value. * * @param mixed $value The value to sanitize. * @return mixed */ public static function sanitize( $value ) { if ( is_numeric( $value ) ) { return filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); } else { return sanitize_text_field( $value ); } } /** * Filter arguments before creating the control. * * @since 1.0.0 * * @param array $args The field arguments. * @param \WP_Customize_Manager $wp_customize The customizer instance. * * @return array $args The maybe-filtered arguments. */ 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-input-slider'; } return $args; } } packages/kirki-pro-input-slider/src/Control/InputSlider.php 0000644 00000007415 14717762257 0020061 0 ustar 00 <?php /** * The input slider control. * * Creates an input slider control. * * @package kirki-pro-input-slider */ namespace Kirki\Pro\Control; use Kirki\Control\Base; use Kirki\URL; /** * Input slider control. * * @since 1.0 */ class InputSlider extends Base { /** * The control type. * * @since 1.0 * @access public * @var string */ public $type = 'kirki-input-slider'; /** * The control version. * * @since 1.0 * @access public * @var string */ public static $control_ver = '0.1.0'; /** * Control's value unit. * * @var string */ public $value_unit = ''; /** * Control's value number. * * @var string */ public $value_number = 0; /** * Control's constructor. * * @since 1.0.0 * * @param WP_Customize_Manager $wp_customize WP_Customize_Manager instance. * @param string $id The control's ID. * @param array $args The control's arguments. */ public function __construct( $wp_customize, $id, $args = array() ) { parent::__construct( $wp_customize, $id, $args ); // If `unit` choice is defined. if ( ! empty( $this->choices['unit'] ) ) { $this->value_unit = $this->choices['unit']; } // If the value includes the unit, then replace the `value_unit` (set from choice) with unit from value. if ( ! is_numeric( $this->value() ) ) { $this->value_unit = preg_replace( '/\d+/', '', $this->value() ); $this->value_number = str_ireplace( $this->value_unit, '', $this->value() ); $this->value_number = (float) $this->value_number; } else { $this->value_number = (float) $this->value(); } // Set default choices. $this->choices = wp_parse_args( $this->choices, [ 'min' => 0, 'max' => 100, 'step' => 1, ] ); $this->choices['min'] = (float) $this->choices['min']; $this->choices['max'] = (float) $this->choices['max']; $this->choices['step'] = (float) $this->choices['step']; // Value number must not be less than min and must not be greater than max. $this->value_number = $this->value_number < $this->choices['min'] ? $this->choices['min'] : $this->value_number; $this->value_number = $this->value_number > $this->choices['max'] ? $this->choices['max'] : $this->value_number; } /** * Enqueue control related styles/scripts. * * @since 1.0 * @access public */ public function enqueue() { parent::enqueue(); // Enqueue the style. wp_enqueue_style( 'kirki-control-input-slider', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver ); // Enqueue the script. wp_enqueue_script( 'kirki-control-input-slider', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'jquery', 'customize-controls', 'customize-base', 'react-dom' ], self::$control_ver, false ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() * * @since 1.0 * @access public */ public function to_json() { parent::to_json(); if ( isset( $this->json['label'] ) ) { $this->json['label'] = html_entity_decode( $this->json['label'] ); } if ( isset( $this->json['description'] ) ) { $this->json['description'] = html_entity_decode( $this->json['description'] ); } $this->json['value_number'] = $this->value_number; $this->json['value_unit'] = $this->value_unit; $this->json['value'] = $this->value_number . $this->value_unit; } /** * 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 WP_Customize_Control::to_json(). * * @see WP_Customize_Control::print_template() * * @since 1.0 */ protected function content_template() {} } packages/kirki-pro-input-slider/kirki-pro-input-slider.php 0000644 00000002674 14717762257 0017736 0 ustar 00 <?php /** * Plugin Name: Kirki PRO Input Slider * Plugin URI: https://www.themeum.com/ * Description: Input slider control for Kirki Customizer Framework. * Version: 1.1 * Author: Themeum * Author URI: https://themeum.com/ * License: GPL-3.0 * License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=control%20input%20slider * Text Domain: kirki-pro-input-slider * Domain Path: /languages * * @package kirki-pro-input-slider */ defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'kirki_pro_load_input_slider_control' ) ) { /** * Load input slider control. */ function kirki_pro_load_input_slider_control() { // Stop, if Kirki is not installed. if ( ! defined( 'KIRKI_VERSION' ) ) { return; } // Stop, if Kirki PRO (bundle) is already installed. if ( defined( 'KIRKI_PRO_VERSION' ) ) { return; } // Stop, if Kirki Pro Input Slider is already installed. if ( class_exists( '\Kirki\Pro\InputSlider\Init' ) ) { return; } if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugin_data = get_plugin_data( __FILE__ ); define( 'KIRKI_PRO_INPUT_SLIDER_VERSION', $plugin_data['Version'] ); define( 'KIRKI_PRO_INPUT_SLIDER_PLUGIN_FILE', __FILE__ ); require_once __DIR__ . '/vendor/autoload.php'; new \Kirki\Pro\InputSlider\Init(); } add_action( 'plugins_loaded', 'kirki_pro_load_input_slider_control' ); } packages/kirki-pro-input-slider/package.json 0000644 00000001527 14717762257 0015163 0 ustar 00 { "name": "kirki-pro-input-slider", "version": "1.1", "description": "Dev toolkit for kirki-pro-input-slider", "keywords": [ "kirki-pro-input-slider" ], "author": "Kirki", "license": "GPL-3.0", "bugs": { "url": "https://www.themeum.com/" }, "homepage": "https://www.themeum.com/", "dependencies": { "react": "^17.0.2", "react-dom": "^17.0.2" }, "devDependencies": { "@babel/preset-react": "^7.16.7", "@parcel/transformer-sass": "^2.2.1", "parcel": "^2.2.1" }, "alias": { "jquery": { "global": "jQuery" }, "react": { "global": "React" }, "react-dom": { "global": "ReactDOM" } }, "browserslist": "> 0.5%, last 2 versions, not dead", "source": "src/control.js", "scripts": { "build": "parcel build", "dev": "parcel build --no-optimize" } } packages/kirki-pro-input-slider/.babelrc 0000644 00000000131 14717762257 0014256 0 ustar 00 { "presets": [ [ "@babel/preset-react", { "runtime": "classic" } ] ] } packages/kirki-pro-input-slider/dist/control.js 0000644 00000006604 14717762257 0015657 0 ustar 00 !function(){var t={};t=React;var e=function(e){var n=e.control,r=e.customizerSetting,a=e.choices,i="",o=function(t){return t<a.min&&(t=a.min),t>a.max&&(t=a.max),t},c=function(t){var e=(t="string"!=typeof t?t.toString():t).replace(/\d+/g,""),n=t.replace(e,"");return n=parseFloat(n.trim()),{number:n=o(n),unit:e}},l=function(t){var e=c(t);return e.number+e.unit},u=function(t){return c(t).number};n.updateComponentState=function(t){"slider"===i?f.current.value=l(t):"input"===i?d.current.value=u(t):"reset"===i&&(f.current.value=t,d.current.value=t)};var s="kirki-control-input-".concat(r.id),m=u(e.value),p=l(e.value),d=t.useRef(null),f=t.useRef(null);return React.createElement("div",{className:"kirki-control-form",tabIndex:"1"},React.createElement("label",{className:"kirki-control-label",htmlFor:s},React.createElement("span",{className:"customize-control-title"},e.label),React.createElement("span",{className:"customize-control-description description",dangerouslySetInnerHTML:{__html:e.description}})),React.createElement("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),React.createElement("button",{type:"button",className:"kirki-control-reset",onClick:function(t){""!==e.default&&void 0!==e.default?(d.current.value=e.default,f.current.value=e.default):""!==e.value?(d.current.value=e.value,f.current.value=e.value):(d.current.value=a.min,f.current.value=""),i="reset",r.set(d.current.value)}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement("div",{className:"kirki-control-cols"},React.createElement("div",{className:"kirki-control-left-col"},React.createElement("input",{ref:d,type:"range",id:s,defaultValue:m,min:a.min,max:a.max,step:a.step,className:"kirki-control-input-slider kirki-pro-control-input-slider",onChange:function(t){i="slider";var e=parseFloat(t.target.value),n=(e=o(e))+c(f.current.value).unit;r.set(n)}})),React.createElement("div",{className:"kirki-control-right-col"},React.createElement("input",{ref:f,type:"text",defaultValue:p,className:"kirki-control-input",onChange:function(t){i="input",r.set(l(t.target.value))}}))))};function n(){return n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}var r=wp.customize.Control.extend({initialize:function(t,e){var n=this;n.setNotificationContainer=n.setNotificationContainer.bind(n),wp.customize.Control.prototype.initialize.call(n,t,e),wp.customize.control.bind("removed",(function t(e){n===e&&(n.destroy(),n.container.remove(),wp.customize.control.unbind("removed",t))}))},setNotificationContainer:function(t){this.notifications.container=jQuery(t),this.notifications.render()},renderContent:function(){var t=this;ReactDOM.render(React.createElement(e,n({},t.params,{control:t,customizerSetting:t.setting,setNotificationContainer:t.setNotificationCotainer,value:t.params.value})),t.container[0]),!1!==t.params.choices.allowCollapse&&t.container.addClass("allowCollapse")},ready:function(){var t=this;t.setting.bind((function(e){t.updateComponentState(e)}))},updateComponentState:function(t){},destroy:function(){ReactDOM.unmountComponentAtNode(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["kirki-input-slider"]=r}(); //# sourceMappingURL=control.js.map packages/kirki-pro-input-slider/dist/control.css.map 0000644 00000021412 14717762257 0016601 0 ustar 00 {"mappings":"AAEE,2DAEE,aAAA,CADA,iBCAJ,CDIE,qEACE,kBCFJ,CDKE,0DAEE,kBAAA,CADA,iBCFJ,CDMM,qFACE,SCJR,CDSE,2DAEE,kBAAA,CASA,4BAAA,CACA,iBAAA,CACA,cAAA,CATA,WAAA,CAMA,aAAA,CAKA,cAAA,CAdA,YAAA,CAQA,WAAA,CANA,sBAAA,CAWA,SAAA,CAPA,SAAA,CADA,iBAAA,CADA,OAAA,CAWA,kBAAA,CARA,UAAA,CASA,SCPJ,CDUI,iEACE,SCRN,CDYE,mEACE,SAAA,CACA,wBCVJ,CDaE,6DACE,cAAA,CAEA,WAAA,CACA,uBAAA,CACA,wBAAA,CAHA,UCRJ,CDcE,0DAEE,kBAAA,CADA,YAAA,CAEA,6BCZJ,CDeE,8DAEE,kBAAA,CADA,SCZJ,CDgBE,+DAEE,gBAAA,CADA,SCbJ,CDiBE,iEACE,qBCfJ,CDkBE,2DAGE,wBAAA,CACA,iBAAA,CACA,iBAAA,CAJA,cAAA,CACA,iBAAA,CAKA,0BAAA,CADA,SCfJ,CDmBE,kEAUE,uBAAA,CAFA,wBAAA,CADA,mBAAA,CADA,UAAA,CAFA,QAAA,CAKA,YAAA,CANA,SAAA,CAFA,iBAAA,CACA,QAAA,CAGA,UCZJ,CDoBE,wFACE,uBAAA,CACA,eAAA,CAIA,wBAAA,CAEA,qBAAA,CAHA,iBAAA,CAIA,eAAA,CAFA,cAAA,CAHA,WAAA,CAMA,gGAAA,CAEA,wFAAA,CATA,UCVJ,CDuBE,4LAEE,wBCrBJ,CDwBE,+FACE,wBCtBJ,CDyBE,oFAKE,wBAAA,CAEA,qBAAA,CAHA,iBAAA,CAIA,eAAA,CAFA,cAAA,CAJA,WAAA,CAOA,6FAAA,CAEA,wFAAA,CAVA,UCdJ,CD4BE,oLAEE,wBC1BJ,CD6BE,yDACE,wBAAA,CACA,QC3BJ,CD8BE,4HAEE,QC5BJ","sources":["src/control.scss","%3Cinput%20css%204yUkfo%3E"],"sourcesContent":["// Range slider control.\r\n.customize-control-kirki-input-slider {\r\n .kirki-control-label {\r\n position: relative;\r\n display: block;\r\n }\r\n\r\n .customize-control-description {\r\n padding-right: 30px;\r\n }\r\n\r\n .kirki-control-form {\r\n position: relative;\r\n margin-bottom: 12px;\r\n\r\n &:hover {\r\n .kirki-control-reset {\r\n opacity: 1;\r\n }\r\n }\r\n }\r\n\r\n .kirki-control-reset {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n bottom: 36px;\r\n right: 0;\r\n position: absolute;\r\n padding: 0;\r\n width: 16px;\r\n height: 16px;\r\n color: #50575e;\r\n background-color: transparent;\r\n border-radius: 50%;\r\n border-width: 0;\r\n opacity: 0;\r\n cursor: pointer;\r\n transition: all 0.3s;\r\n z-index: 3;\r\n\r\n // a11y: support tab focus.\r\n &:focus {\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .kirki-control-reset:hover i {\r\n color: #f00;\r\n transform: rotate(-45deg);\r\n }\r\n\r\n .kirki-control-reset i {\r\n font-size: 12px;\r\n width: auto;\r\n height: auto;\r\n transform: rotate(45deg);\r\n transition: transform 0.3s;\r\n }\r\n\r\n .kirki-control-cols {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n }\r\n\r\n .kirki-control-left-col {\r\n width: 75%;\r\n padding-right: 13px;\r\n }\r\n\r\n .kirki-control-right-col {\r\n width: 25%;\r\n text-align: right;\r\n }\r\n\r\n .kirki-control-input:focus {\r\n background-color: #fff;\r\n }\r\n\r\n .kirki-control-input {\r\n font-size: 12px;\r\n text-align: center;\r\n background-color: #f7f7f7;\r\n border-color: #bbb;\r\n border-radius: 4px;\r\n z-index: 2;\r\n transition: box-shadow 0.15s;\r\n }\r\n\r\n .kirki-control-input-slider {\r\n position: relative;\r\n top: -1px;\r\n padding: 0;\r\n margin: 0;\r\n width: 100%;\r\n height: 5px;\r\n border-radius: 2.5px;\r\n background-color: #bdc3c7;\r\n outline: none;\r\n -webkit-appearance: none;\r\n }\r\n\r\n .kirki-control-input-slider::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n appearance: none;\r\n width: 16px;\r\n height: 16px;\r\n border-radius: 50%;\r\n background-color: #f0f0f0;\r\n cursor: pointer;\r\n border: 1px solid #999;\r\n box-shadow: none;\r\n -webkit-transition: background-color 0.15s ease-in-out,\r\n box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\r\n transition: background-color 0.15s ease-in-out,\r\n box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\r\n }\r\n\r\n .kirki-control-input-slider::-webkit-slider-thumb:hover,\r\n .kirki-control-input-slider::-webkit-slider-thumb:focus {\r\n background-color: #e7e7e7;\r\n }\r\n\r\n .kirki-control-input-slider:active::-webkit-slider-thumb {\r\n background-color: #e7e7e7;\r\n }\r\n\r\n .kirki-control-input-slider::-moz-range-thumb {\r\n width: 16px;\r\n height: 16px;\r\n border: 0;\r\n border-radius: 50%;\r\n background-color: #f0f0f0;\r\n cursor: pointer;\r\n border: 1px solid #999;\r\n box-shadow: none;\r\n -moz-transition: background-color 0.15s ease-in-out,\r\n box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\r\n transition: background-color 0.15s ease-in-out,\r\n box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\r\n }\r\n\r\n .kirki-control-input-slider::-moz-range-thumb:hover,\r\n .kirki-control-input-slider::-moz-range-thumb:focus {\r\n background-color: #e7e7e7;\r\n }\r\n\r\n ::-moz-range-track {\r\n background-color: #bdc3c7;\r\n border: 0;\r\n }\r\n\r\n input::-moz-focus-inner,\r\n input::-moz-focus-outer {\r\n border: 0;\r\n }\r\n}\r\n",".customize-control-kirki-input-slider .kirki-control-label {\n position: relative;\n display: block;\n}\n.customize-control-kirki-input-slider .customize-control-description {\n padding-right: 30px;\n}\n.customize-control-kirki-input-slider .kirki-control-form {\n position: relative;\n margin-bottom: 12px;\n}\n.customize-control-kirki-input-slider .kirki-control-form:hover .kirki-control-reset {\n opacity: 1;\n}\n.customize-control-kirki-input-slider .kirki-control-reset {\n display: flex;\n align-items: center;\n justify-content: center;\n bottom: 36px;\n right: 0;\n position: absolute;\n padding: 0;\n width: 16px;\n height: 16px;\n color: #50575e;\n background-color: transparent;\n border-radius: 50%;\n border-width: 0;\n opacity: 0;\n cursor: pointer;\n transition: all 0.3s;\n z-index: 3;\n}\n.customize-control-kirki-input-slider .kirki-control-reset:focus {\n opacity: 1;\n}\n.customize-control-kirki-input-slider .kirki-control-reset:hover i {\n color: #f00;\n transform: rotate(-45deg);\n}\n.customize-control-kirki-input-slider .kirki-control-reset i {\n font-size: 12px;\n width: auto;\n height: auto;\n transform: rotate(45deg);\n transition: transform 0.3s;\n}\n.customize-control-kirki-input-slider .kirki-control-cols {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.customize-control-kirki-input-slider .kirki-control-left-col {\n width: 75%;\n padding-right: 13px;\n}\n.customize-control-kirki-input-slider .kirki-control-right-col {\n width: 25%;\n text-align: right;\n}\n.customize-control-kirki-input-slider .kirki-control-input:focus {\n background-color: #fff;\n}\n.customize-control-kirki-input-slider .kirki-control-input {\n font-size: 12px;\n text-align: center;\n background-color: #f7f7f7;\n border-color: #bbb;\n border-radius: 4px;\n z-index: 2;\n transition: box-shadow 0.15s;\n}\n.customize-control-kirki-input-slider .kirki-control-input-slider {\n position: relative;\n top: -1px;\n padding: 0;\n margin: 0;\n width: 100%;\n height: 5px;\n border-radius: 2.5px;\n background-color: #bdc3c7;\n outline: none;\n -webkit-appearance: none;\n}\n.customize-control-kirki-input-slider .kirki-control-input-slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background-color: #f0f0f0;\n cursor: pointer;\n border: 1px solid #999;\n box-shadow: none;\n -webkit-transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n}\n.customize-control-kirki-input-slider .kirki-control-input-slider::-webkit-slider-thumb:hover,\n.customize-control-kirki-input-slider .kirki-control-input-slider::-webkit-slider-thumb:focus {\n background-color: #e7e7e7;\n}\n.customize-control-kirki-input-slider .kirki-control-input-slider:active::-webkit-slider-thumb {\n background-color: #e7e7e7;\n}\n.customize-control-kirki-input-slider .kirki-control-input-slider::-moz-range-thumb {\n width: 16px;\n height: 16px;\n border: 0;\n border-radius: 50%;\n background-color: #f0f0f0;\n cursor: pointer;\n border: 1px solid #999;\n box-shadow: none;\n -moz-transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n}\n.customize-control-kirki-input-slider .kirki-control-input-slider::-moz-range-thumb:hover,\n.customize-control-kirki-input-slider .kirki-control-input-slider::-moz-range-thumb:focus {\n background-color: #e7e7e7;\n}\n.customize-control-kirki-input-slider ::-moz-range-track {\n background-color: #bdc3c7;\n border: 0;\n}\n.customize-control-kirki-input-slider input::-moz-focus-inner,\n.customize-control-kirki-input-slider input::-moz-focus-outer {\n border: 0;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"} packages/kirki-pro-input-slider/dist/control.js.map 0000644 00000027252 14717762257 0016435 0 ustar 00 {"mappings":"qBAAAA,EAAeC,MCEf,IA6IAC,EA7I8BC,SAAAA,GAC5B,IAAQC,EAAwCD,EAAxCC,QAASC,EAA+BF,EAA/BE,kBAAmBC,EAAYH,EAAZG,QAEhCC,EAAU,GAERC,EAAiBC,SAAAA,GAIrB,OAHIA,EAAQH,EAAQI,MAAKD,EAAQH,EAAQI,KACrCD,EAAQH,EAAQK,MAAKF,EAAQH,EAAQK,KAElCF,GAGHG,EAAkBH,SAAAA,GAGtB,IAAMI,GAFNJ,EAAQ,iBAAoBA,EAAQA,EAAMK,WAAaL,GAE/BM,QAAN,OAAsB,IACpCC,EAAcP,EAAMM,QAAQF,EAAW,IAK3C,OAHAG,EAAcC,WAAWD,EAAYE,QAG9B,CACLC,OAHFH,EAAcR,EAAcQ,GAI1BI,KAAMP,IAIJQ,EAAoBZ,SAAAA,GACxB,IAAMa,EAAcV,EAAeH,GACnC,OAAOa,EAAYH,OAASG,EAAYF,MAGpCG,EAAqBd,SAAAA,GACzB,OAAOG,EAAeH,GAAOU,QAG/Bf,EAAQoB,qBAAwBC,SAAAA,GAC1B,WAAalB,EACfmB,EAASC,QAAQlB,MAAQY,EAAiBI,GACjC,UAAYlB,EACrBqB,EAAUD,QAAQlB,MAAQc,EAAkBE,GACnC,UAAYlB,IACrBmB,EAASC,QAAQlB,MAAQgB,EACzBG,EAAUD,QAAQlB,MAAQgB,IAI9B,IAoCMI,EAAW,uBAA2CC,OAArBzB,EAAkB0B,IACnDC,EAAcT,EAAkBpB,EAAMM,OACtCwB,EAAaZ,EAAiBlB,EAAMM,OAEpCmB,EAAYM,EAAAA,OAAO,MACnBR,EAAWQ,EAAAA,OAAO,MAExB,OACEjC,MADFkC,cAAA,MAAA,CACOC,UAAU,qBAAqBC,SAAS,KAC3CpC,MADFkC,cAAA,QAAA,CACSC,UAAU,sBAAsBE,QAAST,GAC9C5B,MADFkC,cAAA,OAAA,CACQC,UAAU,2BAA2BjC,EAAMoC,OACjDtC,MADAkC,cAAA,OAAA,CAEEC,UAAU,4CACVI,wBAAyB,CAAEC,OAAQtC,EAAMuC,gBAI7CzC,MANEkC,cAAA,MAAA,CAOAC,UAAU,4CACVO,IAAKxC,EAAMyC,2BAGb3C,MALAkC,cAAA,SAAA,CAMEU,KAAK,SACLT,UAAU,sBACVU,QA5CeC,SAAAA,GACf,KAAO5C,EAAM6C,cAAW,IAAuB7C,EAAM6C,SACvDpB,EAAUD,QAAQlB,MAAQN,EAAM6C,QAChCtB,EAASC,QAAQlB,MAAQN,EAAM6C,SAE3B,KAAO7C,EAAMM,OACfmB,EAAUD,QAAQlB,MAAQN,EAAMM,MAChCiB,EAASC,QAAQlB,MAAQN,EAAMM,QAE/BmB,EAAUD,QAAQlB,MAAQH,EAAQI,IAClCgB,EAASC,QAAQlB,MAAQ,IAI7BF,EAAU,QACVF,EAAkB4C,IAAIrB,EAAUD,QAAQlB,SA+BpCR,MALFkC,cAAA,IAAA,CAKKC,UAAU,sCAGfnC,MAHEkC,cAAA,MAAA,CAGGC,UAAU,sBACbnC,MADFkC,cAAA,MAAA,CACOC,UAAU,0BACbnC,MADFkC,cAAA,QAAA,CAEIQ,IAAKf,EACLiB,KAAK,QACLd,GAAIF,EACJqB,aAAclB,EACdtB,IAAKJ,EAAQI,IACbC,IAAKL,EAAQK,IACbwC,KAAM7C,EAAQ6C,KACdf,UAAU,4DACVgB,SAxEkBL,SAAAA,GAC1BxC,EAAU,SAEV,IAAIE,EAAQQ,WAAW8B,EAAEM,OAAO5C,OAI1B6C,GAHN7C,EAAQD,EAAcC,IAEAG,EAAec,EAASC,QAAQlB,OACVW,KAE5Cf,EAAkB4C,IAAIK,OAkElBrD,MAZEkC,cAAA,MAAA,CAYGC,UAAU,2BACbnC,MADFkC,cAAA,QAAA,CAEIQ,IAAKjB,EACLmB,KAAK,OACLK,aAAcjB,EACdG,UAAU,sBACVgB,SAtFiBL,SAAAA,GACzBxC,EAAU,QACVF,EAAkB4C,IAAI5B,EAAiB0B,EAAEM,OAAO5C,qOCXhD8C,GAAAC,UAAAC,QAAAC,OAAA,CAzBwDC,WAAA,SAAA5B,EAAA6B,GAiD5D,IAAAxD,EAAAyD,KAEIzD,EAAMA,yBAANA,EAAAwC,yBAAAkB,KAAA1D,GAEA2D,GAAAA,UAASC,QACPC,UAAAN,WAAAO,KAAA9D,EAAC2B,EAAA6B,GAtDqDL,GAAAC,UAAApD,QAAA0D,KAAA,WAsDtD,SACM1D,EAFR2D,GAGI3D,IAFF+D,IAGE/D,EAAAgE,UACAhE,EAAAiE,UAAAC,SACAf,GAAOnD,UAAQwD,QAAOnD,OAAtB,UAAA8D,QAwCR3B,yBAAA,SAAA4B,GAEoBX,KAGRY,cAACC,UAAuBtE,OAAQiE,GAHxBR,KAMTL,cAAUC,4kBCrHrBF,GAAGC,UAAUmB,mBAAmB,sBAAwBC","sources":["React.js","src/KirkiInputSliderForm.js","src/KirkiInputSliderControl.js","src/control.js"],"sourcesContent":["module.exports=React;","import { useRef } from \"react\";\n\nconst KirkiInputSliderForm = (props) => {\n const { control, customizerSetting, choices } = props;\n\n let trigger = \"\";\n\n const validateValue = (value) => {\n if (value < choices.min) value = choices.min;\n if (value > choices.max) value = choices.max;\n\n return value;\n };\n\n const getValueObject = (value) => {\n value = \"string\" !== typeof value ? value.toString() : value;\n\n const valueUnit = value.replace(/\\d+/g, \"\");\n let valueNumber = value.replace(valueUnit, \"\");\n\n valueNumber = parseFloat(valueNumber.trim());\n valueNumber = validateValue(valueNumber);\n\n return {\n number: valueNumber,\n unit: valueUnit,\n };\n };\n\n const getValueForInput = (value) => {\n const valueObject = getValueObject(value);\n return valueObject.number + valueObject.unit;\n };\n\n const getValueForSlider = (value) => {\n return getValueObject(value).number;\n };\n\n control.updateComponentState = (val) => {\n if (\"slider\" === trigger) {\n valueRef.current.value = getValueForInput(val);\n } else if (\"input\" === trigger) {\n sliderRef.current.value = getValueForSlider(val);\n } else if (\"reset\" === trigger) {\n valueRef.current.value = val;\n sliderRef.current.value = val;\n }\n };\n\n const handleInputChange = (e) => {\n trigger = \"input\";\n customizerSetting.set(getValueForInput(e.target.value));\n };\n\n const handleSliderChange = (e) => {\n trigger = \"slider\";\n\n let value = parseFloat(e.target.value);\n value = validateValue(value);\n\n const inputValueObj = getValueObject(valueRef.current.value); // We're going to use the unit.\n const valueForInput = value + inputValueObj.unit;\n\n customizerSetting.set(valueForInput);\n };\n\n const handleReset = (e) => {\n if (\"\" !== props.default && \"undefined\" !== typeof props.default) {\n sliderRef.current.value = props.default;\n valueRef.current.value = props.default;\n } else {\n if (\"\" !== props.value) {\n sliderRef.current.value = props.value;\n valueRef.current.value = props.value;\n } else {\n sliderRef.current.value = choices.min;\n valueRef.current.value = \"\";\n }\n }\n\n trigger = \"reset\";\n customizerSetting.set(sliderRef.current.value);\n };\n\n // Preparing for the template.\n const fieldId = `kirki-control-input-${customizerSetting.id}`;\n const sliderValue = getValueForSlider(props.value);\n const inputValue = getValueForInput(props.value);\n\n const sliderRef = useRef(null);\n const valueRef = useRef(null);\n\n return (\n <div className=\"kirki-control-form\" tabIndex=\"1\">\n <label className=\"kirki-control-label\" htmlFor={fieldId}>\n <span className=\"customize-control-title\">{props.label}</span>\n <span\n className=\"customize-control-description description\"\n dangerouslySetInnerHTML={{ __html: props.description }}\n />\n </label>\n\n <div\n className=\"customize-control-notifications-container\"\n ref={props.setNotificationContainer}\n ></div>\n\n <button\n type=\"button\"\n className=\"kirki-control-reset\"\n onClick={handleReset}\n >\n <i className=\"dashicons dashicons-image-rotate\"></i>\n </button>\n\n <div className=\"kirki-control-cols\">\n <div className=\"kirki-control-left-col\">\n <input\n ref={sliderRef}\n type=\"range\"\n id={fieldId}\n defaultValue={sliderValue}\n min={choices.min}\n max={choices.max}\n step={choices.step}\n className=\"kirki-control-input-slider kirki-pro-control-input-slider\"\n onChange={handleSliderChange}\n />\n </div>\n <div className=\"kirki-control-right-col\">\n <input\n ref={valueRef}\n type=\"text\"\n defaultValue={inputValue}\n className=\"kirki-control-input\"\n onChange={handleInputChange}\n />\n </div>\n </div>\n </div>\n );\n};\n\nexport default KirkiInputSliderForm;\n","import KirkiInputSliderForm from \"./KirkiInputSliderForm\";\r\n\r\n/**\r\n * KirkiInputSliderControl.\r\n *\r\n * Global objects brought:\r\n * - wp\r\n * - jQuery\r\n * - React\r\n * - ReactDOM\r\n *\r\n * @class\r\n * @augments wp.customize.Control\r\n * @augments wp.customize.Class\r\n */\r\nconst KirkiInputSliderControl = wp.customize.Control.extend({\r\n /**\r\n * Initialize.\r\n *\r\n * @param {string} id - Control ID.\r\n * @param {object} params - Control params.\r\n */\r\n initialize: function (id, params) {\r\n const control = this;\r\n\r\n // Bind functions to this control context for passing as React props.\r\n control.setNotificationContainer =\r\n control.setNotificationContainer.bind(control);\r\n\r\n wp.customize.Control.prototype.initialize.call(control, id, params);\r\n\r\n // The following should be eliminated with <https://core.trac.wordpress.org/ticket/31334>.\r\n function onRemoved(removedControl) {\r\n if (control === removedControl) {\r\n control.destroy();\r\n control.container.remove();\r\n wp.customize.control.unbind(\"removed\", onRemoved);\r\n }\r\n }\r\n\r\n wp.customize.control.bind(\"removed\", onRemoved);\r\n },\r\n\r\n /**\r\n * Set notification container and render.\r\n *\r\n * This is called when the React component is mounted.\r\n *\r\n * @param {Element} element - Notification container.\r\n * @returns {void}\r\n */\r\n setNotificationContainer: function setNotificationContainer(element) {\r\n const control = this;\r\n\r\n control.notifications.container = jQuery(element);\r\n control.notifications.render();\r\n },\r\n\r\n /**\r\n * Render the control into the DOM.\r\n *\r\n * This is called from the Control#embed() method in the parent class.\r\n *\r\n * @returns {void}\r\n */\r\n renderContent: function renderContent() {\r\n const control = this;\r\n\r\n ReactDOM.render(\r\n <KirkiInputSliderForm\r\n {...control.params}\r\n control={control}\r\n customizerSetting={control.setting}\r\n setNotificationContainer={control.setNotificationCotainer}\r\n value={control.params.value}\r\n />,\r\n control.container[0]\r\n );\r\n\r\n if (false !== control.params.choices.allowCollapse) {\r\n control.container.addClass(\"allowCollapse\");\r\n }\r\n },\r\n\r\n /**\r\n * After control has been first rendered, start re-rendering when setting changes.\r\n *\r\n * React is able to be used here instead of the wp.customize.Element abstraction.\r\n *\r\n * @returns {void}\r\n */\r\n ready: function ready() {\r\n const control = this;\r\n\r\n /**\r\n * Update component value's state when customizer setting's value is changed.\r\n */\r\n control.setting.bind((val) => {\r\n control.updateComponentState(val);\r\n });\r\n },\r\n\r\n /**\r\n * This method will be overriden by the rendered component.\r\n */\r\n updateComponentState: (val) => {},\r\n\r\n /**\r\n * Handle removal/de-registration of the control.\r\n *\r\n * This is essentially the inverse of the Control#embed() method.\r\n *\r\n * @link https://core.trac.wordpress.org/ticket/31334\r\n * @returns {void}\r\n */\r\n destroy: function destroy() {\r\n const control = this;\r\n\r\n // Garbage collection: undo mounting that was done in the embed/renderContent method.\r\n ReactDOM.unmountComponentAtNode(control.container[0]);\r\n\r\n // Call destroy method in parent if it exists (as of #31334).\r\n if (wp.customize.Control.prototype.destroy) {\r\n wp.customize.Control.prototype.destroy.call(control);\r\n }\r\n },\r\n});\r\n\r\nexport default KirkiInputSliderControl;\r\n","import \"./control.scss\";\r\nimport KirkiInputSliderControl from './KirkiInputSliderControl';\r\n\r\n\r\n// Register control type with Customizer.\r\nwp.customize.controlConstructor['kirki-input-slider'] = KirkiInputSliderControl;\r\n"],"names":["module","React","$5e62cac5aac90bdd$export$2e2bcd8739ae039","props","control","customizerSetting","choices","trigger","validateValue","value","min","max","getValueObject","valueUnit","toString","replace","valueNumber","parseFloat","trim","number","unit","getValueForInput","valueObject","getValueForSlider","updateComponentState","val","valueRef","current","sliderRef","fieldId","concat","id","sliderValue","inputValue","useRef","createElement","className","tabIndex","htmlFor","label","dangerouslySetInnerHTML","__html","description","ref","setNotificationContainer","type","onClick","e","default","set","defaultValue","step","onChange","target","valueForInput","wp","customize","Control","extend","initialize","params","this","bind","ReactDOM","render","prototype","call","removedControl","destroy","container","remove","onRemoved","element","notifications","unmountComponentAtNode","controlConstructor","KirkiInputSliderControl"],"version":3,"file":"control.js.map"} packages/kirki-pro-input-slider/dist/control.css 0000644 00000006541 14717762257 0016033 0 ustar 00 .customize-control-kirki-input-slider .kirki-control-label{display:block;position:relative}.customize-control-kirki-input-slider .customize-control-description{padding-right:30px}.customize-control-kirki-input-slider .kirki-control-form{margin-bottom:12px;position:relative}.customize-control-kirki-input-slider .kirki-control-form:hover .kirki-control-reset{opacity:1}.customize-control-kirki-input-slider .kirki-control-reset{align-items:center;background-color:transparent;border-radius:50%;border-width:0;bottom:36px;color:#50575e;cursor:pointer;display:flex;height:16px;justify-content:center;opacity:0;padding:0;position:absolute;right:0;transition:all .3s;width:16px;z-index:3}.customize-control-kirki-input-slider .kirki-control-reset:focus{opacity:1}.customize-control-kirki-input-slider .kirki-control-reset:hover i{color:red;transform:rotate(-45deg)}.customize-control-kirki-input-slider .kirki-control-reset i{font-size:12px;height:auto;transform:rotate(45deg);transition:transform .3s;width:auto}.customize-control-kirki-input-slider .kirki-control-cols{align-items:center;display:flex;justify-content:space-between}.customize-control-kirki-input-slider .kirki-control-left-col{padding-right:13px;width:75%}.customize-control-kirki-input-slider .kirki-control-right-col{text-align:right;width:25%}.customize-control-kirki-input-slider .kirki-control-input:focus{background-color:#fff}.customize-control-kirki-input-slider .kirki-control-input{background-color:#f7f7f7;border-color:#bbb;border-radius:4px;font-size:12px;text-align:center;transition:box-shadow .15s;z-index:2}.customize-control-kirki-input-slider .kirki-control-input-slider{-webkit-appearance:none;background-color:#bdc3c7;border-radius:2.5px;height:5px;margin:0;outline:none;padding:0;position:relative;top:-1px;width:100%}.customize-control-kirki-input-slider .kirki-control-input-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:#f0f0f0;border:1px solid #999;border-radius:50%;box-shadow:none;cursor:pointer;height:16px;-webkit-transition:background-color .15s ease-in-out,box-shadow .15s cubic-bezier(.4,0,.2,1) 0ms;transition:background-color .15s ease-in-out,box-shadow .15s cubic-bezier(.4,0,.2,1) 0ms;width:16px}.customize-control-kirki-input-slider .kirki-control-input-slider::-webkit-slider-thumb:focus,.customize-control-kirki-input-slider .kirki-control-input-slider::-webkit-slider-thumb:hover{background-color:#e7e7e7}.customize-control-kirki-input-slider .kirki-control-input-slider:active::-webkit-slider-thumb{background-color:#e7e7e7}.customize-control-kirki-input-slider .kirki-control-input-slider::-moz-range-thumb{background-color:#f0f0f0;border:1px solid #999;border-radius:50%;box-shadow:none;cursor:pointer;height:16px;-moz-transition:background-color .15s ease-in-out,box-shadow .15s cubic-bezier(.4,0,.2,1) 0ms;transition:background-color .15s ease-in-out,box-shadow .15s cubic-bezier(.4,0,.2,1) 0ms;width:16px}.customize-control-kirki-input-slider .kirki-control-input-slider::-moz-range-thumb:focus,.customize-control-kirki-input-slider .kirki-control-input-slider::-moz-range-thumb:hover{background-color:#e7e7e7}.customize-control-kirki-input-slider ::-moz-range-track{background-color:#bdc3c7;border:0}.customize-control-kirki-input-slider input::-moz-focus-inner,.customize-control-kirki-input-slider input::-moz-focus-outer{border:0} /*# sourceMappingURL=control.css.map */ packages/kirki-pro-input-slider/composer.json 0000644 00000000372 14717762257 0015414 0 ustar 00 { "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\InputSlider\\": "src" } } } packages/kirki-pro-input-slider/.gitignore 0000644 00000000063 14717762257 0014657 0 ustar 00 node_modules package-lock.json .parcel-cache builds packages/kirki-pro-headline-divider/composer.lock 0000644 00000001124 14717762257 0016145 0 ustar 00 { "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "7671334a59eed8eda46b8c2c75a5fecf", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } packages/kirki-pro-headline-divider/kirki-pro-headline-divider.php 0000644 00000002777 14717762257 0021276 0 ustar 00 <?php /** * Plugin Name: Kirki PRO - Headlines & Divider Control * Plugin URI: https://themeum.com * Description: Headlines & divider control for Kirki Customizer Framework. * Version: 1.1 * Author: Themeum * Author URI: https://themeum.com/ * License: GPL-3.0 * License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=control%20headline%20divider * Text Domain: kirki-pro-headline-divider * Domain Path: /languages * * @package kirki-pro-headline-divider */ defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'kirki_pro_load_headline_divider_control' ) ) { /** * Load headline divider control. */ function kirki_pro_load_headline_divider_control() { // Stop, if Kirki is not installed. if ( ! defined( 'KIRKI_VERSION' ) ) { return; } // Stop, if Kirki PRO (bundle) is already installed. if ( defined( 'KIRKI_PRO_VERSION' ) ) { return; } // Stop, if Kirki Pro Headline Divider is already installed. if ( class_exists( '\Kirki\Pro\HeadlineDivider\Init' ) ) { return; } if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugin_data = get_plugin_data( __FILE__ ); define( 'KIRKI_PRO_HEADLINE_DIVIDER_VERSION', $plugin_data['Version'] ); define( 'KIRKI_PRO_HEADLINE_DIVIDER_PLUGIN_FILE', __FILE__ ); require_once __DIR__ . '/vendor/autoload.php'; new \Kirki\Pro\HeadlineDivider\Init(); } add_action( 'plugins_loaded', 'kirki_pro_load_headline_divider_control' ); } packages/kirki-pro-headline-divider/readme.txt 0000644 00000000600 14717762257 0015440 0 ustar 00 === Kirki Headlines & Divider Control === Contributors: davidvongries Tags: kirki-headline-divider-control Requires at least: 5.2 Tested up to: 5.9 Requires PHP: 7.0 License: GPL-3.0 License License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=kirki%20pro%20headline%20divider == Description == Headlines & divider extension for Kirki Customizer Framework. packages/kirki-pro-headline-divider/vendor/autoload.php 0000644 00000001403 14717762257 0017262 0 ustar 00 <?php // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, $err); } elseif (!headers_sent()) { echo $err; } } trigger_error( $err, E_USER_ERROR ); } require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit09f4acd2a8ddcef84af2ce57f365286e::getLoader(); packages/kirki-pro-headline-divider/vendor/composer/autoload_namespaces.php 0000644 00000000213 14717762257 0023306 0 ustar 00 <?php // autoload_namespaces.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( ); packages/kirki-pro-headline-divider/vendor/composer/LICENSE 0000644 00000002056 14717762257 0017602 0 ustar 00 Copyright (c) Nils Adermann, Jordi Boggiano 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. packages/kirki-pro-headline-divider/vendor/composer/autoload_psr4.php 0000644 00000000504 14717762257 0022062 0 ustar 00 <?php // autoload_psr4.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Kirki\\Pro\\HeadlineDivider\\' => array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); packages/kirki-pro-headline-divider/vendor/composer/autoload_real.php 0000644 00000002161 14717762257 0022116 0 ustar 00 <?php // autoload_real.php @generated by Composer class ComposerAutoloaderInit09f4acd2a8ddcef84af2ce57f365286e { private static $loader; public static function loadClassLoader($class) { if ('Composer\Autoload\ClassLoader' === $class) { require __DIR__ . '/ClassLoader.php'; } } /** * @return \Composer\Autoload\ClassLoader */ public static function getLoader() { if (null !== self::$loader) { return self::$loader; } require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit09f4acd2a8ddcef84af2ce57f365286e', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit09f4acd2a8ddcef84af2ce57f365286e', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInit09f4acd2a8ddcef84af2ce57f365286e::getInitializer($loader)); $loader->register(true); return $loader; } } packages/kirki-pro-headline-divider/vendor/composer/platform_check.php 0000644 00000001635 14717762257 0022271 0 ustar 00 <?php // platform_check.php @generated by Composer $issues = array(); if (!(PHP_VERSION_ID >= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); } elseif (!headers_sent()) { echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; } } trigger_error( 'Composer detected issues in your platform: ' . implode(' ', $issues), E_USER_ERROR ); } packages/kirki-pro-headline-divider/vendor/composer/ClassLoader.php 0000644 00000040220 14717762257 0021475 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Autoload; /** * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. * * $loader = new \Composer\Autoload\ClassLoader(); * * // register classes with namespaces * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * * // activate the autoloader * $loader->register(); * * // to enable searching the include path (eg. for PEAR packages) * $loader->setUseIncludePath(true); * * In this example, if you try to use a class in the Symfony\Component * namespace or one of its children (Symfony\Component\Console for instance), * the autoloader will first look for the class under the component/ * directory, and it will then fallback to the framework/ directory if not * found before giving up. * * This class is loosely based on the Symfony UniversalClassLoader. * * @author Fabien Potencier <fabien@symfony.com> * @author Jordi Boggiano <j.boggiano@seld.be> * @see https://www.php-fig.org/psr/psr-0/ * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { /** @var \Closure(string):void */ private static $includeFile; /** @var ?string */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array<string, array<string, int>> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array<string, array<int, string>> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array<string, array<string, string[]>> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array<string, string> */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array<string, bool> */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array<string, array<int, string>> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array<string, string> */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array<string, string> $classMap * * @return void */ public function addClassMap(array $classMap) { if ($this->classMap) { $this->classMap = array_merge($this->classMap, $classMap); } else { $this->classMap = $classMap; } } /** * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 root directories * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $paths ); } } /** * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { // Register directories for a new namespace. $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $paths ); } } /** * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 base directories * * @return void */ public function set($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr0 = (array) $paths; } else { $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; } } /** * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * * @return void */ public function setPsr4($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr4 = (array) $paths; } else { $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } } /** * Turns on searching the include path for class files. * * @param bool $useIncludePath * * @return void */ public function setUseIncludePath($useIncludePath) { $this->useIncludePath = $useIncludePath; } /** * Can be used to check if the autoloader uses the include path to check * for classes. * * @return bool */ public function getUseIncludePath() { return $this->useIncludePath; } /** * Turns off searching the prefix and fallback directories for classes * that have not been registered with the class map. * * @param bool $classMapAuthoritative * * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { $this->classMapAuthoritative = $classMapAuthoritative; } /** * Should class lookup fail if not found in the current class map? * * @return bool */ public function isClassMapAuthoritative() { return $this->classMapAuthoritative; } /** * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix * * @return void */ public function setApcuPrefix($apcuPrefix) { $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** * The APCu prefix in use, or null if APCu caching is not enabled. * * @return string|null */ public function getApcuPrefix() { return $this->apcuPrefix; } /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not * * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { return; } if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); self::$registeredLoaders[$this->vendorDir] = $this; } } /** * Unregisters this instance as an autoloader. * * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); if (null !== $this->vendorDir) { unset(self::$registeredLoaders[$this->vendorDir]); } } /** * Loads the given class or interface. * * @param string $class The name of the class * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { $includeFile = self::$includeFile; $includeFile($file); return true; } return null; } /** * Finds the path to the file where the class is defined. * * @param string $class The name of the class * * @return string|false The path if found, false otherwise */ public function findFile($class) { // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } if (null !== $this->apcuPrefix) { $file = apcu_fetch($this->apcuPrefix.$class, $hit); if ($hit) { return $file; } } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM if (false === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } if (null !== $this->apcuPrefix) { apcu_add($this->apcuPrefix.$class, $file); } if (false === $file) { // Remember that this class does not exist. $this->missingClasses[$class] = true; } return $file; } /** * Returns the currently registered loaders indexed by their corresponding vendor directories. * * @return self[] */ public static function getRegisteredLoaders() { return self::$registeredLoaders; } /** * @param string $class * @param string $ext * @return string|false */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { if (file_exists($file = $dir . $pathEnd)) { return $file; } } } } } // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } // PSR-0 lookup if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); } else { // PEAR-like class name $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; } if (isset($this->prefixesPsr0[$first])) { foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } } } } // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } // PSR-0 include paths. if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } return false; } /** * @return void */ private static function initializeIncludeClosure() { if (self::$includeFile !== null) { return; } /** * Scope isolated include. * * Prevents access to $this/self from included files. * * @param string $file * @return void */ self::$includeFile = \Closure::bind(static function($file) { include $file; }, null, null); } } packages/kirki-pro-headline-divider/vendor/composer/autoload_classmap.php 0000644 00000000336 14717762257 0023000 0 ustar 00 <?php // autoload_classmap.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-headline-divider/vendor/composer/autoload_static.php 0000644 00000002574 14717762257 0022472 0 ustar 00 <?php // autoload_static.php @generated by Composer namespace Composer\Autoload; class ComposerStaticInit09f4acd2a8ddcef84af2ce57f365286e { public static $prefixLengthsPsr4 = array ( 'K' => array ( 'Kirki\\Pro\\HeadlineDivider\\' => 26, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\HeadlineDivider\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit09f4acd2a8ddcef84af2ce57f365286e::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit09f4acd2a8ddcef84af2ce57f365286e::$prefixDirsPsr4; $loader->classMap = ComposerStaticInit09f4acd2a8ddcef84af2ce57f365286e::$classMap; }, null, ClassLoader::class); } } packages/kirki-pro-headline-divider/vendor/composer/InstalledVersions.php 0000644 00000037417 14717762257 0022767 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; /** * This class is copied in every Composer installed project and available to all * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` * * @final */ class InstalledVersions { /** * @var mixed[]|null * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static $installedByVendor = array(); /** * Returns a list of all package names which are present, either by being installed, replaced or provided * * @return string[] * @psalm-return list<string> */ public static function getInstalledPackages() { $packages = array(); foreach (self::getInstalled() as $installed) { $packages[] = array_keys($installed['versions']); } if (1 === \count($packages)) { return $packages[0]; } return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); } /** * Returns a list of all package names with a specific type e.g. 'library' * * @param string $type * @return string[] * @psalm-return list<string> */ public static function getInstalledPackagesByType($type) { $packagesByType = array(); foreach (self::getInstalled() as $installed) { foreach ($installed['versions'] as $name => $package) { if (isset($package['type']) && $package['type'] === $type) { $packagesByType[] = $name; } } } return $packagesByType; } /** * Checks whether the given package is installed * * This also returns true if the package name is provided or replaced by another package * * @param string $packageName * @param bool $includeDevRequirements * @return bool */ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } return false; } /** * Checks whether the given package satisfies a version constraint * * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: * * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') * * @param VersionParser $parser Install composer/semver to have access to this class and functionality * @param string $packageName * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package * @return bool */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); } /** * Returns a version constraint representing all the range(s) which are installed for a given package * * It is easier to use this via isInstalled() with the $constraint argument if you need to check * whether a given version of a package is installed, and not just whether it exists * * @param string $packageName * @return string Version constraint usable with composer/semver */ public static function getVersionRanges($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } $ranges = array(); if (isset($installed['versions'][$packageName]['pretty_version'])) { $ranges[] = $installed['versions'][$packageName]['pretty_version']; } if (array_key_exists('aliases', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); } if (array_key_exists('replaced', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); } if (array_key_exists('provided', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); } return implode(' || ', $ranges); } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['version'])) { return null; } return $installed['versions'][$packageName]['version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getPrettyVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['pretty_version'])) { return null; } return $installed['versions'][$packageName]['pretty_version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference */ public static function getReference($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['reference'])) { return null; } return $installed['versions'][$packageName]['reference']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. */ public static function getInstallPath($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @return array * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { $installed = self::getInstalled(); return $installed[0]['root']; } /** * Returns the raw installed.php data for custom implementations * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} */ public static function getRawData() { @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { self::$installed = include __DIR__ . '/installed.php'; } else { self::$installed = array(); } } return self::$installed; } /** * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ public static function getAllRawData() { return self::getInstalled(); } /** * Lets you reload the static array from another file * * This is only useful for complex integrations in which a project needs to use * this class but then also needs to execute another project's autoloader in process, * and wants to ensure both projects have access to their version of installed.php. * * A typical case would be PHPUnit, where it would need to make sure it reads all * the data it needs from this class, then call reload() with * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure * the project in which it runs can then also use this class safely, without * interference between PHPUnit's dependencies and the project's dependencies. * * @param array[] $data A vendor/composer/installed.php data set * @return void * * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static function getInstalled() { if (null === self::$canGetVendors) { self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); } $installed = array(); if (self::$canGetVendors) { foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require $vendorDir.'/composer/installed.php'; $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } } } } if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } packages/kirki-pro-headline-divider/vendor/composer/installed.json 0000644 00000000105 14717762257 0021440 0 ustar 00 { "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-headline-divider/vendor/composer/installed.php 0000644 00000001344 14717762257 0021264 0 ustar 00 <?php return array( 'root' => array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); packages/kirki-pro-headline-divider/src/Init.php 0000644 00000001373 14717762257 0015655 0 ustar 00 <?php /** * Init the Kirki PRO's headlines & divider package. * * @package kirki-pro-headline-divider * @since 1.0.0 */ namespace Kirki\Pro\HeadlineDivider; /** * Manage the tabs package. */ class Init { /** * The class constructor. */ public function __construct() { add_filter( 'kirki_control_types', [ $this, 'control_type' ] ); } /** * The control type. * * @param array $control_types The existing control types. */ public function control_type( $control_types ) { $control_types['kirki-headline'] = 'Kirki\Pro\Control\Headline'; $control_types['kirki-headline-toggle'] = 'Kirki\Pro\Control\HeadlineToggle'; $control_types['kirki-divider'] = 'Kirki\Pro\Control\Divider'; return $control_types; } } packages/kirki-pro-headline-divider/src/control.js 0000644 00000000031 14717762257 0016245 0 ustar 00 import "./control.scss"; packages/kirki-pro-headline-divider/src/control.scss 0000644 00000002005 14717762257 0016607 0 ustar 00 .customize-control-kirki-headline { position: relative; left: -24px; padding: 10px 24px; width: calc(100% + 48px); background-color: #fff; .customize-control-title { margin-top: 0; margin-bottom: 0; line-height: 1.2; font-size: 14px; font-weight: 600; } .customize-control-description { margin-top: 0; margin-bottom: 0; line-height: 1.3; } .kirki-tooltip-wrapper { .tooltip-trigger { top: -4px; left: 2px; &:hover { + .tooltip-content { bottom: 29px; } } } .tooltip-content { bottom: 26px; } } } .customize-control-kirki-headline-toggle { position: relative; padding: 10px 24px; width: calc(100% + 48px); left: -24px; background-color: #fff; &.customize-control-kirki-switch { .kirki-toggle { align-items: center; } } .customize-control-title { margin-bottom: 0; font-size: 14px; } .kirki-toggle { .kirki-control-form { top: 2px; } } } packages/kirki-pro-headline-divider/src/Field/Divider.php 0000644 00000003461 14717762257 0017363 0 ustar 00 <?php // phpcs:disable PHPCompatibility.FunctionDeclarations.NewClosure /** * Override field methods * * @package kirki-pro-divider * @since 1.0 */ namespace Kirki\Pro\Field; use Kirki\Field; /** * Field overrides. * * @since 1.0 */ class Divider extends Field { /** * The field type. * * @since 1.0 * @var string */ public $type = 'kirki-divider'; /** * The control class-name. * * @since 1.0 * @var string */ protected $control_class = '\Kirki\Pro\Control\Divider'; /** * Whether we should register the control class for JS-templating or not. * * @access protected * @since 1.0 * @var bool */ protected $control_has_js_template = true; /** * Filter arguments before creating the setting. * * @since 1.0 * * @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'] = '__return_null'; } } return $args; } /** * Filter arguments before creating the control. * * @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-divider'; } return $args; } } packages/kirki-pro-headline-divider/src/Field/Headline.php 0000644 00000003466 14717762257 0017513 0 ustar 00 <?php // phpcs:disable PHPCompatibility.FunctionDeclarations.NewClosure /** * Override field methods * * @package kirki-pro-headline * @since 1.0 */ namespace Kirki\Pro\Field; use Kirki\Field; /** * Field overrides. * * @since 1.0 */ class Headline extends Field { /** * The field type. * * @since 1.0 * @var string */ public $type = 'kirki-headline'; /** * The control class-name. * * @since 1.0 * @var string */ protected $control_class = '\Kirki\Pro\Control\Headline'; /** * Whether we should register the control class for JS-templating or not. * * @access protected * @since 1.0 * @var bool */ protected $control_has_js_template = true; /** * Filter arguments before creating the setting. * * @since 1.0 * * @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'] = '__return_null'; } } return $args; } /** * Filter arguments before creating the control. * * @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-headline'; } return $args; } } packages/kirki-pro-headline-divider/src/Field/HeadlineToggle.php 0000644 00000000732 14717762257 0020646 0 ustar 00 <?php // phpcs:disable PHPCompatibility.FunctionDeclarations.NewClosure /** * Override field methods * * @package kirki-pro-headline * @since 1.0 */ namespace Kirki\Pro\Field; use Kirki\Field; use Kirki\Field\Checkbox_Toggle; /** * Field overrides. * * @since 1.0 */ class HeadlineToggle extends Checkbox_Toggle { /** * The control class-name. * * @since 1.0 * @var string */ protected $control_class = '\Kirki\Pro\Control\HeadlineToggle'; } packages/kirki-pro-headline-divider/src/Control/Divider.php 0000644 00000003146 14717762257 0017760 0 ustar 00 <?php /** * Customizer Control: kirki-divider. * * @package kirki-pro-divider * @since 1.0 */ namespace Kirki\Pro\Control; use Kirki\Control\Base; // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Divider control */ class Divider extends Base { /** * The control type. * * @since 1.0 * @var string */ public $type = 'kirki-divider'; /** * The version. Used in scripts & styles for cache-busting. * * @since 1.0 * @var string */ public static $control_ver = '1.0'; /** * Refresh the parameters passed to the JavaScript via JSON. * * @access public * @since 1.0 * @see WP_Customize_Control::to_json() * @return void */ public function to_json() { // Get the basics from the parent class. parent::to_json(); $border_top_color = isset( $this->choices ) && isset( $this->choices['color'] ) ? esc_attr( $this->choices['color'] ) : '#ccc'; $border_bottom_color = '#f8f8f8'; $this->json['choices']['borderTopColor'] = $border_top_color; $this->json['choices']['borderBottomColor'] = $border_bottom_color; } /** * 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() * @since 1.0 */ protected function content_template() { ?> <hr style="border-top: 1px solid {{ data.choices.borderTopColor }}; border-bottom: 1px solid {{ data.choices.borderBottomColor }}" /> <?php } } packages/kirki-pro-headline-divider/src/Control/Headline.php 0000644 00000003014 14717762257 0020075 0 ustar 00 <?php /** * Customizer Control: kirki-headline. * * @package kirki-pro-headline * @since 1.0 */ namespace Kirki\Pro\Control; use Kirki\Control\Base; use Kirki\URL; // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Headline control */ class Headline extends Base { /** * The control type. * * @since 1.0 * @var string */ public $type = 'kirki-headline'; /** * The version. Used in scripts & styles for cache-busting. * * @since 1.0 * @var string */ public static $control_ver = '1.0.0.1'; /** * Enqueue control related styles/scripts. * * @since 1.0 * @access public */ public function enqueue() { parent::enqueue(); // Enqueue the style. wp_enqueue_style( 'kirki-control-headline', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver ); } /** * 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() * @since 1.0 */ protected function content_template() { ?> <div class="kirki-control-label"> <# if (data.label) { #> <h4 class="customize-control-title"> {{{ data.label }}} </h4> <# } #> <# if (data.description) { #> <p class="customize-control-description">{{{ data.description }}}</p> <# } #> </div> <?php } } packages/kirki-pro-headline-divider/src/Control/HeadlineToggle.php 0000644 00000002023 14717762257 0021236 0 ustar 00 <?php /** * Customizer Control: kirki-headline-toggle. * * @package kirki-pro-headline-toggle * @since 1.0 */ namespace Kirki\Pro\Control; use Kirki\Control\Checkbox_Switch; // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Headline toggle control */ class HeadlineToggle extends Checkbox_Switch { /** * The class constructor. * * @since 1.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args The control arguments. */ public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); if ( isset( $args['wrapper_attrs'] ) && isset( $args['wrapper_attrs']['class'] ) ) { $this->wrapper_attrs['class'] = '{default_class} ' . $args['wrapper_attrs']['class'] . ' customize-control-kirki-headline-toggle'; } else { $this->wrapper_attrs['class'] = '{default_class} customize-control-kirki-headline-toggle'; } } } packages/kirki-pro-headline-divider/package.json 0000644 00000001433 14717762257 0015735 0 ustar 00 { "name": "kirki-pro-headline-divider", "version": "1.1", "description": "Dev toolkit for Kirki kirki-pro-headline-divider", "keywords": [ "kirki-pro-headline-divider" ], "author": "Kirki", "license": "MIT", "bugs": { "url": "https://www.themeum.com/" }, "homepage": "https://www.themeum.com/", "devDependencies": { "@parcel/transformer-sass": "^2.2.1", "parcel": "^2.2.1" }, "source": "src/control.js", "scripts": { "build": "parcel build", "dev": "parcel build --no-optimize" }, "alias": { "jquery": { "global": "jQuery" }, "wp": { "global": "wp" }, "react": { "global": "React" }, "react-dom": { "global": "ReactDOM" } }, "browserslist": "> 0.5%, last 2 versions, not dead" } packages/kirki-pro-headline-divider/dist/control.js 0000644 00000000045 14717762257 0016426 0 ustar 00 //# sourceMappingURL=control.js.map packages/kirki-pro-headline-divider/dist/control.css.map 0000644 00000005677 14717762257 0017376 0 ustar 00 {"mappings":"AAAA,kCAKE,qBAAA,CAHA,UAAA,CACA,iBAAA,CAFA,iBAAA,CAGA,uBCEF,CDCE,2DAIE,cAAA,CACA,eAAA,CAFA,eAAA,CADA,eAAA,CADA,YCKJ,CDEE,iEAGE,eAAA,CADA,eAAA,CADA,YCEJ,CDII,0EAEE,QAAA,CADA,QCDN,CDKQ,iGACE,WCHV,CDQI,0EACE,WCNN,CDWA,yCAKE,qBAAA,CADA,UAAA,CAFA,iBAAA,CADA,iBAAA,CAEA,uBCNF,CDWI,sFACE,kBCTN,CDaE,kEAEE,cAAA,CADA,eCVJ,CDeI,2EACE,OCbN","sources":["src/control.scss","%3Cinput%20css%20KSx3Ca%3E"],"sourcesContent":[".customize-control-kirki-headline {\r\n position: relative;\r\n left: -24px;\r\n padding: 10px 24px;\r\n width: calc(100% + 48px);\r\n background-color: #fff;\r\n\r\n .customize-control-title {\r\n margin-top: 0;\r\n margin-bottom: 0;\r\n line-height: 1.2;\r\n font-size: 14px;\r\n font-weight: 600;\r\n }\r\n\r\n .customize-control-description {\r\n margin-top: 0;\r\n margin-bottom: 0;\r\n line-height: 1.3;\r\n }\r\n\r\n .kirki-tooltip-wrapper {\r\n .tooltip-trigger {\r\n top: -4px;\r\n left: 2px;\r\n\r\n &:hover {\r\n + .tooltip-content {\r\n bottom: 29px;\r\n }\r\n }\r\n }\r\n\r\n .tooltip-content {\r\n bottom: 26px;\r\n }\r\n }\r\n}\r\n\r\n.customize-control-kirki-headline-toggle {\r\n position: relative;\r\n padding: 10px 24px;\r\n width: calc(100% + 48px);\r\n left: -24px;\r\n background-color: #fff;\r\n\r\n &.customize-control-kirki-switch {\r\n .kirki-toggle {\r\n align-items: center;\r\n }\r\n }\r\n\r\n .customize-control-title {\r\n margin-bottom: 0;\r\n font-size: 14px;\r\n }\r\n\r\n .kirki-toggle {\r\n .kirki-control-form {\r\n top: 2px;\r\n }\r\n }\r\n}\r\n",".customize-control-kirki-headline {\n position: relative;\n left: -24px;\n padding: 10px 24px;\n width: calc(100% + 48px);\n background-color: #fff;\n}\n.customize-control-kirki-headline .customize-control-title {\n margin-top: 0;\n margin-bottom: 0;\n line-height: 1.2;\n font-size: 14px;\n font-weight: 600;\n}\n.customize-control-kirki-headline .customize-control-description {\n margin-top: 0;\n margin-bottom: 0;\n line-height: 1.3;\n}\n.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-trigger {\n top: -4px;\n left: 2px;\n}\n.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-trigger:hover + .tooltip-content {\n bottom: 29px;\n}\n.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-content {\n bottom: 26px;\n}\n\n.customize-control-kirki-headline-toggle {\n position: relative;\n padding: 10px 24px;\n width: calc(100% + 48px);\n left: -24px;\n background-color: #fff;\n}\n.customize-control-kirki-headline-toggle.customize-control-kirki-switch .kirki-toggle {\n align-items: center;\n}\n.customize-control-kirki-headline-toggle .customize-control-title {\n margin-bottom: 0;\n font-size: 14px;\n}\n.customize-control-kirki-headline-toggle .kirki-toggle .kirki-control-form {\n top: 2px;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"} packages/kirki-pro-headline-divider/dist/control.js.map 0000644 00000000137 14717762257 0017204 0 ustar 00 {"mappings":"","sources":[],"sourcesContent":[],"names":[],"version":3,"file":"control.js.map"} packages/kirki-pro-headline-divider/dist/control.css 0000644 00000002137 14717762257 0016606 0 ustar 00 .customize-control-kirki-headline{background-color:#fff;left:-24px;padding:10px 24px;position:relative;width:calc(100% + 48px)}.customize-control-kirki-headline .customize-control-title{font-size:14px;font-weight:600;line-height:1.2;margin-bottom:0;margin-top:0}.customize-control-kirki-headline .customize-control-description{line-height:1.3;margin-bottom:0;margin-top:0}.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-trigger{left:2px;top:-4px}.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-trigger:hover+.tooltip-content{bottom:29px}.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-content{bottom:26px}.customize-control-kirki-headline-toggle{background-color:#fff;left:-24px;padding:10px 24px;position:relative;width:calc(100% + 48px)}.customize-control-kirki-headline-toggle.customize-control-kirki-switch .kirki-toggle{align-items:center}.customize-control-kirki-headline-toggle .customize-control-title{font-size:14px;margin-bottom:0}.customize-control-kirki-headline-toggle .kirki-toggle .kirki-control-form{top:2px} /*# sourceMappingURL=control.css.map */ packages/kirki-pro-headline-divider/composer.json 0000644 00000000376 14717762257 0016176 0 ustar 00 { "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\HeadlineDivider\\": "src" } } } packages/kirki-pro-headline-divider/.gitignore 0000644 00000000063 14717762257 0015435 0 ustar 00 node_modules package-lock.json .parcel-cache builds packages/kirki-pro-margin-padding/composer.lock 0000644 00000001124 14717762257 0015631 0 ustar 00 { "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "6068bbfbc68ad05162ba739d0807ec89", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } packages/kirki-pro-margin-padding/kirki-pro-margin-padding.php 0000644 00000002740 14717762257 0020434 0 ustar 00 <?php /** * Plugin Name: Kirki PRO Margin & Padding * Plugin URI: https://www.themeum.com/ * Description: Margin & padding control for Kirki Customizer Framework. * Version: 1.1 * Author: Themeum * Author URI: https://themeum.com/ * License: GPL-3.0 * License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=control%20margin%20padding * Text Domain: kirki-pro-margin-padding * Domain Path: /languages * * @package kirki-pro-margin-padding */ defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'kirki_pro_load_margin_padding_control' ) ) { /** * Load margin & padding control. */ function kirki_pro_load_margin_padding_control() { // Stop, if Kirki is not installed. if ( ! defined( 'KIRKI_VERSION' ) ) { return; } // Stop, if Kirki PRO (bundle) is already installed. if ( defined( 'KIRKI_PRO_VERSION' ) ) { return; } // Stop, if Kirki Pro Margin & Padding is already installed. if ( class_exists( '\Kirki\Pro\MarginPadding\Init' ) ) { return; } if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugin_data = get_plugin_data( __FILE__ ); define( 'KIRKI_PRO_MARGIN_PADDING_VERSION', $plugin_data['Version'] ); define( 'KIRKI_PRO_MARGIN_PADDING_PLUGIN_FILE', __FILE__ ); require_once __DIR__ . '/vendor/autoload.php'; new \Kirki\Pro\MarginPadding\Init(); } add_action( 'plugins_loaded', 'kirki_pro_load_margin_padding_control' ); } packages/kirki-pro-margin-padding/readme.txt 0000644 00000000566 14717762257 0015137 0 ustar 00 === Kirki Margin & Padding Control === Contributors: davidvongries Tags: kirki-margin-padding-control Requires at least: 5.2 Tested up to: 5.9 Requires PHP: 7.0 License: GPL-3.0 License License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=kirki%20pro%20margin%20padding == Description == Margin & padding extension for Kirki Customizer Framework. packages/kirki-pro-margin-padding/vendor/autoload.php 0000644 00000001403 14717762257 0016746 0 ustar 00 <?php // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, $err); } elseif (!headers_sent()) { echo $err; } } trigger_error( $err, E_USER_ERROR ); } require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInitdcc6b1a8cec7267c7e011f71f11c7c7e::getLoader(); packages/kirki-pro-margin-padding/vendor/composer/autoload_namespaces.php 0000644 00000000213 14717762257 0022772 0 ustar 00 <?php // autoload_namespaces.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( ); packages/kirki-pro-margin-padding/vendor/composer/LICENSE 0000644 00000002056 14717762257 0017266 0 ustar 00 Copyright (c) Nils Adermann, Jordi Boggiano 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. packages/kirki-pro-margin-padding/vendor/composer/autoload_psr4.php 0000644 00000000502 14717762257 0021544 0 ustar 00 <?php // autoload_psr4.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Kirki\\Pro\\MarginPadding\\' => array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); packages/kirki-pro-margin-padding/vendor/composer/autoload_real.php 0000644 00000002161 14717762257 0021602 0 ustar 00 <?php // autoload_real.php @generated by Composer class ComposerAutoloaderInitdcc6b1a8cec7267c7e011f71f11c7c7e { private static $loader; public static function loadClassLoader($class) { if ('Composer\Autoload\ClassLoader' === $class) { require __DIR__ . '/ClassLoader.php'; } } /** * @return \Composer\Autoload\ClassLoader */ public static function getLoader() { if (null !== self::$loader) { return self::$loader; } require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInitdcc6b1a8cec7267c7e011f71f11c7c7e', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInitdcc6b1a8cec7267c7e011f71f11c7c7e', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInitdcc6b1a8cec7267c7e011f71f11c7c7e::getInitializer($loader)); $loader->register(true); return $loader; } } packages/kirki-pro-margin-padding/vendor/composer/platform_check.php 0000644 00000001635 14717762257 0021755 0 ustar 00 <?php // platform_check.php @generated by Composer $issues = array(); if (!(PHP_VERSION_ID >= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); } elseif (!headers_sent()) { echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; } } trigger_error( 'Composer detected issues in your platform: ' . implode(' ', $issues), E_USER_ERROR ); } packages/kirki-pro-margin-padding/vendor/composer/ClassLoader.php 0000644 00000040220 14717762257 0021161 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Autoload; /** * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. * * $loader = new \Composer\Autoload\ClassLoader(); * * // register classes with namespaces * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * * // activate the autoloader * $loader->register(); * * // to enable searching the include path (eg. for PEAR packages) * $loader->setUseIncludePath(true); * * In this example, if you try to use a class in the Symfony\Component * namespace or one of its children (Symfony\Component\Console for instance), * the autoloader will first look for the class under the component/ * directory, and it will then fallback to the framework/ directory if not * found before giving up. * * This class is loosely based on the Symfony UniversalClassLoader. * * @author Fabien Potencier <fabien@symfony.com> * @author Jordi Boggiano <j.boggiano@seld.be> * @see https://www.php-fig.org/psr/psr-0/ * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { /** @var \Closure(string):void */ private static $includeFile; /** @var ?string */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array<string, array<string, int>> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array<string, array<int, string>> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array<string, array<string, string[]>> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array<string, string> */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array<string, string> */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array<string, bool> */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array<string, array<int, string>> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array<string, string> */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array<string, string> */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array<string, string> $classMap * * @return void */ public function addClassMap(array $classMap) { if ($this->classMap) { $this->classMap = array_merge($this->classMap, $classMap); } else { $this->classMap = $classMap; } } /** * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 root directories * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $paths ); } } /** * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { // Register directories for a new namespace. $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $paths ); } } /** * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * * @param string $prefix The prefix * @param string[]|string $paths The PSR-0 base directories * * @return void */ public function set($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr0 = (array) $paths; } else { $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; } } /** * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * * @return void */ public function setPsr4($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr4 = (array) $paths; } else { $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } } /** * Turns on searching the include path for class files. * * @param bool $useIncludePath * * @return void */ public function setUseIncludePath($useIncludePath) { $this->useIncludePath = $useIncludePath; } /** * Can be used to check if the autoloader uses the include path to check * for classes. * * @return bool */ public function getUseIncludePath() { return $this->useIncludePath; } /** * Turns off searching the prefix and fallback directories for classes * that have not been registered with the class map. * * @param bool $classMapAuthoritative * * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { $this->classMapAuthoritative = $classMapAuthoritative; } /** * Should class lookup fail if not found in the current class map? * * @return bool */ public function isClassMapAuthoritative() { return $this->classMapAuthoritative; } /** * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix * * @return void */ public function setApcuPrefix($apcuPrefix) { $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** * The APCu prefix in use, or null if APCu caching is not enabled. * * @return string|null */ public function getApcuPrefix() { return $this->apcuPrefix; } /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not * * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { return; } if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); self::$registeredLoaders[$this->vendorDir] = $this; } } /** * Unregisters this instance as an autoloader. * * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); if (null !== $this->vendorDir) { unset(self::$registeredLoaders[$this->vendorDir]); } } /** * Loads the given class or interface. * * @param string $class The name of the class * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { $includeFile = self::$includeFile; $includeFile($file); return true; } return null; } /** * Finds the path to the file where the class is defined. * * @param string $class The name of the class * * @return string|false The path if found, false otherwise */ public function findFile($class) { // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } if (null !== $this->apcuPrefix) { $file = apcu_fetch($this->apcuPrefix.$class, $hit); if ($hit) { return $file; } } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM if (false === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } if (null !== $this->apcuPrefix) { apcu_add($this->apcuPrefix.$class, $file); } if (false === $file) { // Remember that this class does not exist. $this->missingClasses[$class] = true; } return $file; } /** * Returns the currently registered loaders indexed by their corresponding vendor directories. * * @return self[] */ public static function getRegisteredLoaders() { return self::$registeredLoaders; } /** * @param string $class * @param string $ext * @return string|false */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { if (file_exists($file = $dir . $pathEnd)) { return $file; } } } } } // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } // PSR-0 lookup if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); } else { // PEAR-like class name $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; } if (isset($this->prefixesPsr0[$first])) { foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } } } } // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } // PSR-0 include paths. if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } return false; } /** * @return void */ private static function initializeIncludeClosure() { if (self::$includeFile !== null) { return; } /** * Scope isolated include. * * Prevents access to $this/self from included files. * * @param string $file * @return void */ self::$includeFile = \Closure::bind(static function($file) { include $file; }, null, null); } } packages/kirki-pro-margin-padding/vendor/composer/autoload_classmap.php 0000644 00000000336 14717762257 0022464 0 ustar 00 <?php // autoload_classmap.php @generated by Composer $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-margin-padding/vendor/composer/autoload_static.php 0000644 00000002570 14717762257 0022152 0 ustar 00 <?php // autoload_static.php @generated by Composer namespace Composer\Autoload; class ComposerStaticInitdcc6b1a8cec7267c7e011f71f11c7c7e { public static $prefixLengthsPsr4 = array ( 'K' => array ( 'Kirki\\Pro\\MarginPadding\\' => 24, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\MarginPadding\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInitdcc6b1a8cec7267c7e011f71f11c7c7e::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitdcc6b1a8cec7267c7e011f71f11c7c7e::$prefixDirsPsr4; $loader->classMap = ComposerStaticInitdcc6b1a8cec7267c7e011f71f11c7c7e::$classMap; }, null, ClassLoader::class); } } packages/kirki-pro-margin-padding/vendor/composer/InstalledVersions.php 0000644 00000037417 14717762257 0022453 0 ustar 00 <?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; /** * This class is copied in every Composer installed project and available to all * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` * * @final */ class InstalledVersions { /** * @var mixed[]|null * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static $installedByVendor = array(); /** * Returns a list of all package names which are present, either by being installed, replaced or provided * * @return string[] * @psalm-return list<string> */ public static function getInstalledPackages() { $packages = array(); foreach (self::getInstalled() as $installed) { $packages[] = array_keys($installed['versions']); } if (1 === \count($packages)) { return $packages[0]; } return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); } /** * Returns a list of all package names with a specific type e.g. 'library' * * @param string $type * @return string[] * @psalm-return list<string> */ public static function getInstalledPackagesByType($type) { $packagesByType = array(); foreach (self::getInstalled() as $installed) { foreach ($installed['versions'] as $name => $package) { if (isset($package['type']) && $package['type'] === $type) { $packagesByType[] = $name; } } } return $packagesByType; } /** * Checks whether the given package is installed * * This also returns true if the package name is provided or replaced by another package * * @param string $packageName * @param bool $includeDevRequirements * @return bool */ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } return false; } /** * Checks whether the given package satisfies a version constraint * * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: * * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') * * @param VersionParser $parser Install composer/semver to have access to this class and functionality * @param string $packageName * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package * @return bool */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); } /** * Returns a version constraint representing all the range(s) which are installed for a given package * * It is easier to use this via isInstalled() with the $constraint argument if you need to check * whether a given version of a package is installed, and not just whether it exists * * @param string $packageName * @return string Version constraint usable with composer/semver */ public static function getVersionRanges($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } $ranges = array(); if (isset($installed['versions'][$packageName]['pretty_version'])) { $ranges[] = $installed['versions'][$packageName]['pretty_version']; } if (array_key_exists('aliases', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); } if (array_key_exists('replaced', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); } if (array_key_exists('provided', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); } return implode(' || ', $ranges); } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['version'])) { return null; } return $installed['versions'][$packageName]['version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getPrettyVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['pretty_version'])) { return null; } return $installed['versions'][$packageName]['pretty_version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference */ public static function getReference($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['reference'])) { return null; } return $installed['versions'][$packageName]['reference']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. */ public static function getInstallPath($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @return array * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { $installed = self::getInstalled(); return $installed[0]['root']; } /** * Returns the raw installed.php data for custom implementations * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} */ public static function getRawData() { @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { self::$installed = include __DIR__ . '/installed.php'; } else { self::$installed = array(); } } return self::$installed; } /** * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ public static function getAllRawData() { return self::getInstalled(); } /** * Lets you reload the static array from another file * * This is only useful for complex integrations in which a project needs to use * this class but then also needs to execute another project's autoloader in process, * and wants to ensure both projects have access to their version of installed.php. * * A typical case would be PHPUnit, where it would need to make sure it reads all * the data it needs from this class, then call reload() with * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure * the project in which it runs can then also use this class safely, without * interference between PHPUnit's dependencies and the project's dependencies. * * @param array[] $data A vendor/composer/installed.php data set * @return void * * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static function getInstalled() { if (null === self::$canGetVendors) { self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); } $installed = array(); if (self::$canGetVendors) { foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require $vendorDir.'/composer/installed.php'; $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } } } } if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } packages/kirki-pro-margin-padding/vendor/composer/installed.json 0000644 00000000105 14717762257 0021124 0 ustar 00 { "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-margin-padding/vendor/composer/installed.php 0000644 00000001344 14717762257 0020750 0 ustar 00 <?php return array( 'root' => array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); packages/kirki-pro-margin-padding/src/Init.php 0000644 00000001210 14717762257 0015327 0 ustar 00 <?php /** * Init the Kirki PRO's slider package. * * @package kirki-pro-margin-padding * @since 1.0.0 */ namespace Kirki\Pro\MarginPadding; /** * Manage the tabs package. */ class Init { /** * The class constructor. */ public function __construct() { add_filter( 'kirki_control_types', [ $this, 'control_type' ] ); } /** * The control type. * * @param array $control_types The existing control types. */ public function control_type( $control_types ) { $control_types['kirki-margin'] = 'Kirki\Pro\Control\Margin'; $control_types['kirki-padding'] = 'Kirki\Pro\Control\Padding'; return $control_types; } } packages/kirki-pro-margin-padding/src/control.js 0000644 00000000444 14717762257 0015741 0 ustar 00 import "./control.scss"; import KirkiMarginPaddingControl from "./KirkiMarginPaddingControl"; // Register control type with Customizer. wp.customize.controlConstructor["kirki-margin"] = KirkiMarginPaddingControl; wp.customize.controlConstructor["kirki-padding"] = KirkiMarginPaddingControl; packages/kirki-pro-margin-padding/src/control.scss 0000644 00000003673 14717762257 0016307 0 ustar 00 // Range slider control. .customize-control-kirki-margin, .customize-control-kirki-padding { .kirki-control-label { position: relative; display: block; } .customize-control-description { padding-right: 30px; } .kirki-control-form { position: relative; margin-bottom: 12px; &:hover { .kirki-control-reset { opacity: 1; } } } .kirki-control-reset { display: flex; align-items: center; justify-content: center; bottom: 50px; right: 0; position: absolute; padding: 0; width: 16px; height: 16px; color: #50575e; background-color: transparent; border-radius: 50%; border-width: 0; opacity: 0; cursor: pointer; transition: all 0.3s; z-index: 3; // a11y: support tab focus. &:focus { opacity: 1; } } .kirki-control-reset:hover i { color: #f00; transform: rotate(-45deg); } .kirki-control-reset i { font-size: 12px; width: auto; height: auto; transform: rotate(45deg); transition: transform 0.3s; } .kirki-control-cols { display: flex; align-items: center; justify-content: space-between; } .kirki-control-left-col { width: 91%; } .kirki-control-right-col { width: 9%; text-align: right; } .kirki-control-fields { display: flex; } .kirki-control-field { padding-right: 5px; width: 25%; } .kirki-control-input { padding-left: 3px; padding-right: 3px; font-size: 12px; text-align: center; background-color: #f7f7f7; border-color: #bbb; border-radius: 4px; z-index: 2; transition: box-shadow 0.15s; &:focus { background-color: #fff; } } .kirki-control-unit { position: relative; top: -10px; font-size: 12px; font-weight: 600; } .kirki-control-sublabel { display: block; font-size: 11px; text-align: center; text-transform: capitalize; } } packages/kirki-pro-margin-padding/src/KirkiMarginPaddingForm.js 0000644 00000011106 14717762257 0020600 0 ustar 00 import { useRef, useState } from "react"; const KirkiMarginPaddingForm = (props) => { const { control, customizerSetting, defaultArray, valueArray, valueUnit } = props; const [inputValues, setInputValues] = useState(() => { return valueArray; }); const getSingleValueAsObject = (value) => { let unit = ""; let number = ""; let negative = ""; if ("" !== value) { value = "string" !== typeof value ? value.toString() : value; value = value.trim(); negative = -1 < value.indexOf("-") ? "-" : ""; value = value.replace(negative, ""); if ("" !== value) { unit = value.replace(/\d+/g, ""); number = value.replace(unit, ""); number = negative + number.trim(); number = parseFloat(number); } else { number = negative; } } return { unit: unit, number: number, }; }; const getValuesForInput = (values) => { let singleValue; for (const position in values) { if (Object.hasOwnProperty.call(values, position)) { singleValue = getSingleValueAsObject(values[position]); values[position] = singleValue.number; } } return values; }; const getValuesForCustomizer = (values) => { let singleValue; for (const position in values) { if (Object.hasOwnProperty.call(values, position)) { singleValue = values[position]; if ("" !== singleValue) { singleValue = getSingleValueAsObject(singleValue); singleValue = singleValue.number + valueUnit; } values[position] = singleValue; } } return values; }; control.updateComponentState = (val) => { setInputValues(getValuesForInput(val)); }; const handleChange = (e, position) => { let values = { ...inputValues }; values[position] = e.target.value; customizerSetting.set(getValuesForCustomizer(values)); }; const handleReset = (e) => { const values = "" !== props.default && "undefined" !== typeof props.default ? defaultArray : valueArray; customizerSetting.set(getValuesForCustomizer(values)); }; // Preparing for the template. const fieldId = `kirki-control-input-${props.type}-top`; const unitRef = useRef(null); const makeMapable = () => { const items = []; for (const position in inputValues) { if (Object.hasOwnProperty.call(inputValues, position)) { items.push({ position: position, value: inputValues[position] }); } } return items; }; return ( <div className="kirki-control-form" tabIndex="1"> {(props.label || props.description) && ( <> <label className="kirki-control-label" htmlFor={fieldId}> {props.label && ( <span className="customize-control-title">{props.label}</span> )} {props.description && ( <span className="customize-control-description description" dangerouslySetInnerHTML={{ __html: props.description }} /> )} </label> <div className="customize-control-notifications-container" ref={props.setNotificationContainer} /> </> )} <button type="button" className="kirki-control-reset" onClick={handleReset} > <i className="dashicons dashicons-image-rotate"></i> </button> <div className="kirki-control-cols"> <div className="kirki-control-left-col"> <div class="kirki-control-fields"> {makeMapable(inputValues).map((item) => { const className = `kirki-control-input kirki-control-input-${item.position}`; const id = `kirki-control-input-${props.type}-${item.position}`; return ( <div class="kirki-control-field"> <input id={id} type="number" value={item.value || 0 === item.value ? item.value : ""} className={className} onChange={(e) => handleChange(e, item.position)} /> <label class="kirki-control-sublabel" htmlFor={id}> {item.position} </label> </div> ); })} </div> </div> <div className="kirki-control-right-col"> <span ref={unitRef} className="kirki-control-unit"> {valueUnit} </span> </div> </div> </div> ); }; export default KirkiMarginPaddingForm; packages/kirki-pro-margin-padding/src/KirkiMarginPaddingControl.js 0000644 00000006474 14717762257 0021331 0 ustar 00 import KirkiMarginPaddingForm from "./KirkiMarginPaddingForm"; /** * KirkiMarginPaddingControl. * * Global objects brought: * - wp * - jQuery * - React * - ReactDOM * * @class * @augments wp.customize.Control * @augments wp.customize.Class */ const KirkiMarginPaddingControl = wp.customize.Control.extend({ /** * Initialize. * * @param {string} id - Control ID. * @param {object} params - Control params. */ initialize: function (id, params) { const control = this; // Bind functions to this control context for passing as React props. control.setNotificationContainer = control.setNotificationContainer.bind(control); wp.customize.Control.prototype.initialize.call(control, id, params); // The following should be eliminated with <https://core.trac.wordpress.org/ticket/31334>. function onRemoved(removedControl) { if (control === removedControl) { control.destroy(); control.container.remove(); wp.customize.control.unbind("removed", onRemoved); } } wp.customize.control.bind("removed", onRemoved); }, /** * Set notification container and render. * * This is called when the React component is mounted. * * @param {Element} element - Notification container. * @returns {void} */ setNotificationContainer: function setNotificationContainer(element) { const control = this; control.notifications.container = jQuery(element); control.notifications.render(); }, /** * Render the control into the DOM. * * This is called from the Control#embed() method in the parent class. * * @returns {void} */ renderContent: function renderContent() { const control = this; ReactDOM.render( <KirkiMarginPaddingForm {...control.params} control={control} customizerSetting={control.setting} setNotificationContainer={control.setNotificationCotainer} value={control.params.value} />, control.container[0] ); if (false !== control.params.choices.allowCollapse) { control.container.addClass("allowCollapse"); } }, /** * After control has been first rendered, start re-rendering when setting changes. * * React is able to be used here instead of the wp.customize.Element abstraction. * * @returns {void} */ ready: function ready() { const control = this; /** * Update component value's state when customizer setting's value is changed. */ control.setting.bind((val) => { control.updateComponentState(val); }); }, /** * This method will be overriden by the rendered component. */ updateComponentState: (val) => {}, /** * Handle removal/de-registration of the control. * * This is essentially the inverse of the Control#embed() method. * * @link https://core.trac.wordpress.org/ticket/31334 * @returns {void} */ destroy: function destroy() { const control = this; // Garbage collection: undo mounting that was done in the embed/renderContent method. ReactDOM.unmountComponentAtNode(control.container[0]); // Call destroy method in parent if it exists (as of #31334). if (wp.customize.Control.prototype.destroy) { wp.customize.Control.prototype.destroy.call(control); } }, }); export default KirkiMarginPaddingControl; packages/kirki-pro-margin-padding/src/preview.js 0000644 00000002242 14717762257 0015740 0 ustar 00 (() => { /** * Function to hook into `kirkiPostMessageStylesOutput` filter. * * @param {string} styles The styles to be filtered. * @param {string|Object|int} values The control's value. * @param {Object} output The control's output argument. * @param {string} controlType The control type. * * @return {string} The filtered styles. */ const stylesOutput = (styles, values, output, controlType) => { if ("kirki-margin" !== controlType && "kirki-padding" !== controlType) { return styles; } if (!values.top && !values.right && !values.bottom && !values.left) { return styles; } const property = controlType.replace("kirki-", ""); styles += output.element + "{"; for (const position in values) { if (Object.hasOwnProperty.call(values, position)) { const value = values[position]; if ("" !== value) { styles += property + "-" + position + ": " + value + ";"; } } } styles += "}"; return styles; }; // Hook the function to the `kirkiPostMessageStylesOutput` filter. wp.hooks.addFilter("kirkiPostMessageStylesOutput", "kirki", stylesOutput); })(); packages/kirki-pro-margin-padding/src/Field/Padding.php 0000644 00000001723 14717762257 0017026 0 ustar 00 <?php /** * Override field methods. * * @package kirki-pro-padding * @since 1.0 */ namespace Kirki\Pro\Field; /** * Field overrides. * * @since 1.0 */ class Padding extends Margin { /** * The field type. * * @since 1.0 * @access public * @var string */ public $type = 'kirki-padding'; /** * The control class-name. * * @since 1.0 * @access protected * @var string */ protected $control_class = '\Kirki\Pro\Control\Padding'; /** * Filter arguments before creating the control. * * @param array $args The field arguments. * @param \WP_Customize_Manager $wp_customize The customizer instance. * * @return array $args The maybe-filtered arguments. */ 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-padding'; } return $args; } } packages/kirki-pro-margin-padding/src/Field/Margin.php 0000644 00000006575 14717762257 0016707 0 ustar 00 <?php /** * Override field methods. * * @package kirki-pro-margin * @since 1.0 */ namespace Kirki\Pro\Field; use Kirki\Field; use Kirki\URL; /** * Field overrides. * * @since 1.0 */ class Margin extends Field { /** * The field type. * * @since 1.0 * @access public * @var string */ public $type = 'kirki-margin'; /** * The control class-name. * * @since 1.0 * @access protected * @var string */ protected $control_class = '\Kirki\Pro\Control\Margin'; /** * Whether we should register the control class for JS-templating or not. * * @since 1.0 * @access protected * @var bool */ protected $control_has_js_template = false; /** * Additional logic for the field. * * @since 1.0.0 * @access protected * * @param array $args The field arguments. */ protected function init( $args ) { add_action( 'customize_preview_init', [ $this, 'enqueue_customize_preview_scripts' ] ); add_filter( 'kirki_output_control_classnames', [ $this, 'output_control_classnames' ] ); } /** * Filter arguments before creating the setting. * * @param array $args The field arguments. * @param \WP_Customize_Manager $wp_customize The customizer instance. * * @return array $args The maybe-filtered arguments. */ 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'] = [ __CLASS__, 'sanitize' ]; } } return $args; } /** * Sanitize the value. * * @param mixed $values The value to sanitize. * @return mixed */ public static function sanitize( $values ) { foreach ( $values as $position => $value ) { if ( '' !== $value ) { if ( is_numeric( $value ) ) { $value = $value . 'px'; } } $values[ $position ] = sanitize_text_field( $value ); } return $values; } /** * Filter arguments before creating the control. * * @param array $args The field arguments. * @param \WP_Customize_Manager $wp_customize The customizer instance. * * @return array $args The maybe-filtered arguments. */ 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-margin'; } return $args; } /** * Enqueue styles & scripts on 'customize_preview_init' action. * * @since 4.0.0 * @access public */ public function enqueue_customize_preview_scripts() { wp_enqueue_script( 'kirki-preview-margin-padding', URL::get_from_path( dirname( dirname( __DIR__ ) ) ) . '/dist/preview.js', [ 'wp-hooks', 'customize-preview' ], $this->control_class::$control_ver, true ); } /** * Add output control class for margin/padding control. * * @since 1.0.0 * @access public * * @param array $control_classes The existing control classes. * @return array */ public function output_control_classnames( $control_classes ) { $class_name = str_ireplace( 'kirki-', '', $this->type ); $class_name = ucfirst( $class_name ); $control_classes[ $this->type ] = '\Kirki\Pro\Field\CSS\\' . $class_name; return $control_classes; } } packages/kirki-pro-margin-padding/src/Field/CSS/Padding.php 0000644 00000000517 14717762257 0017456 0 ustar 00 <?php /** * Handle CSS output for padding control. * * @package Kirki * @subpackage Controls * @since 1.0.0 */ namespace Kirki\Pro\Field\CSS; /** * Outpout overrides. */ class Padding extends Margin { /** * The field type. * * @since 1.0 * @access public * @var string */ protected $type = 'kirki-padding'; } packages/kirki-pro-margin-padding/src/Field/CSS/Margin.php 0000644 00000003100 14717762257 0017314 0 ustar 00 <?php /** * Handle CSS output for margin control. * * @package Kirki * @subpackage Controls * @since 1.0.0 */ namespace Kirki\Pro\Field\CSS; use Kirki\Module\CSS\Output; /** * Outpout overrides. */ class Margin extends Output { /** * The field type. * * @since 1.0 * @access public * @var string */ protected $type = 'kirki-margin'; /** * Process a single item from the `output` array. * * @since 1.0 * @access protected * * @param array $output The `output` item. * @param array|string $value The field's value. */ protected function process_output( $output, $value ) { $property = str_ireplace( 'kirki-', '', $this->type ); $unit = isset( $this->field['choices'] ) && isset( $this->field['choices']['unit'] ) ? $this->field['choices']['unit'] : 'px'; $output = wp_parse_args( $output, array( 'media_query' => 'global', 'element' => '', ) ); // Stop if the value is not an array. if ( ! is_array( $value ) ) { return; } foreach ( $value as $position => $value ) { if ( '' !== $value ) { $value = is_numeric( $value ) ? $value . $unit : $value; $css_property = $property . '-' . $position; $this->styles[ $output['media_query'] ][ $output['element'] ][ $css_property ] = $value; } } if ( 'kirki_pro_demo_responsive_margin[desktop]' === $this->field['settings'] ) { // error_log( print_r( get_theme_mod( 'kirki_pro_demo_responsive_margin[desktop]' ), true ) ); // error_log( print_r( $this->styles, true ) ); // error_log( print_r( $value, true ) ); } } } packages/kirki-pro-margin-padding/src/Control/Padding.php 0000644 00000000535 14717762257 0017423 0 ustar 00 <?php /** * The padding control. * * Creates a padding control. * * @package kirki-pro-padding * @since 1.0 */ namespace Kirki\Pro\Control; /** * Slider control. * * @since 1.0 */ class Padding extends Margin { /** * The control type. * * @since 1.0 * @access public * @var string */ public $type = 'kirki-padding'; } packages/kirki-pro-margin-padding/src/Control/Margin.php 0000644 00000010566 14717762257 0017277 0 ustar 00 <?php /** * The margin control. * * Creates a margin control. * * @package kirki-pro-margin * @since 1.0 */ namespace Kirki\Pro\Control; use Kirki\Control\Base; use Kirki\URL; /** * Slider control. * * @since 1.0 */ class Margin extends Base { /** * The control type. * * @since 1.0 * @access public * @var string */ public $type = 'kirki-margin'; /** * The control version. * * @since 1.0 * @access public * @var string */ public static $control_ver = '0.1.0'; /** * Control's value unit. * * @var string */ public $value_unit = 'px'; /** * The default of control's default. * This will be parsed with $args['default'] and without the unit. * * @var array */ public $default_array = [ 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ]; /** * The default of control's value. * This will be parsed with $this->value() and without the unit. * * @var array */ public $value_array = [ 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ]; /** * Control's constructor. * * @since 1.0.0 * * @param WP_Customize_Manager $wp_customize WP_Customize_Manager instance. * @param string $id The control's ID. * @param array $args The control's arguments. */ public function __construct( $wp_customize, $id, $args = array() ) { parent::__construct( $wp_customize, $id, $args ); // If `unit` choice is defined. if ( ! empty( $this->choices['unit'] ) ) { $this->value_unit = $this->choices['unit']; } $this->value_unit = strtolower( $this->value_unit ); // Parse $args['default'] with $this->default_array. if ( ! empty( $args['default'] ) && is_array( $args['default'] ) ) { $this->default_array = wp_parse_args( $args['default'], $this->default_array ); } $this->default_array = $this->remove_unit( $this->default_array ); // Parse $this->value() with $this->value_array. if ( ! empty( $this->value() ) && is_array( $this->value() ) ) { $this->value_array = wp_parse_args( $this->value(), $this->value_array ); } $this->value_array = $this->remove_unit( $this->value_array ); } /** * Remove unit from values. * * @param array $values The provided values. * @return array */ public function remove_unit( $values ) { foreach ( $values as $position => $value ) { if ( '' !== $value ) { // Force $value to not using unit. if ( ! is_numeric( $value ) ) { $unit = preg_replace( '/\d+/', '', $value ); $value = str_ireplace( $unit, '', $value ); $value = (float) $value; } else { $value = (float) $value; } } $values[ $position ] = $value; } return $values; } /** * Enqueue control related styles/scripts. * * @since 1.0 * @access public */ public function enqueue() { parent::enqueue(); // Enqueue the style. wp_enqueue_style( 'kirki-control-margin-padding', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver ); // Enqueue the script. wp_enqueue_script( 'kirki-control-margin-padding', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'jquery', 'customize-controls', 'customize-base', 'react-dom' ], self::$control_ver, false ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() * * @since 1.0 * @access public */ public function to_json() { parent::to_json(); if ( isset( $this->json['label'] ) ) { $this->json['label'] = html_entity_decode( $this->json['label'] ); } if ( isset( $this->json['description'] ) ) { $this->json['description'] = html_entity_decode( $this->json['description'] ); } $this->json['valueArray'] = $this->value_array; $this->json['defaultArray'] = $this->value_array; $this->json['valueUnit'] = $this->value_unit; $this->json['value'] = []; foreach ( $this->json['valueArray'] as $position => $value ) { $this->json['value'][ $position ] = $value . $this->value_unit; } } /** * 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 WP_Customize_Control::to_json(). * * @see WP_Customize_Control::print_template() * * @since 1.0 */ protected function content_template() {} } packages/kirki-pro-margin-padding/package.json 0000644 00000001570 14717762257 0015423 0 ustar 00 { "name": "kirki-pro-margin-padding", "version": "1.1", "description": "Dev toolkit for kirki-pro-margin-padding", "keywords": [ "kirki-pro-margin-padding" ], "author": "Kirki", "license": "MIT", "bugs": { "url": "https://www.themeum.com/" }, "homepage": "https://www.themeum.com/", "dependencies": { "react": "^17.0.2", "react-dom": "^17.0.2" }, "devDependencies": { "@babel/preset-react": "^7.16.7", "@parcel/transformer-sass": "^2.2.1", "parcel": "^2.2.1" }, "alias": { "jquery": { "global": "jQuery" }, "react": { "global": "React" }, "react-dom": { "global": "ReactDOM" } }, "browserslist": "> 0.5%, last 2 versions, not dead", "source": [ "src/control.js", "src/preview.js" ], "scripts": { "build": "parcel build", "dev": "parcel build --no-optimize" } } packages/kirki-pro-margin-padding/.babelrc 0000644 00000000131 14717762257 0014520 0 ustar 00 { "presets": [ [ "@babel/preset-react", { "runtime": "classic" } ] ] } packages/kirki-pro-margin-padding/dist/preview.js.map 0000644 00000003331 14717762257 0016670 0 ustar 00 {"mappings":"2DAkCI,SAAAA,EAAAC,EAAAC,EAAAC,GAEA,GAAA,iBAAAA,GAAA,kBAAAA,EAAA,OAAAH,EAGF,KAAAC,EAAAG,KAAAH,EAAAI,OAAAJ,EAAAK,QAAAL,EAAAM,MAFC,OAAAP,EAGEQ,IAAHC,EAAmBN,EAAnBO,QAAA,SAAA,iBAxCFV,GAAAE,EAAAS,QAAA","sources":["src/preview.js"],"sourcesContent":["(() => {\r\n /**\r\n * Function to hook into `kirkiPostMessageStylesOutput` filter.\r\n *\r\n * @param {string} styles The styles to be filtered.\r\n * @param {string|Object|int} values The control's value.\r\n * @param {Object} output The control's output argument.\r\n * @param {string} controlType The control type.\r\n *\r\n * @return {string} The filtered styles.\r\n */\r\n const stylesOutput = (styles, values, output, controlType) => {\r\n if (\"kirki-margin\" !== controlType && \"kirki-padding\" !== controlType) {\r\n return styles;\r\n }\r\n\r\n if (!values.top && !values.right && !values.bottom && !values.left) {\r\n return styles;\r\n }\r\n\r\n const property = controlType.replace(\"kirki-\", \"\");\r\n\r\n styles += output.element + \"{\";\r\n\r\n for (const position in values) {\r\n if (Object.hasOwnProperty.call(values, position)) {\r\n const value = values[position];\r\n\r\n if (\"\" !== value) {\r\n styles += property + \"-\" + position + \": \" + value + \";\";\r\n }\r\n }\r\n }\r\n\r\n styles += \"}\";\r\n\r\n return styles;\r\n };\r\n\r\n // Hook the function to the `kirkiPostMessageStylesOutput` filter.\r\n wp.hooks.addFilter(\"kirkiPostMessageStylesOutput\", \"kirki\", stylesOutput);\r\n})();\r\n"],"names":["styles","values","output","controlType","top","right","bottom","left","hooks","property","replace","element"],"version":3,"file":"preview.js.map"} packages/kirki-pro-margin-padding/dist/control.js 0000644 00000010743 14717762257 0016120 0 ustar 00 !function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var n={};n=React;var r=function(r){var o=r.control,i=r.customizerSetting,a=r.defaultArray,c=r.valueArray,l=r.valueUnit,s=e(n.useState((function(){return c}))),u=s[0],m=s[1],p=function(t){var e="",n="",r="";return""!==t&&(r=-1<(t=(t="string"!=typeof t?t.toString():t).trim()).indexOf("-")?"-":"",""!==(t=t.replace(r,""))?(e=t.replace(/\d+/g,""),n=r+(n=t.replace(e,"")).trim(),n=parseFloat(n)):n=r),{unit:e,number:n}},f=function(t){var e;for(var n in t)Object.hasOwnProperty.call(t,n)&&(""!==(e=t[n])&&(e=(e=p(e)).number+l),t[n]=e);return t};o.updateComponentState=function(t){m(function(t){var e;for(var n in t)Object.hasOwnProperty.call(t,n)&&(e=p(t[n]),t[n]=e.number);return t}(t))};var d=function(e,n){var r=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(n){t(e,n,r[n])}))}return e}({},u);r[n]=e.target.value,i.set(f(r))},v="kirki-control-input-".concat(r.type,"-top"),b=n.useRef(null);return React.createElement("div",{className:"kirki-control-form",tabIndex:"1"},(r.label||r.description)&&React.createElement(React.Fragment,null,React.createElement("label",{className:"kirki-control-label",htmlFor:v},r.label&&React.createElement("span",{className:"customize-control-title"},r.label),r.description&&React.createElement("span",{className:"customize-control-description description",dangerouslySetInnerHTML:{__html:r.description}})),React.createElement("div",{className:"customize-control-notifications-container",ref:r.setNotificationContainer})),React.createElement("button",{type:"button",className:"kirki-control-reset",onClick:function(t){var e=""!==r.default&&void 0!==r.default?a:c;i.set(f(e))}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement("div",{className:"kirki-control-cols"},React.createElement("div",{className:"kirki-control-left-col"},React.createElement("div",{class:"kirki-control-fields"},function(){var t=[];for(var e in u)Object.hasOwnProperty.call(u,e)&&t.push({position:e,value:u[e]});return t}().map((function(t){var e="kirki-control-input kirki-control-input-".concat(t.position),n="kirki-control-input-".concat(r.type,"-").concat(t.position);return React.createElement("div",{class:"kirki-control-field"},React.createElement("input",{id:n,type:"number",value:t.value||0===t.value?t.value:"",className:e,onChange:function(e){return d(e,t.position)}}),React.createElement("label",{class:"kirki-control-sublabel",htmlFor:n},t.position))})))),React.createElement("div",{className:"kirki-control-right-col"},React.createElement("span",{ref:b,className:"kirki-control-unit"},l))))};function o(){return o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o.apply(this,arguments)}var i=wp.customize.Control.extend({initialize:function(t,e){var n=this;n.setNotificationContainer=n.setNotificationContainer.bind(n),wp.customize.Control.prototype.initialize.call(n,t,e),wp.customize.control.bind("removed",(function t(e){n===e&&(n.destroy(),n.container.remove(),wp.customize.control.unbind("removed",t))}))},setNotificationContainer:function(t){this.notifications.container=jQuery(t),this.notifications.render()},renderContent:function(){var t=this;ReactDOM.render(React.createElement(r,o({},t.params,{control:t,customizerSetting:t.setting,setNotificationContainer:t.setNotificationCotainer,value:t.params.value})),t.container[0]),!1!==t.params.choices.allowCollapse&&t.container.addClass("allowCollapse")},ready:function(){var t=this;t.setting.bind((function(e){t.updateComponentState(e)}))},updateComponentState:function(t){},destroy:function(){ReactDOM.unmountComponentAtNode(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["kirki-margin"]=i,wp.customize.controlConstructor["kirki-padding"]=i}(); //# sourceMappingURL=control.js.map packages/kirki-pro-margin-padding/dist/control.css.map 0000644 00000014624 14717762257 0017052 0 ustar 00 {"mappings":"AAGE,2GAEE,aAAA,CADA,iBCAJ,CDIE,+HACE,kBCDJ,CDIE,yGAEE,kBAAA,CADA,iBCAJ,CDIM,+JACE,SCDR,CDME,2GAEE,kBAAA,CASA,4BAAA,CACA,iBAAA,CACA,cAAA,CATA,WAAA,CAMA,aAAA,CAKA,cAAA,CAdA,YAAA,CAQA,WAAA,CANA,sBAAA,CAWA,SAAA,CAPA,SAAA,CADA,iBAAA,CADA,OAAA,CAWA,kBAAA,CARA,UAAA,CASA,SCHJ,CDMI,uHACE,SCHN,CDOE,2HACE,SAAA,CACA,wBCJJ,CDOE,+GACE,cAAA,CAEA,WAAA,CACA,uBAAA,CACA,wBAAA,CAHA,UCDJ,CDOE,yGAEE,kBAAA,CADA,YAAA,CAEA,6BCJJ,CDOE,iHACE,SCJJ,CDOE,mHAEE,gBAAA,CADA,QCHJ,CDOE,6GACE,YCJJ,CDOE,2GACE,iBAAA,CACA,SCJJ,CDOE,2GAKE,wBAAA,CACA,iBAAA,CACA,iBAAA,CAJA,cAAA,CAFA,gBAAA,CACA,iBAAA,CAEA,iBAAA,CAKA,0BAAA,CADA,SCHJ,CDMI,uHACE,qBCHN,CDOE,yGAGE,cAAA,CACA,eAAA,CAHA,iBAAA,CACA,SCFJ,CDOE,iHACE,aAAA,CACA,cAAA,CACA,iBAAA,CACA,yBCJJ","sources":["src/control.scss","%3Cinput%20css%20ImJP0D%3E"],"sourcesContent":["// Range slider control.\r\n.customize-control-kirki-margin,\r\n.customize-control-kirki-padding {\r\n .kirki-control-label {\r\n position: relative;\r\n display: block;\r\n }\r\n\r\n .customize-control-description {\r\n padding-right: 30px;\r\n }\r\n\r\n .kirki-control-form {\r\n position: relative;\r\n margin-bottom: 12px;\r\n\r\n &:hover {\r\n .kirki-control-reset {\r\n opacity: 1;\r\n }\r\n }\r\n }\r\n\r\n .kirki-control-reset {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n bottom: 50px;\r\n right: 0;\r\n position: absolute;\r\n padding: 0;\r\n width: 16px;\r\n height: 16px;\r\n color: #50575e;\r\n background-color: transparent;\r\n border-radius: 50%;\r\n border-width: 0;\r\n opacity: 0;\r\n cursor: pointer;\r\n transition: all 0.3s;\r\n z-index: 3;\r\n\r\n // a11y: support tab focus.\r\n &:focus {\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .kirki-control-reset:hover i {\r\n color: #f00;\r\n transform: rotate(-45deg);\r\n }\r\n\r\n .kirki-control-reset i {\r\n font-size: 12px;\r\n width: auto;\r\n height: auto;\r\n transform: rotate(45deg);\r\n transition: transform 0.3s;\r\n }\r\n\r\n .kirki-control-cols {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n }\r\n\r\n .kirki-control-left-col {\r\n width: 91%;\r\n }\r\n\r\n .kirki-control-right-col {\r\n width: 9%;\r\n text-align: right;\r\n }\r\n\r\n .kirki-control-fields {\r\n display: flex;\r\n }\r\n\r\n .kirki-control-field {\r\n padding-right: 5px;\r\n width: 25%;\r\n }\r\n\r\n .kirki-control-input {\r\n padding-left: 3px;\r\n padding-right: 3px;\r\n font-size: 12px;\r\n text-align: center;\r\n background-color: #f7f7f7;\r\n border-color: #bbb;\r\n border-radius: 4px;\r\n z-index: 2;\r\n transition: box-shadow 0.15s;\r\n\r\n &:focus {\r\n background-color: #fff;\r\n }\r\n }\r\n\r\n .kirki-control-unit {\r\n position: relative;\r\n top: -10px;\r\n font-size: 12px;\r\n font-weight: 600;\r\n }\r\n\r\n .kirki-control-sublabel {\r\n display: block;\r\n font-size: 11px;\r\n text-align: center;\r\n text-transform: capitalize;\r\n }\r\n}\r\n",".customize-control-kirki-margin .kirki-control-label,\n.customize-control-kirki-padding .kirki-control-label {\n position: relative;\n display: block;\n}\n.customize-control-kirki-margin .customize-control-description,\n.customize-control-kirki-padding .customize-control-description {\n padding-right: 30px;\n}\n.customize-control-kirki-margin .kirki-control-form,\n.customize-control-kirki-padding .kirki-control-form {\n position: relative;\n margin-bottom: 12px;\n}\n.customize-control-kirki-margin .kirki-control-form:hover .kirki-control-reset,\n.customize-control-kirki-padding .kirki-control-form:hover .kirki-control-reset {\n opacity: 1;\n}\n.customize-control-kirki-margin .kirki-control-reset,\n.customize-control-kirki-padding .kirki-control-reset {\n display: flex;\n align-items: center;\n justify-content: center;\n bottom: 50px;\n right: 0;\n position: absolute;\n padding: 0;\n width: 16px;\n height: 16px;\n color: #50575e;\n background-color: transparent;\n border-radius: 50%;\n border-width: 0;\n opacity: 0;\n cursor: pointer;\n transition: all 0.3s;\n z-index: 3;\n}\n.customize-control-kirki-margin .kirki-control-reset:focus,\n.customize-control-kirki-padding .kirki-control-reset:focus {\n opacity: 1;\n}\n.customize-control-kirki-margin .kirki-control-reset:hover i,\n.customize-control-kirki-padding .kirki-control-reset:hover i {\n color: #f00;\n transform: rotate(-45deg);\n}\n.customize-control-kirki-margin .kirki-control-reset i,\n.customize-control-kirki-padding .kirki-control-reset i {\n font-size: 12px;\n width: auto;\n height: auto;\n transform: rotate(45deg);\n transition: transform 0.3s;\n}\n.customize-control-kirki-margin .kirki-control-cols,\n.customize-control-kirki-padding .kirki-control-cols {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.customize-control-kirki-margin .kirki-control-left-col,\n.customize-control-kirki-padding .kirki-control-left-col {\n width: 91%;\n}\n.customize-control-kirki-margin .kirki-control-right-col,\n.customize-control-kirki-padding .kirki-control-right-col {\n width: 9%;\n text-align: right;\n}\n.customize-control-kirki-margin .kirki-control-fields,\n.customize-control-kirki-padding .kirki-control-fields {\n display: flex;\n}\n.customize-control-kirki-margin .kirki-control-field,\n.customize-control-kirki-padding .kirki-control-field {\n padding-right: 5px;\n width: 25%;\n}\n.customize-control-kirki-margin .kirki-control-input,\n.customize-control-kirki-padding .kirki-control-input {\n padding-left: 3px;\n padding-right: 3px;\n font-size: 12px;\n text-align: center;\n background-color: #f7f7f7;\n border-color: #bbb;\n border-radius: 4px;\n z-index: 2;\n transition: box-shadow 0.15s;\n}\n.customize-control-kirki-margin .kirki-control-input:focus,\n.customize-control-kirki-padding .kirki-control-input:focus {\n background-color: #fff;\n}\n.customize-control-kirki-margin .kirki-control-unit,\n.customize-control-kirki-padding .kirki-control-unit {\n position: relative;\n top: -10px;\n font-size: 12px;\n font-weight: 600;\n}\n.customize-control-kirki-margin .kirki-control-sublabel,\n.customize-control-kirki-padding .kirki-control-sublabel {\n display: block;\n font-size: 11px;\n text-align: center;\n text-transform: capitalize;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"} packages/kirki-pro-margin-padding/dist/preview.js 0000644 00000000563 14717762257 0016120 0 ustar 00 wp.hooks.addFilter("kirkiPostMessageStylesOutput","kirki",(function(r,i,t,e){if("kirki-margin"!==e&&"kirki-padding"!==e)return r;if(!(i.top||i.right||i.bottom||i.left))return r;var k=e.replace("kirki-","");for(var a in r+=t.element+"{",i)if(Object.hasOwnProperty.call(i,a)){var n=i[a];""!==n&&(r+=k+"-"+a+": "+n+";")}return r+="}"})); //# sourceMappingURL=preview.js.map packages/kirki-pro-margin-padding/dist/control.js.map 0000644 00000037727 14717762257 0016707 0 ustar 00 {"mappings":"uBAAwCA,EAAKC,EAAKC,GAYhD,OAXID,KAAOD,EACTG,OAAOC,eAAeJ,EAAKC,EAAK,CAC9BC,MAAOA,EACPG,YAAY,EACZC,cAAc,EACdC,UAAU,IAGZP,EAAIC,GAAOC,EAGNF,aCR8BQ,EAAKC,GAC1C,gBCLsCD,GACtC,GAAIE,MAAMC,QAAQH,GAAM,OAAOA,EDIxBI,CAAeJ,aELiBK,GACvC,GAAIC,OAAOC,YAAYZ,OAAOU,IAAkD,uBAAzCV,OAAOa,UAAUC,SAASC,KAAKL,GAAgC,OAAOH,MAAMS,KAAKN,GFI1FO,CAAqBZ,eGJnD,MAAM,IAAIa,UAAU,wDHI0CC,YILhEC,EAAeC,MCEf,IAyKAC,EAzKgCC,SAAAA,GAC9B,IAAQC,EACND,EADMC,QAASC,EACfF,EADeE,kBAAmBC,EAClCH,EADkCG,aAAcC,EAChDJ,EADgDI,WAAYC,EAC5DL,EAD4DK,UAGxBC,EAAtCC,EAAsCD,EAAAA,UAAS,WAC7C,OAAOF,MADFI,EAA+BF,EAAtC,GAAoBG,EAAkBH,EAAtC,GAIMI,EAA0BlC,SAAAA,GAC9B,IAAImC,EAAO,GACPC,EAAS,GACTC,EAAW,GAkBf,MAhBI,KAAOrC,IAGTqC,GAAW,GADXrC,GADAA,EAAQ,iBAAoBA,EAAQA,EAAMe,WAAaf,GACzCsC,QACQC,QAAQ,KAAO,IAAM,GAGvC,MAFJvC,EAAQA,EAAMwC,QAAQH,EAAU,MAG9BF,EAAOnC,EAAMwC,QAAN,OAAsB,IAE7BJ,EAASC,GADTD,EAASpC,EAAMwC,QAAQL,EAAM,KACFG,OAC3BF,EAASK,WAAWL,IAEpBA,EAASC,GAIN,CACLF,KAAMA,EACNC,OAAQA,IAiBNM,EAA0BC,SAAAA,GAC9B,IAAIC,EAEJ,IAAK,IAAMC,KAAYF,EACjB1C,OAAO6C,eAAe9B,KAAK2B,EAAQE,KAGjC,MAFJD,EAAcD,EAAOE,MAInBD,GADAA,EAAcV,EAAuBU,IACXR,OAASP,GAGrCc,EAAOE,GAAYD,GAIvB,OAAOD,GAGTlB,EAAQsB,qBAAwBC,SAAAA,GAC9Bf,EAjCyBU,SAAAA,GACzB,IAAIC,EAEJ,IAAK,IAAMC,KAAYF,EACjB1C,OAAO6C,eAAe9B,KAAK2B,EAAQE,KACrCD,EAAcV,EAAuBS,EAAOE,IAC5CF,EAAOE,GAAYD,EAAYR,QAInC,OAAOO,EAuBQM,CAAkBD,KAGnC,IAAME,EAAe,SAACC,EAAGN,GACvB,IAAIF,WCxE8BS,GACpC,IAAK,IAAI7C,EAAI,EAAGA,EAAI8C,UAAUC,OAAQ/C,IAAK,CACzC,IAAIgD,EAAyB,MAAhBF,UAAU9C,GAAa8C,UAAU9C,GAAK,GAC/CiD,EAAUvD,OAAOwD,KAAKF,GAEkB,mBAAjCtD,OAAOyD,wBAChBF,EAAUA,EAAQG,OAAO1D,OAAOyD,sBAAsBH,GAAQK,QAAO,SAAUC,GAC7E,OAAO5D,OAAO6D,yBAAyBP,EAAQM,GAAK1D,gBAIxDqD,EAAQO,SAAQ,SAAUhE,GACxBiE,EAAeZ,EAAQrD,EAAKwD,EAAOxD,OAIvC,OAAOqD,EDwDKa,CAAA,GAAQjC,GAClBW,EAAOE,GAAYM,EAAEC,OAAOpD,MAE5B0B,EAAkBwC,IAAIxB,EAAuBC,KAazCwB,EAAW,uBAAiCR,OAAXnC,EAAM4C,KAAK,QAC5CC,EAAUC,EAAAA,OAAO,MAcvB,OACEhD,MADFiD,cAAA,MAAA,CACOC,UAAU,qBAAqBC,SAAS,MACzCjD,EAAMkD,OAASlD,EAAMmD,cACrBrD,MAAAiD,cAAAjD,MAAAsD,SAAA,KACEtD,MAHNiD,cAAA,QAAA,CAGaC,UAAU,sBAAsBK,QAASV,GAC7C3C,EAAMkD,OACLpD,MAFJiD,cAAA,OAAA,CAEUC,UAAU,2BAA2BhD,EAAMkD,OAGlDlD,EAAMmD,aACLrD,MAJAiD,cAAA,OAAA,CAKEC,UAAU,4CACVM,wBAAyB,CAAEC,OAAQvD,EAAMmD,gBAK/CrD,MAPIiD,cAAA,MAAA,CAQFC,UAAU,4CACVQ,IAAKxD,EAAMyD,4BAKjB3D,MAPIiD,cAAA,SAAA,CAQFH,KAAK,SACLI,UAAU,sBACVU,QApDe/B,SAAAA,GACnB,IAAMR,EACJ,KAAOnB,EAAM2D,cAAW,IAAuB3D,EAAM2D,QACjDxD,EACAC,EAENF,EAAkBwC,IAAIxB,EAAuBC,MAgDzCrB,MALFiD,cAAA,IAAA,CAKKC,UAAU,sCAGflD,MAHEiD,cAAA,MAAA,CAGGC,UAAU,sBACblD,MADFiD,cAAA,MAAA,CACOC,UAAU,0BACblD,MADFiD,cAAA,MAAA,CACOa,MAAM,wBA9CC,WAClB,IAAMC,EAAQ,GAEd,IAAK,IAAMxC,KAAYb,EACjB/B,OAAO6C,eAAe9B,KAAKgB,EAAaa,IAC1CwC,EAAMC,KAAK,CAAEzC,SAAUA,EAAU7C,MAAOgC,EAAYa,KAIxD,OAAOwC,EAsCEE,GAAyBC,KAAKC,SAAAA,GAC7B,IAAMjB,EAAa,2CAAwDb,OAAd8B,EAAK5C,UAC5D6C,EAAM,uBAAoCD,OAAdjE,EAAM4C,KAAK,KAAiBT,OAAd8B,EAAK5C,UAErD,OACEvB,MADFiD,cAAA,MAAA,CACOa,MAAM,uBACT9D,MADFiD,cAAA,QAAA,CAEImB,GAAIA,EACJtB,KAAK,SACLpE,MAAOyF,EAAKzF,OAAS,IAAMyF,EAAKzF,MAAQyF,EAAKzF,MAAQ,GACrDwE,UAAWA,EACXmB,SAAWxC,SAAAA,GAAMD,OAAAA,EAAaC,EAAGsC,EAAK5C,aAExCvB,MAPAiD,cAAA,QAAA,CAOOa,MAAM,yBAAyBP,QAASa,GAC5CD,EAAK5C,gBAOlBvB,MAHKiD,cAAA,MAAA,CAGAC,UAAU,2BACblD,MADFiD,cAAA,OAAA,CACQS,IAAKX,EAASG,UAAU,sBAC3B3C,6NE3HT+D,GAAAC,UAAAC,QAAAC,OAAA,CAzB0DC,WAAA,SAAAN,EAAAO,GAiD9D,IAAAxE,EAAAyE,KAEIzE,EAAMA,yBAANA,EAAAwD,yBAAAkB,KAAA1E,GAEA2E,GAAAA,UAASC,QACPvF,UAAAkF,WAAAhF,KAAAS,EAACiE,EAAAO,GAtDuDL,GAAAC,UAAApE,QAAA0E,KAAA,WAsDxD,SACM1E,EAFR2E,GAGI3E,IAFF6E,IAGE7E,EAAA8E,UACA9E,EAAA+E,UAAAC,SACAb,GAAOnE,UAAQwE,QAAOjG,OAAtB,UAAA0G,QAwCRzB,yBAAA,SAAA0B,GAEoBT,KAGRU,cAACC,UAAuBpF,OAAQ+E,GAHxBN,KAMTL,cAAUC,4kBCtHrBF,GAAGC,UAAUiB,mBAAmB,gBAAkBC,EAClDnB,GAAGC,UAAUiB,mBAAmB,iBAAmBC","sources":["node_modules/@swc/helpers/src/_define_property.js","node_modules/@swc/helpers/src/_sliced_to_array.js","node_modules/@swc/helpers/src/_array_with_holes.js","node_modules/@swc/helpers/src/_iterable_to_array.js","node_modules/@swc/helpers/src/_non_iterable_rest.js","React.js","src/KirkiMarginPaddingForm.js","node_modules/@swc/helpers/src/_object_spread.js","src/KirkiMarginPaddingControl.js","src/control.js"],"sourcesContent":["export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n","import arrayWithHoles from './_array_with_holes';\nimport iterableToArrayLimit from './_iterable_to_array';\nimport nonIterableRest from './_non_iterable_rest';\n\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n","export default function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n","module.exports=React;","import { useRef, useState } from \"react\";\n\nconst KirkiMarginPaddingForm = (props) => {\n const { control, customizerSetting, defaultArray, valueArray, valueUnit } =\n props;\n\n const [inputValues, setInputValues] = useState(() => {\n return valueArray;\n });\n\n const getSingleValueAsObject = (value) => {\n let unit = \"\";\n let number = \"\";\n let negative = \"\";\n\n if (\"\" !== value) {\n value = \"string\" !== typeof value ? value.toString() : value;\n value = value.trim();\n negative = -1 < value.indexOf(\"-\") ? \"-\" : \"\";\n value = value.replace(negative, \"\");\n\n if (\"\" !== value) {\n unit = value.replace(/\\d+/g, \"\");\n number = value.replace(unit, \"\");\n number = negative + number.trim();\n number = parseFloat(number);\n } else {\n number = negative;\n }\n }\n\n return {\n unit: unit,\n number: number,\n };\n };\n\n const getValuesForInput = (values) => {\n let singleValue;\n\n for (const position in values) {\n if (Object.hasOwnProperty.call(values, position)) {\n singleValue = getSingleValueAsObject(values[position]);\n values[position] = singleValue.number;\n }\n }\n\n return values;\n };\n\n const getValuesForCustomizer = (values) => {\n let singleValue;\n\n for (const position in values) {\n if (Object.hasOwnProperty.call(values, position)) {\n singleValue = values[position];\n\n if (\"\" !== singleValue) {\n singleValue = getSingleValueAsObject(singleValue);\n singleValue = singleValue.number + valueUnit;\n }\n\n values[position] = singleValue;\n }\n }\n\n return values;\n };\n\n control.updateComponentState = (val) => {\n setInputValues(getValuesForInput(val));\n };\n\n const handleChange = (e, position) => {\n let values = { ...inputValues };\n values[position] = e.target.value;\n\n customizerSetting.set(getValuesForCustomizer(values));\n };\n\n const handleReset = (e) => {\n const values =\n \"\" !== props.default && \"undefined\" !== typeof props.default\n ? defaultArray\n : valueArray;\n\n customizerSetting.set(getValuesForCustomizer(values));\n };\n\n // Preparing for the template.\n const fieldId = `kirki-control-input-${props.type}-top`;\n const unitRef = useRef(null);\n\n const makeMapable = () => {\n const items = [];\n\n for (const position in inputValues) {\n if (Object.hasOwnProperty.call(inputValues, position)) {\n items.push({ position: position, value: inputValues[position] });\n }\n }\n\n return items;\n };\n\n return (\n <div className=\"kirki-control-form\" tabIndex=\"1\">\n {(props.label || props.description) && (\n <>\n <label className=\"kirki-control-label\" htmlFor={fieldId}>\n {props.label && (\n <span className=\"customize-control-title\">{props.label}</span>\n )}\n\n {props.description && (\n <span\n className=\"customize-control-description description\"\n dangerouslySetInnerHTML={{ __html: props.description }}\n />\n )}\n </label>\n\n <div\n className=\"customize-control-notifications-container\"\n ref={props.setNotificationContainer}\n />\n </>\n )}\n\n <button\n type=\"button\"\n className=\"kirki-control-reset\"\n onClick={handleReset}\n >\n <i className=\"dashicons dashicons-image-rotate\"></i>\n </button>\n\n <div className=\"kirki-control-cols\">\n <div className=\"kirki-control-left-col\">\n <div class=\"kirki-control-fields\">\n {makeMapable(inputValues).map((item) => {\n const className = `kirki-control-input kirki-control-input-${item.position}`;\n const id = `kirki-control-input-${props.type}-${item.position}`;\n\n return (\n <div class=\"kirki-control-field\">\n <input\n id={id}\n type=\"number\"\n value={item.value || 0 === item.value ? item.value : \"\"}\n className={className}\n onChange={(e) => handleChange(e, item.position)}\n />\n <label class=\"kirki-control-sublabel\" htmlFor={id}>\n {item.position}\n </label>\n </div>\n );\n })}\n </div>\n </div>\n <div className=\"kirki-control-right-col\">\n <span ref={unitRef} className=\"kirki-control-unit\">\n {valueUnit}\n </span>\n </div>\n </div>\n </div>\n );\n};\n\nexport default KirkiMarginPaddingForm;\n","import defineProperty from './_define_property';\n\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import KirkiMarginPaddingForm from \"./KirkiMarginPaddingForm\";\r\n\r\n/**\r\n * KirkiMarginPaddingControl.\r\n *\r\n * Global objects brought:\r\n * - wp\r\n * - jQuery\r\n * - React\r\n * - ReactDOM\r\n *\r\n * @class\r\n * @augments wp.customize.Control\r\n * @augments wp.customize.Class\r\n */\r\nconst KirkiMarginPaddingControl = wp.customize.Control.extend({\r\n /**\r\n * Initialize.\r\n *\r\n * @param {string} id - Control ID.\r\n * @param {object} params - Control params.\r\n */\r\n initialize: function (id, params) {\r\n const control = this;\r\n\r\n // Bind functions to this control context for passing as React props.\r\n control.setNotificationContainer =\r\n control.setNotificationContainer.bind(control);\r\n\r\n wp.customize.Control.prototype.initialize.call(control, id, params);\r\n\r\n // The following should be eliminated with <https://core.trac.wordpress.org/ticket/31334>.\r\n function onRemoved(removedControl) {\r\n if (control === removedControl) {\r\n control.destroy();\r\n control.container.remove();\r\n wp.customize.control.unbind(\"removed\", onRemoved);\r\n }\r\n }\r\n\r\n wp.customize.control.bind(\"removed\", onRemoved);\r\n },\r\n\r\n /**\r\n * Set notification container and render.\r\n *\r\n * This is called when the React component is mounted.\r\n *\r\n * @param {Element} element - Notification container.\r\n * @returns {void}\r\n */\r\n setNotificationContainer: function setNotificationContainer(element) {\r\n const control = this;\r\n\r\n control.notifications.container = jQuery(element);\r\n control.notifications.render();\r\n },\r\n\r\n /**\r\n * Render the control into the DOM.\r\n *\r\n * This is called from the Control#embed() method in the parent class.\r\n *\r\n * @returns {void}\r\n */\r\n renderContent: function renderContent() {\r\n const control = this;\r\n\r\n ReactDOM.render(\r\n <KirkiMarginPaddingForm\r\n {...control.params}\r\n control={control}\r\n customizerSetting={control.setting}\r\n setNotificationContainer={control.setNotificationCotainer}\r\n value={control.params.value}\r\n />,\r\n control.container[0]\r\n );\r\n\r\n if (false !== control.params.choices.allowCollapse) {\r\n control.container.addClass(\"allowCollapse\");\r\n }\r\n },\r\n\r\n /**\r\n * After control has been first rendered, start re-rendering when setting changes.\r\n *\r\n * React is able to be used here instead of the wp.customize.Element abstraction.\r\n *\r\n * @returns {void}\r\n */\r\n ready: function ready() {\r\n const control = this;\r\n\r\n /**\r\n * Update component value's state when customizer setting's value is changed.\r\n */\r\n control.setting.bind((val) => {\r\n control.updateComponentState(val);\r\n });\r\n },\r\n\r\n /**\r\n * This method will be overriden by the rendered component.\r\n */\r\n updateComponentState: (val) => {},\r\n\r\n /**\r\n * Handle removal/de-registration of the control.\r\n *\r\n * This is essentially the inverse of the Control#embed() method.\r\n *\r\n * @link https://core.trac.wordpress.org/ticket/31334\r\n * @returns {void}\r\n */\r\n destroy: function destroy() {\r\n const control = this;\r\n\r\n // Garbage collection: undo mounting that was done in the embed/renderContent method.\r\n ReactDOM.unmountComponentAtNode(control.container[0]);\r\n\r\n // Call destroy method in parent if it exists (as of #31334).\r\n if (wp.customize.Control.prototype.destroy) {\r\n wp.customize.Control.prototype.destroy.call(control);\r\n }\r\n },\r\n});\r\n\r\nexport default KirkiMarginPaddingControl;\r\n","import \"./control.scss\";\r\nimport KirkiMarginPaddingControl from \"./KirkiMarginPaddingControl\";\r\n\r\n// Register control type with Customizer.\r\nwp.customize.controlConstructor[\"kirki-margin\"] = KirkiMarginPaddingControl;\r\nwp.customize.controlConstructor[\"kirki-padding\"] = KirkiMarginPaddingControl;\r\n"],"names":["obj","key","value","Object","defineProperty","enumerable","configurable","writable","arr","i","Array","isArray","$6e00726c30bb8aa8$export$2e2bcd8739ae039","iter","Symbol","iterator","prototype","toString","call","from","$8664303016091545$export$2e2bcd8739ae039","TypeError","$9e1e3aff84b72d71$export$2e2bcd8739ae039","module","React","$c53a0f08a36f035b$export$2e2bcd8739ae039","props","control","customizerSetting","defaultArray","valueArray","valueUnit","useState","$d8de0eb6e0dd5f0d$export$2e2bcd8739ae039","inputValues","setInputValues","getSingleValueAsObject","unit","number","negative","trim","indexOf","replace","parseFloat","getValuesForCustomizer","values","singleValue","position","hasOwnProperty","updateComponentState","val","getValuesForInput","handleChange","e","target","arguments","length","source","ownKeys","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","forEach","$7dbcf7086e8d10dc$export$2e2bcd8739ae039","$d48ddae4a704ec47$export$2e2bcd8739ae039","set","fieldId","type","unitRef","useRef","createElement","className","tabIndex","label","description","Fragment","htmlFor","dangerouslySetInnerHTML","__html","ref","setNotificationContainer","onClick","default","class","items","push","makeMapable","map","item","id","onChange","wp","customize","Control","extend","initialize","params","this","bind","ReactDOM","render","removedControl","destroy","container","remove","onRemoved","element","notifications","unmountComponentAtNode","controlConstructor","KirkiMarginPaddingControl"],"version":3,"file":"control.js.map"} packages/kirki-pro-margin-padding/dist/control.css 0000644 00000005571 14717762257 0016277 0 ustar 00 .customize-control-kirki-margin .kirki-control-label,.customize-control-kirki-padding .kirki-control-label{display:block;position:relative}.customize-control-kirki-margin .customize-control-description,.customize-control-kirki-padding .customize-control-description{padding-right:30px}.customize-control-kirki-margin .kirki-control-form,.customize-control-kirki-padding .kirki-control-form{margin-bottom:12px;position:relative}.customize-control-kirki-margin .kirki-control-form:hover .kirki-control-reset,.customize-control-kirki-padding .kirki-control-form:hover .kirki-control-reset{opacity:1}.customize-control-kirki-margin .kirki-control-reset,.customize-control-kirki-padding .kirki-control-reset{align-items:center;background-color:transparent;border-radius:50%;border-width:0;bottom:50px;color:#50575e;cursor:pointer;display:flex;height:16px;justify-content:center;opacity:0;padding:0;position:absolute;right:0;transition:all .3s;width:16px;z-index:3}.customize-control-kirki-margin .kirki-control-reset:focus,.customize-control-kirki-padding .kirki-control-reset:focus{opacity:1}.customize-control-kirki-margin .kirki-control-reset:hover i,.customize-control-kirki-padding .kirki-control-reset:hover i{color:red;transform:rotate(-45deg)}.customize-control-kirki-margin .kirki-control-reset i,.customize-control-kirki-padding .kirki-control-reset i{font-size:12px;height:auto;transform:rotate(45deg);transition:transform .3s;width:auto}.customize-control-kirki-margin .kirki-control-cols,.customize-control-kirki-padding .kirki-control-cols{align-items:center;display:flex;justify-content:space-between}.customize-control-kirki-margin .kirki-control-left-col,.customize-control-kirki-padding .kirki-control-left-col{width:91%}.customize-control-kirki-margin .kirki-control-right-col,.customize-control-kirki-padding .kirki-control-right-col{text-align:right;width:9%}.customize-control-kirki-margin .kirki-control-fields,.customize-control-kirki-padding .kirki-control-fields{display:flex}.customize-control-kirki-margin .kirki-control-field,.customize-control-kirki-padding .kirki-control-field{padding-right:5px;width:25%}.customize-control-kirki-margin .kirki-control-input,.customize-control-kirki-padding .kirki-control-input{background-color:#f7f7f7;border-color:#bbb;border-radius:4px;font-size:12px;padding-left:3px;padding-right:3px;text-align:center;transition:box-shadow .15s;z-index:2}.customize-control-kirki-margin .kirki-control-input:focus,.customize-control-kirki-padding .kirki-control-input:focus{background-color:#fff}.customize-control-kirki-margin .kirki-control-unit,.customize-control-kirki-padding .kirki-control-unit{font-size:12px;font-weight:600;position:relative;top:-10px}.customize-control-kirki-margin .kirki-control-sublabel,.customize-control-kirki-padding .kirki-control-sublabel{display:block;font-size:11px;text-align:center;text-transform:capitalize} /*# sourceMappingURL=control.css.map */ packages/kirki-pro-margin-padding/composer.json 0000644 00000000374 14717762257 0015660 0 ustar 00 { "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\MarginPadding\\": "src" } } } packages/kirki-pro-margin-padding/.gitignore 0000644 00000000063 14717762257 0015121 0 ustar 00 node_modules package-lock.json .parcel-cache builds Init.php 0000644 00000001157 14717762257 0006206 0 ustar 00 <?php /** * Init Kirki PRO. * * @package kirki-pro * @since 1.0.0 */ namespace Kirki\Pro; /** * Class to init Kirki PRO. * * Only call this class when it's used as embedded package. * This class will not be called when it's used as a regular plugin. * * @since 1.0.0 */ class Init { /** * The class constructor. * * @since 1.0.0 */ public function __construct() { // Stop, if Kirki is not installed. if ( ! defined( 'KIRKI_VERSION' ) ) { return; } // Stop, if Kirki PRO is already installed. if ( defined( 'KIRKI_PRO_VERSION' ) ) { return; } kirki_pro_init_controls(); } } pro-index.php 0000644 00000003462 14717762257 0007211 0 ustar 00 <?php defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'kirki_pro_init_controls' ) ) { /** * Init Kirki PRO controls. */ function kirki_pro_init_controls() { $packages = array( __DIR__ . '/packages/kirki-pro-headline-divider', __DIR__ . '/packages/kirki-pro-input-slider', __DIR__ . '/packages/kirki-pro-margin-padding', __DIR__ . '/packages/kirki-pro-responsive', __DIR__ . '/packages/kirki-pro-tabs', ); foreach ( $packages as $package ) { $init_class_name = str_ireplace( __DIR__ . '/packages/kirki-pro-', '', $package ); $init_class_name = str_ireplace( '-', ' ', $init_class_name ); $init_class_name = ucwords( $init_class_name ); $init_class_name = str_ireplace( ' ', '', $init_class_name ); $init_class_name = '\\Kirki\\Pro\\' . $init_class_name . '\\Init'; $init_file_path = $package . '/' . basename( $package ) . '.php'; $vendor_file = $package . '/vendor/autoload.php'; if ( file_exists( $init_file_path ) ) { include_once $init_file_path; include_once $vendor_file; } if ( class_exists( $init_class_name ) ) { new $init_class_name(); } } } } if ( ! function_exists( 'kirki_pro_load_controls' ) ) { /** * Load Kirki PRO controls. */ function kirki_pro_load_controls() { // Stop, if Kirki is not installed. if ( ! defined( 'KIRKI_VERSION' ) ) { return; } // Stop, if Kirki PRO is already installed. if ( defined( 'KIRKI_PRO_VERSION' ) ) { return; } if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugin_data = get_plugin_data( __FILE__ ); define( 'KIRKI_PRO_VERSION', $plugin_data['Version'] ); define( 'KIRKI_PRO_PLUGIN_FILE', __FILE__ ); kirki_pro_init_controls(); } add_action( 'plugins_loaded', 'kirki_pro_load_controls' ); }
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка