Skip to content

Commit

Permalink
Merge pull request #171 from tbela99/v.next
Browse files Browse the repository at this point in the history
remove docs reference xml installer #170
  • Loading branch information
tbela99 authored Jul 14, 2022
2 parents 17661ad + a849849 commit be379f5
Show file tree
Hide file tree
Showing 18 changed files with 104 additions and 45 deletions.
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions gzip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
<license>Released under dual license LGPL v3 | MIT</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://tbela.net</authorUrl>
<version>3.1.1</version>
<version>3.1.2</version>
<description>PLG_SYSTEM_GZIP_XML_DESCRIPTION</description>
<files>
<folder>docs</folder>
<folder>css</folder>
<folder>fields</folder>
<folder>helpers</folder>
Expand All @@ -19,7 +18,6 @@
<folder>language</folder>
<folder>worker/dist</folder>
<folder>worker/css</folder>
<folder>docs/</folder>
<folder>push</folder>
<folder>vendor</folder>
<filename>autoload.php</filename>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gzip",
"version": "3.1.1",
"version": "3.1.2",
"scripts": {
"build": "./build.sh",
"rollup-config": "./node_modules/rollup/dist/bin/rollup ./config/rollup/rollup.js -f iife --name=rollupConfig > ./rollup.config.js",
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getFallbackDirsPsr4()

/**
* @return string[] Array of classname => path
* @psalm-return array<string, string>
* @psalm-var array<string, string>
*/
public function getClassMap()
{
Expand Down
2 changes: 0 additions & 2 deletions vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
* 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
{
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(__DIR__);
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/autoload_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_files.php @generated by Composer

$vendorDir = dirname(__DIR__);
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/autoload_namespaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(__DIR__);
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(__DIR__);
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
Expand Down
40 changes: 29 additions & 11 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,38 @@ public static function getLoader()
require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInit25e05d6f03a126040f1a3cf5082f1706', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit25e05d6f03a126040f1a3cf5082f1706', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
\Composer\Autoload\ComposerStaticInit25e05d6f03a126040f1a3cf5082f1706::getInitializer($loader)();
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInit25e05d6f03a126040f1a3cf5082f1706::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}

$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}

$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}

$loader->register(true);

$includeFiles = \Composer\Autoload\ComposerStaticInit25e05d6f03a126040f1a3cf5082f1706::$files;
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit25e05d6f03a126040f1a3cf5082f1706::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire25e05d6f03a126040f1a3cf5082f1706($fileIdentifier, $file);
}
Expand All @@ -42,16 +65,11 @@ public static function getLoader()
}
}

/**
* @param string $fileIdentifier
* @param string $file
* @return void
*/
function composerRequire25e05d6f03a126040f1a3cf5082f1706($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

require $file;

$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}
8 changes: 4 additions & 4 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@
"source": {
"type": "git",
"url": "https://github.com/tbela99/css.git",
"reference": "66357d1655adee242c91093fdca40a8d2696df4a"
"reference": "8156a0f72deb264573b0262b9ffa39f7945e05f6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tbela99/css/zipball/66357d1655adee242c91093fdca40a8d2696df4a",
"reference": "66357d1655adee242c91093fdca40a8d2696df4a",
"url": "https://api.github.com/repos/tbela99/css/zipball/8156a0f72deb264573b0262b9ffa39f7945e05f6",
"reference": "8156a0f72deb264573b0262b9ffa39f7945e05f6",
"shasum": ""
},
"require": {
Expand All @@ -420,7 +420,7 @@
"php": ">=5.6.40",
"symfony/polyfill-mbstring": "v1.19.0"
},
"time": "2022-07-01T19:53:21+00:00",
"time": "2022-07-14T01:12:39+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down
6 changes: 3 additions & 3 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '79e7040ecf7a4e5cf7f105c0b5974c83d9753d64',
'reference' => '17661ad5b68cea101fa6d28937270e9389ae4f89',
'name' => '__root__',
'dev' => true,
),
Expand All @@ -16,7 +16,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '79e7040ecf7a4e5cf7f105c0b5974c83d9753d64',
'reference' => '17661ad5b68cea101fa6d28937270e9389ae4f89',
'dev_requirement' => false,
),
'axy/backtrace' => array(
Expand Down Expand Up @@ -88,7 +88,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../tbela99/css',
'aliases' => array(),
'reference' => '66357d1655adee242c91093fdca40a8d2696df4a',
'reference' => '8156a0f72deb264573b0262b9ffa39f7945e05f6',
'dev_requirement' => false,
),
),
Expand Down
12 changes: 8 additions & 4 deletions vendor/tbela99/css/src/TBela/CSS/ArrayTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* - Getter syntax: $value = $element['value']; // $value = $element->getValue()
* - Setter syntax: $element['value'] = $value; // $element->setValue($value);
* - Properties: $element['childNodes'], $element['firstChild'], $element['lastChild']
* - Properties: $element['childNodes'], $element['firstChild'], $element['lastChild'], $element['parentNode']
* @package TBela\CSS
*/
trait ArrayTrait
Expand Down Expand Up @@ -62,7 +62,7 @@ public function offsetExists($offset)
{
return is_callable([$this, 'get' . $offset]) ||
is_callable([$this, 'set' . $offset]) ||
(isset($this->ast->children) && in_array($offset, ['childNodes', 'firstChild', 'lastChild']));
(isset($this->ast->children) && in_array($offset, ['childNodes', 'firstChild', 'lastChild', 'parentNode']));
}

/**
Expand Down Expand Up @@ -91,6 +91,11 @@ public function offsetGet($offset)
return call_user_func([$this, 'get' . $offset]);
}

if ($offset == 'parentNode') {

return $this->parent;
}

if (isset($this->ast->children)) {

switch ($offset) {
Expand All @@ -105,8 +110,7 @@ public function offsetGet($offset)

case 'lastChild':

$count = count($this->ast->children);
return $count > 0 ? $this->ast->children[$count - 1] : null;
return end($this->ast->children);
}
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/tbela99/css/src/TBela/CSS/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ public function __toString()

catch (Exception $ex) {

error_log($ex->getTraceAsString());
error_log($ex);
}

return '';
Expand Down
11 changes: 10 additions & 1 deletion vendor/tbela99/css/src/TBela/CSS/Element/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function addSelector($selector)
* Remove a css selector
* @param array|string $selector
* @return Rule
* @throws Exception
*/
public function removeSelector($selector)
{
Expand All @@ -111,7 +112,15 @@ public function removeSelector($selector)
$selector = array_map('trim', explode(',', $selector));
}

$this->ast->selector = array_diff($this->ast->selector, $selector);
$selector = array_values(array_diff($this->ast->selector, $selector));

if (empty($selector)) {

throw new \Exception(sprintf('the selector is empty: %s:%s:%s', isset($this->ast->src) ? $this->ast->src : '', isset($this->ast->position->line) ? $this->ast->position->line : '', isset($this->ast->position->column) ? $this->ast->position->column : ''), 400);
}

$this->ast->selector = $selector;

return $this;
}

Expand Down
13 changes: 11 additions & 2 deletions vendor/tbela99/css/src/TBela/CSS/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,18 @@ protected function renderSelector($ast, $level)

$indent = $this->indents[$level];

if (is_array($selector) && is_string($selector[0])) {
if (is_array($selector)) {

$selector = implode(','.$this->options['indent'], $selector);
if (empty($selector)) {
;
// the selector is empty!
throw new \Exception(sprintf('the selector is empty: %s:%s:%s', isset($ast->src) ? $ast->src : '', isset($ast->position->line) ? $ast->position->line :'', isset($ast->position->column) ? $ast->position->column : ''), 400);
}

if (is_string($selector[0])) {

$selector = implode(','.$this->options['indent'], $selector);
}
}

if (is_string($selector)) {
Expand Down
4 changes: 2 additions & 2 deletions vendor/tbela99/css/src/TBela/CSS/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -1196,10 +1196,10 @@ public static function getTokens($string, $capture_whitespace = true, $context =
$tokens[] = (object)['type' => $context === 'attribute' ? 'operator' : 'css-string', 'value' => '='];
} else if ($context === 'attribute') {

$tokens[] = (object)['type' => 'operator', 'value' => $string[$i++] . '='];
$tokens[] = (object)['type' => 'operator', 'value' => $string[$i++] .$string[$i]];
} else {

$tokens[] = (object)['type' => 'css-string', 'value' => $string[$i++]];
$tokens[] = (object)['type' => 'css-string', 'value' => $string[$i]];
}

break;
Expand Down
25 changes: 24 additions & 1 deletion vendor/tbela99/css/src/TBela/CSS/Value/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,36 @@ public function render(array $options = [])

public static function doRender($data, array $options = []) {

if ($data->value == 0) {
/**
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types#quantities
*/
if ($data->value == 0 && !in_array(strtolower($data->unit), ['s', 'ms', 'hz', 'khz', 'dpi', 'dpcm', 'dppx', 'x'])) {

return '0'.(isset($options['omit_unit']) && isset($data->unit) && $options['omit_unit'] == false ? $data->unit : '');
}

$unit = !empty($options['omit_unit']) && $options['omit_unit'] == $data->unit ? '' : $data->unit;

if ($data->value == 0) {

$unit = strtolower($data->unit);

if ($unit == 'ms') {

$unit = 's';
}

else if ($unit == 'khz') {

$unit = 'hz';
}
}

if ($unit == 'dppx') {

$unit = 'x';
}

if (!empty($options['compress'])) {

$value = $data->value;
Expand Down

0 comments on commit be379f5

Please sign in to comment.