mjawad096 / laravel-grapesjs

This package provide an esay way to integrate GrapesJS into your laravel proejct.
MIT License
108 stars 54 forks source link

How to add plugins #9

Closed J87NL closed 2 years ago

J87NL commented 2 years ago

Hi! Thanks for creating this package!

Can you please share some instructions how to add plugins like https://github.com/artf/grapesjs-plugin-forms to the config? Is this possible?

Kind regards, Johan.

ghost commented 2 years ago

Hi Johan, Thanks for using my package.

Sadly! For now, there is no option/config for adding plugins to the editor dynamically. But if you set true exposeApi in the config, an instance of the editor will be available via window.gjsEditor. You can look into that if it helps.

Thanks, JD.

J87NL commented 2 years ago

Hi JD, Thanks for your fast reply! I tried that method and was able to access window.gjsEditor, unfortunatly I don't know how to add plugins from there. I hoped you might know a way? Kind regards, Johan.

ghost commented 2 years ago

Sorry, I thought it may help you -- But I think it is not possible to added plugins after initialization of editor. So I it seems not possible to add a new plugin to it for now. I'll work on it and will update package to add custom plugins. But for that you may have to wait as I'm busy now a days.

vnsinfo commented 2 years ago

Hi JD Thanks for this amazing code. It has helped us a lot. Had a small request. The version of grapesjs used in this package seems to be quite old. The latest editor has a lot of new features.
I am especially after the tab component. Is there any easy way of updating/using the latest version of the editor. Thanks in advance.

Kind Regards Hemant

ghost commented 2 years ago

Will work on it in next one or two weeks.

insssomniac commented 2 years ago

Hi JD If you have a chance, please give a short explanation of the config file - it seems it is possible to connect some scripts and styles in the 'scripts' and 'styles' sections, and what mean the 'image_editor'? Could you please give little example how to connect style file, if it is possible to connect scss or css file to access it inside editor. Thanks for the great product.

ghost commented 2 years ago

Hi JD If you have a chance, please give a short explanation of the config file - it seems it is possible to connect some scripts and styles in the 'scripts' and 'styles' sections, and what mean the 'image_editor'? Could you please give little example how to connect style file, if it is possible to connect scss or css file to access it inside editor. Thanks for the great product.

Hi, the styles and scripts are the global sheets you may need to apply to your content. e.g bootstrap files. -- THe "image_editor" option is to enable image manipulation after the image uploaded

ghost commented 2 years ago

Hi @J87NL, Now you can plugin from config, I've added your mentioned plugin in config by default -- Please see release 3.2.0