From e3d4181837313673023dd5bea0a601bbaa5a690c Mon Sep 17 00:00:00 2001 From: Jyrki De Neve Date: Fri, 30 May 2025 14:23:06 +0300 Subject: [PATCH 1/5] Upgrade to Filament v4 --- composer.json | 10 +++++----- phpstan-baseline.neon | 8 -------- src/LinkAction/LinkAction.php | 19 +++++++++---------- src/MediaAction/MediaAction.php | 11 ++++++----- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/composer.json b/composer.json index 9cdd375..27cf93d 100644 --- a/composer.json +++ b/composer.json @@ -10,17 +10,17 @@ "license": "MIT", "require": { "php": "^8.2", - "awcodes/filament-tiptap-editor": "^3.2", - "codedor/filament-link-picker": "^1.6", - "codedor/filament-media-library": "^1.0|^2.0|^3.0", - "filament/filament": "^3.1", + "codedor/filament-link-picker": "dev-feature/filament-v4", + "codedor/filament-media-library": "dev-feature/filament-v4", + "filament/filament": "^4.0", "illuminate/contracts": "^10.0|^11.0|^12.0", "spatie/laravel-package-tools": "^1.12" }, "require-dev": { + "filament/upgrade": "^4.0", + "larastan/larastan": "^2.0|^3.0", "laravel/pint": "^1.0", "nunomaduro/collision": "^7.0|^8.0", - "larastan/larastan": "^2.0|^3.0", "orchestra/testbench": "^8.0|^9.0|^10.0", "pestphp/pest": "^2.0|^3.0", "pestphp/pest-plugin-laravel": "^2.0|^3.0", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 97e09bc..364905f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,10 +1,2 @@ parameters: ignoreErrors: - - - message: "#^Call to an undefined method Filament\\\\Forms\\\\Contracts\\\\HasForms\\:\\:dispatch\\(\\)\\.$#" - count: 2 - path: src/LinkAction/LinkAction.php - - - message: "#^Call to an undefined method Filament\\\\Forms\\\\Contracts\\\\HasForms\\:\\:dispatch\\(\\)\\.$#" - count: 1 - path: src/MediaAction/MediaAction.php diff --git a/src/LinkAction/LinkAction.php b/src/LinkAction/LinkAction.php index ce5b06b..47e9f1e 100644 --- a/src/LinkAction/LinkAction.php +++ b/src/LinkAction/LinkAction.php @@ -3,14 +3,11 @@ namespace Codedor\FilamentCustomTiptapExtensions\LinkAction; use Codedor\LinkPicker\Filament\LinkPickerInput; -use Filament\Forms\ComponentContainer; -use Filament\Forms\Components\Actions\Action; -use Filament\Forms\Components\Grid; -use FilamentTiptapEditor\TiptapEditor; +use Filament\Forms\Components\RichEditor; use Illuminate\Support\Str; use Livewire\Component; -class LinkAction extends Action +class LinkAction extends \Filament\Actions\Action { private const PREFIX = '#link-picker='; @@ -28,8 +25,8 @@ protected function setUp(): void 'href' => '', 'rel' => '', ]) - ->mountUsing(function (ComponentContainer $form, array $arguments) { - $form->fill([ + ->mountUsing(function (\Filament\Schemas\Schema $schema, array $arguments) { + $schema->fill([ 'href' => json_decode( Str::of($arguments['href']) ->replace(self::PREFIX, '', $arguments['href']) @@ -44,8 +41,8 @@ protected function setUp(): void return __('filament-tiptap-editor::link-modal.heading.' . $context); }) - ->form([ - Grid::make(['md' => 2])->schema([ + ->schema([ + \Filament\Schemas\Components\Grid::make(['md' => 2])->schema([ LinkPickerInput::make('href') ->hiddenLabel() ->columnSpan('full') @@ -53,8 +50,9 @@ protected function setUp(): void ), ]), ]) - ->action(function (TiptapEditor $component, $data, array $arguments, Component $livewire) { + ->action(function (RichEditor $component, $data, array $arguments, Component $livewire) { if (filled($data['href'])) { + // TODO: how to do this in Filament 4? $component->getLivewire()->dispatch( 'insert-content', type: 'link', @@ -63,6 +61,7 @@ protected function setUp(): void id: '' ); } else { + // TODO: how to do this in Filament 4? $component->getLivewire()->dispatch( 'unset-link', statePath: $component->getStatePath(), diff --git a/src/MediaAction/MediaAction.php b/src/MediaAction/MediaAction.php index 60246b7..d03dd1c 100644 --- a/src/MediaAction/MediaAction.php +++ b/src/MediaAction/MediaAction.php @@ -6,9 +6,10 @@ use Codedor\MediaLibrary\Models\Attachment; use Filament\Forms\ComponentContainer; use Filament\Forms\Components\Actions\Action; +use Filament\Forms\Components\RichEditor; use FilamentTiptapEditor\TiptapEditor; -class MediaAction extends Action +class MediaAction extends \Filament\Actions\Action { public static function getDefaultName(): ?string { @@ -25,14 +26,14 @@ protected function setUp(): void $this->modalWidth('md'); - $this->mountUsing(function (TiptapEditor $component, ComponentContainer $form, array $arguments) { + $this->mountUsing(function (RichEditor $component, \Filament\Schemas\Schema $schema, array $arguments) { preg_match( '/\/([\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12})\//iD', $arguments['src'] ?? null, $matches ); - $form->fill(['attachment' => $matches[1] ?? null]); + $schema->fill(['attachment' => $matches[1] ?? null]); }); $this->modalHeading(function (array $arguments) { @@ -41,7 +42,7 @@ protected function setUp(): void return __('filament-tiptap-editor::media-modal.heading.' . $context); }); - $this->form(function () { + $this->schema(function () { return [ AttachmentInput::make('attachment') ->hiddenLabel() @@ -51,7 +52,7 @@ protected function setUp(): void ]; }); - $this->action(function (TiptapEditor $component, $data) { + $this->action(function (RichEditor $component, $data) { $attachment = Attachment::find($data['attachment']); $component->getLivewire()->dispatch( From 889e81ca0293b8870ac35e0bacd33adeb01da67a Mon Sep 17 00:00:00 2001 From: Jyrki De Neve Date: Fri, 30 May 2025 14:23:27 +0300 Subject: [PATCH 2/5] Remove todo --- src/LinkAction/LinkAction.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/LinkAction/LinkAction.php b/src/LinkAction/LinkAction.php index 47e9f1e..f589739 100644 --- a/src/LinkAction/LinkAction.php +++ b/src/LinkAction/LinkAction.php @@ -52,7 +52,6 @@ protected function setUp(): void ]) ->action(function (RichEditor $component, $data, array $arguments, Component $livewire) { if (filled($data['href'])) { - // TODO: how to do this in Filament 4? $component->getLivewire()->dispatch( 'insert-content', type: 'link', @@ -61,7 +60,6 @@ protected function setUp(): void id: '' ); } else { - // TODO: how to do this in Filament 4? $component->getLivewire()->dispatch( 'unset-link', statePath: $component->getStatePath(), From 4987648d07cb34b7cfca83dec61d2fb6417351c0 Mon Sep 17 00:00:00 2001 From: jyrkidn <2447042+jyrkidn@users.noreply.github.com> Date: Fri, 30 May 2025 11:23:47 +0000 Subject: [PATCH 3/5] Fix styling --- src/MediaAction/MediaAction.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/MediaAction/MediaAction.php b/src/MediaAction/MediaAction.php index d03dd1c..593bbbf 100644 --- a/src/MediaAction/MediaAction.php +++ b/src/MediaAction/MediaAction.php @@ -4,10 +4,7 @@ use Codedor\MediaLibrary\Filament\AttachmentInput; use Codedor\MediaLibrary\Models\Attachment; -use Filament\Forms\ComponentContainer; -use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\RichEditor; -use FilamentTiptapEditor\TiptapEditor; class MediaAction extends \Filament\Actions\Action { From 6c8e94056af42eb65e853d8d7affb798ff38d115 Mon Sep 17 00:00:00 2001 From: Jyrki De Neve Date: Thu, 3 Jul 2025 22:37:13 +0300 Subject: [PATCH 4/5] Update to Filament its own RichEditor --- README.md | 40 ++--- composer.json | 21 ++- config/filament-custom-tiptap-extensions.php | 6 - database/factories/ModelFactory.php | 17 -- ...2021_04_06_000000_create_package_table.php | 18 --- docs/index.md | 89 +++-------- .../views/components/linkpicker.blade.php | 28 ---- src/Components/Linkpicker.php | 19 --- src/LinkAction/LinkAction.php | 72 --------- src/LinkAction/Linkpicker.php | 7 - src/MediaAction/MediaAction.php | 70 -------- src/Plugins/LinkPickerRichContentPlugin.php | 150 ++++++++++++++++++ ...tCustomTiptapExtensionsServiceProvider.php | 12 +- tests/ExampleTest.php | 5 - tests/Pest.php | 5 - tests/TestCase.php | 36 ----- 16 files changed, 197 insertions(+), 398 deletions(-) delete mode 100644 config/filament-custom-tiptap-extensions.php delete mode 100644 database/factories/ModelFactory.php delete mode 100644 database/migrations/2021_04_06_000000_create_package_table.php delete mode 100644 resources/views/components/linkpicker.blade.php delete mode 100644 src/Components/Linkpicker.php delete mode 100644 src/LinkAction/LinkAction.php delete mode 100644 src/LinkAction/Linkpicker.php delete mode 100644 src/MediaAction/MediaAction.php create mode 100644 src/Plugins/LinkPickerRichContentPlugin.php delete mode 100644 tests/ExampleTest.php delete mode 100644 tests/Pest.php delete mode 100644 tests/TestCase.php diff --git a/README.md b/README.md index 2543d70..7a63aac 100644 --- a/README.md +++ b/README.md @@ -10,37 +10,21 @@ You can install the package via composer: composer require codedor/filament-custom-tiptap-extensions ``` -You can publish and run the migrations with: - -```bash -php artisan vendor:publish --tag="filament-custom-tiptap-extensions-migrations" -php artisan migrate -``` - -You can publish the config file with: - -```bash -php artisan vendor:publish --tag="filament-custom-tiptap-extensions-config" -``` - -This is the contents of the published config file: - -```php -return [ -]; -``` - -Optionally, you can publish the views using - -```bash -php artisan vendor:publish --tag="filament-custom-tiptap-extensions-views" -``` - ## Usage ```php -$filamentCustomTiptapExtensions = new Codedor\FilamentCustomTiptapExtensions(); -echo $filamentCustomTiptapExtensions->echoPhrase('Hello, Codedor!'); +use Codedor\FilamentCustomTiptapExtensions\Plugins\LinkPickerRichContentPlugin; +use Filament\Forms\Components\RichEditor; + +RichEditor::make('description') + ->toolbarButtons([ + [ + 'linkPicker', + ], + ]) + ->plugins([ + LinkPickerRichContentPlugin::make(), + ]); ``` ## Documentation diff --git a/composer.json b/composer.json index 27cf93d..1ef05e2 100644 --- a/composer.json +++ b/composer.json @@ -11,27 +11,24 @@ "require": { "php": "^8.2", "codedor/filament-link-picker": "dev-feature/filament-v4", - "codedor/filament-media-library": "dev-feature/filament-v4", "filament/filament": "^4.0", - "illuminate/contracts": "^10.0|^11.0|^12.0", + "illuminate/contracts": "^11.0|^12.0", "spatie/laravel-package-tools": "^1.12" }, "require-dev": { - "filament/upgrade": "^4.0", - "larastan/larastan": "^2.0|^3.0", + "larastan/larastan": "^3.0", "laravel/pint": "^1.0", "nunomaduro/collision": "^7.0|^8.0", - "orchestra/testbench": "^8.0|^9.0|^10.0", - "pestphp/pest": "^2.0|^3.0", - "pestphp/pest-plugin-laravel": "^2.0|^3.0", - "phpstan/extension-installer": "^1.1|^2.0", - "phpstan/phpstan-deprecation-rules": "^1.0|^2.0", - "phpstan/phpstan-phpunit": "^1.0|^2.0" + "orchestra/testbench": "^9.0|^10.0", + "pestphp/pest": "^3.0", + "pestphp/pest-plugin-laravel": "^3.0", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0" }, "autoload": { "psr-4": { - "Codedor\\FilamentCustomTiptapExtensions\\": "src", - "Codedor\\FilamentCustomTiptapExtensions\\Database\\Factories\\": "database/factories" + "Codedor\\FilamentCustomTiptapExtensions\\": "src" } }, "autoload-dev": { diff --git a/config/filament-custom-tiptap-extensions.php b/config/filament-custom-tiptap-extensions.php deleted file mode 100644 index cbda43b..0000000 --- a/config/filament-custom-tiptap-extensions.php +++ /dev/null @@ -1,6 +0,0 @@ -increments('id'); - $table->timestamps(); - - // add fields - }); - } -}; diff --git a/docs/index.md b/docs/index.md index 61f3141..ffaaf23 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,73 +12,34 @@ First, install this package via the Composer package manager: composer require codedor/filament-custom-tiptap-extensions ``` -## LinkAction +## LinkPicker Plugin -This overrides the default `LinkAction` to use our [link picker](https://github.com/codedor/filament-link-picker) instead. +This provides a custom Tiptap plugin that allows you to pick links via our [link picker](https://github.com/codedor/filament-link-picker) package. -### Setup +If you want to enable this plugin for each RichEditor, you can do this by adding the following code to your Filament service provider: -Update the `filament-tiptap-editor` config file to use the custom `LinkAction`: - -```php -return [ - // ... - 'extensions' => [ - // ... - [ - 'id' => 'linkpicker', - 'name' => 'Linkpicker', - 'button' => 'filament-custom-tiptap-extensions::linkpicker', - 'parser' => \Codedor\FilamentCustomTiptapExtensions\LinkAction\Linkpicker::class, - ], - ], -]; -``` - -Follow the instructions [here](https://github.com/awcodes/filament-tiptap-editor#custom-extensions) to add a `extension.js` file. - -```js -import Link from '@tiptap/extension-link' - -window.TiptapEditorExtensions = { - // ... - linkpicker: [ - Link.configure({ - openOnClick: false, - HTMLAttributes: { - // Change rel to different value - // Allow search engines to follow links(remove nofollow) - rel: '', - // Remove target entirely so links open in current tab - target: null - } - }) - ] -} -``` - -Update the `link_action` in the config file to ```php -return [ - // ... - 'link_action' => \Codedor\FilamentCustomTiptapExtensions\LinkAction\LinkAction::class, - // ... -]; +use Codedor\FilamentCustomTiptapExtensions\Plugins\LinkPickerRichContentPlugin; +use Filament\Forms\Components\RichEditor; + +RichEditor::configureUsing(function (RichEditor $editor) { + $editor + ->toolbarButtons([ + [ + 'h2', 'h3', 'bulletList', 'orderedList', 'blockquote', + ], + [ + 'bold', 'italic', 'strike', 'underline', 'superscript', 'subscript', 'lead', 'small', 'alignStart', 'alignCenter', 'alignEnd', + ], + [ + 'linkPicker', + ], + ['undo', 'redo'], + ]) + ->plugins([ + LinkPickerRichContentPlugin::make(), + ]); +}); ``` -And replace `'link'` with `'linkpicker'` in the `toolbar` config. - -## MediaAction - -This overrides the default `MediaAction` to use our [media library](https://github.com/codedor/filament-media-library) instead. - -### Setup - -Update the `media_action` in the config file to -```php -return [ - // ... - 'media_action' => \Codedor\FilamentCustomTiptapExtensions\MediaAction\MediaAction::class, - // ... -]; -``` +That's all you need to do to enable the LinkPicker plugin for all RichEditor components in your Filament application. diff --git a/resources/views/components/linkpicker.blade.php b/resources/views/components/linkpicker.blade.php deleted file mode 100644 index 047334b..0000000 --- a/resources/views/components/linkpicker.blade.php +++ /dev/null @@ -1,28 +0,0 @@ -@props([ - 'statePath' => null, - 'icon' => 'link', - 'label' => __('filament-tiptap-editor::editor.link.insert_edit'), - 'active' => true, -]) - -@php - $useActive = $active ? 'link' : false; -@endphp - - diff --git a/src/Components/Linkpicker.php b/src/Components/Linkpicker.php deleted file mode 100644 index 525392d..0000000 --- a/src/Components/Linkpicker.php +++ /dev/null @@ -1,19 +0,0 @@ -modalWidth('md') - ->arguments([ - 'href' => '', - 'rel' => '', - ]) - ->mountUsing(function (\Filament\Schemas\Schema $schema, array $arguments) { - $schema->fill([ - 'href' => json_decode( - Str::of($arguments['href']) - ->replace(self::PREFIX, '', $arguments['href']) - ->replaceFirst('[[', '') - ->replaceLast(']]', ''), - true - ), - ]); - }) - ->modalHeading(function (array $arguments) { - $context = blank($arguments['href']) ? 'insert' : 'update'; - - return __('filament-tiptap-editor::link-modal.heading.' . $context); - }) - ->schema([ - \Filament\Schemas\Components\Grid::make(['md' => 2])->schema([ - LinkPickerInput::make('href') - ->hiddenLabel() - ->columnSpan('full') - ->dehydrateStateUsing(fn ($state) => filled($state) ? self::PREFIX . '[[' . json_encode($state) . ']]' : null - ), - ]), - ]) - ->action(function (RichEditor $component, $data, array $arguments, Component $livewire) { - if (filled($data['href'])) { - $component->getLivewire()->dispatch( - 'insert-content', - type: 'link', - statePath: $component->getStatePath(), - href: $data['href'], - id: '' - ); - } else { - $component->getLivewire()->dispatch( - 'unset-link', - statePath: $component->getStatePath(), - ); - } - - $component->state($component->getState()); - }); - } -} diff --git a/src/LinkAction/Linkpicker.php b/src/LinkAction/Linkpicker.php deleted file mode 100644 index 8ea44aa..0000000 --- a/src/LinkAction/Linkpicker.php +++ /dev/null @@ -1,7 +0,0 @@ -arguments([ - 'src' => '', - ]); - - $this->modalWidth('md'); - - $this->mountUsing(function (RichEditor $component, \Filament\Schemas\Schema $schema, array $arguments) { - preg_match( - '/\/([\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12})\//iD', - $arguments['src'] ?? null, - $matches - ); - - $schema->fill(['attachment' => $matches[1] ?? null]); - }); - - $this->modalHeading(function (array $arguments) { - $context = blank($arguments['src'] ?? null) ? 'insert' : 'update'; - - return __('filament-tiptap-editor::media-modal.heading.' . $context); - }); - - $this->schema(function () { - return [ - AttachmentInput::make('attachment') - ->hiddenLabel() - ->required() - ->reactive() - ->disableFormatter(), - ]; - }); - - $this->action(function (RichEditor $component, $data) { - $attachment = Attachment::find($data['attachment']); - - $component->getLivewire()->dispatch( - 'insert-content', - type: 'media', - statePath: $component->getStatePath(), - media: [ - 'src' => $attachment->url, - 'alt' => $attachment->alt, - 'title' => $attachment->translated_name, - 'width' => $attachment->width, - 'height' => $attachment->height, - 'link_text' => null, - ], - ); - }); - } -} diff --git a/src/Plugins/LinkPickerRichContentPlugin.php b/src/Plugins/LinkPickerRichContentPlugin.php new file mode 100644 index 0000000..451bc20 --- /dev/null +++ b/src/Plugins/LinkPickerRichContentPlugin.php @@ -0,0 +1,150 @@ + + */ + public function getTipTapPhpExtensions(): array + { + // This method should return an array of PHP TipTap extension objects. + // See: https://github.com/ueberdosis/tiptap-php + + return [ + app(Link::class, []), + ]; + } + + /** + * @return array + */ + public function getTipTapJsExtensions(): array + { + // This method should return an array of URLs to JavaScript files containing + // TipTap extensions that should be asynchronously loaded into the editor + // when the plugin is used. + + return []; + } + + /** + * @return array + */ + public function getEditorTools(): array + { + // This method should return an array of `RichEditorTool` objects, which can then be + // used in the `toolbarButtons()` of the editor. + + // The `jsHandler()` method allows you to access the TipTap editor instance + // through `$getEditor()`, and `chain()` any TipTap commands to it. + // See: https://tiptap.dev/docs/editor/api/commands + + // The `action()` method allows you to run an action (registered in the `getEditorActions()` + // method) when the toolbar button is clicked. This allows you to open a modal to + // collect additional information from the user before running a command. + + return [ + RichEditorTool::make('linkPicker') + ->label(__('filament-forms::components.rich_editor.tools.link')) + ->action(arguments: '{ url: $getEditor().getAttributes(\'link\')?.href, shouldOpenInNewTab: $getEditor().getAttributes(\'link\')?.target === \'_blank\' }') + ->icon(Heroicon::Link) + ->iconAlias('forms:components.rich-editor.toolbar.link'), + ]; + } + + /** + * @return array + */ + public function getEditorActions(): array + { + // This method should return an array of `Action` objects, which can be used by the tools + // registered in the `getEditorTools()` method. The name of the action should match + // the name of the tool that uses it. + + // The `runCommands()` method allows you to run TipTap commands on the editor instance. + // It accepts an array of `EditorCommand` objects that define the command to run, + // as well as any arguments to pass to the command. You should also pass in the + // `editorSelection` argument, which is the current selection in the editor + // to apply the commands to. + + return [ + Action::make('linkPicker') + ->label(__('filament-forms::components.rich_editor.actions.link.label')) + ->modalHeading(__('filament-forms::components.rich_editor.actions.link.modal.heading')) + ->modalWidth(Width::Large) + ->fillForm(fn (array $arguments): array => [ + 'href' => json_decode( + Str::of($arguments['url'] ?? '') + ->replace(self::PREFIX, '', $arguments['url'] ?? '') + ->replaceFirst('[[', '') + ->replaceLast(']]', ''), + true + ), + ]) + ->schema([ + LinkPickerInput::make('href') + ->hiddenLabel() + ->dehydrateStateUsing( + fn ($state) => filled($state) ? self::PREFIX . '[[' . json_encode($state) . ']]' : null + ), + ]) + ->action(function (array $arguments, array $data, RichEditor $component): void { + $isSingleCharacterSelection = ($arguments['editorSelection']['head'] ?? null) === ($arguments['editorSelection']['anchor'] ?? null); + + // Copied from vendor/filament/forms/src/Components/RichEditor/Actions/LinkAction.php + if (blank($data['href'])) { + $component->runCommands( + [ + ...($isSingleCharacterSelection ? [EditorCommand::make( + 'extendMarkRange', + arguments: ['link'], + )] : []), + EditorCommand::make('unsetLink'), + ], + editorSelection: $arguments['editorSelection'], + ); + + return; + } + + $component->runCommands( + [ + ...($isSingleCharacterSelection ? [EditorCommand::make( + 'extendMarkRange', + arguments: ['link'], + )] : []), + EditorCommand::make( + 'setLink', + arguments: [[ + 'href' => $data['href'], + ]], + ), + ], + editorSelection: $arguments['editorSelection'], + ); + }), + ]; + } +} + diff --git a/src/Providers/FilamentCustomTiptapExtensionsServiceProvider.php b/src/Providers/FilamentCustomTiptapExtensionsServiceProvider.php index 7a9846a..a459e6a 100644 --- a/src/Providers/FilamentCustomTiptapExtensionsServiceProvider.php +++ b/src/Providers/FilamentCustomTiptapExtensionsServiceProvider.php @@ -2,8 +2,6 @@ namespace Codedor\FilamentCustomTiptapExtensions\Providers; -use Codedor\FilamentCustomTiptapExtensions\Components\Linkpicker; -use Illuminate\Support\Facades\Blade; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; @@ -13,14 +11,6 @@ public function configurePackage(Package $package): void { $package ->name('filament-custom-tiptap-extensions') - ->setBasePath(__DIR__ . '/../') - ->hasConfigFile() - ->hasMigration('create_package_table') - ->hasViews('filament-custom-tiptap-extensions'); - } - - public function packageBooted() - { - Blade::component(Linkpicker::class, 'filament-custom-tiptap-extensions::linkpicker'); + ->setBasePath(__DIR__ . '/../'); } } diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php deleted file mode 100644 index 5d36321..0000000 --- a/tests/ExampleTest.php +++ /dev/null @@ -1,5 +0,0 @@ -toBeTrue(); -}); diff --git a/tests/Pest.php b/tests/Pest.php deleted file mode 100644 index 4ac45b1..0000000 --- a/tests/Pest.php +++ /dev/null @@ -1,5 +0,0 @@ -in(__DIR__); diff --git a/tests/TestCase.php b/tests/TestCase.php deleted file mode 100644 index 60cce2f..0000000 --- a/tests/TestCase.php +++ /dev/null @@ -1,36 +0,0 @@ - 'Codedor\\FilamentCustomTiptapExtensions\\Database\\Factories\\' . class_basename($modelName) . 'Factory' - ); - } - - protected function getPackageProviders($app) - { - return [ - FilamentCustomTiptapExtensionsServiceProvider::class, - ]; - } - - public function getEnvironmentSetUp($app) - { - config()->set('database.default', 'testing'); - - /* - $migration = include __DIR__.'/../database/migrations/create_filament-custom-tiptap-extensions_table.php.stub'; - $migration->up(); - */ - } -} From 4a70d54ffd3dec38a82583e10213b1627742db35 Mon Sep 17 00:00:00 2001 From: jyrkidn <2447042+jyrkidn@users.noreply.github.com> Date: Thu, 3 Jul 2025 19:37:33 +0000 Subject: [PATCH 5/5] Fix styling --- src/Plugins/LinkPickerRichContentPlugin.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Plugins/LinkPickerRichContentPlugin.php b/src/Plugins/LinkPickerRichContentPlugin.php index 451bc20..2359689 100644 --- a/src/Plugins/LinkPickerRichContentPlugin.php +++ b/src/Plugins/LinkPickerRichContentPlugin.php @@ -147,4 +147,3 @@ public function getEditorActions(): array ]; } } -