forked from laysense/laysite
Address canvas review and add paragraph shortcut
This commit is contained in:
@@ -25,6 +25,19 @@ final class CanvasStyle
|
||||
];
|
||||
private const PREFIX = 'studio-style-';
|
||||
|
||||
public static function encode(array $presentation): string
|
||||
{
|
||||
return $presentation === [] ? '{}' : Database::json($presentation);
|
||||
}
|
||||
|
||||
public static function stylesheetUrl(): string
|
||||
{
|
||||
static $version;
|
||||
$version ??= hash_file('xxh64', __FILE__);
|
||||
|
||||
return '/canvas-style.css?v=' . $version;
|
||||
}
|
||||
|
||||
public static function normalize(mixed $input, array $roles): array
|
||||
{
|
||||
if (!is_array($input) || count($input) > count($roles) + 28) {
|
||||
|
||||
Reference in New Issue
Block a user