newindforks/orchid-editorjs

A orchid editorjs field

dev-master 2023-10-30 11:34 UTC

This package is auto-updated.

Last update: 2024-04-30 00:40:08 UTC


README

GitHub Workflow Status styleci

Packagist Packagist Packagist

Package description: Work in process

Installation

Install via composer

composer require newindforks/orchid-editorjs

Usage

    /**
     * Views.
     *
     * @return Layout[]
     */
    public function layout(): array
    {
        return [
            Layout::rows([
                EditorJS::make('mydata')->tools([
                    MarkerTool::make('marker'),
                    ImageTool::make('picture')
                    HeaderTool::make('header')
                ])
            ]),
        ];
    }

Register new tool

php artisan orchid:editorjs:tool MySuperTool

And in js

class MySuperTool {
    //code
}

window.editorJSTools = window.editorJSTools || [];
window.editorJSTools['MySuperTool'] = MySuperTool;

This package is bootstrapped with the help of melihovv/laravel-package-generator.