block editor

This commit is contained in:
2023-10-14 18:06:36 +03:00
parent 9e37a7f730
commit 2e81d27ff6
21 changed files with 523 additions and 141 deletions
+12
View File
@@ -35,6 +35,11 @@ class SchemaService
isEntry: $schemaArr["isEntry"] ?? false,
color: $schemaArr["color"] ?? "",
titleTemplate: $schemaArr["titleTemplate"] ?? "",
),
"block" => new BlockSchema(
name: $schemaArr["name"],
label: $schemaArr["label"],
fields: (new Collection($schemaArr["fields"]))->map([$this, 'mapBlockFields'])
)
};
@@ -47,6 +52,13 @@ class SchemaService
return new $className(...$field);
}
public function mapBlockFields(array $field): FieldInterface
{
$className = "\\Lucent\Schema\BlockUi\\" . ucfirst($field["ui"]);
unset($field["ui"]);
return new $className(...$field);
}
//
// /**