hi, thanks for your great project. I have a problem confused recently. I want to import some react components to my projects,I changed this Jsx to html through renderToStaticMarkup method,and get the result <button type="button" class="ant-btn ant-btn-primary"><span>test</span></button> and I also import this class by...
WARNING READ and FOLLOW next 5 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdUse the GitHub Issues EXCLUSIVELY for BUGS, FEATURE REQUESTS or QUESTIONS. Prefix the title of the issue with its context, eg. [Bug]: ....Do a quick...
Hi @artf I have created a very basic custom component named 'customsection' which uses traits to change the component's background-color by adding a class. Pretty straightforward. I have created two blocks:Section - includes only the component.Section collection - includes a collection of DOM elements and the componen...
artf
Try to put your custom component definitions in a plugin and see if it works
alialrabi
@selcukcura are it is working when putting it in plugin ?
selcukcura
Much appreciated @artf, placing my custom component in a plugin solved both issues! Out of curiousity, are there any particular reasons why it now works as a plugin and not otherwise ? @alialrabi Yes, I managed to get it working. Try using...
how do I make a trait like a video trait, I have a provider type, the other trait type depends on the provider I choose, can it be demonstrated? Thank you very much.
giorgiosjames
The video component is a great demonstration in and of itself. Can be found at grapesjs repo root > src > dom_components > model > ComponentVideo.js. Here's some example code with the bare minimum necessary code: You can test this out by a...
I want a form inside a modal (using the default modal ), on click of the submit button make an ajax call. I have created a new component which pops a modal on drag and drop. I am able to insert the form in the modal It looks like this : <img width="1001" alt="Screen Shot 2019-07-11 at 10 22 17 AM" src="https://user-im...
giorgiosjames
Doing away with the form and just using javascript to create/interface with the modal contents works well. modal.setContent() for appending the button and myButton.onclick = () => {} to catch its click event. Here's some example code:
artf
The point here is that content accepts HTML nodes (not only HTML strings) so you can have any HTMLElement with any attached event (forms with submits, buttons with clicks, etc.) so the approach proposed is totally valid (thanks @giorgiosja...
AkibDeraiya123
@giorgiosjames Thanks, man this(https://github.com/artf/grapesjs/issues/2129#issuecomment-510734779) is work like a charm in my case. Your answer save a lot of my time :)
Hi, Please help me add device manager mobile landscape with structure example: @media only screen and (min-device-width: 375px) and (max-device-width: 667px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: landscape) { } Currently, i have device manager with structure: @media (max-width: 480px) { } Thanks
artf
Check the DeviceManager API For now, it's only possible to use a single condition (configurable via mainConfigObject.mediaCondition option, max-width is the default)
Ensaphelon
@artf Is there any reason why grapesjs still does not support this feature? It seems that it could be resolved just by removing mediaCondition option from the EditorConfig at all, and allowing to pass any media query for each device in the...
Hello, I want to update the content property based on the changes from the trait I have this component added and notice I have a custom property chartType which is the one that I would be needing to update. Here is the Trait that I created: What I want to do is whenever the updated or doStuff event is called in the ca...
artf
First of all, move all the props from block to the component to have something like this: otherwise, you can face unexpected behaviorsWhat I want to do is whenever the updated or doStuff event is called in the canvas-options it will update...
Hello, I am making a custom category using ChartJS which would be blocks of draggable charts. I currently have this code to have a static chart rendered in the canvas after dropping Now my problem is after dragging it I cannot update/edit the chart's data. How can I make it so that the data, options properties of the...
Why on the editor canvas, the video component has a div in parent tag (video), whereas when I get html(editor.getHtml()), the div doesn't existis it possible if I want to add 1 div as a parent again? (for stye css)
artf
Why on the editor canvas, the video component has a div in parent tag (video), whereas when I get html(editor.getHtml()), the div doesn't exist To make a component behave in a specific manner its view (what you see in canvas) can be comple...