BUG: Wrong Type for "content" property in BlockProperties
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Chrome v122
Reproducible demo link
not applicable
Describe the bug
The GrapeJs Docs indicate that it is possible to add mixed content to the "content" property of a block (see https://grapesjs.com/docs/modules/Blocks.html#mixed). But the type definition for the property is 'string | ComponentDefinition' (see https://github.com/GrapesJS/grapesjs/blob/dev/src/block_manager/model/Block.ts#L17). This leads to errors during compiling in TypeScript Projects.
How to reproduce the bug?
- define Block property "content" with a mixed value (e.g. an array of ComponentDefinitions)
const block: BlockProperties = {
id: 'test',
label: 'Test'
content: [
{ type: 'image' },
{ type: 'text' }
]
}
What is the expected behavior? does compile
What is the current behavior? type error
Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (0)
No answers yet.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #5746
BUG: ColorPicker Offset incorrect when Panels are outside of Editor Container
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v122 Reproducible demo link https:/...
Issue #5154
BUG: TS2416: Property '_up' in type 'PropertyStack' is not assignable to the same property in base type 'PropertyComposite<PropertyStackProps>'
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? ---- Reproducible demo link https://codesa...
Issue #4732
BUG: Tabs behaviour after HTML import
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 107 (MacOS) Reproducible demo link...
Issue #5757
BUG: The link titles are not editable
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v122, Safari 17 Reproducible demo l...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.