Hi guys instead of styling in the init in this way... it's possibile to use a scss file in canvas? canvas { style:['FILE.SCSS'] } or simple make it cleaner with a single init css? Thank you! myComponent.append(<style> body { background: rgb(204,204,204); } .footer { position: absolute; bottom: 5mm; width: auto; left:...
artf
You can use canvasCSS option if you don't want to use files.
devtechk
Thank you very much! This config file is gonna help me a lot!
GJSBlock
Thanks for reporting this, @devtechk. Great question about canvas style css. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on()...
Version: 0.16.44 Hi there! I have remote storage for pages, and recently I faced an issue when saving page, JSON.stringify(editor.getComponents()) started to throw error Uncaught TypeError: e[M].getId is not a function. I investigated the already saved JSON representation of the page and found out that it fails on thi...
yucomds
Same error here ... do you have a solution? [EDIT] Downgrading seems to be the only solution for now
josfh2005
Same problem here, if I preprocess the components and remove that attribute (__symbol) before load the Editor the template works fine. Is the a way @artf to disable the symbols for now?
artf
Yeah unfortunately the previous version of grapesjs had a bug that created symbols involuntary. In the current version, the bug is fixed and symbols are disabled, but unfortunately, this still happens if you try to load a component with a...
nvm You have to put component overriding in the plugins.
GJSBlock
Thanks for reporting this, @Andrew-Chen-Wang. Great question about How to update built-in component's traits?. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your s...
What are you trying to add to GrapesJS? Support for richtext editors with promise based APIs. Describe your feature request detailed CKEditor5's Editor.create and Editor.destroy methods return a Promise that resolves when the editor has been fully created or destroyed. This causes an issue when destroying the editor (...
artf
Yeah, makes sense, probably I'd try to check if it's possible to make enable/disable methods (from ComponentTextView) async by default without breaking stuff, but checking if are thennable is always an option.
artf
This should be already possible.
GJSBlock
Thanks for reporting this, @martijnc. Great suggestion about FEAT: Add support for promises to custom RTE API! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior. Using the event syste...
Version: 0.16.34 Are you able to reproduce the bug from the demo? [ ] Yes [x ] No As I understand the code import dialog skips all the HTML scripts, so I can not reproduce the issue on the demo What is the expected behavior? The editor must remove dead script blocks before appending a new script block at the end of th...
Ju99ernaut
I'm unable to reproduce this, maybe you can provide more information on the custom component itself, anyway I suspect this is a storage related issue. Are you storing then loading pages from the generated html?
Andrew-Chen-Wang
Typically inline scripts go in the body at the bottom. Try putting it there maybe?
am1rb
I do not append anything by myself. The editor appends the scripts related to my components in a new script tag at the end of the generated HTML. Please take a look at this file: https://github.com/artf/grapesjs/blob/dev/src/editor/model/E...
Version: 0.16.44 Hi @artf I have a custom block with a custom button component, which its content is similar to this one. <a data-gjs-type="custom_button" class="btn btn-1" href="">Click here</a> Additionally, I've added a text trait to change the button content, in this particular case I do not want to use the editor...
artf
Hi Juan, thanks for the report, are you able to show me how your text trait works? I'd expect it to work correctly if you update your component in this way component.components(e.target.value)
jcamejo
This was my trait I have changed it to And now it works without overriding update content or render children, thanks! I would have never arrived to the conclusion of using the components method. Now i don't like text nodes 😅 I think we ca...
artf
I don't think you need this one target.set('content', value);. For the rest all good 👍
For text placed at the top of the page, component labels can overlap and hide the text while editing. Also the label can overlap the text editing tools when not at the top. Hiding the labels while editing text would avoid this.
RutujaBadbe
You can hide the labels using badgable : false https://grapesjs.com/docs/api/components.html#parameters-3
GJSBlock
Thanks for reporting this, @neon12345. Thanks for sharing your report about FEAT: hide component labels while editing text. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSFid...
Version: v0.16.41 Are you able to reproduce the bug from the demo? [ ] Yes [ ] No What is the expected behavior? When we have a button with the property data-gjs-draggable in false, this button not should be dragged in the canvas. Describe the bug detailed StepsSet a button component with draggable property in falseDr...
artf
I guess you're doing something wrong, how do you create those components and their properties?? You shouldn't even see those attributes in the inspector.
marcepoblet
@artf In our codes we have not changed anything. The only difference is that we update the GrapesJs version. Before I had version v0.16.18 and it worked correctly, but now we update GrapesJs to v0.16.41 and it doesn't work for buttons.
marcepoblet
we set the properties with this: editor.getSelected().attributes.attributes["data-gjs-editable"] = 'false' editor.getSelected().attributes.attributes["data-gjs-copyable"] = 'false' editor.getSelected().attributes.attributes["data-gjs-dropp...
Much grateful to you for this library. Background: I am building an editor where I intend to define most of the components from an existing set of Vuejs components which I have developed earlier and use in my applications. Most of these are UI based simple and complex components. For example, I have simple vuejs compo...
Ju99ernaut
I'm not sure if such hooks exist per component but you can try to take advantage to the toHtml property of a component. It's already been discussed elsewhere so you search it in the issues as there are quite a few.
artf
Yeap, you can define your components with a custom toHTML/toJSON function (in model), in order to customize their output
GJSBlock
Thanks for reporting this, @sudiptochoudhury. The issue with Is there a event per component before save which the component can listen to? appears to be a race condition or state management timing problem. This typically happens when compo...
Version: 0.16.41 Are you able to reproduce the bug from the demo? [X] Yes [ ] No What is the expected behavior? 1) Copy selected parent component (container) to the clipboard. 2) Paste selected parent component (container) from the clipboard (into the same page or an other page). 3) All components keep ID styles and i...
artf
That because you've updated original commands with your versions (incorrectly). Indeed, if I remove your plugin from the demo everything works as expected. Please check the original copy and paste command, you should clone components befor...
artf
Just check the original commands https://github.com/artf/grapesjs/blob/dev/src/commands/view/CopyComponent.js https://github.com/artf/grapesjs/blob/dev/src/commands/view/PasteComponent.js
bgrand-ch
@artf Thanks for your answer. A link or an example or more explanations please? 😅