Skip to content

Commit f6e32be

Browse files
committed
theme preview updated
1 parent c3dfcc4 commit f6e32be

254 files changed

Lines changed: 2041 additions & 1234 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/Concerns/HasTheme.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Concerns;
44

5+
use App\Models\Font;
56
use InvalidArgumentException;
67

78
trait HasTheme
@@ -137,14 +138,30 @@ public static function fromRegistry(array $data): static
137138

138139
public function toRegistry(): array
139140
{
141+
$dependencies = $this->dependencies ?? [];
142+
foreach ($this->registryDependencies ?? [] as $regDep) {
143+
$depName = basename($regDep, '.json');
144+
if (str_starts_with($depName, 'font-')) {
145+
try {
146+
$font = Font::where('name', $depName)->first();
147+
if ($font && $font->font_dependency) {
148+
$dependencies[] = $font->font_dependency;
149+
}
150+
} catch (\Exception $e) {
151+
// Fallback if table doesn't exist during migrations/seeding
152+
}
153+
}
154+
}
155+
$dependencies = array_values(array_unique($dependencies));
156+
140157
$registry = [
141158
'$schema' => 'https://ui.shadcn.com/schema/registry-item.json',
142159
'name' => $this->name,
143160
'type' => 'registry:theme',
144161
'title' => $this->title,
145162
'description' => $this->description,
146163
'author' => $this->author,
147-
'dependencies' => $this->dependencies ?? [],
164+
'dependencies' => $dependencies,
148165
'devDependencies' => $this->devDependencies ?? [],
149166
'registryDependencies' => $this->registryDependencies ?? [],
150167
'files' => $this->files ?? [],

database/seeders/FontSeeder.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,22 @@ private static function fonts(): array
575575
'font_selector' => null,
576576
'font_dependency' => '@fontsource-variable/instrument-sans',
577577
],
578+
[
579+
'name' => 'font-geist',
580+
'title' => 'Geist',
581+
'type' => 'registry:font',
582+
'author' => 'designbycode',
583+
'meta' => ['category' => 'fonts', 'version' => '1.0.0'],
584+
'registryDependencies' => [],
585+
'font_family' => "'Geist Variable', sans-serif",
586+
'font_provider' => 'google',
587+
'font_import' => 'Geist',
588+
'font_variable' => '--font-geist',
589+
'font_weight' => [],
590+
'font_subsets' => ['latin'],
591+
'font_selector' => null,
592+
'font_dependency' => '@fontsource-variable/geist',
593+
],
578594
];
579595
}
580596
}

database/seeders/RegistrySeeder.php

Lines changed: 54 additions & 52 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/assets/animate-css-DsgelL4_.js renamed to public/build/assets/animate-css-C84cPu8A.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/assets/app-BUCkaLXN.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

public/build/assets/app-BnfgQdGS.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/assets/app-mi9-fbn7.css

Lines changed: 0 additions & 2 deletions
This file was deleted.

public/build/assets/app-ul9X9Opr.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/assets/appearance-CT_6zw_y.js renamed to public/build/assets/appearance-B7bTR5J9.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)