@builder.io/sdk-svelte 0.0.1-3 → 0.0.1-30
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/README.md +19 -0
- package/package.json +8 -1
- package/src/blocks/button/button.svelte +25 -47
- package/src/blocks/columns/columns.svelte +115 -102
- package/src/blocks/columns/component-info.js +25 -1
- package/src/blocks/custom-code/custom-code.svelte +59 -61
- package/src/blocks/embed/component-info.js +20 -1
- package/src/blocks/embed/embed.svelte +38 -56
- package/src/blocks/embed/helpers.js +9 -0
- package/src/blocks/form/form.svelte +264 -294
- package/src/blocks/fragment/fragment.svelte +1 -25
- package/src/blocks/image/component-info.js +47 -1
- package/src/blocks/image/image.helpers.js +48 -0
- package/src/blocks/image/image.svelte +126 -116
- package/src/blocks/img/img.svelte +25 -35
- package/src/blocks/input/input.svelte +17 -30
- package/src/blocks/raw-text/raw-text.svelte +4 -25
- package/src/blocks/section/section.svelte +20 -35
- package/src/blocks/select/select.svelte +16 -36
- package/src/blocks/submit-button/submit-button.svelte +4 -29
- package/src/blocks/symbol/component-info.js +1 -0
- package/src/blocks/symbol/symbol.svelte +67 -52
- package/src/blocks/text/text.svelte +1 -24
- package/src/blocks/textarea/textarea.svelte +5 -28
- package/src/blocks/video/video.svelte +60 -41
- package/src/components/render-block/block-styles.svelte +54 -50
- package/src/components/render-block/render-block.helpers.js +23 -0
- package/src/components/render-block/render-block.svelte +199 -159
- package/src/components/render-block/render-component.svelte +20 -0
- package/src/components/render-block/render-repeated-block.svelte +29 -0
- package/src/components/render-block/types.js +0 -0
- package/src/components/render-blocks.svelte +74 -79
- package/src/components/render-content/components/render-styles.svelte +43 -63
- package/src/components/render-content/index.js +4 -0
- package/src/components/render-content/render-content.svelte +266 -207
- package/src/components/render-inlined-styles.svelte +15 -43
- package/src/constants/builder-registered-components.js +48 -0
- package/src/constants/device-sizes.js +3 -21
- package/src/context/builder.context.js +7 -1
- package/src/functions/camel-to-kebab-case.js +4 -0
- package/src/functions/convert-style-object.js +6 -0
- package/src/functions/get-block-component-options.js +6 -1
- package/src/functions/get-block-styles.js +7 -4
- package/src/functions/get-builder-search-params/index.js +12 -1
- package/src/functions/get-content/ab-testing.js +38 -0
- package/src/functions/get-content/fn.test.js +1 -1
- package/src/functions/get-content/index.js +16 -58
- package/src/functions/get-content/types.js +0 -0
- package/src/functions/get-processed-block.js +15 -8
- package/src/functions/get-processed-block.test.js +2 -1
- package/src/functions/register-component.js +45 -26
- package/src/functions/sanitize-styles.js +5 -0
- package/src/helpers/css.js +12 -0
- package/src/helpers/flatten.js +34 -0
- package/src/index-helpers/blocks-exports.js +10 -8
- package/src/types/components.js +0 -0
- package/src/types/element.js +0 -0
- package/src/blocks/button/index.js +0 -7
- package/src/blocks/columns/index.js +0 -7
- package/src/blocks/custom-code/index.js +0 -7
- package/src/blocks/embed/index.js +0 -7
- package/src/blocks/form/index.js +0 -7
- package/src/blocks/fragment/index.js +0 -7
- package/src/blocks/image/index.js +0 -7
- package/src/blocks/img/index.js +0 -7
- package/src/blocks/input/index.js +0 -7
- package/src/blocks/raw-text/index.js +0 -7
- package/src/blocks/section/index.js +0 -7
- package/src/blocks/select/index.js +0 -7
- package/src/blocks/submit-button/index.js +0 -7
- package/src/blocks/symbol/index.js +0 -7
- package/src/blocks/text/index.js +0 -7
- package/src/blocks/textarea/index.js +0 -7
- package/src/blocks/video/index.js +0 -7
- package/src/components/error-boundary.svelte +0 -26
- package/src/functions/macro-eval.js +0 -5
- package/src/functions/previewing-model-name.js +0 -11
|
@@ -1,163 +1,203 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
console.warn(`
|
|
2
|
+
import BuilderContext from "../../context/builder.context";
|
|
3
|
+
import { getBlockActions } from "../../functions/get-block-actions.js";
|
|
4
|
+
import { getBlockComponentOptions } from "../../functions/get-block-component-options.js";
|
|
5
|
+
import { getBlockProperties } from "../../functions/get-block-properties.js";
|
|
6
|
+
import { getBlockStyles } from "../../functions/get-block-styles.js";
|
|
7
|
+
import { getBlockTag } from "../../functions/get-block-tag.js";
|
|
8
|
+
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
9
|
+
import { evaluate } from "../../functions/evaluate.js";
|
|
10
|
+
import BlockStyles from "./block-styles.svelte";
|
|
11
|
+
import { isEmptyHtmlElement } from "./render-block.helpers.js";
|
|
12
|
+
import RenderComponent from "./render-component.svelte";
|
|
13
|
+
import RenderRepeatedBlock from "./render-repeated-block.svelte";
|
|
14
|
+
|
|
15
|
+
import { getContext, setContext } from "svelte";
|
|
16
|
+
|
|
17
|
+
export let block;
|
|
18
|
+
|
|
19
|
+
$: component = () => {
|
|
20
|
+
const componentName = getProcessedBlock({
|
|
21
|
+
block: block,
|
|
22
|
+
state: builderContext.state,
|
|
23
|
+
context: builderContext.context,
|
|
24
|
+
evaluateBindings: false,
|
|
25
|
+
}).component?.name;
|
|
26
|
+
|
|
27
|
+
if (!componentName) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const ref = builderContext.registeredComponents[componentName];
|
|
32
|
+
|
|
33
|
+
if (!ref) {
|
|
34
|
+
// TODO: Public doc page with more info about this message
|
|
35
|
+
console.warn(`
|
|
37
36
|
Could not find a registered component named "${componentName}".
|
|
38
37
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return ref;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
38
|
+
return undefined;
|
|
39
|
+
} else {
|
|
40
|
+
return ref;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
$: componentInfo = () => {
|
|
45
|
+
if (component()) {
|
|
46
|
+
const { component: _, ...info } = component();
|
|
47
|
+
return info;
|
|
48
|
+
} else {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
$: componentRef = () => {
|
|
54
|
+
return component?.()?.component;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
$: tagName = () => {
|
|
58
|
+
return getBlockTag(useBlock());
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
$: useBlock = () => {
|
|
62
|
+
return repeatItemData()
|
|
63
|
+
? block
|
|
64
|
+
: getProcessedBlock({
|
|
65
|
+
block: block,
|
|
66
|
+
state: builderContext.state,
|
|
67
|
+
context: builderContext.context,
|
|
68
|
+
evaluateBindings: true,
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
$: attributes = () => {
|
|
73
|
+
return {
|
|
74
|
+
...getBlockProperties(useBlock()),
|
|
75
|
+
...getBlockActions({
|
|
76
|
+
block: useBlock(),
|
|
77
|
+
state: builderContext.state,
|
|
78
|
+
context: builderContext.context,
|
|
79
|
+
}),
|
|
80
|
+
style: getBlockStyles(useBlock()),
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
$: shouldWrap = () => {
|
|
85
|
+
return !componentInfo?.()?.noWrap;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
$: componentOptions = () => {
|
|
89
|
+
return {
|
|
90
|
+
...getBlockComponentOptions(useBlock()),
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* These attributes are passed to the wrapper element when there is one. If `noWrap` is set to true, then
|
|
94
|
+
* they are provided to the component itself directly.
|
|
95
|
+
*/
|
|
96
|
+
...(shouldWrap()
|
|
97
|
+
? {}
|
|
98
|
+
: {
|
|
99
|
+
attributes: attributes(),
|
|
100
|
+
}),
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
$: renderComponentProps = () => {
|
|
105
|
+
return {
|
|
106
|
+
blockChildren: children(),
|
|
107
|
+
componentRef: componentRef(),
|
|
108
|
+
componentOptions: componentOptions(),
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
$: children = () => {
|
|
113
|
+
// TO-DO: When should `canHaveChildren` dictate rendering?
|
|
114
|
+
// This is currently commented out because some Builder components (e.g. Box) do not have `canHaveChildren: true`,
|
|
115
|
+
// but still receive and need to render children.
|
|
116
|
+
// return componentInfo?.()?.canHaveChildren ? useBlock().children : [];
|
|
117
|
+
return useBlock().children ?? [];
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
$: childrenWithoutParentComponent = () => {
|
|
121
|
+
/**
|
|
122
|
+
* When there is no `componentRef`, there might still be children that need to be rendered. In this case,
|
|
123
|
+
* we render them outside of `componentRef`.
|
|
124
|
+
* NOTE: We make sure not to render this if `repeatItemData` is non-null, because that means we are rendering an array of
|
|
125
|
+
* blocks, and the children will be repeated within those blocks.
|
|
126
|
+
*/
|
|
127
|
+
const shouldRenderChildrenOutsideRef = !componentRef() && !repeatItemData();
|
|
128
|
+
return shouldRenderChildrenOutsideRef ? children() : [];
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
$: repeatItemData = () => {
|
|
132
|
+
/**
|
|
133
|
+
* we don't use `useBlock()` here because the processing done within its logic includes evaluating the block's bindings,
|
|
134
|
+
* which will not work if there is a repeat.
|
|
135
|
+
*/
|
|
136
|
+
const { repeat, ...blockWithoutRepeat } = block;
|
|
137
|
+
|
|
138
|
+
if (!repeat?.collection) {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const itemsArray = evaluate({
|
|
143
|
+
code: repeat.collection,
|
|
144
|
+
state: builderContext.state,
|
|
145
|
+
context: builderContext.context,
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
if (!Array.isArray(itemsArray)) {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const collectionName = repeat.collection.split(".").pop();
|
|
153
|
+
const itemNameToUse =
|
|
154
|
+
repeat.itemName || (collectionName ? collectionName + "Item" : "item");
|
|
155
|
+
const repeatArray = itemsArray.map((item, index) => ({
|
|
156
|
+
context: {
|
|
157
|
+
...builderContext,
|
|
158
|
+
state: {
|
|
159
|
+
...builderContext.state,
|
|
160
|
+
$index: index,
|
|
161
|
+
$item: item,
|
|
162
|
+
[itemNameToUse]: item,
|
|
163
|
+
[`$${itemNameToUse}Index`]: index,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
block: blockWithoutRepeat,
|
|
167
|
+
}));
|
|
168
|
+
return repeatArray;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
let builderContext = getContext(BuilderContext.key);
|
|
172
|
+
</script>
|
|
173
|
+
|
|
174
|
+
{#if shouldWrap()}
|
|
175
|
+
{#if !isEmptyHtmlElement(tagName())}
|
|
176
|
+
<svelte:element this={tagName()} {...attributes()}>
|
|
177
|
+
{#if repeatItemData()}
|
|
178
|
+
{#each repeatItemData() as data, index (index)}
|
|
179
|
+
<RenderRepeatedBlock
|
|
180
|
+
repeatContext={data.context}
|
|
181
|
+
block={data.block}
|
|
182
|
+
/>
|
|
183
|
+
{/each}
|
|
184
|
+
{/if}
|
|
185
|
+
|
|
186
|
+
{#if !repeatItemData()}
|
|
187
|
+
<RenderComponent {...renderComponentProps()} />
|
|
188
|
+
{/if}
|
|
189
|
+
|
|
190
|
+
{#each childrenWithoutParentComponent() as child, undefined ("render-block-" + child.id)}
|
|
191
|
+
<svelte:self block={child} />
|
|
192
|
+
{/each}
|
|
193
|
+
|
|
194
|
+
{#each childrenWithoutParentComponent() as child, undefined ("block-style-" + child.id)}
|
|
195
|
+
<BlockStyles block={child} />
|
|
196
|
+
{/each}
|
|
197
|
+
</svelte:element>
|
|
198
|
+
{:else}
|
|
199
|
+
<svelte:element this={tagName()} {...attributes()} />
|
|
200
|
+
{/if}
|
|
152
201
|
{:else}
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
{#each children() as child, index }
|
|
157
|
-
<svelte:self block={child} ></svelte:self>
|
|
158
|
-
{/each}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
</svelte:component>
|
|
162
|
-
|
|
163
|
-
{/if}
|
|
202
|
+
<RenderComponent {...renderComponentProps()} />
|
|
203
|
+
{/if}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import BlockStyles from "./block-styles.svelte";
|
|
3
|
+
import RenderBlock from "./render-block.svelte";
|
|
4
|
+
|
|
5
|
+
export let componentRef;
|
|
6
|
+
export let componentOptions;
|
|
7
|
+
export let blockChildren;
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
{#if componentRef}
|
|
11
|
+
<svelte:component this={componentRef} {...componentOptions}>
|
|
12
|
+
{#each blockChildren as child, undefined ("render-block-" + child.id)}
|
|
13
|
+
<RenderBlock block={child} />
|
|
14
|
+
{/each}
|
|
15
|
+
|
|
16
|
+
{#each blockChildren as child, undefined ("block-style-" + child.id)}
|
|
17
|
+
<BlockStyles block={child} />
|
|
18
|
+
{/each}
|
|
19
|
+
</svelte:component>
|
|
20
|
+
{/if}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import BuilderContext from "../../context/builder.context";
|
|
3
|
+
import RenderBlock from "./render-block.svelte";
|
|
4
|
+
|
|
5
|
+
import { getContext, setContext } from "svelte";
|
|
6
|
+
|
|
7
|
+
export let block;
|
|
8
|
+
export let repeatContext;
|
|
9
|
+
|
|
10
|
+
setContext(BuilderContext.key, {
|
|
11
|
+
get content() {
|
|
12
|
+
return repeatContext.content;
|
|
13
|
+
},
|
|
14
|
+
get state() {
|
|
15
|
+
return repeatContext.state;
|
|
16
|
+
},
|
|
17
|
+
get context() {
|
|
18
|
+
return repeatContext.context;
|
|
19
|
+
},
|
|
20
|
+
get apiKey() {
|
|
21
|
+
return repeatContext.apiKey;
|
|
22
|
+
},
|
|
23
|
+
get registeredComponents() {
|
|
24
|
+
return repeatContext.registeredComponents;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<RenderBlock {block} />
|
|
File without changes
|
|
@@ -1,82 +1,77 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
data: {
|
|
23
|
-
parentElementId: parent,
|
|
24
|
-
dataPath: path
|
|
2
|
+
import { isEditing } from "../functions/is-editing.js";
|
|
3
|
+
import BlockStyles from "./render-block/block-styles.svelte";
|
|
4
|
+
import RenderBlock from "./render-block/render-block.svelte";
|
|
5
|
+
|
|
6
|
+
export let blocks;
|
|
7
|
+
export let parent;
|
|
8
|
+
export let path;
|
|
9
|
+
|
|
10
|
+
const onClick = function onClick() {
|
|
11
|
+
if (isEditing() && !blocks?.length) {
|
|
12
|
+
window.parent?.postMessage(
|
|
13
|
+
{
|
|
14
|
+
type: "builder.clickEmptyBlocks",
|
|
15
|
+
data: {
|
|
16
|
+
parentElementId: parent,
|
|
17
|
+
dataPath: path,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
"*"
|
|
21
|
+
);
|
|
25
22
|
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onMouseEnter = function onMouseEnter() {
|
|
26
|
+
if (isEditing() && !blocks?.length) {
|
|
27
|
+
window.parent?.postMessage(
|
|
28
|
+
{
|
|
29
|
+
type: "builder.hoverEmptyBlocks",
|
|
30
|
+
data: {
|
|
31
|
+
parentElementId: parent,
|
|
32
|
+
dataPath: path,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
"*"
|
|
36
|
+
);
|
|
37
37
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{#each blocks as block,
|
|
66
|
-
<
|
|
67
|
-
{/each}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
.div {
|
|
79
|
-
display: flex;
|
|
80
|
-
flex-direction: column;
|
|
81
|
-
align-items: stretch; }
|
|
82
|
-
</style>
|
|
38
|
+
};
|
|
39
|
+
$: className = () => {
|
|
40
|
+
return "builder-blocks" + (!blocks?.length ? " no-blocks" : "");
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<div
|
|
45
|
+
class={className() + " div"}
|
|
46
|
+
builder-path={path}
|
|
47
|
+
builder-parent-id={parent}
|
|
48
|
+
dataSet={{
|
|
49
|
+
class: className(),
|
|
50
|
+
}}
|
|
51
|
+
on:click={(event) => {
|
|
52
|
+
onClick();
|
|
53
|
+
}}
|
|
54
|
+
on:mouseenter={(event) => {
|
|
55
|
+
onMouseEnter();
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
{#if blocks}
|
|
59
|
+
{#each blocks as block, undefined ("render-block-" + block.id)}
|
|
60
|
+
<RenderBlock {block} />
|
|
61
|
+
{/each}
|
|
62
|
+
{/if}
|
|
63
|
+
|
|
64
|
+
{#if blocks}
|
|
65
|
+
{#each blocks as block, undefined ("block-style-" + block.id)}
|
|
66
|
+
<BlockStyles {block} />
|
|
67
|
+
{/each}
|
|
68
|
+
{/if}
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<style>
|
|
72
|
+
.div {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
align-items: stretch;
|
|
76
|
+
}
|
|
77
|
+
</style>
|