Coder Social home page Coder Social logo

bumpcore / editor.php Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 3.0 533 KB

Editor.php is a package designed to assist in parsing and manipulating the output of Editor.js with ease.

Home Page: https://bumpcore.com/docs/editorphp

License: MIT License

Blade 16.46% PHP 83.39% Hack 0.15%
php laravel editorjs editor editorjs-parser laravel-package php-library

editor.php's People

Contributors

megasteve19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dtdi lazdakon

editor.php's Issues

[2.x] Merging blocks into `EditorPhp` itself.

It is annoying to access $content->blocks->filter(...) way. There's no much important doing so. I think we should able to do $content->filter(...). Other properties will work as same before: $content->version or $content->time

[2.x] Dry run & validation

Validation should be done beforehand, before everything is converted into associated objects. This will allow library to throw errors (if any) and prevent invalid data. Also new Laravel rule can be introduced.

  • Create seperate validation handler
  • Validate input before using it, throw error if input is invalid
  • Add validation rule

Compact blocks

Blocks and providers too away from each other. We should able to access blocks from providers. It applies for cast too. We should able to access model from provider.

Block Type Resolver

Feature that allows to resolving block type by class name. Which means we can rid of type function.

Default block types

Currently there's no standart for block types (names) in Editor.js, so automatically resolving types causes Editor.js to not recognizing blocks. To get over it, should add types to current supported blocks.

Macros

Macros for EditorPhp class

Get/Set methods for block data & renaming BlockData to Data

Currently we are using invokable class. We still preserve the invokable structure with additional get set methods. Currently block data takes second argument as value for setting new value. Instead invoking will only reflect get method and get method will have default value parameter.

[2.x] Html import

Way to handling html import so migration from other editors would be much more easy. For reference we can imitate Editor.js's onPaste event.

[2.x] Virtual attributes

Both EditorPhp class and Block class can have virtual attributes. Like Laravel models but in a simple matter.

This will also resolve #42 and possibly #50

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.