@builder.io/sdk-solid 0.5.8 → 0.6.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/README.md +0 -4
- package/dist/index.d.ts +51 -0
- package/lib/browser/dev.js +4790 -0
- package/lib/browser/dev.jsx +4392 -0
- package/lib/browser/index.js +4767 -0
- package/lib/browser/index.jsx +4374 -0
- package/lib/edge/dev.js +7921 -0
- package/lib/edge/dev.jsx +7525 -0
- package/lib/edge/index.js +7898 -0
- package/lib/edge/index.jsx +7507 -0
- package/lib/node/dev.js +4790 -0
- package/lib/node/dev.jsx +4392 -0
- package/lib/node/index.js +4767 -0
- package/lib/node/index.jsx +4374 -0
- package/package.json +86 -14
- package/CHANGELOG.md +0 -98
- package/solid-index.jsx +0 -5
- package/src/blocks/BaseText.jsx +0 -11
- package/src/blocks/button/button.jsx +0 -41
- package/src/blocks/button/component-info.js +0 -34
- package/src/blocks/columns/columns.jsx +0 -174
- package/src/blocks/columns/component-info.js +0 -218
- package/src/blocks/custom-code/component-info.js +0 -24
- package/src/blocks/custom-code/custom-code.jsx +0 -62
- package/src/blocks/embed/component-info.js +0 -37
- package/src/blocks/embed/embed.jsx +0 -50
- package/src/blocks/embed/helpers.js +0 -3
- package/src/blocks/form/component-info.js +0 -223
- package/src/blocks/form/form.jsx +0 -5
- package/src/blocks/fragment/component-info.js +0 -8
- package/src/blocks/fragment/fragment.jsx +0 -5
- package/src/blocks/helpers.js +0 -27
- package/src/blocks/image/component-info.js +0 -122
- package/src/blocks/image/image.helpers.js +0 -46
- package/src/blocks/image/image.jsx +0 -122
- package/src/blocks/img/component-info.js +0 -15
- package/src/blocks/img/img.jsx +0 -20
- package/src/blocks/input/component-info.js +0 -45
- package/src/blocks/input/input.jsx +0 -22
- package/src/blocks/raw-text/component-info.js +0 -11
- package/src/blocks/raw-text/raw-text.jsx +0 -10
- package/src/blocks/section/component-info.js +0 -41
- package/src/blocks/section/section.jsx +0 -26
- package/src/blocks/select/component-info.js +0 -44
- package/src/blocks/select/select.jsx +0 -30
- package/src/blocks/submit-button/component-info.js +0 -23
- package/src/blocks/submit-button/submit-button.jsx +0 -11
- package/src/blocks/symbol/component-info.js +0 -35
- package/src/blocks/symbol/symbol.helpers.js +0 -60
- package/src/blocks/symbol/symbol.jsx +0 -64
- package/src/blocks/text/component-info.js +0 -20
- package/src/blocks/text/text.jsx +0 -14
- package/src/blocks/textarea/component-info.js +0 -38
- package/src/blocks/textarea/textarea.jsx +0 -16
- package/src/blocks/video/component-info.js +0 -83
- package/src/blocks/video/video.jsx +0 -61
- package/src/components/block/block.helpers.js +0 -99
- package/src/components/block/block.jsx +0 -167
- package/src/components/block/components/block-styles.jsx +0 -85
- package/src/components/block/components/block-wrapper.jsx +0 -50
- package/src/components/block/components/component-ref/component-ref.helpers.js +0 -41
- package/src/components/block/components/component-ref/component-ref.jsx +0 -58
- package/src/components/block/components/interactive-element.jsx +0 -30
- package/src/components/block/components/repeated-block.jsx +0 -20
- package/src/components/block/types.js +0 -0
- package/src/components/blocks/blocks-wrapper.jsx +0 -66
- package/src/components/blocks/blocks.jsx +0 -57
- package/src/components/content/components/enable-editor.jsx +0 -347
- package/src/components/content/components/styles.helpers.js +0 -56
- package/src/components/content/components/styles.jsx +0 -36
- package/src/components/content/content.helpers.js +0 -48
- package/src/components/content/content.jsx +0 -136
- package/src/components/content/content.types.js +0 -0
- package/src/components/content/index.js +0 -2
- package/src/components/content/wrap-component-ref.js +0 -2
- package/src/components/content-variants/content-variants.jsx +0 -115
- package/src/components/content-variants/content-variants.types.js +0 -0
- package/src/components/content-variants/helpers.js +0 -158
- package/src/components/inlined-script.jsx +0 -5
- package/src/components/inlined-styles.jsx +0 -5
- package/src/constants/builder-registered-components.js +0 -63
- package/src/constants/device-sizes.js +0 -48
- package/src/constants/sdk-version.js +0 -1
- package/src/constants/target.js +0 -4
- package/src/context/builder.context.js +0 -16
- package/src/context/components.context.js +0 -5
- package/src/context/types.js +0 -0
- package/src/functions/apply-patch-with-mutation.js +0 -66
- package/src/functions/camel-to-kebab-case.js +0 -2
- package/src/functions/evaluate/acorn-interpreter.js +0 -2876
- package/src/functions/evaluate/evaluate.js +0 -79
- package/src/functions/evaluate/index.js +0 -2
- package/src/functions/evaluate/non-node-runtime/index.js +0 -18
- package/src/functions/evaluate/non-node-runtime/non-node-runtime.js +0 -92
- package/src/functions/evaluate/types.js +0 -0
- package/src/functions/event-handler-name.js +0 -5
- package/src/functions/extract-text-styles.js +0 -14
- package/src/functions/fast-clone.js +0 -2
- package/src/functions/fetch-builder-props.js +0 -60
- package/src/functions/get-block-actions-handler.js +0 -11
- package/src/functions/get-block-actions.js +0 -29
- package/src/functions/get-block-component-options.js +0 -27
- package/src/functions/get-block-properties.js +0 -63
- package/src/functions/get-builder-search-params/index.js +0 -33
- package/src/functions/get-content/generate-content-url.js +0 -59
- package/src/functions/get-content/index.js +0 -116
- package/src/functions/get-content/types.js +0 -0
- package/src/functions/get-fetch.js +0 -12
- package/src/functions/get-global-this.js +0 -16
- package/src/functions/get-processed-block.js +0 -74
- package/src/functions/get-react-native-block-styles.js +0 -32
- package/src/functions/is-browser.js +0 -4
- package/src/functions/is-editing.js +0 -6
- package/src/functions/is-iframe.js +0 -5
- package/src/functions/is-non-node-server.js +0 -9
- package/src/functions/is-previewing.js +0 -12
- package/src/functions/on-change.js +0 -24
- package/src/functions/register-component.js +0 -60
- package/src/functions/register.js +0 -27
- package/src/functions/sanitize-react-native-block-styles.js +0 -71
- package/src/functions/set-editor-settings.js +0 -13
- package/src/functions/set.js +0 -9
- package/src/functions/track/helpers.js +0 -48
- package/src/functions/track/index.js +0 -131
- package/src/functions/track/interaction.js +0 -57
- package/src/functions/transform-block-properties.js +0 -4
- package/src/functions/transform-block.js +0 -4
- package/src/helpers/ab-tests.js +0 -158
- package/src/helpers/canTrack.js +0 -3
- package/src/helpers/cookie.js +0 -77
- package/src/helpers/css.js +0 -30
- package/src/helpers/flatten.js +0 -31
- package/src/helpers/localStorage.js +0 -32
- package/src/helpers/logger.js +0 -8
- package/src/helpers/nullable.js +0 -2
- package/src/helpers/preview-lru-cache/get.js +0 -4
- package/src/helpers/preview-lru-cache/helpers.js +0 -0
- package/src/helpers/preview-lru-cache/init.js +0 -2
- package/src/helpers/preview-lru-cache/set.js +0 -31
- package/src/helpers/preview-lru-cache/types.js +0 -0
- package/src/helpers/sessionId.js +0 -55
- package/src/helpers/time.js +0 -3
- package/src/helpers/url.js +0 -11
- package/src/helpers/uuid.js +0 -11
- package/src/helpers/visitorId.js +0 -35
- package/src/index-helpers/blocks-exports.js +0 -13
- package/src/index-helpers/top-of-file.js +0 -2
- package/src/index.js +0 -12
- package/src/scripts/init-editing.js +0 -109
- package/src/types/api-version.js +0 -2
- package/src/types/builder-block.js +0 -0
- package/src/types/builder-content.js +0 -0
- package/src/types/builder-props.js +0 -0
- package/src/types/can-track.js +0 -0
- package/src/types/components.js +0 -0
- package/src/types/deep-partial.js +0 -0
- package/src/types/element.js +0 -0
- package/src/types/enforced-partials.js +0 -0
- package/src/types/input.js +0 -0
- package/src/types/targets.js +0 -0
- package/src/types/typescript.js +0 -0
- package/vite.config.ts +0 -18
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { Show, createSignal } from "solid-js";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
getMaxWidthQueryForSize,
|
|
5
|
-
getSizesForBreakpoints,
|
|
6
|
-
} from "../../../constants/device-sizes.js";
|
|
7
|
-
import { TARGET } from "../../../constants/target.js";
|
|
8
|
-
import { getProcessedBlock } from "../../../functions/get-processed-block.js";
|
|
9
|
-
import { createCssClass } from "../../../helpers/css.js";
|
|
10
|
-
import { checkIsDefined } from "../../../helpers/nullable.js";
|
|
11
|
-
import InlinedStyles from "../../inlined-styles";
|
|
12
|
-
|
|
13
|
-
function BlockStyles(props) {
|
|
14
|
-
const [processedBlock, setProcessedBlock] = createSignal(
|
|
15
|
-
getProcessedBlock({
|
|
16
|
-
block: props.block,
|
|
17
|
-
localState: props.context.localState,
|
|
18
|
-
rootState: props.context.rootState,
|
|
19
|
-
rootSetState: props.context.rootSetState,
|
|
20
|
-
context: props.context.context,
|
|
21
|
-
shouldEvaluateBindings: true,
|
|
22
|
-
})
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
function canShowBlock() {
|
|
26
|
-
// only render styles for blocks that are visible
|
|
27
|
-
if (checkIsDefined(processedBlock().hide)) {
|
|
28
|
-
return !processedBlock().hide;
|
|
29
|
-
}
|
|
30
|
-
if (checkIsDefined(processedBlock().show)) {
|
|
31
|
-
return processedBlock().show;
|
|
32
|
-
}
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function css() {
|
|
37
|
-
const styles = processedBlock().responsiveStyles;
|
|
38
|
-
const content = props.context.content;
|
|
39
|
-
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
40
|
-
content?.meta?.breakpoints || {}
|
|
41
|
-
);
|
|
42
|
-
const largeStyles = styles?.large;
|
|
43
|
-
const mediumStyles = styles?.medium;
|
|
44
|
-
const smallStyles = styles?.small;
|
|
45
|
-
const className = processedBlock().id;
|
|
46
|
-
if (!className) {
|
|
47
|
-
return "";
|
|
48
|
-
}
|
|
49
|
-
const largeStylesClass = largeStyles
|
|
50
|
-
? createCssClass({
|
|
51
|
-
className,
|
|
52
|
-
styles: largeStyles,
|
|
53
|
-
})
|
|
54
|
-
: "";
|
|
55
|
-
const mediumStylesClass = mediumStyles
|
|
56
|
-
? createCssClass({
|
|
57
|
-
className,
|
|
58
|
-
styles: mediumStyles,
|
|
59
|
-
mediaQuery: getMaxWidthQueryForSize(
|
|
60
|
-
"medium",
|
|
61
|
-
sizesWithUpdatedBreakpoints
|
|
62
|
-
),
|
|
63
|
-
})
|
|
64
|
-
: "";
|
|
65
|
-
const smallStylesClass = smallStyles
|
|
66
|
-
? createCssClass({
|
|
67
|
-
className,
|
|
68
|
-
styles: smallStyles,
|
|
69
|
-
mediaQuery: getMaxWidthQueryForSize(
|
|
70
|
-
"small",
|
|
71
|
-
sizesWithUpdatedBreakpoints
|
|
72
|
-
),
|
|
73
|
-
})
|
|
74
|
-
: "";
|
|
75
|
-
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<Show when={TARGET !== "reactNative" && css() && canShowBlock()}>
|
|
80
|
-
<InlinedStyles styles={css()}></InlinedStyles>
|
|
81
|
-
</Show>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export default BlockStyles;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Show } from "solid-js";
|
|
2
|
-
import { Dynamic } from "solid-js/web";
|
|
3
|
-
|
|
4
|
-
import { getBlockActions } from "../../../functions/get-block-actions.js";
|
|
5
|
-
import { getBlockProperties } from "../../../functions/get-block-properties.js";
|
|
6
|
-
|
|
7
|
-
function BlockWrapper(props) {
|
|
8
|
-
return (
|
|
9
|
-
<Show
|
|
10
|
-
fallback={
|
|
11
|
-
<Dynamic
|
|
12
|
-
{...getBlockProperties({
|
|
13
|
-
block: props.block,
|
|
14
|
-
context: props.context,
|
|
15
|
-
})}
|
|
16
|
-
{...getBlockActions({
|
|
17
|
-
block: props.block,
|
|
18
|
-
rootState: props.context.rootState,
|
|
19
|
-
rootSetState: props.context.rootSetState,
|
|
20
|
-
localState: props.context.localState,
|
|
21
|
-
context: props.context.context,
|
|
22
|
-
stripPrefix: true,
|
|
23
|
-
})}
|
|
24
|
-
component={props.Wrapper}
|
|
25
|
-
></Dynamic>
|
|
26
|
-
}
|
|
27
|
-
when={props.hasChildren}
|
|
28
|
-
>
|
|
29
|
-
<Dynamic
|
|
30
|
-
{...getBlockProperties({
|
|
31
|
-
block: props.block,
|
|
32
|
-
context: props.context,
|
|
33
|
-
})}
|
|
34
|
-
{...getBlockActions({
|
|
35
|
-
block: props.block,
|
|
36
|
-
rootState: props.context.rootState,
|
|
37
|
-
rootSetState: props.context.rootSetState,
|
|
38
|
-
localState: props.context.localState,
|
|
39
|
-
context: props.context.context,
|
|
40
|
-
stripPrefix: true,
|
|
41
|
-
})}
|
|
42
|
-
component={props.Wrapper}
|
|
43
|
-
>
|
|
44
|
-
{props.children}
|
|
45
|
-
</Dynamic>
|
|
46
|
-
</Show>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export default BlockWrapper;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value
|
|
10
|
-
}) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
|
-
import { getBlockProperties } from "../../../../functions/get-block-properties.js";
|
|
19
|
-
const getWrapperProps = ({
|
|
20
|
-
componentOptions,
|
|
21
|
-
builderBlock,
|
|
22
|
-
context,
|
|
23
|
-
componentRef,
|
|
24
|
-
includeBlockProps,
|
|
25
|
-
isInteractive,
|
|
26
|
-
contextValue
|
|
27
|
-
}) => {
|
|
28
|
-
const interactiveElementProps = {
|
|
29
|
-
Wrapper: componentRef,
|
|
30
|
-
block: builderBlock,
|
|
31
|
-
context,
|
|
32
|
-
wrapperProps: componentOptions
|
|
33
|
-
};
|
|
34
|
-
return isInteractive ? interactiveElementProps : __spreadValues(__spreadValues({}, componentOptions), includeBlockProps ? {
|
|
35
|
-
attributes: getBlockProperties({
|
|
36
|
-
block: builderBlock,
|
|
37
|
-
context: contextValue
|
|
38
|
-
})
|
|
39
|
-
} : {});
|
|
40
|
-
};
|
|
41
|
-
export { getWrapperProps }
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Show, For, createSignal } from "solid-js";
|
|
2
|
-
import { Dynamic } from "solid-js/web";
|
|
3
|
-
|
|
4
|
-
import BlockStyles from "../block-styles";
|
|
5
|
-
import Block from "../../block";
|
|
6
|
-
import InteractiveElement from "../interactive-element";
|
|
7
|
-
import { getWrapperProps } from "./component-ref.helpers.js";
|
|
8
|
-
|
|
9
|
-
function ComponentRef(props) {
|
|
10
|
-
const [Wrapper, setWrapper] = createSignal(
|
|
11
|
-
props.isInteractive ? InteractiveElement : props.componentRef
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Show when={props.componentRef}>
|
|
16
|
-
<Dynamic
|
|
17
|
-
{...getWrapperProps({
|
|
18
|
-
componentOptions: props.componentOptions,
|
|
19
|
-
builderBlock: props.builderBlock,
|
|
20
|
-
context: props.context,
|
|
21
|
-
componentRef: props.componentRef,
|
|
22
|
-
includeBlockProps: props.includeBlockProps,
|
|
23
|
-
isInteractive: props.isInteractive,
|
|
24
|
-
contextValue: props.context,
|
|
25
|
-
})}
|
|
26
|
-
component={Wrapper()}
|
|
27
|
-
>
|
|
28
|
-
<For each={props.blockChildren}>
|
|
29
|
-
{(child, _index) => {
|
|
30
|
-
const index = _index();
|
|
31
|
-
return (
|
|
32
|
-
<Block
|
|
33
|
-
key={"block-" + child.id}
|
|
34
|
-
block={child}
|
|
35
|
-
context={props.context}
|
|
36
|
-
registeredComponents={props.registeredComponents}
|
|
37
|
-
></Block>
|
|
38
|
-
);
|
|
39
|
-
}}
|
|
40
|
-
</For>
|
|
41
|
-
<For each={props.blockChildren}>
|
|
42
|
-
{(child, _index) => {
|
|
43
|
-
const index = _index();
|
|
44
|
-
return (
|
|
45
|
-
<BlockStyles
|
|
46
|
-
key={"block-style-" + child.id}
|
|
47
|
-
block={child}
|
|
48
|
-
context={props.context}
|
|
49
|
-
></BlockStyles>
|
|
50
|
-
);
|
|
51
|
-
}}
|
|
52
|
-
</For>
|
|
53
|
-
</Dynamic>
|
|
54
|
-
</Show>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export default ComponentRef;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Dynamic } from "solid-js/web";
|
|
2
|
-
|
|
3
|
-
import { getBlockActions } from "../../../functions/get-block-actions.js";
|
|
4
|
-
import { getBlockProperties } from "../../../functions/get-block-properties.js";
|
|
5
|
-
|
|
6
|
-
function InteractiveElement(props) {
|
|
7
|
-
return (
|
|
8
|
-
<Dynamic
|
|
9
|
-
{...props.wrapperProps}
|
|
10
|
-
attributes={{
|
|
11
|
-
...getBlockProperties({
|
|
12
|
-
block: props.block,
|
|
13
|
-
context: props.context,
|
|
14
|
-
}),
|
|
15
|
-
...getBlockActions({
|
|
16
|
-
block: props.block,
|
|
17
|
-
rootState: props.context.rootState,
|
|
18
|
-
rootSetState: props.context.rootSetState,
|
|
19
|
-
localState: props.context.localState,
|
|
20
|
-
context: props.context.context,
|
|
21
|
-
}),
|
|
22
|
-
}}
|
|
23
|
-
component={props.Wrapper}
|
|
24
|
-
>
|
|
25
|
-
{props.children}
|
|
26
|
-
</Dynamic>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default InteractiveElement;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createSignal } from "solid-js";
|
|
2
|
-
|
|
3
|
-
import BuilderContext from "../../../context/builder.context.js";
|
|
4
|
-
import Block from "../block";
|
|
5
|
-
|
|
6
|
-
function RepeatedBlock(props) {
|
|
7
|
-
const [store, setStore] = createSignal(props.repeatContext);
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<BuilderContext.Provider value={store()}>
|
|
11
|
-
<Block
|
|
12
|
-
block={props.block}
|
|
13
|
-
context={store()}
|
|
14
|
-
registeredComponents={props.registeredComponents}
|
|
15
|
-
></Block>
|
|
16
|
-
</BuilderContext.Provider>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default RepeatedBlock;
|
|
File without changes
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { createSignal } from "solid-js";
|
|
2
|
-
|
|
3
|
-
import { css } from "solid-styled-components";
|
|
4
|
-
|
|
5
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
6
|
-
|
|
7
|
-
function BlocksWrapper(props) {
|
|
8
|
-
function className() {
|
|
9
|
-
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function onClick() {
|
|
13
|
-
if (isEditing() && !props.blocks?.length) {
|
|
14
|
-
window.parent?.postMessage(
|
|
15
|
-
{
|
|
16
|
-
type: "builder.clickEmptyBlocks",
|
|
17
|
-
data: {
|
|
18
|
-
parentElementId: props.parent,
|
|
19
|
-
dataPath: props.path,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
"*"
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function onMouseEnter() {
|
|
28
|
-
if (isEditing() && !props.blocks?.length) {
|
|
29
|
-
window.parent?.postMessage(
|
|
30
|
-
{
|
|
31
|
-
type: "builder.hoverEmptyBlocks",
|
|
32
|
-
data: {
|
|
33
|
-
parentElementId: props.parent,
|
|
34
|
-
dataPath: props.path,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
"*"
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div
|
|
44
|
-
class={
|
|
45
|
-
className() +
|
|
46
|
-
" " +
|
|
47
|
-
css({
|
|
48
|
-
display: "flex",
|
|
49
|
-
flexDirection: "column",
|
|
50
|
-
alignItems: "stretch",
|
|
51
|
-
})
|
|
52
|
-
}
|
|
53
|
-
builder-path={props.path}
|
|
54
|
-
builder-parent-id={props.parent}
|
|
55
|
-
{...{}}
|
|
56
|
-
style={props.styleProp}
|
|
57
|
-
onClick={(event) => onClick()}
|
|
58
|
-
onMouseEnter={(event) => onMouseEnter()}
|
|
59
|
-
onKeyPress={(event) => onClick()}
|
|
60
|
-
>
|
|
61
|
-
{props.children}
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export default BlocksWrapper;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { useContext, Show, For } from "solid-js";
|
|
2
|
-
|
|
3
|
-
import BlockStyles from "../block/components/block-styles";
|
|
4
|
-
import Block from "../block/block";
|
|
5
|
-
import BlocksWrapper from "./blocks-wrapper";
|
|
6
|
-
import BuilderContext from "../../context/builder.context.js";
|
|
7
|
-
import ComponentsContext from "../../context/components.context.js";
|
|
8
|
-
|
|
9
|
-
function Blocks(props) {
|
|
10
|
-
const builderContext = useContext(BuilderContext);
|
|
11
|
-
|
|
12
|
-
const componentsContext = useContext(ComponentsContext);
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<BlocksWrapper
|
|
16
|
-
blocks={props.blocks}
|
|
17
|
-
parent={props.parent}
|
|
18
|
-
path={props.path}
|
|
19
|
-
styleProp={props.styleProp}
|
|
20
|
-
>
|
|
21
|
-
<Show when={props.blocks}>
|
|
22
|
-
<For each={props.blocks}>
|
|
23
|
-
{(block, _index) => {
|
|
24
|
-
const index = _index();
|
|
25
|
-
return (
|
|
26
|
-
<Block
|
|
27
|
-
key={"render-block-" + block.id}
|
|
28
|
-
block={block}
|
|
29
|
-
context={props.context || builderContext}
|
|
30
|
-
registeredComponents={
|
|
31
|
-
props.registeredComponents ||
|
|
32
|
-
componentsContext.registeredComponents
|
|
33
|
-
}
|
|
34
|
-
></Block>
|
|
35
|
-
);
|
|
36
|
-
}}
|
|
37
|
-
</For>
|
|
38
|
-
</Show>
|
|
39
|
-
<Show when={props.blocks}>
|
|
40
|
-
<For each={props.blocks}>
|
|
41
|
-
{(block, _index) => {
|
|
42
|
-
const index = _index();
|
|
43
|
-
return (
|
|
44
|
-
<BlockStyles
|
|
45
|
-
key={"block-style-" + block.id}
|
|
46
|
-
block={block}
|
|
47
|
-
context={props.context || builderContext}
|
|
48
|
-
></BlockStyles>
|
|
49
|
-
);
|
|
50
|
-
}}
|
|
51
|
-
</For>
|
|
52
|
-
</Show>
|
|
53
|
-
</BlocksWrapper>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default Blocks;
|