@pronto-tools-and-more/components-renderer 5.4.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -13,23 +13,26 @@ export const renderElement = (element) => {
|
|
13
13
|
if (typeof element.tag === "function") {
|
14
14
|
const vnode = element.tag({
|
15
15
|
...element.props,
|
16
|
-
children: element.children,
|
17
16
|
});
|
18
|
-
|
17
|
+
const rendered = renderElement(vnode);
|
18
|
+
return rendered;
|
19
19
|
}
|
20
20
|
const hasComplexChildren = HasComplexChildren.hasComplexChildren(element);
|
21
21
|
const renderedChildren = hasComplexChildren
|
22
22
|
? element.children.map(renderElement)
|
23
23
|
: [];
|
24
24
|
const content = hasComplexChildren ? "" : element.children[0] || "";
|
25
|
-
const
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
const props = element.props ? element.props : {};
|
26
|
+
const { className, ...rest } = props;
|
27
|
+
let attributes;
|
28
|
+
if (Object.keys(rest).length > 0) {
|
29
|
+
attributes = rest;
|
30
|
+
}
|
29
31
|
return CreateFakeSection.createFakeSection([
|
30
32
|
{
|
31
33
|
type: "html",
|
32
34
|
tag: element.tag,
|
35
|
+
attributes,
|
33
36
|
class: className,
|
34
37
|
content,
|
35
38
|
},
|