-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev' into prod
- Loading branch information
Showing
190 changed files
with
1,944 additions
and
1,655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Modules\UI\Actions\Block; | ||
|
||
use Illuminate\Support\Arr; | ||
use Illuminate\Support\Facades\File; | ||
use Illuminate\Support\Str; | ||
use Modules\Xot\Datas\ComponentFileData; | ||
use Spatie\LaravelData\DataCollection; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class GetAllBlocksAction | ||
{ | ||
use QueueableAction; | ||
|
||
/** | ||
* @return DataCollection<ComponentFileData> | ||
*/ | ||
public function execute(string $context = 'form'): DataCollection | ||
{ | ||
$files = File::glob(base_path('Modules').'/*/Filament/Blocks/*.php'); | ||
$blocks = Arr::map($files, | ||
function ($path) { | ||
$class = Str::of($path) | ||
->after(base_path('Modules')) | ||
->prepend('\Modules') | ||
->before('.php') | ||
->replace('/', '\\') | ||
->toString(); | ||
|
||
$name = Str::of(class_basename($class))->snake()->toString(); | ||
if (Str::endsWith($name, '_block')) { | ||
$name = Str::before($name, '_block'); | ||
} | ||
|
||
$module = Str::of($class)->between('Modules\\', '\Filament\\')->toString(); | ||
|
||
/* | ||
$name2 = $ns::make()->getName(); | ||
if ($name !== $name2) { | ||
dddx([ | ||
'ns' => $ns, | ||
'block' => $block, | ||
'name' => $name, | ||
'test' => $name2, | ||
]); | ||
} | ||
// */ | ||
// return $ns::make(name: $name, context: $context); | ||
return [ | ||
'name' => $name, | ||
'class' => $class, | ||
'module' => $module, | ||
'path' => $path, | ||
]; | ||
} | ||
); | ||
|
||
return ComponentFileData::collection($blocks); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Modules\UI\Actions\Icon; | ||
|
||
use BladeUI\Icons\Factory as IconFactory; | ||
use Illuminate\Support\Arr; | ||
use Illuminate\Support\Facades\App; | ||
use Illuminate\Support\Facades\File; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class GetAllIconsAction | ||
{ | ||
use QueueableAction; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function execute(string $context = 'form') | ||
{ | ||
$iconsFactory = App::make(IconFactory::class); | ||
$icons = $iconsFactory->all(); | ||
/* | ||
* "heroicons" => array:5 [▼ | ||
* "prefix" => "heroicon" | ||
* "fallback" => "" | ||
* "class" => "" | ||
* "attributes" => [] | ||
* "paths" => array:1 [▼ | ||
* 0 => "F:\var\www\_bases\base_fixcity_fila3\laravel\vendor\blade-ui-kit\blade-heroicons\src/../resources/svg" | ||
* ] | ||
] | ||
*/ | ||
$icons = Arr::map($icons, function ($set, $name) { | ||
$set['name'] = $name; | ||
$icons = []; | ||
|
||
foreach ($set['paths'] as $path) { | ||
foreach (File::allFiles($path) as $file) { | ||
// Simply ignore files that aren't SVGs | ||
if ('svg' !== $file->getExtension()) { | ||
continue; | ||
} | ||
|
||
// $iconName = $this->getIconName($file, parentPath: $path, prefix: $prefix); | ||
$iconName = str($file->getPathname()) | ||
->after($path.DIRECTORY_SEPARATOR) | ||
->replace(DIRECTORY_SEPARATOR, '.') | ||
->basename('.svg') | ||
->toString(); | ||
|
||
$icons[] = $set['prefix'].'-'.$iconName; | ||
} | ||
} | ||
$set['icons'] = $icons; | ||
|
||
return $set; | ||
}); | ||
|
||
return $icons; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Modules\UI\Enums; | ||
|
||
use Filament\Support\Contracts\HasColor; | ||
use Filament\Support\Contracts\HasIcon; | ||
use Filament\Support\Contracts\HasLabel; | ||
|
||
enum CornerPositionEnum: string implements HasColor, HasIcon, HasLabel | ||
{ | ||
case TOP_LEFT = 'top-left'; | ||
case TOP_RIGHT = 'top-right'; | ||
case BOTTOM_LEFT = 'bottom-left'; | ||
case BOTTOM_RIGHT = 'bottom-right'; | ||
|
||
public function getLabel(): ?string | ||
{ | ||
// return $this->name; | ||
return trans('ui::corner-position.'.$this->value.'.label'); | ||
|
||
// or | ||
/* | ||
return match ($this) { | ||
self::Draft => 'Draft', | ||
self::Reviewing => 'Reviewing', | ||
self::Published => 'Published', | ||
self::Rejected => 'Rejected', | ||
}; | ||
*/ | ||
} | ||
|
||
public function getColor(): string|array|null | ||
{ | ||
return match ($this) { | ||
self::TOP_LEFT => 'gray', | ||
self::TOP_RIGHT => 'gray', | ||
self::BOTTOM_LEFT => 'gray', | ||
self::BOTTOM_RIGHT => 'gray', | ||
}; | ||
} | ||
|
||
public function getIcon(): ?string | ||
{ | ||
return match ($this) { | ||
self::TOP_LEFT => 'heroicon-o-arrow-up-left', | ||
self::TOP_RIGHT => 'heroicon-o-arrow-up-right', | ||
self::BOTTOM_LEFT => 'heroicon-o-arrow-down-left', | ||
self::BOTTOM_RIGHT => 'heroicon-o-arrow-down-right', | ||
}; | ||
} | ||
|
||
/** | ||
* ---. | ||
*/ | ||
public function getCssClass(): ?string | ||
{ | ||
return match ($this) { | ||
self::TOP_LEFT => 'top-0 left-0', | ||
self::TOP_RIGHT => 'top-0 right-0', | ||
self::BOTTOM_LEFT => 'bottom-0 left-0', | ||
self::BOTTOM_RIGHT => 'bottom-0 right-0', | ||
}; | ||
} | ||
} |
Oops, something went wrong.