Fix palette choices, template drawer, and canvas layer labels

This commit is contained in:
2026-11-28 11:59:15 +08:00
parent 5c37952bca
commit f9af7af86c
16 changed files with 141 additions and 81 deletions
+1 -6
View File
@@ -11,11 +11,6 @@ final class LayoutPage
{
public const TYPES = ['page' => '普通页面', 'home' => '首页', 'header' => '页头', 'footer' => '页脚'];
public static function slug(string $kind, int $id): string
{
return "layout--$kind-$id";
}
public static function insertPreset(PDO $pdo, string $kind, string $name): int
{
$pdo->prepare('INSERT INTO design_presets (kind, name, preset, payload) VALUES (?, ?, ?, ?)')
@@ -40,7 +35,7 @@ final class LayoutPage
$layout = $row;
$layout['payload'] = DesignLibrary::normalize($kind, $row['preset'], json_decode($row['payload'], true, flags: JSON_THROW_ON_ERROR));
$body = self::component($kind, $layout, $site['name']);
Repository::insertPage($pdo, self::slug($kind, $row['id']), $row['name'], [
Repository::insertPage($pdo, 'layout--' . $kind . '-' . $row['id'], $row['name'], [
'visibility' => ['hero' => false],
'sections' => [[
'key' => 'layout-content', 'title' => DesignLibrary::PRESETS[$kind][$row['preset']], 'lead' => '',