Skip to content

Commit

Permalink
Merge pull request #5711 from getkirby/release/4.0.0-beta.2
Browse files Browse the repository at this point in the history
4.0.0-beta.2
  • Loading branch information
bastianallgeier authored Sep 28, 2023
2 parents bc43ab0 + ee1572a commit ee62955
Show file tree
Hide file tree
Showing 325 changed files with 6,920 additions and 4,255 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ tests/ export-ignore
panel/.env.example export-ignore
panel/.eslintrc.js export-ignore
panel/.prettierrc.json export-ignore
panel/jsconfig.json export-ignore
panel/package-lock.json export-ignore
panel/package.json export-ignore
panel/public export-ignore
panel/README.md export-ignore
panel/scripts export-ignore
panel/src export-ignore
panel/vite.config.js export-ignore
panel/vitest.setup.js export-ignore
panel/jsconfig.json export-ignore

# other
.tx export-ignore
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The Kirby core",
"license": "proprietary",
"type": "kirby-cms",
"version": "4.0.0-beta.1",
"version": "4.0.0-beta.2",
"keywords": [
"kirby",
"cms",
Expand Down Expand Up @@ -37,14 +37,14 @@
"ext-mbstring": "*",
"ext-openssl": "*",
"claviska/simpleimage": "4.0.6",
"composer/semver": "3.3.2",
"composer/semver": "3.4.0",
"filp/whoops": "2.15.3",
"getkirby/composer-installer": "^1.2.1",
"laminas/laminas-escaper": "2.12.0",
"michelf/php-smartypants": "1.8.1",
"phpmailer/phpmailer": "6.8.0",
"symfony/polyfill-intl-idn": "1.27.0",
"symfony/polyfill-mbstring": "1.27.0",
"phpmailer/phpmailer": "6.8.1",
"symfony/polyfill-intl-idn": "1.28.0",
"symfony/polyfill-mbstring": "1.28.0",
"symfony/yaml": "5.4.23"
},
"replace": {
Expand Down
88 changes: 44 additions & 44 deletions composer.lock

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

37 changes: 37 additions & 0 deletions config/fields/color.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,42 @@
'text' => is_string($key) ? $key : null
]);
}
],
'validations' => [
'color' => function ($value) {
if (empty($value) === true) {
return true;
}

if (
$this->format === 'hex' &&
preg_match('/^#([\da-f]{3,4}){1,2}$/i', $value) !== 1
) {
throw new InvalidArgumentException([
'key' => 'validation.color',
'data' => ['format' => 'hex']
]);
}

if (
$this->format === 'rgb' &&
preg_match('/^rgba?\(\s*(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i', $value) !== 1
) {
throw new InvalidArgumentException([
'key' => 'validation.color',
'data' => ['format' => 'rgb']
]);
}

if (
$this->format === 'hsl' &&
preg_match('/^hsla?\(\s*(\d{1,3}\.?\d*)(deg|rad|grad|turn)?(?:,|\s)+(\d{1,3})%(?:,|\s)+(\d{1,3})%(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i', $value) !== 1
) {
throw new InvalidArgumentException([
'key' => 'validation.color',
'data' => ['format' => 'hsl']
]);
}
}
]
];
7 changes: 7 additions & 0 deletions config/fields/text.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
return $counter;
},

/**
* Sets the font family (sans or monospace)
*/
'font' => function (string $font = null) {
return $font === 'monospace' ? 'monospace' : 'sans-serif';
},

/**
* Maximum number of allowed characters
*/
Expand Down
Loading

0 comments on commit ee62955

Please sign in to comment.