Download the PHP package naturalgroove/laravel-filament-rich-editor-source-ai without Composer
On this page you can find all versions of the php package naturalgroove/laravel-filament-rich-editor-source-ai. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download naturalgroove/laravel-filament-rich-editor-source-ai
More information about naturalgroove/laravel-filament-rich-editor-source-ai
Files in naturalgroove/laravel-filament-rich-editor-source-ai
Package laravel-filament-rich-editor-source-ai
Short Description Source functionality for Filament 4.x Rich Editor with AI support
License MIT
Homepage https://github.com/naturalgroove/filament-rich-editor-source-ai
Informations about the package laravel-filament-rich-editor-source-ai
Laravel Filament Rich Editor HTML Source with AI transformation
A powerful Filament 4.x plugin that enhances the Rich Editor component with editing HTML source capabilities and AI-powered HTML transformation. Edit raw HTML directly and leverage AI to clean, optimize, and transform your content automatically.
โจ Features
- ๐ HTML Source Mode - View and edit raw HTML content directly in the Rich Editor
- ๐ค AI-Powered HTML Transformation - Clean, optimize, and transform HTML using AI (OpenAI, Anthropic, etc.)
- โจ๏ธ Keyboard Shortcuts - Quick access with
Ctrl/Cmd + Shift + L - ๐จ Customizable Prompts - Define your own AI transformation prompts
- ๐ Multi-language Support - Comes with English, Polish, and German translations
- ๐ Plug & Play - Automatically integrates with all Rich Editor instances
- ๐ฏ Tailwind CSS Ready - Includes prompt preset for Tailwind Typography optimization
- โฟ WCAG Compliance - AI can transform content to meet accessibility standards
๐ Requirements
- PHP 8.2 or higher
- Laravel 10.x, 11.x or 12.x
- Filament 4.x
- Prism PHP for AI integration
๐ฆ Installation
Install the package via Composer:
Publish Configuration
Optionally publish the configuration file to customize AI providers and prompts:
Publish Translations
To customize translations:
๐ Usage
Basic Setup
The plugin automatically registers itself globally with all Rich Editor instances. No additional configuration required!
Available Toolbar Buttons
source-ai- Toggle HTML source mode to view/edit raw HTMLsource-ai-transform- Opens AI transformation modal with predefined prompts
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl + Shift + L (Windows/Linux)Cmd + Shift + L (Mac) |
Toggle HTML source mode |
Esc |
Exit source mode |
๐ค AI-Powered HTML Transformation
How It Works
- Click the Transform HTML button in the Rich Editor toolbar
- Select a transformation prompt from the dropdown
- Preview and edit the HTML content
- Click Transform HTML to apply AI optimization
- Review the transformed content and insert it back into the editor
Default Configuration
The plugin comes with a preconfigured AI setup:
Custom AI Prompts
Add your own transformation prompts in the configuration file:
Supported AI Providers
Configure your preferred AI provider via the Prism PHP package:
- OpenAI (GPT-4, GPT-4o, GPT-3.5)
- Anthropic (Claude)
- Ollama (Local models)
- Mistral
- Groq
- And many more...
Setup AI Provider
- Install Prism PHP (already included as dependency)
-
Configure your API keys in
.env: - Update the provider in config:
โ๏ธ Configuration
Full Configuration Example
System Prompt Customization
The system-prompt defines the AI's behavior and guidelines. Customize it to match your needs:
๐ Internationalization
The plugin includes translations for:
- ๐ฌ๐ง English (en)
- ๐ต๐ฑ Polish (pl)
- ๐ฉ๐ช German (de)
Available Translation Keys
Adding Custom Languages
Publish the translations and add your language:
Then create a new language file in resources/lang/vendor/filament-rich-editor-source-ai/{locale}/editor.php.
๐จ Customization
Javascript assets will be published to public/js/naturalgroove/laravel-filament-rich-editor-source-ai/.
Css assets will be published to public/css/naturalgroove/laravel-filament-rich-editor-source-ai/.
๐ก Use Cases
1. Clean Pasted Content
Users often paste content from Word, Google Docs, or websites that contains messy HTML with inline styles. Use the AI transformation to clean it up automatically.
2. Optimize for Tailwind CSS
When using Tailwind's Typography plugin (@tailwindcss/typography), the AI can remove unnecessary classes and optimize HTML structure.
3. Ensure Accessibility
Transform existing content to meet WCAG guidelines, adding proper semantic HTML, ARIA labels, and improving overall accessibility.
4. Convert Legacy HTML
Modernize old HTML with deprecated tags and attributes into clean, semantic HTML5.
5. Standardize Content
Ensure consistent HTML structure across your application by transforming content to follow your standards.
๐งช Testing
Run the test suite:
Run static analysis:
Format code:
๐ Changelog
Please see CHANGELOG for more information on what has changed recently.
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
๐จโ๐ป Credits
- Grzegorz Adamczyk
- All Contributors
๐ License
The MIT License (MIT). Please see License File for more information.
๐ Acknowledgments
This package uses:
- Filament - The elegant TALL stack admin panel
- Prism PHP - AI integration abstraction layer
- Spatie Laravel Package Tools - Package development utilities
Made with โค๏ธ by NaturalGroove
All versions of laravel-filament-rich-editor-source-ai with dependencies
filament/filament Version ^4.0|^5.0
filament/forms Version ^4.0|^5.0
prism-php/prism Version ^0.97.0 || ^0.98.0 || ^0.99.0
spatie/laravel-package-tools Version ^1.15.0