@pronto-tools-and-more/components-renderer 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -15,10 +15,15 @@ export const renderElement = (element) => {
|
|
15
15
|
? element.children.map(renderElement)
|
16
16
|
: [];
|
17
17
|
const content = hasComplexChildren ? "" : element.children[0] || "";
|
18
|
+
const className =
|
19
|
+
element.props && element.props.className
|
20
|
+
? element.props.className
|
21
|
+
: undefined;
|
18
22
|
return CreateFakeSection.createFakeSection([
|
19
23
|
{
|
20
24
|
type: "html",
|
21
25
|
tag: element.tag,
|
26
|
+
class: className,
|
22
27
|
content,
|
23
28
|
},
|
24
29
|
...renderedChildren,
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import * as Assert from "../Assert/Assert.js";
|
2
2
|
import * as CreateViews from "../CreateViews/CreateViews.js";
|
3
|
-
import * as FakeNode from "../FakeNode/FakeNode.js";
|
4
3
|
import * as LoadRoutes from "../LoadRoutes/LoadRoutes.js";
|
5
4
|
import * as LoadSwc from "../LoadSwc/LoadSwc.js";
|
6
5
|
import * as RenderView from "../RenderView/RenderView.js";
|
@@ -15,59 +14,5 @@ export const renderViews = async (componentsPathMain, tsconfigPath) => {
|
|
15
14
|
// TODO return views string instead of json for faster performance?
|
16
15
|
const views = CreateViews.createViews(values);
|
17
16
|
const rendered = views.map(RenderView.renderView);
|
18
|
-
|
19
|
-
// console.log(JSON.stringify(rendered, null, 2));
|
20
|
-
if (Math) {
|
21
|
-
return rendered;
|
22
|
-
}
|
23
|
-
const newViews = [
|
24
|
-
{
|
25
|
-
content: [
|
26
|
-
{
|
27
|
-
type: "section",
|
28
|
-
content: [
|
29
|
-
FakeNode.fakeNode,
|
30
|
-
{
|
31
|
-
type: "html",
|
32
|
-
tag: "div",
|
33
|
-
className: "outer",
|
34
|
-
content: "",
|
35
|
-
},
|
36
|
-
{
|
37
|
-
type: "html",
|
38
|
-
tag: "div",
|
39
|
-
className: "inner",
|
40
|
-
content: "child",
|
41
|
-
},
|
42
|
-
// {
|
43
|
-
// type: "section",
|
44
|
-
// content: [
|
45
|
-
// FakeNode.fakeNode,
|
46
|
-
// {
|
47
|
-
// type: "html",
|
48
|
-
// tag: "p",
|
49
|
-
// content: "inner",
|
50
|
-
// },
|
51
|
-
// ],
|
52
|
-
// },
|
53
|
-
],
|
54
|
-
},
|
55
|
-
// {
|
56
|
-
// type: "section",
|
57
|
-
// content: [
|
58
|
-
// FakeNode.fakeNode,
|
59
|
-
// {
|
60
|
-
// type: "html",
|
61
|
-
// tag: "div",
|
62
|
-
// content: "23",
|
63
|
-
// },
|
64
|
-
// ],
|
65
|
-
// },
|
66
|
-
],
|
67
|
-
name: "test",
|
68
|
-
path: "test",
|
69
|
-
appBar: "login",
|
70
|
-
},
|
71
|
-
];
|
72
|
-
return newViews;
|
17
|
+
return rendered;
|
73
18
|
};
|