live-controls / editor
There is no license information available for the latest version (dev-main) of this package.
editor.js implementation for live-controls
dev-main
2023-11-24 18:16 UTC
Requires
- livewire/livewire: ^2.12
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-25 12:33:41 UTC
README
editor.js implementation for live-controls
Warning: This package is not usable at the moment!
Installation
- Run composer:
composer require live-controls/editor;
- Auto-Installer:
php artisan livecontrols-editor:install;
2.1) Add vite reference to layout:
- Open layout file (ex. layouts/app.blade.php)
- Add to @vite(['resources/css/app.css', 'resources/js/lseditor.js', 'resources/css/lseditor.css', 'resources/js/app.js'])
Usage
Tools
Custom Tools
To add custom tools simply follow those steps:
- Call installation tool:
livecontrols-editor:install-tool;
- Select "other" option
- Add package name like in "npm i --save @editorjs/image"
- Add unique tool name. This will be saved as a javascript variable as window.TOOL_NAME
- Add a key for the tool at the end it will look like this:
KEY: TOOL_NAME
- Add the tool like this:
@livewire('livecontrols-editor', ['tools' => ['KEY' => ['name' => 'TOOL_NAME]]])
Custom Tools with additional configuration
To add custom tools with additional informations, follow this example with carousel-editorjs:
- Call installation tool:
livecontrols-editor:install-tool;
- Select "other" option
- Add package name: carousel-editorjs
- Add tool name: EditorJSCarousel
- Add key for tool: carousel
- Let system install the tool
- Add the tool like this:
@livewire('livecontrols-editor', ['tools' => ['carousel' => ['name' => 'EditorJSCarousel', 'custom' => '{class: EditorJSCarousel,config:{ endpoints: {byFile: "URL_FETCH",}}}']]])