EditorJs integration for Filament Admin/Forms.
You can install the package via composer:
composer require abdelhamiderrahmouni/filament-editorjs
use FilamentEditorJs\Forms\Components\EditorJs;
EditorJs::make('content')
By default all tools are enabled. This is a list of available tools:
[
'attaches', // @editorjs/attaches
'checklist', // @editorjs/checklist
'code', // @editorjs/code
'delimiter', // @editorjs/delimiter
'header', // @editorjs/header
'image-gallery', // editorjs-gallery
'image', // @editorjs/image
'inline-code', // @editorjs/inline-code
'link', // @editorjs/link
'list', // @editorjs/list
'marker', // @editorjs/marker
'nested-list', // @editorjs/nested-list
'paragraph', // @editorjs/paragraph
'quote', // @editorjs/quote
'raw', // @editorjs/raw
'style', // editorjs-style
'table', // @editorjs/table
'underline', // @editorjs/underline
'warning', // @editorjs/warning
]
You can disable any of them using by passing an array of tool names:
EditorJs::make('content')
->disableTools(['image', 'raw']);
Also you can enable only certain tools:
EditorJs::make('content')
->tools(['image', 'raw']);
You can pass options to the tools:
EditorJs::make('content')
->toolsOptions([
'attaches' => [
'endpoint' => '/upload/file',
],
'image' => [
'endpoints' => [
'byFile' => '/upload/image',
'byUrl' => '/upload/image-by-url',
],
],
]);
To debug the editor, you can enable the debug mode:
EditorJs::make('content')
->debug();
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.