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

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

  1. Run composer:
composer require live-controls/editor;
  1. 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:

  1. Call installation tool:
livecontrols-editor:install-tool;
  1. Select "other" option
  2. Add package name like in "npm i --save @editorjs/image"
  3. Add unique tool name. This will be saved as a javascript variable as window.TOOL_NAME
  4. Add a key for the tool at the end it will look like this:
KEY: TOOL_NAME
  1. 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:

  1. Call installation tool:
livecontrols-editor:install-tool;
  1. Select "other" option
  2. Add package name: carousel-editorjs
  3. Add tool name: EditorJSCarousel
  4. Add key for tool: carousel
  5. Let system install the tool
  6. Add the tool like this:
@livewire('livecontrols-editor', ['tools' => ['carousel' => ['name' => 'EditorJSCarousel', 'custom' => '{class: EditorJSCarousel,config:{ endpoints: {byFile: "URL_FETCH",}}}']]])