Ju99ernaut / grapesjs-component-code-editor

Code editor for grapesjs
MIT License
64 stars 21 forks source link

Editor CSS #39

Open vizardkill opened 2 years ago

vizardkill commented 2 years ago

First of all bro, I love each of your projects as always I continue to learn a lot from you.

I wanted to ask you if it is possible in the future to implement a block to inject our own CSS styles as a CSS editor?

Ju99ernaut commented 2 years ago

I think this plugin already covers such a use case: https://github.com/artf/grapesjs-custom-code

vizardkill commented 2 years ago

yes, it is similar to the code editor, suppose we wanted the entire canvas to be able to load a style sheet without having to add a block, a component would be interesting where you can manage what was html, style sheet and javascript independently of blocks and that could be injected throughout the site

Ju99ernaut commented 2 years ago

I doubt something like that would be a good fit for this plugin, it's quite difficult to manage styles outside of the style manager, as you'd end up with a lot of duplicate styles. But you could just modify the custom code plugin to do that.

vizardkill commented 2 years ago

If it is a topic of conversation for another project outside of this one.

Another question bro, does the plugin inject tailwind or does it have to add the library through the cdn script?

We could file the issue as a discussion.

Ju99ernaut commented 2 years ago

Yeah, my thoughts are this would need to be a new plugin for managing global css and js or part of the code-editor plugin.

It's added through the cdn script.

vizardkill commented 2 years ago

bro another question regarding this plugin, is it possible to activate codeMirror autocomplete?

Ju99ernaut commented 2 years ago

I'm not sure, haven't experimented with adding plugins, you could try something with codeViewOptions

vizardkill commented 2 years ago

Do you have any example of viewOptions?

Ju99ernaut commented 2 years ago

These options are basically merged with the defaults https://github.com/Ju99ernaut/grapesjs-component-code-editor/blob/14844edeaf1fd76972e552547d8ceff6549198b1/src/code-editor/index.js#L33-L43

Also noticed that grapesjs exposes Codemirror so you could also try that

vizardkill commented 2 years ago

my brother, thank you very much for answering all my questions, I admire how humble you are to share your knowledge, I think it is something that makes you unique and that makes all your projects so great, thank you very much for your help.

Thanks to you I have been able to learn a lot about Grapes js I will be telling you how the project I am working on is going

image

Ju99ernaut commented 2 years ago

Awesome, look forward to following your progress!