@builder.io/react
Advanced tools
Comparing version
@@ -200,16 +200,34 @@ "use strict"; | ||
var innerComponentProperties = options.component && __assign({}, options.options, (options.component.options || options.component.data)); | ||
// TODO: handle rendering components | ||
return (react_1.default.createElement(TagName, __assign({}, omit_1.default(options, 'class'), { | ||
// TODO: suppress warnings about className in development | ||
class: "builder-block " + this.id + (block.class ? " " + block.class : '') + (block.component && !includes_1.default(['Image', 'Video', 'Banner'], componentName) | ||
? " builder-has-component" | ||
: '') + (options.class ? ' ' + options.class : ''), key: this.id + index, "builder-id": this.id }), | ||
InnerComponent && react_1.default.createElement(InnerComponent, __assign({ builderBlock: block }, innerComponentProperties)), | ||
var voidElements = [ | ||
'area', | ||
'base', | ||
'br', | ||
'col', | ||
'embed', | ||
'hr', | ||
'img', | ||
'input', | ||
'link', | ||
'meta', | ||
'param', | ||
'source', | ||
'track', | ||
'wbr' | ||
]; | ||
var isVoid = voidElements.indexOf(TagName) !== -1; | ||
// TODO: test it out | ||
return (react_1.default.createElement(react_1.default.Fragment, null, | ||
react_1.default.createElement(TagName, __assign({}, omit_1.default(options, 'class'), { | ||
// TODO: suppress warnings about className in development | ||
class: "builder-block " + this.id + (block.class ? " " + block.class : '') + (block.component && !includes_1.default(['Image', 'Video', 'Banner'], componentName) | ||
? " builder-has-component" | ||
: '') + (options.class ? ' ' + options.class : ''), key: this.id + index, "builder-id": this.id }), | ||
InnerComponent && react_1.default.createElement(InnerComponent, __assign({ builderBlock: block }, innerComponentProperties)), | ||
isVoid ? null : block.text || options.text ? ( | ||
// TODO: remove me! No longer in use (maybe with rich text will be back tho) | ||
react_1.default.createElement(TextTag, { dangerouslySetInnerHTML: { __html: options.text || block.text } })) : block.children && block.children.length ? (block.children.map(function (block, index) { return (react_1.default.createElement(BuilderBlock, { key: (_this.id || '') + index, block: block, index: index, size: _this.props.size, fieldName: _this.props.fieldName, child: _this.props.child })); })) : null), | ||
InnerComponent && | ||
// TODO: Put in get css() method! | ||
!isBlock && react_1.default.createElement("style", null, "." + this.id + " > * { height: 100%; width: 100%; }"), | ||
react_1.default.createElement("style", { className: "builder-style" }, this.css), | ||
block.text || options.text ? ( | ||
// TODO: remove me! No longer in use (maybe with rich text will be back tho) | ||
react_1.default.createElement(TextTag, { dangerouslySetInnerHTML: { __html: options.text || block.text } })) : block.children && block.children.length ? (block.children.map(function (block, index) { return (react_1.default.createElement(BuilderBlock, { key: (_this.id || '') + index, block: block, index: index, size: _this.props.size, fieldName: _this.props.fieldName, child: _this.props.child })); })) : null)); | ||
react_1.default.createElement("style", { className: "builder-style" }, this.css))); | ||
}; | ||
@@ -216,0 +234,0 @@ Object.defineProperty(BuilderBlock.prototype, "id", { |
{ | ||
"name": "@builder.io/react", | ||
"version": "0.1.97-0", | ||
"version": "0.1.97-1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3605748
0.09%26099
0.21%