mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-03-15 12:53:29 +00:00
Compare commits
No commits in common. "8958e65ec205963787c46df1bd1eb01f45ba202e" and "b3b251bae289d474937865a7a7f6ebc5a37c4059" have entirely different histories.
8958e65ec2
...
b3b251bae2
6 changed files with 40 additions and 41 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.4
|
||||
php-version: 8.3
|
||||
coverage: xdebug
|
||||
|
||||
- name: Setup Node
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ final class DeviceModel extends Model
|
|||
return null;
|
||||
}
|
||||
|
||||
// if higher then 4 return 4bit
|
||||
//if higher then 4 return 4bit
|
||||
if ($this->bit_depth > 4) {
|
||||
return '4bit';
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ final class DeviceModel extends Model
|
|||
return $this->bit_depth.'bit';
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns the scale level based on the device width.
|
||||
*/
|
||||
public function getScaleLevelAttribute(): ?string
|
||||
|
|
|
|||
|
|
@ -350,16 +350,15 @@ class Plugin extends Model
|
|||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
||||
'slot' => $renderedContent,
|
||||
])->render();
|
||||
} else {
|
||||
return view('trmnl-layouts.mashup', [
|
||||
'mashupLayout' => $this->getPreviewMashupLayoutForSize($size),
|
||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
||||
'deviceVariant' => $device?->deviceModel->name ?? 'og',
|
||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
||||
'slot' => $renderedContent,
|
||||
])->render();
|
||||
}
|
||||
|
||||
return view('trmnl-layouts.mashup', [
|
||||
'mashupLayout' => $this->getPreviewMashupLayoutForSize($size),
|
||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
||||
'deviceVariant' => $device?->deviceModel->name ?? 'og',
|
||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
||||
'slot' => $renderedContent,
|
||||
])->render();
|
||||
|
||||
}
|
||||
|
||||
return $renderedContent;
|
||||
|
|
|
|||
|
|
@ -267,38 +267,38 @@ class PluginImportService
|
|||
|
||||
// If zipEntryPath is specified, look for files in that specific directory first
|
||||
if ($zipEntryPath) {
|
||||
$targetDir = $tempDir.'/'.$zipEntryPath;
|
||||
$targetDir = $tempDir . '/' . $zipEntryPath;
|
||||
if (File::exists($targetDir)) {
|
||||
// Check if files are directly in the target directory
|
||||
if (File::exists($targetDir.'/settings.yml')) {
|
||||
$settingsYamlPath = $targetDir.'/settings.yml';
|
||||
|
||||
if (File::exists($targetDir.'/full.liquid')) {
|
||||
$fullLiquidPath = $targetDir.'/full.liquid';
|
||||
} elseif (File::exists($targetDir.'/full.blade.php')) {
|
||||
$fullLiquidPath = $targetDir.'/full.blade.php';
|
||||
if (File::exists($targetDir . '/settings.yml')) {
|
||||
$settingsYamlPath = $targetDir . '/settings.yml';
|
||||
|
||||
if (File::exists($targetDir . '/full.liquid')) {
|
||||
$fullLiquidPath = $targetDir . '/full.liquid';
|
||||
} elseif (File::exists($targetDir . '/full.blade.php')) {
|
||||
$fullLiquidPath = $targetDir . '/full.blade.php';
|
||||
}
|
||||
|
||||
if (File::exists($targetDir.'/shared.liquid')) {
|
||||
$sharedLiquidPath = $targetDir.'/shared.liquid';
|
||||
|
||||
if (File::exists($targetDir . '/shared.liquid')) {
|
||||
$sharedLiquidPath = $targetDir . '/shared.liquid';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if files are in src subdirectory of target directory
|
||||
if (! $settingsYamlPath && File::exists($targetDir.'/src/settings.yml')) {
|
||||
$settingsYamlPath = $targetDir.'/src/settings.yml';
|
||||
|
||||
if (File::exists($targetDir.'/src/full.liquid')) {
|
||||
$fullLiquidPath = $targetDir.'/src/full.liquid';
|
||||
} elseif (File::exists($targetDir.'/src/full.blade.php')) {
|
||||
$fullLiquidPath = $targetDir.'/src/full.blade.php';
|
||||
if (!$settingsYamlPath && File::exists($targetDir . '/src/settings.yml')) {
|
||||
$settingsYamlPath = $targetDir . '/src/settings.yml';
|
||||
|
||||
if (File::exists($targetDir . '/src/full.liquid')) {
|
||||
$fullLiquidPath = $targetDir . '/src/full.liquid';
|
||||
} elseif (File::exists($targetDir . '/src/full.blade.php')) {
|
||||
$fullLiquidPath = $targetDir . '/src/full.blade.php';
|
||||
}
|
||||
|
||||
if (File::exists($targetDir.'/src/shared.liquid')) {
|
||||
$sharedLiquidPath = $targetDir.'/src/shared.liquid';
|
||||
|
||||
if (File::exists($targetDir . '/src/shared.liquid')) {
|
||||
$sharedLiquidPath = $targetDir . '/src/shared.liquid';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If we found the required files in the target directory, return them
|
||||
if ($settingsYamlPath && $fullLiquidPath) {
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ new class extends Component {
|
|||
<x-trmnl::screen>
|
||||
<x-trmnl::view>
|
||||
<x-trmnl::layout>
|
||||
<x-trmnl::richtext gapSize="large" align="center">
|
||||
<x-trmnl::markdown gapSize="large">
|
||||
<x-trmnl::title>TRMNL BYOS Laravel</x-trmnl::title>
|
||||
<x-trmnl::content>“This screen was rendered by BYOS Laravel”</x-trmnl::content>
|
||||
<x-trmnl::label variant="underline">Benjamin Nussbaum</x-trmnl::label>
|
||||
</x-trmnl::richtext>
|
||||
</x-trmnl::markdown>
|
||||
</x-trmnl::layout>
|
||||
<x-trmnl::title-bar/>
|
||||
</x-trmnl::view>
|
||||
|
|
@ -88,11 +88,11 @@ HTML;
|
|||
<x-trmnl::screen>
|
||||
<x-trmnl::view>
|
||||
<x-trmnl::layout>
|
||||
<x-trmnl::richtext gapSize="large" align="center">
|
||||
<x-trmnl::markdown gapSize="large">
|
||||
<x-trmnl::title>Motivational Quote</x-trmnl::title>
|
||||
<x-trmnl::content>“I love inside jokes. I hope to be a part of one someday.”</x-trmnl::content>
|
||||
<x-trmnl::label variant="underline">Michael Scott</x-trmnl::label>
|
||||
</x-trmnl::richtext>
|
||||
</x-trmnl::markdown>
|
||||
</x-trmnl::layout>
|
||||
<x-trmnl::title-bar/>
|
||||
</x-trmnl::view>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<x-trmnl::view>
|
||||
<x-trmnl::layout>
|
||||
<x-trmnl::richtext gapSize="large" align="center">
|
||||
<x-trmnl::markdown gapSize="large">
|
||||
<x-trmnl::title>Motivational Quote</x-trmnl::title>
|
||||
<x-trmnl::content>“I love inside jokes. I hope to be a part of one someday.”</x-trmnl::content>
|
||||
<x-trmnl::label variant="underline">Michael Scott</x-trmnl::label>
|
||||
</x-trmnl::richtext>
|
||||
</x-trmnl::markdown>
|
||||
</x-trmnl::layout>
|
||||
<x-trmnl::title-bar/>
|
||||
</x-trmnl::view>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue