From 9cc1ac4f7849023fc02f47d7485ed2bad63602dd Mon Sep 17 00:00:00 2001 From: Helmut Hackbarth Date: Mon, 23 May 2022 08:40:08 +0200 Subject: [PATCH] New release v5.1.13 --- Classes/Controller/ConfigController.php | 86 +++++----- Classes/Utility/ResponsiveImagesUtility.php | 7 +- Classes/ViewHelpers/MediaViewHelper.php | 12 +- Classes/Wrapper/Modal.php | 1 - Configuration/FlexForms/Container/Modal.xml | 2 + Configuration/TSConfig/CKEditor.tsconfig | 2 +- Contrib/scssphp/bin/pscss | 6 +- Contrib/scssphp/composer.json | 19 --- Contrib/scssphp/src/Compiler.php | 150 +++++++----------- Contrib/scssphp/src/Node/Number.php | 4 - Contrib/scssphp/src/Parser.php | 3 +- Contrib/scssphp/src/Version.php | 2 +- .../Backend/Templates/Config/List.html | 2 +- .../Content/Media/Rendering/Image.html | 6 + .../Private/Templates/Container/Modal.html | 9 +- Resources/Public/Backend/t3sbootstrap.css | 8 + ext_emconf.php | 2 +- 17 files changed, 144 insertions(+), 177 deletions(-) diff --git a/Classes/Controller/ConfigController.php b/Classes/Controller/ConfigController.php index 794d1fa8..7c2475e5 100644 --- a/Classes/Controller/ConfigController.php +++ b/Classes/Controller/ConfigController.php @@ -474,7 +474,6 @@ public function getCustomScss( string $file ): array ->execute(); $siteroots = $result->fetchAll(); - $customScssFileName = ''; foreach ($siteroots as $key=>$siteroot) { @@ -492,12 +491,10 @@ public function getCustomScss( string $file ): array if ( file_exists($customScssFile) ) { $customScssFile = $customScssFilePath.$customScssFileName; - if ($file == 'custom') { $assignedOptions['customScss'] = TRUE; } $arguments = $this->request->getArguments(); - if ( !empty($arguments['t3sbootstrap'][$file]) ) { $scss = $arguments['t3sbootstrap'][$file]; } else { @@ -674,27 +671,32 @@ private function getUtilityColors(): array { $defaultUtilColorsList = '$white,$gray-100,$gray-200,$gray-300,$gray-400,$gray-500,$gray-600,$gray-700,$gray-800,$gray-900,$black,$blue,$indigo,$purple,$pink,$red,$orange,$yellow,$green,$teal,$cyan,$primary,$secondary,$success,$info,$warning,$danger,$light,$dark'; $utilityColors = []; - $utilColors = []; $colors = []; + $customScssArr = []; + $defaultUtilityColors = []; + $defaultcolors = []; + $customScss = self::getCustomScss('custom-variables'); - if (!empty($customScss['custom-variables'])) { - $customScssArr = GeneralUtility::trimExplode(';', $customScss['custom-variables']); - foreach( $customScssArr as $customvariables ) { + $custom_variables = empty($customScss['custom-variables']) ? '' : preg_replace('/\s+/', ' ', trim($customScss['custom-variables'])); + $default = '// Overrides Bootstrap variables // $enable-shadows: true; // $enable-gradients: true; // $enable-negative-margins: true;'; + + if ( !empty($customScss['custom-variables']) && str_starts_with($custom_variables, $default) == FALSE ) { + foreach( GeneralUtility::trimExplode(';', $customScss['custom-variables']) as $customvariables ) { $scsscolor = GeneralUtility::trimExplode(':', $customvariables); - if ( !empty($scsscolor[1]) && str_starts_with((string)$scsscolor[1], '$') - && GeneralUtility::inList($defaultUtilColorsList, $scsscolor[0]) ) { - $utilColors[$scsscolor[0]] = $scsscolor[1]; - } elseif (!empty($scsscolor[1]) && str_starts_with((string)$scsscolor[1], '#')) { - if (str_starts_with((string)$scsscolor[0], '$')) { - $colors[$scsscolor[0]] = $scsscolor[1]; - } + if ( str_starts_with((string)$customvariables, '$') && GeneralUtility::inList($defaultUtilColorsList, $scsscolor[0]) ) { + $scsscolor = GeneralUtility::trimExplode(':', $customvariables); + + + $customScssArr[$scsscolor[0]] = $scsscolor[1]; } } - if (is_array($utilColors)) { - foreach($utilColors as $key=>$utiColor) { - if ( !empty($utilityColors[$key]) && str_starts_with((string)$utiColor, '$') ) { - $utilityColors[$key] = $colors[$utiColor]; - } + foreach( $customScssArr as $key=>$customvariables ) { + if (str_starts_with((string)$customvariables, '$')) { + if ($customScssArr[$customvariables]) + $utilityColors[$key] = $customScssArr[$customvariables]; + } elseif ( str_starts_with((string)$customvariables, '#') ) { + if ($customvariables) + $utilityColors[$key] = $customvariables; } } } @@ -702,34 +704,38 @@ private function getUtilityColors(): array $variablesSCSS = 'fileadmin/T3SB/Resources/Public/Contrib/Bootstrap/scss/_variables.scss'; $variablesSCSS = GeneralUtility::getFileAbsFileName($variablesSCSS); $variablesSCSS = GeneralUtility::getURL($variablesSCSS); - $defaultUtilityColors = []; - $defaultcolors = []; - foreach ( GeneralUtility::trimExplode(';', $variablesSCSS) as $defaultVariables) { + if (!empty($variablesSCSS)) { + foreach ( GeneralUtility::trimExplode(';', $variablesSCSS) as $defaultVariables) { + $defaultScssColor = GeneralUtility::trimExplode(':', $defaultVariables); + if ( str_starts_with((string)$defaultVariables, '$') && GeneralUtility::inList($defaultUtilColorsList, $defaultScssColor[0]) + && ( str_starts_with((string)$defaultScssColor[1], '$') || str_starts_with((string)$defaultScssColor[1], '#') ) ) { + $scsscolor = GeneralUtility::trimExplode(':', $defaultVariables); - $defaultScssColor = GeneralUtility::trimExplode(':', $defaultVariables); - if (!empty($defaultScssColor[1]) && GeneralUtility::inList($defaultUtilColorsList, trim($defaultScssColor[0]))) { - if ( str_starts_with((string)$defaultScssColor[1], '$')) { - // variable has variable - $defaultUtilColors[$defaultScssColor[0]] = trim(rtrim($defaultScssColor[1], '!default')); - } elseif (str_starts_with((string)$defaultScssColor[1], '#')) { - if (str_starts_with((string)$defaultScssColor[0], '$')) { - $defaultcolors[$defaultScssColor[0]] = trim(rtrim($defaultScssColor[1], '!default')); - } + + $defaultUtilColors[$scsscolor[0]] = substr($scsscolor[1], 0, -9); } } - } - - if (is_array($defaultUtilColors)) { - foreach($defaultUtilColors as $key=>$defaultUtiColor) { - $defaultUtilityColors[$key] = $defaultcolors[$defaultUtiColor]; + foreach( $defaultUtilColors as $key=>$customvariables ) { + if (str_starts_with((string)$customvariables, '$')) { + if ($customScssArr[$customvariables]) + $defaultUtilityColors[$key] = $customScssArr[$customvariables]; + } elseif ( str_starts_with((string)$customvariables, '#') ) { + if ($customvariables) + $defaultUtilityColors[$key] = $customvariables; + } } } + if ( is_array($utilityColors) && is_array($defaultUtilityColors) ) { - if ( is_array($utilityColors) && is_array($colors) ) { - $colorArr = array_merge($defaultUtilityColors, $defaultcolors, $utilityColors, $colors); - ksort($colorArr); - return $colorArr; + if ( !empty($utilityColors) ) { + $colorArr = array_merge($defaultUtilityColors, $utilityColors); + ksort($colorArr); + return $colorArr; + } else { + ksort($defaultUtilityColors); + return $defaultUtilityColors; + } } else { return []; } diff --git a/Classes/Utility/ResponsiveImagesUtility.php b/Classes/Utility/ResponsiveImagesUtility.php index ed9a75f6..ae39a70b 100644 --- a/Classes/Utility/ResponsiveImagesUtility.php +++ b/Classes/Utility/ResponsiveImagesUtility.php @@ -87,8 +87,6 @@ public function createPictureTag( $webpIsLoaded = ExtensionManagementUtility::isLoaded('webp'); - - // Deal with file formats that can't be cropped separately if ($this->hasIgnoredFileExtension($originalImage, $ignoreFileExtensions)) { return $this->createSimpleImageTag( @@ -136,6 +134,7 @@ public function createPictureTag( $fallbackTag->addAttribute('sizes', sprintf($lastBreakpoint['sizes'], $referenceWidth)); } } else { + // Breakpoint can't be used as fallback if ($lastBreakpoint) { array_push($breakpoints, $lastBreakpoint); @@ -240,7 +239,7 @@ public function createPictureSourceTag( // Generate different image sizes for srcset attribute $srcsetImages = $this->generateSrcsetImages($originalImage, $defaultWidth, $srcset, $cropArea, $absoluteUri, $webpIsLoaded, $type); $srcsetMode = substr(key($srcsetImages), -1); // x or w - + // Create source tag for this breakpoint $sourceTag = GeneralUtility::makeInstance(TagBuilder::class, 'source'); @@ -390,10 +389,12 @@ public function generateSrcsetImages( $srcset = GeneralUtility::trimExplode(',', $srcset); } + $images = []; foreach ($srcset as $widthDescriptor) { // Determine image width $srcsetMode = substr($widthDescriptor, -1); + switch ($srcsetMode) { case 'x': $candidateWidth = (int) ($defaultWidth * (float) substr($widthDescriptor, 0, -1)); diff --git a/Classes/ViewHelpers/MediaViewHelper.php b/Classes/ViewHelpers/MediaViewHelper.php index 8c4462ec..c89306c2 100644 --- a/Classes/ViewHelpers/MediaViewHelper.php +++ b/Classes/ViewHelpers/MediaViewHelper.php @@ -223,7 +223,6 @@ protected function renderImageTag(FileInterface $image, $width, $height, $fileEx $cropVariantCollection = CropVariantCollection::create((string)$cropString); $cropArea = $cropVariantCollection->getCropArea($cropVariant); - if ( $this->arguments['ratio'] ) { $m = $cropArea->getHeight() / $cropArea->getWidth(); $height = ceil((float)$height * (float)$m); @@ -290,16 +289,13 @@ protected function getCropString($image, $cropString) $cropedWidth = $image->getProperties()['width'] * $cropObject->$cropVariant->cropArea->width; $cropedHeight = $image->getProperties()['height'] * $cropObject->$cropVariant->cropArea->height; $rArr = explode(':',$this->arguments['ratio']); - if ($cropVariant == 'mobile') { $rArr[0] = '16'; $rArr[1] = '9'; - } else { - if ( $this->arguments['shift'] ) { - $shift = $this->arguments['shift'] > 0 ? $cropObject->$cropVariant->cropArea->y + $this->arguments['shift'] - : $cropObject->$cropVariant->cropArea->y - ($this->arguments['shift'] * -1); - $cropObject->$cropVariant->cropArea->y = $shift; - } + } elseif ( $this->arguments['shift'] ) { + $shift = $this->arguments['shift'] > 0 ? $cropObject->$cropVariant->cropArea->y + $this->arguments['shift'] + : $cropObject->$cropVariant->cropArea->y - ($this->arguments['shift'] * -1); + $cropObject->$cropVariant->cropArea->y = $shift; } if ( $rArr[0] > $rArr[1] ) { diff --git a/Classes/Wrapper/Modal.php b/Classes/Wrapper/Modal.php index caee2c8d..952f97e5 100644 --- a/Classes/Wrapper/Modal.php +++ b/Classes/Wrapper/Modal.php @@ -20,7 +20,6 @@ class Modal implements SingletonInterface */ public function getProcessedData(array $processedData, array $flexconf): array { - $processedData['modal']['animation'] = $flexconf['animation']; $processedData['modal']['size'] = $flexconf['size']; $processedData['modal']['button'] = $flexconf['button']; diff --git a/Configuration/FlexForms/Container/Modal.xml b/Configuration/FlexForms/Container/Modal.xml index 2db02894..77d54289 100644 --- a/Configuration/FlexForms/Container/Modal.xml +++ b/Configuration/FlexForms/Container/Modal.xml @@ -81,6 +81,8 @@ modal-lg LLL:EXT:t3sbootstrap/Resources/Private/Language/locallang_be.xlf:small modal-sm + Fullscreen + modal-fullscreen default diff --git a/Configuration/TSConfig/CKEditor.tsconfig b/Configuration/TSConfig/CKEditor.tsconfig index 2cf2b728..353e4193 100644 --- a/Configuration/TSConfig/CKEditor.tsconfig +++ b/Configuration/TSConfig/CKEditor.tsconfig @@ -75,7 +75,7 @@ RTE { telephone.properties { class.default = } - properties.class.allowedClasses = phone-link, fax-link, external-link, internal-link, email-link, download-link, btn, btn btn-primary, btn btn-secondary, btn btn-success, btn btn-danger, btn btn-warning, btn btn-info, btn btn-light, btn btn-dark, js-scroll-trigger, text-primary, text-secondary, text-success, text-danger, text-warning, text-info,text-light, text-light bg-dark, text-dark, text-muted, text-white, text-white bg-dark, stretched-link + properties.class.allowedClasses = phone-link, fax-link, external-link, internal-link, email-link, download-link, btn, btn btn-primary, btn btn-secondary, btn btn-success, btn btn-danger, btn btn-warning, btn btn-info, btn btn-light, btn btn-dark, js-scroll-trigger, text-primary, text-secondary, text-success, text-danger, text-warning, text-info,text-light, text-light bg-dark, text-dark, text-muted, text-white, text-white bg-dark, stretched-link, link-primary, link-secondary, link-success, link-primary, link-secondary, link-success, link-danger, link-warning, link-info, link-light, link-darklink, link-danger, link-warning, link-info, link-light, link-dark queryParametersSelector.enabled = 0 } diff --git a/Contrib/scssphp/bin/pscss b/Contrib/scssphp/bin/pscss index e6223983..18c136ac 100644 --- a/Contrib/scssphp/bin/pscss +++ b/Contrib/scssphp/bin/pscss @@ -26,7 +26,7 @@ use ScssPhp\ScssPhp\Parser; use ScssPhp\ScssPhp\Version; $style = null; -$loadPaths = []; +$loadPaths = null; $dumpTree = false; $inputFile = null; $changeDir = false; @@ -148,7 +148,7 @@ EOT; $value = parseArgument($i, array('-I', '--load-path')); if (isset($value)) { - $loadPaths[] = $value; + $loadPaths = $value; continue; } @@ -188,7 +188,7 @@ if ($dumpTree) { $scss = new Compiler(); if ($loadPaths) { - $scss->setImportPaths($loadPaths); + $scss->setImportPaths(explode(PATH_SEPARATOR, $loadPaths)); } if ($style) { diff --git a/Contrib/scssphp/composer.json b/Contrib/scssphp/composer.json index 86cd396b..e4895871 100644 --- a/Contrib/scssphp/composer.json +++ b/Contrib/scssphp/composer.json @@ -40,7 +40,6 @@ "sass/sass-spec": "*", "squizlabs/php_codesniffer": "~3.5", "symfony/phpunit-bridge": "^5.1", - "thoughtbot/bourbon": "^7.0", "twbs/bootstrap": "~5.0", "twbs/bootstrap4": "4.6.0", "zurb/foundation": "~6.5" @@ -64,24 +63,6 @@ } } }, - { - "type": "package", - "package": { - "name": "thoughtbot/bourbon", - "version": "v7.0.0", - "source": { - "type": "git", - "url": "https://github.com/thoughtbot/bourbon.git", - "reference": "fbe338ee6807e7f7aa996d82c8a16f248bb149b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thoughtbot/bourbon/zipball/fbe338ee6807e7f7aa996d82c8a16f248bb149b3", - "reference": "fbe338ee6807e7f7aa996d82c8a16f248bb149b3", - "shasum": "" - } - } - }, { "type": "package", "package": { diff --git a/Contrib/scssphp/src/Compiler.php b/Contrib/scssphp/src/Compiler.php index 58ba795a..76e17f1b 100644 --- a/Contrib/scssphp/src/Compiler.php +++ b/Contrib/scssphp/src/Compiler.php @@ -731,7 +731,7 @@ protected function compileRoot(Block $rootBlock) * * @return void */ - protected function missingSelectors() + public function missingSelectors() { foreach ($this->extends as $extend) { if (isset($extend[3])) { @@ -749,7 +749,7 @@ protected function missingSelectors() $origin = $this->collapseSelectors($origin); $this->sourceLine = $block[Parser::SOURCE_LINE]; - throw $this->error("\"$origin\" failed to @extend \"$target\". The selector \"$target\" was not found."); + throw $this->errorMsg("\"$origin\" failed to @extend \"$target\". The selector \"$target\" was not found."); } } @@ -1970,7 +1970,7 @@ protected function evalSelectors($selectors) try { $isValid = $parser->parseSelector($buffer, $newSelectors, true); } catch (ParserException $e) { - throw $this->error($e->getMessage()); + throw $this->errorMsg($e->getMessage()); } if ($isValid) { @@ -2258,7 +2258,7 @@ protected function pushCallStack($name = '') $msg = $this->callStackMessage(true, 100); $msg = 'Infinite calling loop'; - throw $this->error($msg); + throw $this->errorMsg($msg); } } @@ -2328,7 +2328,7 @@ protected function compileChildrenNoReturn($stms, OutputBlock $out, $selfParent } if (isset($ret)) { - throw $this->error('@return may only be used within a function'); + throw $this->errorMsg('@return may only be used within a function'); } } @@ -3054,14 +3054,14 @@ protected function compileChild($child, OutputBlock $out) $replacedSel = $this->replaceSelfSelector($sel); if ($replacedSel !== $sel) { - throw $this->error('Parent selectors aren\'t allowed here.'); + throw $this->errorMsg('Parent selectors aren\'t allowed here.'); } $results = $this->evalSelectors([$sel]); foreach ($results as $result) { if (\count($result) !== 1) { - throw $this->error('complex selectors may not be extended.'); + throw $this->errorMsg('complex selectors may not be extended.'); } // only use the first one @@ -3214,7 +3214,7 @@ protected function compileChild($child, OutputBlock $out) $mixin = $this->get(static::$namespaces['mixin'] . $name, false); if (! $mixin) { - throw $this->error("Undefined mixin $name"); + throw $this->errorMsg("Undefined mixin $name"); } $callingScope = $this->getStoreEnv(); @@ -3271,7 +3271,7 @@ protected function compileChild($child, OutputBlock $out) if (! empty($mixin->parentEnv)) { $this->env->declarationScopeParent = $mixin->parentEnv; } else { - throw $this->error("@mixin $name() without parentEnv"); + throw $this->errorMsg("@mixin $name() without parentEnv"); } $this->compileChildrenNoReturn($mixin->children, $out, $selfParent, $this->env->marker . ' ' . $name); @@ -3338,10 +3338,10 @@ protected function compileChild($child, OutputBlock $out) $line = $this->sourceLine; $value = $this->compileValue($this->reduce($value, true)); - throw $this->error("File $fname on line $line ERROR: $value\n"); + throw $this->errorMsg("File $fname on line $line ERROR: $value\n"); default: - throw $this->error("unknown child type: $child[0]"); + throw $this->errorMsg("unknown child type: $child[0]"); } } @@ -3827,6 +3827,7 @@ protected function getFunctionReference($name, $safeCopy = false) // try to find a native lib function $normalizedName = $this->normalizeName($name); + $libName = null; if (isset($this->userFunctions[$normalizedName])) { // see if we can find a user function @@ -3835,45 +3836,10 @@ protected function getFunctionReference($name, $safeCopy = false) return [Type::T_FUNCTION_REFERENCE, 'user', $name, $f, $prototype]; } - $lowercasedName = strtolower($normalizedName); - - // Special functions overriding a CSS function are case-insensitive. We normalize them as lowercase - // to avoid the deprecation warning about the wrong case being used. - if ($lowercasedName === 'min' || $lowercasedName === 'max') { - $normalizedName = $lowercasedName; - } - if (($f = $this->getBuiltinFunction($normalizedName)) && \is_callable($f)) { $libName = $f[1]; $prototype = isset(static::$$libName) ? static::$$libName : null; - // All core functions have a prototype defined. Not finding the - // prototype can mean 2 things: - // - the function comes from a child class (deprecated just after) - // - the function was found with a different case, which relates to calling the - // wrong Sass function due to our camelCase usage (`fade-in()` vs `fadein()`), - // because PHP method names are case-insensitive while property names are - // case-sensitive. - if ($prototype === null || strtolower($normalizedName) !== $normalizedName) { - $r = new \ReflectionMethod($this, $libName); - $actualLibName = $r->name; - - if ($actualLibName !== $libName || strtolower($normalizedName) !== $normalizedName) { - $kebabCaseName = preg_replace('~(?<=\\w)([A-Z])~', '-$1', substr($actualLibName, 3)); - assert($kebabCaseName !== null); - $originalName = strtolower($kebabCaseName); - $warning = "Calling built-in functions with a non-standard name is deprecated since Scssphp 1.8.0 and will not work anymore in 2.0 (they will be treated as CSS function calls instead).\nUse \"$originalName\" instead of \"$name\"."; - @trigger_error($warning, E_USER_DEPRECATED); - $fname = $this->getPrettyPath($this->sourceNames[$this->sourceIndex]); - $line = $this->sourceLine; - Warn::deprecation("$warning\n on line $line of $fname"); - - // Use the actual function definition - $prototype = isset(static::$$actualLibName) ? static::$$actualLibName : null; - $f[1] = $libName = $actualLibName; - } - } - if (\get_class($this) !== __CLASS__ && !isset($this->warnedChildFunctions[$libName])) { $r = new \ReflectionMethod($this, $libName); $declaringClass = $r->getDeclaringClass()->name; @@ -4149,7 +4115,7 @@ protected function opColorColor($op, $left, $right) case '%': if ($rval == 0) { - throw $this->error("color: Can't take modulo by zero"); + throw $this->errorMsg("color: Can't take modulo by zero"); } $out[] = $lval % $rval; @@ -4157,7 +4123,7 @@ protected function opColorColor($op, $left, $right) case '/': if ($rval == 0) { - throw $this->error("color: Can't divide by zero"); + throw $this->errorMsg("color: Can't divide by zero"); } $out[] = (int) ($lval / $rval); @@ -4170,7 +4136,7 @@ protected function opColorColor($op, $left, $right) return $this->opNeq($left, $right); default: - throw $this->error("color: unknown op $op"); + throw $this->errorMsg("color: unknown op $op"); } } @@ -4704,7 +4670,7 @@ public function compileValue($value, $quote = true) return $this->compileCommentValue($value); default: - throw $this->error('unknown value type: ' . json_encode($value)); + throw $this->errorMsg('unknown value type: ' . json_encode($value)); } } @@ -5252,7 +5218,7 @@ public function get($name, $shouldThrow = true, Environment $env = null, $unredu } if ($shouldThrow) { - throw $this->error("Undefined variable \$$name" . ($maxDepth <= 0 ? ' (infinite recursion)' : '')); + throw $this->errorMsg("Undefined variable \$$name" . ($maxDepth <= 0 ? ' (infinite recursion)' : '')); } // found nothing @@ -5659,7 +5625,7 @@ protected function importFile($path, OutputBlock $out) $this->sourceLine = 1; $this->sourceColumn = 1; - throw $this->error('The Sass indented syntax is not implemented.'); + throw $this->errorMsg('The Sass indented syntax is not implemented.'); } if (isset($this->importCache[$realPath])) { @@ -5798,7 +5764,7 @@ public function findImport($url, $currentDir = null) } } - throw $this->error("`$url` file not found for @import"); + throw $this->errorMsg("`$url` file not found for @import"); } /** @@ -5847,7 +5813,7 @@ private function checkImportPathConflicts(array $paths) $formattedPrettyPaths[] = ' ' . $this->getPrettyPath($path); } - throw $this->error("It's not clear which file to import. Found:\n" . implode("\n", $formattedPrettyPaths)); + throw $this->errorMsg("It's not clear which file to import. Found:\n" . implode("\n", $formattedPrettyPaths)); } /** @@ -6007,7 +5973,7 @@ public function throwError($msg) E_USER_DEPRECATED ); - throw $this->error(...func_get_args()); + throw $this->errorMsg(...func_get_args()); } /** @@ -6019,7 +5985,7 @@ public function throwError($msg) * * @return CompilerException */ - public function error($msg, ...$args) + public function errorMsg($msg, ...$args) { if ($args) { $msg = sprintf($msg, ...$args); @@ -6072,7 +6038,7 @@ public function errorArgsNumber($functionName, $ExpectedArgs, $nbActual) $nbExpected = \count($ExpectedArgs); if ($nbActual > $nbExpected) { - return $this->error( + return $this->errorMsg( 'Error: Only %d arguments allowed in %s(), but %d were passed.', $nbExpected, $functionName, @@ -6085,7 +6051,7 @@ public function errorArgsNumber($functionName, $ExpectedArgs, $nbActual) array_unshift($missing, array_pop($ExpectedArgs)); } - return $this->error( + return $this->errorMsg( 'Error: %s() argument%s %s missing.', $functionName, count($missing) > 1 ? 's' : '', @@ -6149,7 +6115,7 @@ protected function handleImportLoop($name) } if (realpath($file) === $name) { - throw $this->error('An @import loop has been found: %s imports %s', $file, basename($file)); + throw $this->errorMsg('An @import loop has been found: %s imports %s', $file, basename($file)); } } } @@ -6186,7 +6152,7 @@ protected function callScssFunction($func, $argValues) if (! empty($func->parentEnv)) { $this->env->declarationScopeParent = $func->parentEnv; } else { - throw $this->error("@function $name() without parentEnv"); + throw $this->errorMsg("@function $name() without parentEnv"); } $ret = $this->compileChildren($func->children, $tmp, $this->env->marker . ' ' . $name); @@ -7186,7 +7152,7 @@ protected function compileColorPartValue($value, $min, $max, $isInt = true) } elseif ($value->hasUnit('%')) { $num = $max * $value->getDimension() / 100; } else { - throw $this->error('Expected %s to have no units or "%%".', $value); + throw $this->errorMsg('Expected %s to have no units or "%%".', $value); } $value = $num; @@ -7319,7 +7285,7 @@ public function assertMap($value, $varName = null) public function assertList($value) { if ($value[0] !== Type::T_LIST) { - throw $this->error('expecting list, %s received', $value[0]); + throw $this->errorMsg('expecting list, %s received', $value[0]); } return $value; @@ -7495,7 +7461,7 @@ public function toHSL($red, $green, $blue) } } - return [Type::T_HSL, fmod($h + 360, 360), $s * 100, $l / 5.1]; + return [Type::T_HSL, fmod($h, 360), $s * 100, $l / 5.1]; } /** @@ -7651,7 +7617,7 @@ protected function libCall($args) } if (! in_array($functionReference[0], [Type::T_FUNCTION_REFERENCE, Type::T_FUNCTION])) { - throw $this->error('Function reference expected, got ' . $functionReference[0]); + throw $this->errorMsg('Function reference expected, got ' . $functionReference[0]); } $callArgs = [ @@ -7847,7 +7813,7 @@ protected function alterColor(array $args, $operation, $fn) if (!$scale && $checkPercent) { if (!$number->hasUnit('%')) { - $warning = $this->error("{$name} Passing a number `$number` without unit % is deprecated."); + $warning = $this->errorMsg("{$name} Passing a number `$number` without unit % is deprecated."); $this->logger->warn($warning->getMessage(), true); } } @@ -8008,7 +7974,7 @@ protected function libIeHexStr($args) $color = $this->coerceColor($args[0]); if (\is_null($color)) { - throw $this->error('Error: argument `$color` of `ie-hex-str($color)` must be a color'); + throw $this->errorMsg('Error: argument `$color` of `ie-hex-str($color)` must be a color'); } $color[4] = isset($color[4]) ? round(255 * $color[4]) : 255; @@ -8022,7 +7988,7 @@ protected function libRed($args) $color = $this->coerceColor($args[0]); if (\is_null($color)) { - throw $this->error('Error: argument `$color` of `red($color)` must be a color'); + throw $this->errorMsg('Error: argument `$color` of `red($color)` must be a color'); } return new Number((int) $color[1], ''); @@ -8034,7 +8000,7 @@ protected function libGreen($args) $color = $this->coerceColor($args[0]); if (\is_null($color)) { - throw $this->error('Error: argument `$color` of `green($color)` must be a color'); + throw $this->errorMsg('Error: argument `$color` of `green($color)` must be a color'); } return new Number((int) $color[2], ''); @@ -8046,7 +8012,7 @@ protected function libBlue($args) $color = $this->coerceColor($args[0]); if (\is_null($color)) { - throw $this->error('Error: argument `$color` of `blue($color)` must be a color'); + throw $this->errorMsg('Error: argument `$color` of `blue($color)` must be a color'); } return new Number((int) $color[3], ''); @@ -8182,7 +8148,7 @@ protected function libHsl($args, $kwargs, $funcName = 'hsl') } } - $hueValue = fmod($hue->getDimension(), 360); + $hueValue = $hue->getDimension() % 360; while ($hueValue < 0) { $hueValue += 360; @@ -8246,20 +8212,20 @@ protected function libHwb($args, $kwargs, $funcName = 'hwb') if (\count($args) == 1) { if ($args[0][0] !== Type::T_LIST) { - throw $this->error("Missing elements \$whiteness and \$blackness"); + throw $this->errorMsg("Missing elements \$whiteness and \$blackness"); } if (\trim($args[0][1])) { - throw $this->error("\$channels must be a space-separated list."); + throw $this->errorMsg("\$channels must be a space-separated list."); } if (! empty($args[0]['enclosing'])) { - throw $this->error("\$channels must be an unbracketed list."); + throw $this->errorMsg("\$channels must be an unbracketed list."); } $args = $args[0][2]; if (\count($args) > 3) { - throw $this->error("hwb() : Only 3 elements are allowed but ". \count($args) . "were passed"); + throw $this->errorMsg("hwb() : Only 3 elements are allowed but ". \count($args) . "were passed"); } $args_to_check = $this->extractSlashAlphaInColorFunction($kwargs['channels'][2]); @@ -8269,13 +8235,13 @@ protected function libHwb($args, $kwargs, $funcName = 'hwb') } if (\count($args_to_check) < 2) { - throw $this->error("Missing elements \$whiteness and \$blackness"); + throw $this->errorMsg("Missing elements \$whiteness and \$blackness"); } if (\count($args_to_check) < 3) { - throw $this->error("Missing element \$blackness"); + throw $this->errorMsg("Missing element \$blackness"); } if (\count($args_to_check) > 4) { - throw $this->error("hwb() : Only 4 elements are allowed but ". \count($args) . "were passed"); + throw $this->errorMsg("hwb() : Only 4 elements are allowed but ". \count($args) . "were passed"); } foreach ($kwargs as $k => $arg) { @@ -8312,7 +8278,7 @@ protected function libHwb($args, $kwargs, $funcName = 'hwb') if (! \is_numeric($alpha)) { $val = $this->compileValue($args[3]); - throw $this->error("\$alpha: $val is not a number"); + throw $this->errorMsg("\$alpha: $val is not a number"); } } @@ -8606,7 +8572,7 @@ protected function libMin($args) return $min; } - throw $this->error('At least one argument must be passed.'); + throw $this->errorMsg('At least one argument must be passed.'); } protected static $libMax = ['numbers...']; @@ -8629,7 +8595,7 @@ protected function libMax($args) return $max; } - throw $this->error('At least one argument must be passed.'); + throw $this->errorMsg('At least one argument must be passed.'); } protected static $libLength = ['list']; @@ -8688,7 +8654,7 @@ protected function libSetNth($args) } if (! isset($list[2][$n])) { - throw $this->error('Invalid argument for "n"'); + throw $this->errorMsg('Invalid argument for "n"'); } $list[2][$n] = $args[2]; @@ -9043,7 +9009,7 @@ protected function libComparable($args) ! $number1 instanceof Number || ! $number2 instanceof Number ) { - throw $this->error('Invalid argument(s) for "comparable"'); + throw $this->errorMsg('Invalid argument(s) for "comparable"'); } return $this->toBool($number1->isComparableTo($number2)); @@ -9460,11 +9426,11 @@ protected function isSuperSelector($super, $sub) { // one and only one selector for each arg if (! $super) { - throw $this->error('Invalid super selector for isSuperSelector()'); + throw $this->errorMsg('Invalid super selector for isSuperSelector()'); } if (! $sub) { - throw $this->error('Invalid sub selector for isSuperSelector()'); + throw $this->errorMsg('Invalid sub selector for isSuperSelector()'); } if (count($sub) > 1) { @@ -9564,7 +9530,7 @@ protected function libSelectorAppend($args) $args = $args[2]; if (\count($args) < 1) { - throw $this->error('selector-append() needs at least 1 argument'); + throw $this->errorMsg('selector-append() needs at least 1 argument'); } $selectors = []; @@ -9589,14 +9555,14 @@ protected function selectorAppend($selectors) $lastSelectors = array_pop($selectors); if (! $lastSelectors) { - throw $this->error('Invalid selector list in selector-append()'); + throw $this->errorMsg('Invalid selector list in selector-append()'); } while (\count($selectors)) { $previousSelectors = array_pop($selectors); if (! $previousSelectors) { - throw $this->error('Invalid selector list in selector-append()'); + throw $this->errorMsg('Invalid selector list in selector-append()'); } // do the trick, happening $lastSelector to $previousSelector @@ -9639,7 +9605,7 @@ protected function libSelectorExtend($args) $extender = $this->getSelectorArg($extender, 'extender'); if (! $selectors || ! $extendee || ! $extender) { - throw $this->error('selector-extend() invalid arguments'); + throw $this->errorMsg('selector-extend() invalid arguments'); } $extended = $this->extendOrReplaceSelectors($selectors, $extendee, $extender); @@ -9660,7 +9626,7 @@ protected function libSelectorReplace($args) $replacement = $this->getSelectorArg($replacement, 'replacement'); if (! $selectors || ! $original || ! $replacement) { - throw $this->error('selector-replace() invalid arguments'); + throw $this->errorMsg('selector-replace() invalid arguments'); } $replaced = $this->extendOrReplaceSelectors($selectors, $original, $replacement, true); @@ -9689,7 +9655,7 @@ protected function extendOrReplaceSelectors($selectors, $extendee, $extender, $r foreach ($extendee as $es) { if (\count($es) !== 1) { - throw $this->error('Can\'t extend complex selector.'); + throw $this->errorMsg('Can\'t extend complex selector.'); } // only use the first one @@ -9727,7 +9693,7 @@ protected function libSelectorNest($args) $args = $args[2]; if (\count($args) < 1) { - throw $this->error('selector-nest() needs at least 1 argument'); + throw $this->errorMsg('selector-nest() needs at least 1 argument'); } $selectorsMap = []; @@ -9772,7 +9738,7 @@ protected function libSelectorUnify($args) $selectors2 = $this->getSelectorArg($selectors2, 'selectors2'); if (! $selectors1 || ! $selectors2) { - throw $this->error('selector-unify() invalid arguments'); + throw $this->errorMsg('selector-unify() invalid arguments'); } // only consider the first compound of each diff --git a/Contrib/scssphp/src/Node/Number.php b/Contrib/scssphp/src/Node/Number.php index b326906b..78f86bac 100644 --- a/Contrib/scssphp/src/Node/Number.php +++ b/Contrib/scssphp/src/Node/Number.php @@ -149,7 +149,6 @@ public function getDenominatorUnits() /** * {@inheritdoc} */ - #[\ReturnTypeWillChange] public function offsetExists($offset) { if ($offset === -3) { @@ -175,7 +174,6 @@ public function offsetExists($offset) /** * {@inheritdoc} */ - #[\ReturnTypeWillChange] public function offsetGet($offset) { switch ($offset) { @@ -202,7 +200,6 @@ public function offsetGet($offset) /** * {@inheritdoc} */ - #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { throw new \BadMethodCallException('Number is immutable'); @@ -211,7 +208,6 @@ public function offsetSet($offset, $value) /** * {@inheritdoc} */ - #[\ReturnTypeWillChange] public function offsetUnset($offset) { throw new \BadMethodCallException('Number is immutable'); diff --git a/Contrib/scssphp/src/Parser.php b/Contrib/scssphp/src/Parser.php index 3ba2f67f..3a3ae628 100644 --- a/Contrib/scssphp/src/Parser.php +++ b/Contrib/scssphp/src/Parser.php @@ -15,6 +15,7 @@ use ScssPhp\ScssPhp\Exception\ParserException; use ScssPhp\ScssPhp\Logger\LoggerInterface; use ScssPhp\ScssPhp\Logger\QuietLogger; +use ScssPhp\ScssPhp\Node\Number; /** * Parser @@ -2956,7 +2957,7 @@ protected function unit(&$unit) if (\strlen($this->buffer) === $this->count || ! ctype_digit($this->buffer[$this->count])) { $this->whitespace(); - $unit = new Node\Number($m[1], empty($m[3]) ? '' : $m[3]); + $unit = new Number($m[1], empty($m[3]) ? '' : $m[3]); return true; } diff --git a/Contrib/scssphp/src/Version.php b/Contrib/scssphp/src/Version.php index 62c8006a..4cc0bb68 100644 --- a/Contrib/scssphp/src/Version.php +++ b/Contrib/scssphp/src/Version.php @@ -19,5 +19,5 @@ */ class Version { - const VERSION = '1.8.1'; + const VERSION = '1.7.0'; } diff --git a/Resources/Private/Backend/Templates/Config/List.html b/Resources/Private/Backend/Templates/Config/List.html index 941450ac..ec82e1da 100644 --- a/Resources/Private/Backend/Templates/Config/List.html +++ b/Resources/Private/Backend/Templates/Config/List.html @@ -203,7 +203,7 @@

Configuration

-

Set the following constant to disable the "Utility Colors":
+

Set the following constant to disable the "Utility Colors":
bootstrap.config.enableUtilityColors = 0

diff --git a/Resources/Private/Partials/Content/Media/Rendering/Image.html b/Resources/Private/Partials/Content/Media/Rendering/Image.html index d5a4b4ad..7de31965 100644 --- a/Resources/Private/Partials/Content/Media/Rendering/Image.html +++ b/Resources/Private/Partials/Content/Media/Rendering/Image.html @@ -5,6 +5,12 @@ + + + + + + diff --git a/Resources/Private/Templates/Container/Modal.html b/Resources/Private/Templates/Container/Modal.html index 45857b8a..f8aa2d93 100644 --- a/Resources/Private/Templates/Container/Modal.html +++ b/Resources/Private/Templates/Container/Modal.html @@ -47,16 +47,21 @@