#522 @artf I tried as you said but still no luck, I do not want to waste your time but it would be very useful if you can please create small sample or point me to sample, I am sure I am missing something. sorry had to open another issue but it in continuation of same #522, here it editor.html() only return default va...
adamlc
@krunal039 this isn't a support form. If you have any problems asking here is only going to infuriate the contributors. If you have a problem ask on Stack overflow, thats what its for....
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
How to export the HTML/CSS in the code view / download as zip. With the stylesheets in styles.css referenced in the grapesjs canvas, but not the unused, actually i am fine with all the styles.css stylesheet, for simple API access for export. If I add the stylesheet in init Yea, Table ๐ Thanks for the good work, let u...
artf
@chiqui3d definitely it shouldn't be added to what is used for storing otherwise you will add those styles twice.
artf
The issue I have is that when I try to export the code using the grapesjs export plugin nothing referenced inside canvas is exported. @Yakito For now, those scripts/styles should be included manually, you can use root option from the expor...
artf
Hi @tldrjumps I'm not sure if I properly got your problem. You can simply get all the CSS with editor.getCss(), which also tries to optimize it by removing classes without components. Styles inserted via canvas.styles option are just injec...
I have an editor initialized as so: If I add an image to the canvas and try to upload a new image by dragging it into the drop area in the modal, the uploadFile function is called twice. Uploading by clicking on the upload area and selecting a file from the windows dialog works fine, it only calls the function once.
artf
@roytang I can't reproduce it with the current version https://codesandbox.io/s/p554z8yv7j
duskhacker
@roytang Explicitly disabling the full-width editor dropzone (dropzone: 0) fixed this for me. Using version 0.12.30
kickbk
Got the same and @roytang's comment is true, disabling dropzone takes care of it. always using the latest version of course.
Hi, From time to time, on my canvas the highlighter and toolbar appear in the wrong place. Is this a known bug? Do I have to manually refresh the canvas? It seems that the top css property on gjs-highlighter and gjs-badge aren't being calculated properly, they still line up horizontally just not vertically. Any ideas?...
artf
I'm aware of the toolbar "jump" when the content inside it changes (by adding or removing buttons) but not with the highlighter. Do you use the editor inside a scrolled page?
telliott22
Any way to stop the jumping when the content changes? Yes, the page is scrolled. Should I limit the height of the editor to the browsers height?
artf
Yeah, unfortunately, there is a bug which doesn't get a correct dimension of the scrolled page
below is code i used for traits and custom section but after adding component via block, cannot edit text or trait update does not update canvas. I have extended 'text', Also I do not get html back when I use editor.html(), Also when I click on image it does not open asset manager. I am sure I must be missing somethin...
artf
In your model, you don't need defining data-gjs-* it's only make sense for importing from HTML, so remove this: and you don't need type: 'section', either. From what I see you should define addType like this You can't edit this because it'...
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I wanted to study how to use the video component but the one on the demo website (http://grapesjs.com/demo.html) doesn't seem to be working? Dropping a video component into the canvas shows a still photo with some lights. If I click the edit icon, the photo editor opens with no content and no toolbar and a bunch of JS...
artf
It's not a photo but actually, a video (I just turned off autoplay), if you toggle controls and turn on the preview you should be able to see it play. About the edit button, I think it's a bug, should not be there, I'll check it later
I'm trying to build a custom component that contains some lorem ipsum text in the content, for editing once it's on the canvas. But I also want to modify the HTML in the view (to add some content that I want shown in the editor but not in the saved HTML). I tried something like this: The issue is if I modify the rende...
roytang
I tried the above, as follows: But I'm still unable to edit the text in the h1 and p elements after dropping the component on the canvas. :(
artf
Sorry I didn't notice this you basically remove elements with models and attach a new string as HTML (the editor can't access their models anymore). If you want to add a new component you should do it via models (eg. view.model.append('<di...
artf
You can extend the Text Component instead of the base one
I'm trying to build a custom resizer for one of my components. It's a grid/column layout based on Flexbox and I want users to be able to resize one column (to a fixed width) and have the other columns fill up the remaining space. I already have a custom component for my column, so I added resizer configuration to it,...
artf
Yeah, you're right. This happens just because functions are not serializable, therefore when grapesjs calls JSON.stringify(Component) are simply ripped off. The solution for your case is to override toJSON method in the custom Component
thecodefish
Thanks @artf that did the trick.
sakshigarg9
@thecodefish How do you change initial state of the Resizer properties? Where does this config go if I'm using the grapesjs-preset-webpage, simply under grapesjs.init{...}? I want to fix a minimum dimension for an image component specifica...
Hello, First of all, thanks for contributing such an amazing js framework. I am very new to grapesjs. And github too. https://github.com/artf/grapesjs/wiki/Components-&-JS#template-related According to grapesjs wiki, I load js links inside the canvas as the above codes and it works fine. But when I try with css links...
artf
You were almost there :)
ronaldaug
Thank you so much @artf , it works like a charm.
coder-strange
You have to include separately while rendering, it won't come in getHtml() or anything.
We want to define a custom component that may or may not be added into the HTML, but we want to disallow adding more than one of that component. Can this restriction be done in GrapesJS?
artf
Not something built-in, but definitely achievable by using the GrapesJS's API Extremely easy would be adding a listener (eg, change:changesCount), search your component and then apply your logic
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.