diff --git a/app/Enums/Example.php b/app/Enums/Example.php index e496b746..a75a7687 100644 --- a/app/Enums/Example.php +++ b/app/Enums/Example.php @@ -19,6 +19,7 @@ use App\Enums\Examples\Form\Upload; use App\Enums\Examples\Form\WithoutLivewire; use App\Enums\Examples\Others\Alpine; +use App\Enums\Examples\Others\Command; use App\Enums\Examples\Others\Configuration; use App\Enums\Examples\Others\Contribution; use App\Enums\Examples\Others\DarkTheme; @@ -77,6 +78,7 @@ enum Example: string case ColorPersonalization = ColorPersonalization::class; case Configuration = Configuration::class; case Contribution = Contribution::class; + case Command = Command::class; case Date = Date::class; case DarkTheme = DarkTheme::class; case DebugMode = DebugMode::class; diff --git a/app/Enums/Examples/Others/Command.php b/app/Enums/Examples/Others/Command.php new file mode 100644 index 00000000..cf124c17 --- /dev/null +++ b/app/Enums/Examples/Others/Command.php @@ -0,0 +1,10 @@ + HTML; + public const SCOPED_PERSONALIZATION_WITH_CLASS_BLADE_EXAMPLE = <<<'HTML' + + HTML; + + public const SCOPED_PERSONALIZATION_WITH_CLASS_PHP_EXAMPLE = <<<'HTML' + namespace App\ScopedPersonalization; + + class Alert + { + public function __invoke(array $classes): array + { + return [ + 'wrapper' => [ + 'replace' => [ + 'rounded-lg' => 'rounded-full', + ], + ], + ]; + } + } + HTML; + public const DATA = <<<'HTML' [ "id" => null diff --git a/app/Enums/Examples/Ui/Modal.php b/app/Enums/Examples/Ui/Modal.php index 81b1aefa..6ac86910 100644 --- a/app/Enums/Examples/Ui/Modal.php +++ b/app/Enums/Examples/Ui/Modal.php @@ -41,7 +41,9 @@ class Modal HTML; public const BLUR = <<<'HTML' - + + + TallStackUi HTML; diff --git a/app/Enums/Examples/Ui/Slide.php b/app/Enums/Examples/Ui/Slide.php index 21abef43..4f041da0 100644 --- a/app/Enums/Examples/Ui/Slide.php +++ b/app/Enums/Examples/Ui/Slide.php @@ -47,7 +47,9 @@ class Slide HTML; public const BLUR = <<<'HTML' - + + + TallStackUi HTML; diff --git a/composer.lock b/composer.lock index 33c5fd79..06fe678b 100644 --- a/composer.lock +++ b/composer.lock @@ -5558,16 +5558,16 @@ }, { "name": "tallstackui/tallstackui", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/tallstackui/tallstackui.git", - "reference": "922dc28ddf28627211e40cc916bc7e098bacafb1" + "reference": "bb763a9041adaf0e22899b02db9d7f45c0529b27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tallstackui/tallstackui/zipball/922dc28ddf28627211e40cc916bc7e098bacafb1", - "reference": "922dc28ddf28627211e40cc916bc7e098bacafb1", + "url": "https://api.github.com/repos/tallstackui/tallstackui/zipball/bb763a9041adaf0e22899b02db9d7f45c0529b27", + "reference": "bb763a9041adaf0e22899b02db9d7f45c0529b27", "shasum": "" }, "require": { @@ -5611,7 +5611,7 @@ "description": "TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.", "support": { "issues": "https://github.com/tallstackui/tallstackui/issues", - "source": "https://github.com/tallstackui/tallstackui/tree/v1.29.0" + "source": "https://github.com/tallstackui/tallstackui/tree/v1.30.0" }, "funding": [ { @@ -5619,7 +5619,7 @@ "type": "github" } ], - "time": "2024-06-12T13:17:33+00:00" + "time": "2024-06-14T15:27:46+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -6554,16 +6554,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -6571,11 +6571,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -6601,7 +6602,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -6609,7 +6610,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nunomaduro/collision", @@ -8941,24 +8942,98 @@ ], "time": "2024-04-24T13:22:11+00:00" }, + { + "name": "spatie/error-solutions", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/error-solutions.git", + "reference": "202108314a6988ede156fba1b3ea80a784c1734a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/error-solutions/zipball/202108314a6988ede156fba1b3ea80a784c1734a", + "reference": "202108314a6988ede156fba1b3ea80a784c1734a", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "illuminate/broadcasting": "^10.0|^11.0", + "illuminate/cache": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "livewire/livewire": "^2.11|^3.3.5", + "openai-php/client": "^0.10.1", + "orchestra/testbench": "^7.0|8.22.3|^9.0", + "pestphp/pest": "^2.20", + "phpstan/phpstan": "^1.11", + "psr/simple-cache": "^3.0", + "psr/simple-cache-implementation": "^3.0", + "spatie/ray": "^1.28", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "vlucas/phpdotenv": "^5.5" + }, + "suggest": { + "openai-php/client": "Require get solutions from OpenAI", + "simple-cache-implementation": "To cache solutions from OpenAI" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Ignition\\": "legacy/ignition", + "Spatie\\ErrorSolutions\\": "src", + "Spatie\\LaravelIgnition\\": "legacy/laravel-ignition" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ruben Van Assche", + "email": "ruben@spatie.be", + "role": "Developer" + } + ], + "description": "This is my package error-solutions", + "homepage": "https://github.com/spatie/error-solutions", + "keywords": [ + "error-solutions", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/error-solutions/issues", + "source": "https://github.com/spatie/error-solutions/tree/1.0.0" + }, + "funding": [ + { + "url": "https://github.com/Spatie", + "type": "github" + } + ], + "time": "2024-06-12T14:49:54+00:00" + }, { "name": "spatie/flare-client-php", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/spatie/flare-client-php.git", - "reference": "220a7c8745e9fa427d54099f47147c4b97fe6462" + "reference": "097040ff51e660e0f6fc863684ac4b02c93fa234" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/220a7c8745e9fa427d54099f47147c4b97fe6462", - "reference": "220a7c8745e9fa427d54099f47147c4b97fe6462", + "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/097040ff51e660e0f6fc863684ac4b02c93fa234", + "reference": "097040ff51e660e0f6fc863684ac4b02c93fa234", "shasum": "" }, "require": { "illuminate/pipeline": "^8.0|^9.0|^10.0|^11.0", "php": "^8.0", - "spatie/backtrace": "^1.5.2", + "spatie/backtrace": "^1.6.1", "symfony/http-foundation": "^5.2|^6.0|^7.0", "symfony/mime": "^5.2|^6.0|^7.0", "symfony/process": "^5.2|^6.0|^7.0", @@ -9000,7 +9075,7 @@ ], "support": { "issues": "https://github.com/spatie/flare-client-php/issues", - "source": "https://github.com/spatie/flare-client-php/tree/1.6.0" + "source": "https://github.com/spatie/flare-client-php/tree/1.7.0" }, "funding": [ { @@ -9008,28 +9083,28 @@ "type": "github" } ], - "time": "2024-05-22T09:45:39+00:00" + "time": "2024-06-12T14:39:14+00:00" }, { "name": "spatie/ignition", - "version": "1.14.2", + "version": "1.15.0", "source": { "type": "git", "url": "https://github.com/spatie/ignition.git", - "reference": "5e11c11f675bb5251f061491a493e04a1a571532" + "reference": "e3a68e137371e1eb9edc7f78ffa733f3b98991d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ignition/zipball/5e11c11f675bb5251f061491a493e04a1a571532", - "reference": "5e11c11f675bb5251f061491a493e04a1a571532", + "url": "https://api.github.com/repos/spatie/ignition/zipball/e3a68e137371e1eb9edc7f78ffa733f3b98991d2", + "reference": "e3a68e137371e1eb9edc7f78ffa733f3b98991d2", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", "php": "^8.0", - "spatie/backtrace": "^1.5.3", - "spatie/flare-client-php": "^1.4.0", + "spatie/error-solutions": "^1.0", + "spatie/flare-client-php": "^1.7", "symfony/console": "^5.4|^6.0|^7.0", "symfony/var-dumper": "^5.4|^6.0|^7.0" }, @@ -9091,20 +9166,20 @@ "type": "github" } ], - "time": "2024-05-29T08:10:20+00:00" + "time": "2024-06-12T14:55:22+00:00" }, { "name": "spatie/laravel-ignition", - "version": "2.7.0", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ignition.git", - "reference": "f52124d50122611e8a40f628cef5c19ff6cc5b57" + "reference": "3c067b75bfb50574db8f7e2c3978c65eed71126c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/f52124d50122611e8a40f628cef5c19ff6cc5b57", - "reference": "f52124d50122611e8a40f628cef5c19ff6cc5b57", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/3c067b75bfb50574db8f7e2c3978c65eed71126c", + "reference": "3c067b75bfb50574db8f7e2c3978c65eed71126c", "shasum": "" }, "require": { @@ -9113,8 +9188,7 @@ "ext-mbstring": "*", "illuminate/support": "^10.0|^11.0", "php": "^8.1", - "spatie/flare-client-php": "^1.5", - "spatie/ignition": "^1.14", + "spatie/ignition": "^1.15", "symfony/console": "^6.2.3|^7.0", "symfony/var-dumper": "^6.2.3|^7.0" }, @@ -9183,7 +9257,7 @@ "type": "github" } ], - "time": "2024-05-02T13:42:49+00:00" + "time": "2024-06-12T15:01:18+00:00" }, { "name": "spatie/laravel-ray", diff --git a/public/assets/images/find-component-output.png b/public/assets/images/find-component-output.png new file mode 100644 index 00000000..710f0e00 Binary files /dev/null and b/public/assets/images/find-component-output.png differ diff --git a/resources/views/components/layout/navigation/index.blade.php b/resources/views/components/layout/navigation/index.blade.php index b0594da7..a5b35d85 100644 --- a/resources/views/components/layout/navigation/index.blade.php +++ b/resources/views/components/layout/navigation/index.blade.php @@ -113,7 +113,7 @@ class="hidden w-full items-center rounded-md pr-3 pl-2 text-sm leading-6 text-sl
  • - +
  • @@ -213,6 +213,9 @@ class="hidden w-full items-center rounded-md pr-3 pl-2 text-sm leading-6 text-sl
  • +
  • + +
  • diff --git a/resources/views/components/top-bar.blade.php b/resources/views/components/top-bar.blade.php index 3368c999..5e6ccfef 100644 --- a/resources/views/components/top-bar.blade.php +++ b/resources/views/components/top-bar.blade.php @@ -1,3 +1,5 @@ - - // + + New version 1.30.0 is now available 🎉 + Introducing a useful command to search for component usage. diff --git a/resources/views/documentation/command.blade.php b/resources/views/documentation/command.blade.php new file mode 100644 index 00000000..2c7eda5b --- /dev/null +++ b/resources/views/documentation/command.blade.php @@ -0,0 +1,46 @@ + + + Commands + + + TallStackUI available commands. + + +

    + TallStackUI offers several useful commands to help during the development + process of your projects that use TallStackUI. On this page we will list + all the commands and their references for explanations or details. +

    +
    + +

    + Command to setup icons. + See the details of the command and how to use it by clicking here. + +

    +
    + +

    + Command to setup prefix. + See the details of the command and how to use it by clicking here. + +

    +
    + +

    + Command used to find component usages in all Blade files. +

    + +

    + After running the command, you will need to select the component + you want to find usages for, and then the command will list all + the files that use the selected component, and also the line number + where the component is used. When any occurrence is found, the output + will be similar to the following: +

    +
    + Find Component Command Output +
    +
    +
    diff --git a/resources/views/documentation/personalization/soft.blade.php b/resources/views/documentation/personalization/soft.blade.php index 7c50a578..30779ae6 100644 --- a/resources/views/documentation/personalization/soft.blade.php +++ b/resources/views/documentation/personalization/soft.blade.php @@ -147,6 +147,20 @@ classes in an easy way in order to make modifications while maintaining the rest in the block name or wrong block name, the application will not generate a visual error for the end user, the personalization will just not be applied. +

    + Starting from version 1.30.0 you can pass a class name that contains a __invoke public method + to the personalize attribute to make the personalization more organized and reusable. + Let's take a look at an example: +

    +

    Blade:

    + +

    PHP:

    + +

    + You may have noticed that in the example above we have an array called $classes as + the parameter of the __invoke method, this array is an array with all classes that + came from the original personalization defined to the component. +

    diff --git a/resources/views/documentation/ui/modal.blade.php b/resources/views/documentation/ui/modal.blade.php index 10121406..04afe82c 100644 --- a/resources/views/documentation/ui/modal.blade.php +++ b/resources/views/documentation/ui/modal.blade.php @@ -50,11 +50,29 @@ - - TallStackUi + + SM - - Open Modal + + MD + + + LG + + + XL + + + SM + + + MD + + + LG + + + XL diff --git a/resources/views/documentation/ui/slide.blade.php b/resources/views/documentation/ui/slide.blade.php index 7a010ad0..81ab5b9b 100644 --- a/resources/views/documentation/ui/slide.blade.php +++ b/resources/views/documentation/ui/slide.blade.php @@ -60,11 +60,29 @@ - - TallStackUi + + SM - - Open Slide + + MD + + + LG + + + XL + + + SM + + + MD + + + LG + + + XL diff --git a/routes/web.php b/routes/web.php index 1453dfef..3dac5cef 100644 --- a/routes/web.php +++ b/routes/web.php @@ -94,6 +94,7 @@ Route::view('/dark-theme', 'documentation.helpers.dark-theme', Example::DarkTheme->variables())->name('dark-theme'); Route::view('/configuration', 'documentation.configuration', Example::Configuration->variables())->name('configuration'); + Route::view('/command', 'documentation.command', Example::Command->variables())->name('command'); Route::view('/translation', 'documentation.translation', Example::Translation->variables())->name('translation'); Route::view('/without-livewire', 'documentation.without-livewire', Example::WithoutLivewire->variables())->name('without-livewire'); Route::view('/contribution', 'documentation.contribution', Example::Contribution->variables())->name('contribution'); diff --git a/tests/Feature/StructureTest.php b/tests/Feature/StructureTest.php index 45e8221a..a63925ee 100644 --- a/tests/Feature/StructureTest.php +++ b/tests/Feature/StructureTest.php @@ -92,6 +92,7 @@ fn () => route('documentation.internal.wrapper'), // fn () => route('documentation.configuration'), + fn () => route('documentation.command'), fn () => route('documentation.translation'), fn () => route('documentation.without-livewire'), //