Improve canvas layers, heading removal and component previews in 1.5.3

This commit is contained in:
2026-11-28 16:15:19 +08:00
parent 93b58b87b0
commit cb317bbeb0
31 changed files with 322 additions and 90 deletions
+4 -3
View File
@@ -260,10 +260,11 @@ final class Repository
self::checkVersion($query->rowCount());
}
public function createSection(string $page, string $key, string $title, string $style, string $body, ?string $feed = null, string $lead = ''): void
public function createSection(string $page, string $key, string $title, string $style, string $body, ?string $feed = null, string $lead = '', ?string $template = null): void
{
Database::write(function (PDO $pdo) use ($page, $key, $title, $style, $body, $feed, $lead): void {
self::insertSection($pdo, $page, $key, compact('title', 'style', 'body', 'feed', 'lead'));
Database::write(function (PDO $pdo) use ($page, $key, $title, $style, $body, $feed, $lead, $template): void {
$presentation = CanvasStyle::encode($template === null ? [] : ['template' => $template]);
self::insertSection($pdo, $page, $key, compact('title', 'style', 'body', 'feed', 'lead', 'presentation'));
self::touchPage($pdo, $page);
});
}