Coder Social home page Coder Social logo

furkangm / filament-tiptap-editor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awcodes/filament-tiptap-editor

1.0 0.0 0.0 2.69 MB

A Tiptap ingtegration for Filament Admin/Forms.

License: MIT License

JavaScript 20.91% PHP 22.19% CSS 7.93% Blade 48.97%

filament-tiptap-editor's Introduction

Filament Tiptap Editor

A Tiptap ingtegration for Filament Admin/Forms.

screenshot in light mode

screenshot in dark mode

screenshot of fullscreen editing in dark mode

  • Supports Light/Dark Mode
  • Fullscreen editing
  • Overrideable Media uploading
  • Profile based toolbars to simplify reusing features

Installation

Install the package via composer

composer require awcodes/filament-tiptap-editor

Usage

The editor extends the default Forms Field class so all other methods available on that class can be used when adding it to a form.

use FilamentTiptapEditor\TiptapEditor;

TiptapEditor::make('content')
    ->profile('simple')
    ->required(); //->etc

Config

Publish the config file.

php artisan vendor:publish --tag="filament-tiptap-editor-config"

Profiles

The package comes with 3 profiles for buttons/tools out of the box.

  • default: 'bold', 'italic', 'strike', 'underline', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'lead', 'small', 'color', 'bulletList', 'orderedList', 'checkedList', 'align', 'blockquote', 'hr', 'link', 'superscript', 'subscript', 'table', 'grid', 'media', 'youtube', 'vimeo', 'code', 'codeblock', 'source'
  • simple: 'bold', 'italic', 'h1', 'h2', 'h3', 'lead', 'hr', 'bulletList', 'orderedList', 'checkedList', 'link', 'media'
  • barebone: 'bold', 'italic', 'link', 'bulletList', 'orderedList'

See filament-tiptap-editor.php config file for modifying profiles to add / remove buttons from the editor or to create your own.

Media / Images

  • accepted_file_types: ['image/jpeg', 'image/png', 'image/webp', 'image/svg+xml', 'application/pdf']
  • disk: 'public'
  • directory: 'images'
  • visibility: 'public'
  • preserve_file_names: false
  • max_file_size: 2042
  • image_crop_aspect_ratio: null
  • image_resize_target_width: null
  • image_resize_target_height: null
  • media_uploader_id: 'filament-tiptap-editor-media-uploader-modal'

Overrides

Link Modal

You may override the default link modal with your own Livewire component and assign its ID to the link_modal_id setting in the config file.

See vendor/awcodes/resources/views/components/link-modal.blade.php and vendor/awcodes/filament-tiptap-editor/src/Components/LinkModal.php for implementation.

Media Modal

You may override the default file uploader with your own Livewire component and assign its ID to the media_uploader_id setting in the config file.

See vendor/awcodes/resources/views/components/media-uploader-modal.blade.php and vendor/awcodes/filament-tiptap-editor/src/Components/MediaUploaderModal.php for implementation.

Versioning

This projects follow the Semantic Versioning guidelines.

License

Copyright (c) 2022 Adam Weston and contributors

Licensed under the MIT license, see LICENSE.md for details.

filament-tiptap-editor's People

Contributors

awcodes avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.