diff --git a/app/Models/Plugin.php b/app/Models/Plugin.php index 375921b..948e323 100644 --- a/app/Models/Plugin.php +++ b/app/Models/Plugin.php @@ -345,6 +345,7 @@ class Plugin extends Model if ($standalone) { return view('trmnl-layouts.single', [ 'colorDepth' => $device?->deviceModel?->color_depth, + 'deviceVariant' => $device?->deviceModel?->name ?? 'og', 'slot' => $renderedContent, ])->render(); } @@ -356,6 +357,7 @@ class Plugin extends Model if ($standalone) { return view('trmnl-layouts.single', [ 'colorDepth' => $device?->deviceModel?->color_depth, + 'deviceVariant' => $device?->deviceModel?->name ?? 'og', 'slot' => view($this->render_markup_view, [ 'size' => $size, 'data' => $this->data_payload, diff --git a/app/Services/ImageGenerationService.php b/app/Services/ImageGenerationService.php index a0a78a3..fe6cdd4 100644 --- a/app/Services/ImageGenerationService.php +++ b/app/Services/ImageGenerationService.php @@ -44,13 +44,12 @@ class ImageGenerationService $browserStage->html($markup); if (config('app.puppeteer_window_size_strategy') === 'v1') { + // default behaviour for Framework v1 + $browserStage->useDefaultDimensions(); + } else { $browserStage ->width($imageSettings['width']) ->height($imageSettings['height']); - } else { - $browserStage - ->width(800) - ->height(480); } if (config('app.puppeteer_wait_for_network_idle')) { diff --git a/resources/views/trmnl-layouts/single.blade.php b/resources/views/trmnl-layouts/single.blade.php index 741ddbd..84ec889 100644 --- a/resources/views/trmnl-layouts/single.blade.php +++ b/resources/views/trmnl-layouts/single.blade.php @@ -1,7 +1,20 @@ @props([ + 'noBleed' => false, + 'darkMode' => false, + 'deviceVariant' => 'og', + 'deviceOrientation' => null, 'colorDepth' => '1bit', + 'scaleLevel' => null, ]) - - {!! $slot !!} - +@if(config('app.puppeteer_window_size_strategy') === 'v1') + + {!! $slot !!} + +@else + + {!! $slot !!} + +@endif