packages/kirki-pro-responsive/composer.lock000064400000001124147177622570015145 0ustar00{ "_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.txt000064400000000540147177622570014443 0ustar00=== 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.php000064400000001403147177622570016262 0ustar00 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.php000064400000002161147177622570021116 0ustar00register(true); return $loader; } } packages/kirki-pro-responsive/vendor/composer/platform_check.php000064400000001635147177622570021271 0ustar00= 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.php000064400000040220147177622570020475 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ 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> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $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.php000064400000000336147177622570022000 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-responsive/vendor/composer/autoload_static.php000064400000002562147177622570021467 0ustar00 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.php000064400000037417147177622570021767 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $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.json000064400000000105147177622570020440 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-responsive/vendor/composer/installed.php000064400000001344147177622570020264 0ustar00 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.php000064400000025620147177622570014656 0ustar00register_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.js000064400000007210147177622570015253 0ustar00import "./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.scss000064400000004101147177622570015606 0ustar00.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.php000064400000005034147177622570017130 0ustar00args['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.php000064400000005451147177622570017530 0ustar00 '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 .= '
  • '; } $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() { ?>
    {{{ data.label }}}
    <# if (data.description) { #>
    {{{ data.description }}}
    <# } #>
      {{{ data.deviceMenu }}}
    0.5%, last 2 versions, not dead" } packages/kirki-pro-responsive/dist/control.js000064400000002542147177622570015432 0ustar00!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.map000064400000014507147177622570016366 0ustar00{"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.map000064400000012753147177622570016213 0ustar00{"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.css000064400000005457147177622570015616 0ustar00.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.json000064400000000300147177622570015161 0ustar00{ "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.php000064400000002644147177622570017267 0ustar00api_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( '', $this->slug, $file, in_array( $this->name, $this->get_active_plugins(), true ) ? 'active' : 'inactive' ); echo ''; echo '

    '; $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' ), '', esc_html( $update_cache->response[ $this->name ]->new_version ), '' ); } elseif ( ! empty( $changelog_link ) ) { echo ' '; printf( __( '%1$sView version %2$s details%3$s or %4$supdate now%5$s.', 'easy-digital-downloads' ), '', esc_html( $update_cache->response[ $this->name ]->new_version ), '', '', '' ); } else { printf( ' %1$s%2$s%3$s', '', esc_html__( 'Update now.', 'easy-digital-downloads' ), '' ); } do_action( "in_plugin_update_message-{$file}", $plugin, $plugin ); echo '

    '; } /** * 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 '
    ' . wp_kses_post( $sections['changelog'] ) . '
    '; } } 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.lock000064400000001124147177622570013701 0ustar00{ "_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.php000064400000002637147177622570014561 0ustar00 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.php000064400000002161147177622570017652 0ustar00register(true); return $loader; } } packages/kirki-pro-tabs/vendor/composer/platform_check.php000064400000001635147177622570020025 0ustar00= 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.php000064400000040220147177622570017231 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ 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> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $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.php000064400000000336147177622570020534 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-tabs/vendor/composer/autoload_static.php000064400000002546147177622570020225 0ustar00 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.php000064400000037417147177622570020523 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $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.json000064400000000105147177622570017174 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-tabs/vendor/composer/installed.php000064400000001344147177622570017020 0ustar00 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.php000064400000004020147177622570013401 0ustar00 $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.js000064400000004444147177622570014015 0ustar00import "./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.scss000064400000002055147177622570014350 0ustar00.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.php000064400000004232147177622570014417 0ustar00args['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.php000064400000004547147177622570015025 0ustar00choices['tabs'] ) ? $this->choices['tabs'] : []; $tab_menu = ''; $loop_index = 0; foreach ( $tabs as $tab_id => $tab_args ) { $loop_index++; $tab_menu .= '
  • ' . esc_html( $tab_args['label'] ) . '
  • '; } $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() { ?>
      {{{ data.tabMenu }}}
    0.5%, last 2 versions, not dead" } packages/kirki-pro-tabs/dist/control.js000064400000002237147177622570014167 0ustar00!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.map000064400000005633147177622570015122 0ustar00{"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.map000064400000010062147177622570014736 0ustar00{"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.css000064400000001677147177622570014352 0ustar00.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.json000064400000000272147177622570013725 0ustar00{ "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/.gitignore000064400000000063147177622570013171 0ustar00node_modules package-lock.json .parcel-cache buildspackages/kirki-pro-input-slider/composer.lock000064400000001124147177622570015367 0ustar00{ "_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.txt000064400000000552147177622570014670 0ustar00=== 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.php000064400000001403147177622570016504 0ustar00 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.php000064400000002161147177622570021340 0ustar00register(true); return $loader; } } packages/kirki-pro-input-slider/vendor/composer/platform_check.php000064400000001635147177622570021513 0ustar00= 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.php000064400000040220147177622570020717 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ 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> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $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.php000064400000000336147177622570022222 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-input-slider/vendor/composer/autoload_static.php000064400000002564147177622570021713 0ustar00 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.php000064400000037417147177622570022211 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $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.json000064400000000105147177622570020662 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-input-slider/vendor/composer/installed.php000064400000001344147177622570020506 0ustar00 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.js000064400000006460147177622570020620 0ustar00import 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 . 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( , 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.js000064400000007723147177622570020106 0ustar00import { 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 (
    ); }; export default KirkiInputSliderForm; packages/kirki-pro-input-slider/src/Init.php000064400000001212147177622570015067 0ustar00args['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.php000064400000007415147177622570020061 0ustar00choices['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.php000064400000002674147177622570017736 0ustar00 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/.babelrc000064400000000131147177622570014256 0ustar00{ "presets": [ [ "@babel/preset-react", { "runtime": "classic" } ] ] }packages/kirki-pro-input-slider/dist/control.js000064400000006604147177622570015657 0ustar00!function(){var t={};t=React;var e=function(e){var n=e.control,r=e.customizerSetting,a=e.choices,i="",o=function(t){return ta.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 {\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
    \n \n\n
    \n\n \n \n \n\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \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 .\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 ,\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.css000064400000006541147177622570016033 0ustar00.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.json000064400000000372147177622570015414 0ustar00{ "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/.gitignore000064400000000063147177622570014657 0ustar00node_modules package-lock.json .parcel-cache buildspackages/kirki-pro-headline-divider/composer.lock000064400000001124147177622570016145 0ustar00{ "_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.php000064400000002777147177622570021276 0ustar00 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.php000064400000002161147177622570022116 0ustar00register(true); return $loader; } } packages/kirki-pro-headline-divider/vendor/composer/platform_check.php000064400000001635147177622570022271 0ustar00= 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.php000064400000040220147177622570021475 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ 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> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $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.php000064400000000336147177622570023000 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-headline-divider/vendor/composer/autoload_static.php000064400000002574147177622570022472 0ustar00 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.php000064400000037417147177622570022767 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $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.json000064400000000105147177622570021440 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-headline-divider/vendor/composer/installed.php000064400000001344147177622570021264 0ustar00 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.php000064400000001373147177622570015655 0ustar00args['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.php000064400000003466147177622570017513 0ustar00args['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.php000064400000000732147177622570020646 0ustar00choices ) && 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() { ?>
    <# if (data.label) { #>

    {{{ data.label }}}

    <# } #> <# if (data.description) { #>

    {{{ data.description }}}

    <# } #>
    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.json000064400000001433147177622570015735 0ustar00{ "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.js000064400000000045147177622570016426 0ustar00 //# sourceMappingURL=control.js.map packages/kirki-pro-headline-divider/dist/control.css.map000064400000005677147177622570017376 0ustar00{"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.map000064400000000137147177622570017204 0ustar00{"mappings":"","sources":[],"sourcesContent":[],"names":[],"version":3,"file":"control.js.map"}packages/kirki-pro-headline-divider/dist/control.css000064400000002137147177622570016606 0ustar00.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.json000064400000000376147177622570016176 0ustar00{ "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/.gitignore000064400000000063147177622570015435 0ustar00node_modules package-lock.json .parcel-cache buildspackages/kirki-pro-margin-padding/composer.lock000064400000001124147177622570015631 0ustar00{ "_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.php000064400000002740147177622570020434 0ustar00 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.php000064400000002161147177622570021602 0ustar00register(true); return $loader; } } packages/kirki-pro-margin-padding/vendor/composer/platform_check.php000064400000001635147177622570021755 0ustar00= 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.php000064400000040220147177622570021161 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ 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> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $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.php000064400000000336147177622570022464 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); packages/kirki-pro-margin-padding/vendor/composer/autoload_static.php000064400000002570147177622570022152 0ustar00 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.php000064400000037417147177622570022453 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $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.json000064400000000105147177622570021124 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } packages/kirki-pro-margin-padding/vendor/composer/installed.php000064400000001344147177622570020750 0ustar00 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.php000064400000001210147177622570015327 0ustar00 { 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 (
    {(props.label || props.description) && ( <>
    )}
    {makeMapable(inputValues).map((item) => { const className = `kirki-control-input kirki-control-input-${item.position}`; const id = `kirki-control-input-${props.type}-${item.position}`; return (
    handleChange(e, item.position)} />
    ); })}
    {valueUnit}
    ); }; export default KirkiMarginPaddingForm; packages/kirki-pro-margin-padding/src/KirkiMarginPaddingControl.js000064400000006474147177622570021331 0ustar00import 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 . 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( , 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.js000064400000002242147177622570015740 0ustar00(() => { /** * 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.php000064400000001723147177622570017026 0ustar00args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-padding'; } return $args; } } packages/kirki-pro-margin-padding/src/Field/Margin.php000064400000006575147177622570016707 0ustar00args['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.php000064400000000517147177622570017456 0ustar00type ); $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.php000064400000000535147177622570017423 0ustar00 '', '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.json000064400000001570147177622570015423 0ustar00{ "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/.babelrc000064400000000131147177622570014520 0ustar00{ "presets": [ [ "@babel/preset-react", { "runtime": "classic" } ] ] }packages/kirki-pro-margin-padding/dist/preview.js.map000064400000003331147177622570016670 0ustar00{"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.js000064400000010743147177622570016120 0ustar00!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 {\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
    \n {(props.label || props.description) && (\n <>\n \n\n \n \n )}\n\n \n \n \n\n
    \n
    \n
    \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
    \n handleChange(e, item.position)}\n />\n \n
    \n );\n })}\n
    \n
    \n
    \n \n {valueUnit}\n \n
    \n
    \n
    \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 .\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 ,\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.css000064400000005571147177622570016277 0ustar00.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.json000064400000000374147177622570015660 0ustar00{ "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/.gitignore000064400000000063147177622570015121 0ustar00node_modules package-lock.json .parcel-cache buildsInit.php000064400000001157147177622570006206 0ustar00