GrapesJS Issues

Search parsed GitHub issues, see highlighted answers, and open the original discussion when needed.

3464 issues found

#2054May 31, 2019by zhangyanweiNo answers
0 reactions

[BUG]: Two command names (new and old) cause the command division.

For some predefined commands, has a new name and old name. It tells the user to use the new one as preferred. If choosing the new command name to extend, will not works, that because of old names in the internal. The reason is: In commands/index.js, the added or extended commands are the newly created views (extends f...

#2053May 31, 2019by megarg2 answers
1 reactions

[BUG] Not able to use plugin: grapesjs-custom-code

I am trying to add "custom code plugin" but getting an error in console that "Plugin grapesjs-custom-code not found"I have created an react app and this is part of a reach component. Note that this is working fine when I add the plugin from a html page rather than react component.This issue is only with "grapesjs-cust...

artf

Hi @megarg actually new plugins (presets are not yet updated) use a new export format which makes this import import 'grapesjs-custom-code'; not usable. You can see the example of usage of new plugins here

megarg

Let me provide some more details: -----Configuration----- $ node -v v10.15.3 $ npx node-sass -v node-sass 4.12.0 (Wrapper) [JavaScript] libsass 3.5.4 (Sass Compiler) [C/C++] OS is: Windows 10 Will really appreciate any pointers on why this...

#2052May 31, 2019by tsuwunrut-carecloud1 answer
0 reactions

Merge Fields

I have a question regarding merge fields, similar to https://github.com/artf/grapesjs/issues/481. I'm trying to have my merge field icon button toggle a modal with an inputdropdown, then after selecting an option from the dropdown, have the merge field insert itself. ^ I have something along these lines. Clicking the...

artf

Generally, to prevent losing selection on element click you use event.preventDefault() so it might your case, but I'm not sure. Try at least to create a reproducible demo, BTW I close the issue as it has nothing to do with the core itself

#2051May 30, 2019by alikabeer322 answers
2 reactions

[QUESTION] Can I give default styling to an html tag like <p>?

I want that p tag should always have 0 margin. How do I do that? The reason is that ckeditor is wrapping the text around a p tag and p tag has a margin that's making it all ugly.

artf

You can pass all the styles you want to your initial template

alikabeer32

Exactly what I needed, Thanks!!

#2050May 30, 2019by jitendra16071 answer
0 reactions

no responsiveness in exported code

Exported code from 'https://grapesjs.com/demo.html' is not responsive as it looks in builder.

jitendra1607

Do this experiment please. Drop a nav-bar in to editor. Now click preview and open chrome dev tools and change device size to mobile. You will see nav-bar menu items like desktop instead of hamburger icon. https://grapesjs.com/demo.html

#2049May 30, 2019by benvmatheson3 answers
1 reactions

[Question]: Can the editor be instructed to ignore a class?

Once the editor creates HTML/CSS we hand it off to another piece of code. That piece of code relies on classes using a predetermined class name to perform actions on the HTML. (switching out placeholders for actual data etc.) If this class is added to an element, once that element is clicked, it attempts to add styles...

artf

You could place a listener on a new selector

artf

What do you mean "to ignore"? To ignore where? Being available in the style manager or something else?

benvmatheson

Sorry, I was unclear there. When clicking an element/block and proceeding to styling the element, the class is chosen by default. Could this class be deselected by default and hidden from the Classes field?

#2048May 30, 2019by kwayebopp1 answer
0 reactions

Where is the Box component used in the demos?

Hi! First, I'd like to say thanks to @artf for building such a slick library. I just started using it in my project and it was super easy to get set up. I'm building a React app using grapesjs with the grapesjs-preset-webpage plugin. I've been trying mimic building a webpage like the one in the demo, and I noticed tha...

artf

Thanks @kwayebopp BTW the Box label is used for the default component, nothing special (at the moment of writing Box was more pleasant than Div)

#2047May 30, 2019by alikabeer321 answer
3 reactions

[SOLVED] I need A custom category of blocks to appear in another panel/div

I could use appendto to move the ALL the blocks anywhere I want but how do I move a particular category of blocks. I need them to appear seperately.

alikabeer32

Nvm found the solution define your category like so blockManager.get('myblock').set('category', 'customdefinedcategory'); and then const blocks = blockManager.getAll(); const filtered = blocks.filter(block => block.get('category') == 'cust...

#2046May 29, 2019by sdrebel3 answers
1 reactions

[QUESTIONS] How to disable Scripts inside the editor?

Hi @artf , I need to disable all the scripts (component scripts and other scripts) inside the editor, and scripts should run only when we click on 'preview button'. Is there any method for it?

sdrebel

Hi @artf , Thank you for the reply. Right now i'm removing all the scripts and running only in preview mode.

artf

No, at the moment, there is no kind of public API to do that

mariasmol

Hi @sdrebel would love if you can share your solution. Also,after allowing scripts in the editor i copied this example to import pressed the import and saw the hello world. however when using the preview mode i don't see the alert . Do i n...

#2044May 29, 2019by eduardonunesp3 answers
1 reactions

Npm start to develop on local server didn't work

Did the procedure to start the local server using dev branch as described on README, it worked on the console, but fails on chrome and the grapesjs don't load due to the following error

artf

I made a quick check and the reason seems to be the latest [email protected] I don't have time to investigate so I'll just freeze the currently used version

artf

Weird, never seen that before. It might be some dev dependency change in some minor release. Try to reinstall node_modules with exact dependency versions

verdverm

I'm having issues following the dev setup: Maybe a bundler issue? I am able to drop the min from grapes.min.js in the index.html file and it works. However, if I build the grapes.js output, then this error returns.