androsamp / filament-rich-editor-textcolor
Filament Rich Editor text color plugin (TipTap) for FilamentPHP.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/androsamp/filament-rich-editor-textcolor
Requires
- php: ^8.1
- filament/forms: ^4.0
- spatie/laravel-package-tools: ^1.15.0
README
Plugin for Filament Rich Editor: text color selection (TipTap/ProseMirror).
Installation
composer require androsamp/filament-rich-editor-textcolor
Usage
->toolbarButtons(['textColorPicker'])
->floatingToolbars([ 'paragraph' => [ 'textColorPicker' ] ])
For correct display after rendering:
use Androsamp\FilamentRichEditorTextColor\TextColorRichContentPlugin; use Filament\Forms\Components\RichEditor\RichContentRenderer; // Fetch the post and its content $post = Post::first(); // Render the content using Filament's RichContentRenderer $renderer = RichContentRenderer::make($post->content); // Post-process the HTML to support text color styles $html = $renderer->toUnsafeHtml(); $html = TextColorRichContentPlugin::make()->postProcessHtml($html); // $html now contains the final HTML with text color support
Localization
The package includes translations for English and Russian languages. The translations are automatically loaded when the package is installed.
Available Translation Keys
'filament-rich-editor-textcolor::text-color.label' // Button label 'filament-rich-editor-textcolor::text-color.modal_heading' // Modal heading
Publishing Translations
To customize the translations, you can publish them to your project:
php artisan vendor:publish --tag=filament-rich-editor-textcolor-translations
This will copy the translation files to resources/lang/vendor/filament-rich-editor-textcolor/
.
Supported Languages
- English (
en
) - Default - Russian (
ru
)
License
MIT