Use the same format for styles as it is in theme.json

This should be the first step to using theme.json format in DB and merging more style configurations to the final one.
[MAILPOET-5640]
This commit is contained in:
Jan Lysý
2024-03-08 10:11:14 +01:00
committed by Jan Lysý
parent c415f1efce
commit 5ceef236bf
21 changed files with 195 additions and 155 deletions

View File

@ -39,12 +39,13 @@ class ProcessManager {
/**
* @param array $parsedBlocks
* @param array{width: string, background: string, padding: array{bottom: string, left: string, right: string, top: string}} $layoutStyles
* @param array{contentSize: string} $layout
* @param array{spacing: array{padding: array{bottom: string, left: string, right: string, top: string}, blockGap: string}} $styles
* @return array
*/
public function preprocess(array $parsedBlocks, array $layoutStyles): array {
public function preprocess(array $parsedBlocks, array $layout, array $styles): array {
foreach ($this->preprocessors as $preprocessor) {
$parsedBlocks = $preprocessor->preprocess($parsedBlocks, $layoutStyles);
$parsedBlocks = $preprocessor->preprocess($parsedBlocks, $layout, $styles);
}
return $parsedBlocks;
}