@builder.io/sdk-solid 0.0.16 → 0.0.18

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.
Files changed (119) hide show
  1. package/README.md +5 -1
  2. package/package.json +17 -5
  3. package/solid-index.jsx +5 -0
  4. package/src/blocks/BaseText.jsx +9 -0
  5. package/src/blocks/button/button.jsx +9 -6
  6. package/src/blocks/columns/columns.jsx +54 -52
  7. package/src/blocks/columns/component-info.js +26 -1
  8. package/src/blocks/custom-code/custom-code.jsx +35 -38
  9. package/src/blocks/embed/component-info.js +21 -1
  10. package/src/blocks/embed/embed.jsx +37 -42
  11. package/src/blocks/embed/helpers.js +9 -0
  12. package/src/blocks/form/form.jsx +175 -176
  13. package/src/blocks/image/component-info.js +48 -1
  14. package/src/blocks/image/image.helpers.js +48 -0
  15. package/src/blocks/image/image.jsx +44 -13
  16. package/src/blocks/img/img.jsx +1 -1
  17. package/src/blocks/symbol/component-info.js +1 -0
  18. package/src/blocks/symbol/symbol.jsx +43 -14
  19. package/src/blocks/text/text.jsx +1 -1
  20. package/src/blocks/util.js +7 -0
  21. package/src/blocks/video/video.jsx +21 -2
  22. package/src/components/render-block/block-styles.jsx +41 -31
  23. package/src/components/render-block/render-block.helpers.js +23 -0
  24. package/src/components/render-block/render-block.jsx +205 -90
  25. package/src/components/render-block/render-component-with-context.jsx +36 -0
  26. package/src/components/render-block/render-component.jsx +28 -0
  27. package/src/components/render-block/render-repeated-block.jsx +36 -0
  28. package/src/components/render-block/types.js +0 -0
  29. package/src/components/render-blocks.jsx +42 -33
  30. package/src/components/render-content/components/render-styles.jsx +39 -42
  31. package/src/components/render-content/index.js +4 -0
  32. package/src/components/render-content/render-content.jsx +199 -128
  33. package/src/components/render-inlined-styles.jsx +21 -5
  34. package/src/constants/builder-registered-components.js +54 -0
  35. package/src/constants/device-sizes.js +3 -21
  36. package/src/context/builder.context.js +3 -1
  37. package/src/context/types.js +0 -0
  38. package/src/functions/camel-to-kebab-case.js +4 -0
  39. package/src/functions/convert-style-object.js +14 -0
  40. package/src/functions/evaluate.js +1 -1
  41. package/src/functions/extract-text-styles.js +22 -0
  42. package/src/functions/fast-clone.js +4 -0
  43. package/src/functions/get-block-actions-handler.js +12 -0
  44. package/src/functions/get-block-actions.js +2 -7
  45. package/src/functions/get-block-component-options.js +6 -1
  46. package/src/functions/get-block-styles.js +27 -19
  47. package/src/functions/get-builder-search-params/index.js +17 -2
  48. package/src/functions/get-content/ab-testing.js +99 -0
  49. package/src/functions/get-content/fn.test.js +1 -1
  50. package/src/functions/get-content/index.js +20 -62
  51. package/src/functions/get-content/types.js +0 -0
  52. package/src/functions/get-fetch.js +2 -2
  53. package/src/functions/get-processed-block.js +24 -11
  54. package/src/functions/get-processed-block.test.js +2 -1
  55. package/src/functions/mark-mutable.js +10 -0
  56. package/src/functions/register-component.js +45 -26
  57. package/src/functions/sanitize-styles.js +4 -0
  58. package/src/functions/track.js +108 -13
  59. package/src/helpers/ab-tests.js +16 -0
  60. package/src/helpers/cookie.js +79 -0
  61. package/src/helpers/css.js +28 -0
  62. package/src/helpers/flatten.js +34 -0
  63. package/src/helpers/localStorage.js +34 -0
  64. package/src/helpers/nullable.js +4 -0
  65. package/src/helpers/sessionId.js +49 -0
  66. package/src/helpers/time.js +5 -0
  67. package/src/helpers/url.js +10 -0
  68. package/src/helpers/url.test.js +15 -0
  69. package/src/helpers/uuid.js +13 -0
  70. package/src/helpers/visitorId.js +33 -0
  71. package/src/index-helpers/blocks-exports.js +11 -9
  72. package/src/scripts/init-editing.js +38 -38
  73. package/src/types/can-track.js +0 -0
  74. package/src/types/components.js +0 -0
  75. package/src/types/element.js +0 -0
  76. package/src/blocks/button/button.lite.tsx +0 -20
  77. package/src/blocks/button/index.js +0 -7
  78. package/src/blocks/columns/columns.lite.tsx +0 -102
  79. package/src/blocks/columns/index.js +0 -7
  80. package/src/blocks/custom-code/custom-code.lite.tsx +0 -67
  81. package/src/blocks/custom-code/index.js +0 -7
  82. package/src/blocks/embed/embed.lite.tsx +0 -59
  83. package/src/blocks/embed/index.js +0 -7
  84. package/src/blocks/form/form.lite.tsx +0 -293
  85. package/src/blocks/form/index.js +0 -7
  86. package/src/blocks/fragment/fragment.lite.tsx +0 -5
  87. package/src/blocks/fragment/index.js +0 -7
  88. package/src/blocks/image/image.lite.tsx +0 -83
  89. package/src/blocks/image/index.js +0 -7
  90. package/src/blocks/img/img.lite.tsx +0 -18
  91. package/src/blocks/img/index.js +0 -7
  92. package/src/blocks/input/index.js +0 -7
  93. package/src/blocks/input/input.lite.tsx +0 -20
  94. package/src/blocks/raw-text/index.js +0 -7
  95. package/src/blocks/raw-text/raw-text.lite.tsx +0 -10
  96. package/src/blocks/section/index.js +0 -7
  97. package/src/blocks/section/section.lite.tsx +0 -18
  98. package/src/blocks/select/index.js +0 -7
  99. package/src/blocks/select/select.lite.tsx +0 -28
  100. package/src/blocks/submit-button/index.js +0 -7
  101. package/src/blocks/submit-button/submit-button.lite.tsx +0 -9
  102. package/src/blocks/symbol/index.js +0 -7
  103. package/src/blocks/symbol/symbol.lite.tsx +0 -39
  104. package/src/blocks/text/index.js +0 -7
  105. package/src/blocks/text/text.lite.tsx +0 -5
  106. package/src/blocks/textarea/index.js +0 -7
  107. package/src/blocks/textarea/textarea.lite.tsx +0 -13
  108. package/src/blocks/video/index.js +0 -7
  109. package/src/blocks/video/video.lite.tsx +0 -26
  110. package/src/components/error-boundary.jsx +0 -5
  111. package/src/components/error-boundary.lite.tsx +0 -5
  112. package/src/components/render-block/block-styles.lite.tsx +0 -38
  113. package/src/components/render-block/render-block.lite.tsx +0 -119
  114. package/src/components/render-blocks.lite.tsx +0 -75
  115. package/src/components/render-content/components/render-styles.lite.tsx +0 -76
  116. package/src/components/render-content/render-content.lite.tsx +0 -232
  117. package/src/components/render-inlined-styles.lite.tsx +0 -5
  118. package/src/functions/macro-eval.js +0 -5
  119. package/src/functions/previewing-model-name.js +0 -11
@@ -1,5 +0,0 @@
1
- function FragmentComponent(props) {
2
- return <span>{props.children}</span>;
3
- }
4
-
5
- export default FragmentComponent;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./fragment.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,83 +0,0 @@
1
- import { Show } from "solid-js";
2
-
3
- import { css } from "solid-styled-components";
4
-
5
- function Image(props) {
6
- return (
7
- <div
8
- class={css({
9
- position: "relative",
10
- })}
11
- >
12
- <picture>
13
- <img
14
- class={
15
- "builder-image" +
16
- (props.className ? " " + props.className : "") +
17
- " " +
18
- css({
19
- opacity: "1",
20
- transition: "opacity 0.2s ease-in-out",
21
- position: "absolute",
22
- height: "100%",
23
- width: "100%",
24
- top: "0px",
25
- left: "0px",
26
- })
27
- }
28
- loading="lazy"
29
- alt={props.altText}
30
- aria-role={props.altText ? "presentation" : undefined}
31
- style={{
32
- "object-position": props.backgroundSize || "center",
33
- "object-fit": props.backgroundSize || "cover",
34
- }}
35
- src={props.image}
36
- srcset={props.srcset}
37
- sizes={props.sizes}
38
- />
39
- <source srcSet={props.srcset} />
40
- </picture>
41
- <Show
42
- when={
43
- props.aspectRatio &&
44
- !(props.fitContent && props.builderBlock?.children?.length)
45
- }
46
- >
47
- <div
48
- class={css({
49
- width: "100%",
50
- pointerEvents: "none",
51
- fontSize: "0",
52
- })}
53
- style={{
54
- "padding-top": props.aspectRatio * 100 + "%",
55
- }}
56
- >
57
- {" "}
58
- </div>
59
- </Show>
60
- <Show when={props.builderBlock?.children?.length && props.fitContent}>
61
- {props.children}
62
- </Show>
63
- <Show when={!props.fitContent}>
64
- <div
65
- class={css({
66
- display: "flex",
67
- flexDirection: "column",
68
- alignItems: "stretch",
69
- position: "absolute",
70
- top: "0",
71
- left: "0",
72
- width: "100%",
73
- height: "100%",
74
- })}
75
- >
76
- {props.children}
77
- </div>
78
- </Show>
79
- </div>
80
- );
81
- }
82
-
83
- export default Image;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./image.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,18 +0,0 @@
1
- import { isEditing } from "../../functions/is-editing.js";
2
-
3
- function ImgComponent(props) {
4
- return (
5
- <img
6
- {...props.attributes}
7
- style={{
8
- "object-fit": props.backgroundSize || "cover",
9
- "object-position": props.backgroundPosition || "center",
10
- }}
11
- key={(isEditing() && props.imgSrc) || "default-key"}
12
- alt={props.altText}
13
- src={props.imgSrc}
14
- />
15
- );
16
- }
17
-
18
- export default ImgComponent;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./img.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./input.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,20 +0,0 @@
1
- import { isEditing } from "../../functions/is-editing.js";
2
-
3
- function FormInputComponent(props) {
4
- return (
5
- <input
6
- {...props.attributes}
7
- key={
8
- isEditing() && props.defaultValue ? props.defaultValue : "default-key"
9
- }
10
- placeholder={props.placeholder}
11
- type={props.type}
12
- name={props.name}
13
- value={props.value}
14
- defaultValue={props.defaultValue}
15
- required={props.required}
16
- />
17
- );
18
- }
19
-
20
- export default FormInputComponent;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./raw-text.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,10 +0,0 @@
1
- function RawText(props) {
2
- return (
3
- <span
4
- class={props.attributes?.class || props.attributes?.className}
5
- innerHTML={props.text || ""}
6
- ></span>
7
- );
8
- }
9
-
10
- export default RawText;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./section.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,18 +0,0 @@
1
- function SectionComponent(props) {
2
- return (
3
- <section
4
- {...props.attributes}
5
- style={
6
- props.maxWidth && typeof props.maxWidth === "number"
7
- ? {
8
- "max-width": props.maxWidth,
9
- }
10
- : undefined
11
- }
12
- >
13
- {props.children}
14
- </section>
15
- );
16
- }
17
-
18
- export default SectionComponent;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./select.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,28 +0,0 @@
1
- import { For } from "solid-js";
2
-
3
- import { isEditing } from "../../functions/is-editing.js";
4
-
5
- function SelectComponent(props) {
6
- return (
7
- <select
8
- {...props.attributes}
9
- value={props.value}
10
- key={
11
- isEditing() && props.defaultValue ? props.defaultValue : "default-key"
12
- }
13
- defaultValue={props.defaultValue}
14
- name={props.name}
15
- >
16
- <For each={props.options}>
17
- {(option, _index) => {
18
- const index = _index();
19
- return (
20
- <option value={option.value}>{option.name || option.value}</option>
21
- );
22
- }}
23
- </For>
24
- </select>
25
- );
26
- }
27
-
28
- export default SelectComponent;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./submit-button.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,9 +0,0 @@
1
- function SubmitButton(props) {
2
- return (
3
- <button {...props.attributes} type="submit">
4
- {props.text}
5
- </button>
6
- );
7
- }
8
-
9
- export default SubmitButton;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./symbol.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,39 +0,0 @@
1
- import { createMutable } from "solid-js/store";
2
-
3
- import RenderContent from "../../components/render-content/render-content.js";
4
- import BuilderContext from "../../context/builder.context.js";
5
- import { getContent } from "../../functions/get-content/index.js";
6
-
7
- function Symbol(props) {
8
- const state = createMutable({ className: "builder-symbol", content: null });
9
-
10
- const builderContext = useContext(BuilderContext);
11
-
12
- onMount(() => {
13
- state.content = props.symbol?.content;
14
- });
15
-
16
- return (
17
- <div
18
- class={state.className}
19
- {...props.attributes}
20
- dataSet={{
21
- class: state.className,
22
- }}
23
- >
24
- <RenderContent
25
- apiKey={builderContext.apiKey}
26
- context={builderContext.context}
27
- data={{
28
- ...props.symbol?.data,
29
- ...builderContext.state,
30
- ...props.symbol?.state.content?.data?.state,
31
- }}
32
- model={props.symbol?.model}
33
- content={state.content}
34
- ></RenderContent>
35
- </div>
36
- );
37
- }
38
-
39
- export default Symbol;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./text.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,5 +0,0 @@
1
- function Text(props) {
2
- return <div innerHTML={props.text}></div>;
3
- }
4
-
5
- export default Text;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./textarea.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,13 +0,0 @@
1
- function Textarea(props) {
2
- return (
3
- <textarea
4
- {...props.attributes}
5
- placeholder={props.placeholder}
6
- name={props.name}
7
- value={props.value}
8
- defaultValue={props.defaultValue}
9
- ></textarea>
10
- );
11
- }
12
-
13
- export default Textarea;
@@ -1,7 +0,0 @@
1
- import { registerComponent } from "../../functions/register-component.js";
2
- import { componentInfo } from "./component-info.js";
3
- import component from "./video.js";
4
- var stdin_default = registerComponent(component, componentInfo);
5
- export {
6
- stdin_default as default
7
- };
@@ -1,26 +0,0 @@
1
- function Video(props) {
2
- return (
3
- <video
4
- {...props.attributes}
5
- preload="none"
6
- style={{
7
- width: "100%",
8
- height: "100%",
9
- ...props.attributes?.style,
10
- "object-fit": props.fit,
11
- "object-position": props.position,
12
- // Hack to get object fit to work as expected and
13
- // not have the video overflow
14
- "border-radius": 1,
15
- }}
16
- key={props.video || "no-src"}
17
- poster={props.posterImage}
18
- autoPlay={props.autoPlay}
19
- muted={props.muted}
20
- controls={props.controls}
21
- loop={props.loop}
22
- ></video>
23
- );
24
- }
25
-
26
- export default Video;
@@ -1,5 +0,0 @@
1
- function ErrorBoundary(props) {
2
- return <></>;
3
- }
4
-
5
- export default ErrorBoundary;
@@ -1,5 +0,0 @@
1
- function ErrorBoundary(props) {
2
- return <></>;
3
- }
4
-
5
- export default ErrorBoundary;
@@ -1,38 +0,0 @@
1
- import { createMutable } from "solid-js/store";
2
-
3
- import RenderInlinedStyles from "../render-inlined-styles.js";
4
-
5
- function BlockStyles(props) {
6
- const state = createMutable({
7
- camelToKebabCase(string: string) {
8
- return string
9
- .replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2")
10
- .toLowerCase();
11
- },
12
- get css() {
13
- // TODO: media queries
14
- const styleObject = props.block.responsiveStyles?.large;
15
-
16
- if (!styleObject) {
17
- return "";
18
- }
19
-
20
- let str = `.${props.block.id} {`;
21
-
22
- for (const key in styleObject) {
23
- const value = styleObject[key];
24
-
25
- if (typeof value === "string") {
26
- str += `${state.camelToKebabCase(key)}: ${value};`;
27
- }
28
- }
29
-
30
- str += "}";
31
- return str;
32
- },
33
- });
34
-
35
- return <RenderInlinedStyles styles={state.css}></RenderInlinedStyles>;
36
- }
37
-
38
- export default BlockStyles;
@@ -1,119 +0,0 @@
1
- import { useContext, Show, For } from "solid-js";
2
- import { Dynamic } from "solid-js/web";
3
- import { createMutable } from "solid-js/store";
4
-
5
- import { TARGET } from "../../constants/target.js";
6
- import BuilderContext from "../../context/builder.context.js";
7
- import { getBlockActions } from "../../functions/get-block-actions.js";
8
- import { getBlockComponentOptions } from "../../functions/get-block-component-options.js";
9
- import { getBlockProperties } from "../../functions/get-block-properties.js";
10
- import { getBlockStyles } from "../../functions/get-block-styles.js";
11
- import { getBlockTag } from "../../functions/get-block-tag.js";
12
- import { getProcessedBlock } from "../../functions/get-processed-block.js";
13
- import { components } from "../../functions/register-component.js";
14
- import BlockStyles from "./block-styles.js";
15
-
16
- function RenderBlock(props) {
17
- const state = createMutable({
18
- get component() {
19
- const componentName = state.useBlock.component?.name;
20
-
21
- if (!componentName) {
22
- return null;
23
- }
24
-
25
- const ref = components[componentName];
26
-
27
- if (componentName && !ref) {
28
- // TODO: Public doc page with more info about this message
29
- console.warn(`
30
- Could not find a registered component named "${componentName}".
31
- If you registered it, is the file that registered it imported by the file that needs to render it?`);
32
- }
33
-
34
- return ref;
35
- },
36
- get componentInfo() {
37
- return state.component?.info;
38
- },
39
- get componentRef() {
40
- return state.component?.component;
41
- },
42
- get tagName() {
43
- return getBlockTag(state.useBlock);
44
- },
45
- get useBlock() {
46
- return getProcessedBlock({
47
- block: props.block,
48
- state: builderContext.state,
49
- context: builderContext.context,
50
- });
51
- },
52
- get propertiesAndActions() {
53
- return {
54
- ...getBlockProperties(state.useBlock),
55
- ...getBlockActions({
56
- block: state.useBlock,
57
- state: builderContext.state,
58
- context: builderContext.context,
59
- }),
60
- };
61
- },
62
- get css() {
63
- return getBlockStyles(state.useBlock);
64
- },
65
- get componentOptions() {
66
- return getBlockComponentOptions(state.useBlock);
67
- },
68
- get children() {
69
- // TO-DO: When should `canHaveChildren` dictate rendering?
70
- // This is currently commented out because some Builder components (e.g. Box) do not have `canHaveChildren: true`,
71
- // but still receive and need to render children.
72
- // return state.componentInfo?.canHaveChildren ? state.useBlock.children : [];
73
- return state.useBlock.children ?? [];
74
- },
75
- get noCompRefChildren() {
76
- return state.componentRef ? [] : state.children;
77
- },
78
- });
79
-
80
- const builderContext = useContext(BuilderContext);
81
-
82
- return (
83
- <>
84
- <Show when={!state.componentInfo?.noWrap}>
85
- <Dynamic
86
- {...state.propertiesAndActions}
87
- style={state.css}
88
- component={state.tagName}
89
- >
90
- <Show when={TARGET === "vue" || TARGET === "svelte"}>
91
- <BlockStyles block={state.useBlock}></BlockStyles>
92
- </Show>
93
- <Show when={state.componentRef}>
94
- <Dynamic
95
- {...state.componentOptions}
96
- builderBlock={state.useBlock}
97
- component={state.componentRef}
98
- >
99
- <For each={state.children}>
100
- {(child, _index) => {
101
- const index = _index();
102
- return <RenderBlock block={child}></RenderBlock>;
103
- }}
104
- </For>
105
- </Dynamic>
106
- </Show>
107
- <For each={state.noCompRefChildren}>
108
- {(child, _index) => {
109
- const index = _index();
110
- return <RenderBlock block={child}></RenderBlock>;
111
- }}
112
- </For>
113
- </Dynamic>
114
- </Show>
115
- </>
116
- );
117
- }
118
-
119
- export default RenderBlock;
@@ -1,75 +0,0 @@
1
- import { Show, For } from "solid-js";
2
-
3
- import { createMutable } from "solid-js/store";
4
- import { css } from "solid-styled-components";
5
-
6
- import { isEditing } from "../functions/is-editing.js";
7
- import RenderBlock from "./render-block/render-block.js";
8
-
9
- function RenderBlocks(props) {
10
- const state = createMutable({
11
- get className() {
12
- return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
13
- },
14
- onClick() {
15
- if (isEditing() && !props.blocks?.length) {
16
- window.parent?.postMessage(
17
- {
18
- type: "builder.clickEmptyBlocks",
19
- data: {
20
- parentElementId: props.parent,
21
- dataPath: props.path,
22
- },
23
- },
24
- "*"
25
- );
26
- }
27
- },
28
- onMouseEnter() {
29
- if (isEditing() && !props.blocks?.length) {
30
- window.parent?.postMessage(
31
- {
32
- type: "builder.hoverEmptyBlocks",
33
- data: {
34
- parentElementId: props.parent,
35
- dataPath: props.path,
36
- },
37
- },
38
- "*"
39
- );
40
- }
41
- },
42
- });
43
-
44
- return (
45
- <div
46
- class={
47
- state.className +
48
- " " +
49
- css({
50
- display: "flex",
51
- flexDirection: "column",
52
- alignItems: "stretch",
53
- })
54
- }
55
- builder-path={props.path}
56
- builder-parent-id={props.parent}
57
- dataSet={{
58
- class: state.className,
59
- }}
60
- onClick={(event) => state.onClick()}
61
- onMouseEnter={(event) => state.onMouseEnter()}
62
- >
63
- <Show when={props.blocks}>
64
- <For each={props.blocks}>
65
- {(block, _index) => {
66
- const index = _index();
67
- return <RenderBlock key={block.id} block={block}></RenderBlock>;
68
- }}
69
- </For>
70
- </Show>
71
- </div>
72
- );
73
- }
74
-
75
- export default RenderBlocks;