@builder.io/sdk-solid 0.12.2 → 0.12.4
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/dist/index.d.ts +23 -14
- package/lib/browser/dev.js +250 -166
- package/lib/browser/dev.jsx +199 -130
- package/lib/browser/index.js +250 -166
- package/lib/browser/index.jsx +199 -130
- package/lib/edge/dev.js +250 -166
- package/lib/edge/dev.jsx +199 -130
- package/lib/edge/index.js +250 -166
- package/lib/edge/index.jsx +199 -130
- package/lib/node/dev.js +250 -166
- package/lib/node/dev.jsx +199 -130
- package/lib/node/index.js +250 -166
- package/lib/node/index.jsx +199 -130
- package/package.json +1 -1
package/lib/node/index.jsx
CHANGED
|
@@ -1,33 +1,81 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
2
2
|
import { Show } from "solid-js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { Dynamic } from "solid-js/web";
|
|
4
|
+
|
|
5
|
+
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
6
|
+
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
7
|
+
var isEmptyElement = (tagName) => {
|
|
8
|
+
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
12
|
+
function DynamicRenderer(props) {
|
|
5
13
|
return <Show
|
|
6
|
-
fallback={<
|
|
7
|
-
class={props.attributes.class + " " + css({
|
|
8
|
-
all: "unset"
|
|
9
|
-
})}
|
|
10
|
-
{...{}}
|
|
14
|
+
fallback={<Dynamic
|
|
11
15
|
{...props.attributes}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
{...props.actionAttributes}
|
|
17
|
+
component={props.TagName}
|
|
18
|
+
/>}
|
|
19
|
+
when={!isEmptyElement(props.TagName)}
|
|
20
|
+
><Show
|
|
21
|
+
fallback={<Dynamic
|
|
22
|
+
{...props.attributes}
|
|
23
|
+
{...props.actionAttributes}
|
|
24
|
+
component={props.TagName}
|
|
25
|
+
>{props.children}</Dynamic>}
|
|
26
|
+
when={typeof props.TagName === "string"}
|
|
27
|
+
><Dynamic
|
|
17
28
|
{...props.attributes}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
{...props.actionAttributes}
|
|
30
|
+
component={props.TagName}
|
|
31
|
+
>{props.children}</Dynamic></Show></Show>;
|
|
32
|
+
}
|
|
33
|
+
var Dynamic_renderer_default = DynamicRenderer;
|
|
34
|
+
|
|
35
|
+
// src/constants/target.ts
|
|
36
|
+
var TARGET = "solid";
|
|
37
|
+
|
|
38
|
+
// src/functions/get-class-prop-name.ts
|
|
39
|
+
var getClassPropName = () => {
|
|
40
|
+
switch (TARGET) {
|
|
41
|
+
case "react":
|
|
42
|
+
case "reactNative":
|
|
43
|
+
case "rsc":
|
|
44
|
+
return "className";
|
|
45
|
+
case "svelte":
|
|
46
|
+
case "vue":
|
|
47
|
+
case "solid":
|
|
48
|
+
case "qwik":
|
|
49
|
+
return "class";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// src/blocks/button/button.tsx
|
|
54
|
+
function Button(props) {
|
|
55
|
+
return <Dynamic_renderer_default
|
|
56
|
+
TagName={props.link ? props.builderLinkComponent || "a" : "button"}
|
|
57
|
+
attributes={{
|
|
58
|
+
...props.attributes,
|
|
59
|
+
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
60
|
+
...props.link ? {
|
|
61
|
+
href: props.link,
|
|
62
|
+
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
63
|
+
role: "link"
|
|
64
|
+
} : {
|
|
65
|
+
role: "button"
|
|
66
|
+
}
|
|
67
|
+
}}
|
|
68
|
+
actionAttributes={{}}
|
|
69
|
+
>{props.text}</Dynamic_renderer_default>;
|
|
22
70
|
}
|
|
23
71
|
var button_default = Button;
|
|
24
72
|
|
|
25
73
|
// src/blocks/columns/columns.tsx
|
|
26
|
-
import { Show as
|
|
27
|
-
import { css as
|
|
74
|
+
import { Show as Show6, For as For4, createSignal as createSignal5 } from "solid-js";
|
|
75
|
+
import { css as css2 } from "solid-styled-components";
|
|
28
76
|
|
|
29
77
|
// src/components/blocks/blocks.tsx
|
|
30
|
-
import { useContext, Show as
|
|
78
|
+
import { useContext, Show as Show5, For as For3 } from "solid-js";
|
|
31
79
|
|
|
32
80
|
// src/context/builder.context.ts
|
|
33
81
|
import { createContext } from "solid-js";
|
|
@@ -51,7 +99,7 @@ import { createContext as createContext2 } from "solid-js";
|
|
|
51
99
|
var components_context_default = createContext2({ registeredComponents: {} });
|
|
52
100
|
|
|
53
101
|
// src/components/block/block.tsx
|
|
54
|
-
import { Show as
|
|
102
|
+
import { Show as Show4, For as For2, createSignal as createSignal4 } from "solid-js";
|
|
55
103
|
|
|
56
104
|
// src/functions/get-block-component-options.ts
|
|
57
105
|
function getBlockComponentOptions(block) {
|
|
@@ -78,9 +126,6 @@ function isBrowser() {
|
|
|
78
126
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
79
127
|
}
|
|
80
128
|
|
|
81
|
-
// src/constants/target.ts
|
|
82
|
-
var TARGET = "solid";
|
|
83
|
-
|
|
84
129
|
// src/functions/is-iframe.ts
|
|
85
130
|
function isIframe() {
|
|
86
131
|
return isBrowser() && window.self !== window.top;
|
|
@@ -622,7 +667,7 @@ function BlockStyles(props) {
|
|
|
622
667
|
}
|
|
623
668
|
return true;
|
|
624
669
|
}
|
|
625
|
-
function
|
|
670
|
+
function css4() {
|
|
626
671
|
const processedBlock = getProcessedBlock({
|
|
627
672
|
block: props.block,
|
|
628
673
|
localState: props.context.localState,
|
|
@@ -665,7 +710,7 @@ function BlockStyles(props) {
|
|
|
665
710
|
}) : "";
|
|
666
711
|
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
667
712
|
}
|
|
668
|
-
return <Show2 when={TARGET !== "reactNative" &&
|
|
713
|
+
return <Show2 when={TARGET !== "reactNative" && css4() && canShowBlock()}><Inlined_styles_default styles={css4()} /></Show2>;
|
|
669
714
|
}
|
|
670
715
|
var Block_styles_default = BlockStyles;
|
|
671
716
|
|
|
@@ -711,6 +756,38 @@ function getBlockActions(options) {
|
|
|
711
756
|
return obj;
|
|
712
757
|
}
|
|
713
758
|
|
|
759
|
+
// src/functions/transform-style-property.ts
|
|
760
|
+
function transformStyleProperty({
|
|
761
|
+
style
|
|
762
|
+
}) {
|
|
763
|
+
return style;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
// src/functions/get-style.ts
|
|
767
|
+
var getStyle = ({
|
|
768
|
+
block,
|
|
769
|
+
context
|
|
770
|
+
}) => {
|
|
771
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
772
|
+
style: block.style || {},
|
|
773
|
+
context,
|
|
774
|
+
block
|
|
775
|
+
}));
|
|
776
|
+
};
|
|
777
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
778
|
+
switch (TARGET) {
|
|
779
|
+
case "svelte":
|
|
780
|
+
case "vue":
|
|
781
|
+
case "solid":
|
|
782
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
783
|
+
case "qwik":
|
|
784
|
+
case "reactNative":
|
|
785
|
+
case "react":
|
|
786
|
+
case "rsc":
|
|
787
|
+
return style;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
|
|
714
791
|
// src/functions/transform-block-properties.ts
|
|
715
792
|
function transformBlockProperties({
|
|
716
793
|
properties
|
|
@@ -732,8 +809,11 @@ function getBlockProperties({
|
|
|
732
809
|
...extractRelevantRootBlockProperties(block),
|
|
733
810
|
...block.properties,
|
|
734
811
|
"builder-id": block.id,
|
|
735
|
-
style:
|
|
736
|
-
|
|
812
|
+
style: getStyle({
|
|
813
|
+
block,
|
|
814
|
+
context
|
|
815
|
+
}),
|
|
816
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
737
817
|
};
|
|
738
818
|
return transformBlockProperties({
|
|
739
819
|
properties,
|
|
@@ -741,53 +821,6 @@ function getBlockProperties({
|
|
|
741
821
|
block
|
|
742
822
|
});
|
|
743
823
|
}
|
|
744
|
-
function getStyleAttribute(style) {
|
|
745
|
-
switch (TARGET) {
|
|
746
|
-
case "svelte":
|
|
747
|
-
case "vue":
|
|
748
|
-
case "solid":
|
|
749
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
750
|
-
case "qwik":
|
|
751
|
-
case "reactNative":
|
|
752
|
-
case "react":
|
|
753
|
-
case "rsc":
|
|
754
|
-
return style;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
759
|
-
import { Show as Show3 } from "solid-js";
|
|
760
|
-
import { Dynamic } from "solid-js/web";
|
|
761
|
-
|
|
762
|
-
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
763
|
-
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
764
|
-
var isEmptyElement = (tagName) => {
|
|
765
|
-
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
766
|
-
};
|
|
767
|
-
|
|
768
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
769
|
-
function DynamicRenderer(props) {
|
|
770
|
-
return <Show3
|
|
771
|
-
fallback={<Dynamic
|
|
772
|
-
{...props.attributes}
|
|
773
|
-
{...props.actionAttributes}
|
|
774
|
-
component={props.TagName}
|
|
775
|
-
/>}
|
|
776
|
-
when={!isEmptyElement(props.TagName)}
|
|
777
|
-
><Show3
|
|
778
|
-
fallback={<Dynamic
|
|
779
|
-
{...props.attributes}
|
|
780
|
-
{...props.actionAttributes}
|
|
781
|
-
component={props.TagName}
|
|
782
|
-
>{props.children}</Dynamic>}
|
|
783
|
-
when={typeof props.TagName === "string"}
|
|
784
|
-
><Dynamic
|
|
785
|
-
{...props.attributes}
|
|
786
|
-
{...props.actionAttributes}
|
|
787
|
-
component={props.TagName}
|
|
788
|
-
>{props.children}</Dynamic></Show3></Show3>;
|
|
789
|
-
}
|
|
790
|
-
var Dynamic_renderer_default = DynamicRenderer;
|
|
791
824
|
|
|
792
825
|
// src/components/block/components/block-wrapper.tsx
|
|
793
826
|
function BlockWrapper(props) {
|
|
@@ -810,7 +843,7 @@ function BlockWrapper(props) {
|
|
|
810
843
|
var Block_wrapper_default = BlockWrapper;
|
|
811
844
|
|
|
812
845
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
813
|
-
import { Show as
|
|
846
|
+
import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
|
|
814
847
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
815
848
|
|
|
816
849
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -874,12 +907,13 @@ function ComponentRef(props) {
|
|
|
874
907
|
const [Wrapper, setWrapper] = createSignal2(
|
|
875
908
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
876
909
|
);
|
|
877
|
-
return <
|
|
910
|
+
return <Show3 when={props.componentRef}><Dynamic3
|
|
878
911
|
{...getWrapperProps({
|
|
879
912
|
componentOptions: props.componentOptions,
|
|
880
913
|
builderBlock: props.builderBlock,
|
|
881
914
|
context: props.context,
|
|
882
915
|
componentRef: props.componentRef,
|
|
916
|
+
linkComponent: props.linkComponent,
|
|
883
917
|
includeBlockProps: props.includeBlockProps,
|
|
884
918
|
isInteractive: props.isInteractive,
|
|
885
919
|
contextValue: props.context
|
|
@@ -892,8 +926,9 @@ function ComponentRef(props) {
|
|
|
892
926
|
block={child}
|
|
893
927
|
context={props.context}
|
|
894
928
|
registeredComponents={props.registeredComponents}
|
|
929
|
+
linkComponent={props.linkComponent}
|
|
895
930
|
/>;
|
|
896
|
-
}}</For></Dynamic3></
|
|
931
|
+
}}</For></Dynamic3></Show3>;
|
|
897
932
|
}
|
|
898
933
|
var Component_ref_default = ComponentRef;
|
|
899
934
|
|
|
@@ -905,6 +940,7 @@ function RepeatedBlock(props) {
|
|
|
905
940
|
block={props.block}
|
|
906
941
|
context={store()}
|
|
907
942
|
registeredComponents={props.registeredComponents}
|
|
943
|
+
linkComponent={props.linkComponent}
|
|
908
944
|
/></builder_context_default.Provider>;
|
|
909
945
|
}
|
|
910
946
|
var Repeated_block_default = RepeatedBlock;
|
|
@@ -936,6 +972,10 @@ function Block(props) {
|
|
|
936
972
|
});
|
|
937
973
|
}
|
|
938
974
|
function Tag() {
|
|
975
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
976
|
+
if (shouldUseLink) {
|
|
977
|
+
return props.linkComponent || "a";
|
|
978
|
+
}
|
|
939
979
|
return props.block.tagName || "div";
|
|
940
980
|
}
|
|
941
981
|
function canShowBlock() {
|
|
@@ -959,32 +999,37 @@ function Block(props) {
|
|
|
959
999
|
componentOptions: {
|
|
960
1000
|
...getBlockComponentOptions(processedBlock()),
|
|
961
1001
|
builderContext: props.context,
|
|
1002
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
1003
|
+
builderLinkComponent: props.linkComponent
|
|
1004
|
+
} : {},
|
|
962
1005
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
963
1006
|
builderComponents: props.registeredComponents
|
|
964
1007
|
} : {}
|
|
965
1008
|
},
|
|
966
1009
|
context: childrenContext(),
|
|
1010
|
+
linkComponent: props.linkComponent,
|
|
967
1011
|
registeredComponents: props.registeredComponents,
|
|
968
1012
|
builderBlock: processedBlock(),
|
|
969
1013
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
970
1014
|
isInteractive: !blockComponent()?.isRSC
|
|
971
1015
|
};
|
|
972
1016
|
}
|
|
973
|
-
return <
|
|
1017
|
+
return <Show4 when={canShowBlock()}>
|
|
974
1018
|
<Block_styles_default block={props.block} context={props.context} />
|
|
975
|
-
<
|
|
1019
|
+
<Show4
|
|
976
1020
|
fallback={<Component_ref_default
|
|
977
1021
|
componentRef={componentRefProps().componentRef}
|
|
978
1022
|
componentOptions={componentRefProps().componentOptions}
|
|
979
1023
|
blockChildren={componentRefProps().blockChildren}
|
|
980
1024
|
context={componentRefProps().context}
|
|
981
1025
|
registeredComponents={componentRefProps().registeredComponents}
|
|
1026
|
+
linkComponent={componentRefProps().linkComponent}
|
|
982
1027
|
builderBlock={componentRefProps().builderBlock}
|
|
983
1028
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
984
1029
|
isInteractive={componentRefProps().isInteractive}
|
|
985
1030
|
/>}
|
|
986
1031
|
when={!blockComponent()?.noWrap}
|
|
987
|
-
><
|
|
1032
|
+
><Show4
|
|
988
1033
|
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
989
1034
|
const index = _index();
|
|
990
1035
|
return <Repeated_block_default
|
|
@@ -992,6 +1037,7 @@ function Block(props) {
|
|
|
992
1037
|
repeatContext={data.context}
|
|
993
1038
|
block={data.block}
|
|
994
1039
|
registeredComponents={props.registeredComponents}
|
|
1040
|
+
linkComponent={props.linkComponent}
|
|
995
1041
|
/>;
|
|
996
1042
|
}}</For2>}
|
|
997
1043
|
when={!repeatItem()}
|
|
@@ -999,6 +1045,7 @@ function Block(props) {
|
|
|
999
1045
|
Wrapper={Tag()}
|
|
1000
1046
|
block={processedBlock()}
|
|
1001
1047
|
context={props.context}
|
|
1048
|
+
linkComponent={props.linkComponent}
|
|
1002
1049
|
>
|
|
1003
1050
|
<Component_ref_default
|
|
1004
1051
|
componentRef={componentRefProps().componentRef}
|
|
@@ -1006,6 +1053,7 @@ function Block(props) {
|
|
|
1006
1053
|
blockChildren={componentRefProps().blockChildren}
|
|
1007
1054
|
context={componentRefProps().context}
|
|
1008
1055
|
registeredComponents={componentRefProps().registeredComponents}
|
|
1056
|
+
linkComponent={componentRefProps().linkComponent}
|
|
1009
1057
|
builderBlock={componentRefProps().builderBlock}
|
|
1010
1058
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
1011
1059
|
isInteractive={componentRefProps().isInteractive}
|
|
@@ -1017,16 +1065,17 @@ function Block(props) {
|
|
|
1017
1065
|
block={child}
|
|
1018
1066
|
context={childrenContext()}
|
|
1019
1067
|
registeredComponents={props.registeredComponents}
|
|
1068
|
+
linkComponent={props.linkComponent}
|
|
1020
1069
|
/>;
|
|
1021
1070
|
}}</For2>
|
|
1022
|
-
</Block_wrapper_default></
|
|
1023
|
-
</
|
|
1071
|
+
</Block_wrapper_default></Show4></Show4>
|
|
1072
|
+
</Show4>;
|
|
1024
1073
|
}
|
|
1025
1074
|
var Block_default = Block;
|
|
1026
1075
|
|
|
1027
1076
|
// src/components/blocks/blocks-wrapper.tsx
|
|
1028
1077
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
1029
|
-
import { css
|
|
1078
|
+
import { css } from "solid-styled-components";
|
|
1030
1079
|
function BlocksWrapper(props) {
|
|
1031
1080
|
function className() {
|
|
1032
1081
|
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
@@ -1060,7 +1109,7 @@ function BlocksWrapper(props) {
|
|
|
1060
1109
|
}
|
|
1061
1110
|
}
|
|
1062
1111
|
return <Dynamic4
|
|
1063
|
-
class={className() + " " +
|
|
1112
|
+
class={className() + " " + css({
|
|
1064
1113
|
display: "flex",
|
|
1065
1114
|
flexDirection: "column",
|
|
1066
1115
|
alignItems: "stretch"
|
|
@@ -1089,15 +1138,16 @@ function Blocks(props) {
|
|
|
1089
1138
|
styleProp={props.styleProp}
|
|
1090
1139
|
BlocksWrapper={props.context?.BlocksWrapper}
|
|
1091
1140
|
BlocksWrapperProps={props.context?.BlocksWrapperProps}
|
|
1092
|
-
><
|
|
1141
|
+
><Show5 when={props.blocks}><For3 each={props.blocks}>{(block, _index) => {
|
|
1093
1142
|
const index = _index();
|
|
1094
1143
|
return <Block_default
|
|
1095
1144
|
key={block.id}
|
|
1096
1145
|
block={block}
|
|
1146
|
+
linkComponent={props.linkComponent}
|
|
1097
1147
|
context={props.context || builderContext}
|
|
1098
1148
|
registeredComponents={props.registeredComponents || componentsContext.registeredComponents}
|
|
1099
1149
|
/>;
|
|
1100
|
-
}}</For3></
|
|
1150
|
+
}}</For3></Show5></Blocks_wrapper_default>;
|
|
1101
1151
|
}
|
|
1102
1152
|
var Blocks_default = Blocks;
|
|
1103
1153
|
|
|
@@ -1146,7 +1196,13 @@ function Columns(props) {
|
|
|
1146
1196
|
const mobileWidth = "100%";
|
|
1147
1197
|
const mobileMarginLeft = 0;
|
|
1148
1198
|
const marginLeftKey = "margin-left";
|
|
1199
|
+
const sharedStyles = {
|
|
1200
|
+
display: "flex",
|
|
1201
|
+
flexDirection: "column",
|
|
1202
|
+
alignItems: "stretch"
|
|
1203
|
+
};
|
|
1149
1204
|
return {
|
|
1205
|
+
...sharedStyles,
|
|
1150
1206
|
width,
|
|
1151
1207
|
[marginLeftKey]: gutterPixels,
|
|
1152
1208
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1201,25 +1257,28 @@ function Columns(props) {
|
|
|
1201
1257
|
`;
|
|
1202
1258
|
}
|
|
1203
1259
|
return <div
|
|
1204
|
-
class={`builder-columns ${props.builderBlock.id}-breakpoints ` +
|
|
1260
|
+
class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
|
|
1205
1261
|
display: "flex",
|
|
1206
1262
|
lineHeight: "normal"
|
|
1207
1263
|
})}
|
|
1208
1264
|
style={columnsCssVars()}
|
|
1209
1265
|
{...{}}
|
|
1210
1266
|
>
|
|
1211
|
-
<
|
|
1267
|
+
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default styles={columnsStyles()} /></Show6>
|
|
1212
1268
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1213
1269
|
const index = _index();
|
|
1214
|
-
return <
|
|
1215
|
-
class={"builder-column " + css3({
|
|
1216
|
-
display: "flex",
|
|
1217
|
-
flexDirection: "column",
|
|
1218
|
-
alignItems: "stretch"
|
|
1219
|
-
})}
|
|
1220
|
-
style={columnCssVars(index)}
|
|
1221
|
-
{...{}}
|
|
1270
|
+
return <Dynamic_renderer_default
|
|
1222
1271
|
key={index}
|
|
1272
|
+
TagName={column.link ? props.builderLinkComponent || "a" : "div"}
|
|
1273
|
+
actionAttributes={{}}
|
|
1274
|
+
attributes={{
|
|
1275
|
+
...{},
|
|
1276
|
+
...column.link ? {
|
|
1277
|
+
href: column.link
|
|
1278
|
+
} : {},
|
|
1279
|
+
[getClassPropName()]: "builder-column",
|
|
1280
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1281
|
+
}}
|
|
1223
1282
|
><Blocks_default
|
|
1224
1283
|
path={`component.options.columns.${index}.blocks`}
|
|
1225
1284
|
parent={props.builderBlock.id}
|
|
@@ -1228,8 +1287,9 @@ function Columns(props) {
|
|
|
1228
1287
|
}}
|
|
1229
1288
|
context={props.builderContext}
|
|
1230
1289
|
registeredComponents={props.builderComponents}
|
|
1290
|
+
linkComponent={props.builderLinkComponent}
|
|
1231
1291
|
blocks={column.blocks}
|
|
1232
|
-
/></
|
|
1292
|
+
/></Dynamic_renderer_default>;
|
|
1233
1293
|
}}</For4>
|
|
1234
1294
|
</div>;
|
|
1235
1295
|
}
|
|
@@ -1242,8 +1302,8 @@ function FragmentComponent(props) {
|
|
|
1242
1302
|
var fragment_default = FragmentComponent;
|
|
1243
1303
|
|
|
1244
1304
|
// src/blocks/image/image.tsx
|
|
1245
|
-
import { Show as
|
|
1246
|
-
import { css as
|
|
1305
|
+
import { Show as Show7 } from "solid-js";
|
|
1306
|
+
import { css as css3 } from "solid-styled-components";
|
|
1247
1307
|
|
|
1248
1308
|
// src/blocks/image/image.helpers.ts
|
|
1249
1309
|
function removeProtocol(path) {
|
|
@@ -1331,9 +1391,9 @@ function Image(props) {
|
|
|
1331
1391
|
}
|
|
1332
1392
|
return <>
|
|
1333
1393
|
<picture>
|
|
1334
|
-
<
|
|
1394
|
+
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
1335
1395
|
<img
|
|
1336
|
-
class={"builder-image" + (props.className ? " " + props.className : "") + " " +
|
|
1396
|
+
class={"builder-image" + (props.className ? " " + props.className : "") + " " + css3({
|
|
1337
1397
|
opacity: "1",
|
|
1338
1398
|
transition: "opacity 0.2s ease-in-out"
|
|
1339
1399
|
})}
|
|
@@ -1350,10 +1410,10 @@ function Image(props) {
|
|
|
1350
1410
|
sizes={props.sizes}
|
|
1351
1411
|
/>
|
|
1352
1412
|
</picture>
|
|
1353
|
-
<
|
|
1413
|
+
<Show7
|
|
1354
1414
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
1355
1415
|
><div
|
|
1356
|
-
class={"builder-image-sizer " +
|
|
1416
|
+
class={"builder-image-sizer " + css3({
|
|
1357
1417
|
width: "100%",
|
|
1358
1418
|
pointerEvents: "none",
|
|
1359
1419
|
fontSize: "0"
|
|
@@ -1361,10 +1421,10 @@ function Image(props) {
|
|
|
1361
1421
|
style={{
|
|
1362
1422
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
1363
1423
|
}}
|
|
1364
|
-
/></
|
|
1365
|
-
<
|
|
1366
|
-
<
|
|
1367
|
-
class={
|
|
1424
|
+
/></Show7>
|
|
1425
|
+
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
1426
|
+
<Show7 when={!props.fitContent && props.children}><div
|
|
1427
|
+
class={css3({
|
|
1368
1428
|
display: "flex",
|
|
1369
1429
|
flexDirection: "column",
|
|
1370
1430
|
alignItems: "stretch",
|
|
@@ -1374,7 +1434,7 @@ function Image(props) {
|
|
|
1374
1434
|
width: "100%",
|
|
1375
1435
|
height: "100%"
|
|
1376
1436
|
})}
|
|
1377
|
-
>{props.children}</div></
|
|
1437
|
+
>{props.children}</div></Show7>
|
|
1378
1438
|
</>;
|
|
1379
1439
|
}
|
|
1380
1440
|
var image_default = Image;
|
|
@@ -1404,7 +1464,7 @@ var section_default = SectionComponent;
|
|
|
1404
1464
|
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as createSignal14 } from "solid-js";
|
|
1405
1465
|
|
|
1406
1466
|
// src/components/content-variants/content-variants.tsx
|
|
1407
|
-
import { Show as
|
|
1467
|
+
import { Show as Show11, For as For5, onMount as onMount3, createSignal as createSignal13 } from "solid-js";
|
|
1408
1468
|
|
|
1409
1469
|
// src/helpers/url.ts
|
|
1410
1470
|
var getTopLevelDomain = (host) => {
|
|
@@ -1598,7 +1658,7 @@ var handleABTesting = async ({
|
|
|
1598
1658
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1599
1659
|
|
|
1600
1660
|
// src/components/content/content.tsx
|
|
1601
|
-
import { Show as
|
|
1661
|
+
import { Show as Show10, createSignal as createSignal12 } from "solid-js";
|
|
1602
1662
|
|
|
1603
1663
|
// src/blocks/button/component-info.ts
|
|
1604
1664
|
var componentInfo = {
|
|
@@ -2404,7 +2464,7 @@ var componentInfo12 = {
|
|
|
2404
2464
|
};
|
|
2405
2465
|
|
|
2406
2466
|
// src/blocks/video/video.tsx
|
|
2407
|
-
import { Show as
|
|
2467
|
+
import { Show as Show8 } from "solid-js";
|
|
2408
2468
|
function Video(props) {
|
|
2409
2469
|
function videoProps() {
|
|
2410
2470
|
return {
|
|
@@ -2455,8 +2515,8 @@ function Video(props) {
|
|
|
2455
2515
|
}}
|
|
2456
2516
|
src={props.video || "no-src"}
|
|
2457
2517
|
poster={props.posterImage}
|
|
2458
|
-
><
|
|
2459
|
-
<
|
|
2518
|
+
><Show8 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show8></video>
|
|
2519
|
+
<Show8
|
|
2460
2520
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
2461
2521
|
><div
|
|
2462
2522
|
style={{
|
|
@@ -2465,15 +2525,15 @@ function Video(props) {
|
|
|
2465
2525
|
"pointer-events": "none",
|
|
2466
2526
|
"font-size": "0px"
|
|
2467
2527
|
}}
|
|
2468
|
-
/></
|
|
2469
|
-
<
|
|
2528
|
+
/></Show8>
|
|
2529
|
+
<Show8 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
2470
2530
|
style={{
|
|
2471
2531
|
display: "flex",
|
|
2472
2532
|
"flex-direction": "column",
|
|
2473
2533
|
"align-items": "stretch"
|
|
2474
2534
|
}}
|
|
2475
|
-
>{props.children}</div></
|
|
2476
|
-
<
|
|
2535
|
+
>{props.children}</div></Show8>
|
|
2536
|
+
<Show8 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
2477
2537
|
style={{
|
|
2478
2538
|
"pointer-events": "none",
|
|
2479
2539
|
display: "flex",
|
|
@@ -2485,7 +2545,7 @@ function Video(props) {
|
|
|
2485
2545
|
width: "100%",
|
|
2486
2546
|
height: "100%"
|
|
2487
2547
|
}}
|
|
2488
|
-
>{props.children}</div></
|
|
2548
|
+
>{props.children}</div></Show8>
|
|
2489
2549
|
</div>;
|
|
2490
2550
|
}
|
|
2491
2551
|
var video_default = Video;
|
|
@@ -2605,7 +2665,7 @@ function InlinedScript(props) {
|
|
|
2605
2665
|
var Inlined_script_default = InlinedScript;
|
|
2606
2666
|
|
|
2607
2667
|
// src/components/content/components/enable-editor.tsx
|
|
2608
|
-
import { Show as
|
|
2668
|
+
import { Show as Show9, onMount as onMount2, on as on2, createEffect as createEffect2, createSignal as createSignal10 } from "solid-js";
|
|
2609
2669
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
2610
2670
|
|
|
2611
2671
|
// src/helpers/preview-lru-cache/get.ts
|
|
@@ -3095,7 +3155,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
3095
3155
|
};
|
|
3096
3156
|
|
|
3097
3157
|
// src/constants/sdk-version.ts
|
|
3098
|
-
var SDK_VERSION = "0.12.
|
|
3158
|
+
var SDK_VERSION = "0.12.4";
|
|
3099
3159
|
|
|
3100
3160
|
// src/functions/register.ts
|
|
3101
3161
|
var registry = {};
|
|
@@ -3517,7 +3577,7 @@ function EnableEditor(props) {
|
|
|
3517
3577
|
}
|
|
3518
3578
|
}
|
|
3519
3579
|
createEffect2(on2(() => [props.locale], onUpdateFn_6));
|
|
3520
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
3580
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show9 when={props.builderContextSignal.content}><Dynamic5
|
|
3521
3581
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
3522
3582
|
{...{}}
|
|
3523
3583
|
key={forceReRenderCount()}
|
|
@@ -3532,7 +3592,7 @@ function EnableEditor(props) {
|
|
|
3532
3592
|
}}
|
|
3533
3593
|
{...props.contentWrapperProps}
|
|
3534
3594
|
component={ContentWrapper()}
|
|
3535
|
-
>{props.children}</Dynamic5></
|
|
3595
|
+
>{props.children}</Dynamic5></Show9></builder_context_default.Provider>;
|
|
3536
3596
|
}
|
|
3537
3597
|
var Enable_editor_default = EnableEditor;
|
|
3538
3598
|
|
|
@@ -3606,6 +3666,10 @@ ${getFontCss({
|
|
|
3606
3666
|
customFonts: props.customFonts
|
|
3607
3667
|
})}
|
|
3608
3668
|
|
|
3669
|
+
.builder-button {
|
|
3670
|
+
all: unset;
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3609
3673
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
3610
3674
|
margin: 0;
|
|
3611
3675
|
}
|
|
@@ -3750,21 +3814,23 @@ function ContentComponent(props) {
|
|
|
3750
3814
|
builderContextSignal={builderContextSignal()}
|
|
3751
3815
|
contentWrapper={props.contentWrapper}
|
|
3752
3816
|
contentWrapperProps={props.contentWrapperProps}
|
|
3817
|
+
linkComponent={props.linkComponent}
|
|
3753
3818
|
trustedHosts={props.trustedHosts}
|
|
3754
3819
|
{...{
|
|
3755
3820
|
setBuilderContextSignal
|
|
3756
3821
|
}}
|
|
3757
3822
|
>
|
|
3758
|
-
<
|
|
3759
|
-
<
|
|
3823
|
+
<Show10 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show10>
|
|
3824
|
+
<Show10 when={TARGET !== "reactNative"}><Styles_default
|
|
3760
3825
|
contentId={builderContextSignal().content?.id}
|
|
3761
3826
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
3762
3827
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
3763
|
-
/></
|
|
3828
|
+
/></Show10>
|
|
3764
3829
|
<Blocks_default
|
|
3765
3830
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
3766
3831
|
context={builderContextSignal()}
|
|
3767
3832
|
registeredComponents={registeredComponents()}
|
|
3833
|
+
linkComponent={props.linkComponent}
|
|
3768
3834
|
/>
|
|
3769
3835
|
</Enable_editor_default></components_context_default.Provider>;
|
|
3770
3836
|
}
|
|
@@ -3803,8 +3869,8 @@ function ContentVariants(props) {
|
|
|
3803
3869
|
setShouldRenderVariants(false);
|
|
3804
3870
|
});
|
|
3805
3871
|
return <>
|
|
3806
|
-
<
|
|
3807
|
-
<
|
|
3872
|
+
<Show11 when={!props.__isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show11>
|
|
3873
|
+
<Show11 when={shouldRenderVariants()}>
|
|
3808
3874
|
<Inlined_styles_default
|
|
3809
3875
|
id={`variants-styles-${props.content?.id}`}
|
|
3810
3876
|
styles={hideVariantsStyleString()}
|
|
@@ -3824,6 +3890,7 @@ function ContentVariants(props) {
|
|
|
3824
3890
|
apiKey={props.apiKey}
|
|
3825
3891
|
apiVersion={props.apiVersion}
|
|
3826
3892
|
customComponents={props.customComponents}
|
|
3893
|
+
linkComponent={props.linkComponent}
|
|
3827
3894
|
canTrack={props.canTrack}
|
|
3828
3895
|
locale={props.locale}
|
|
3829
3896
|
includeRefs={props.includeRefs}
|
|
@@ -3836,7 +3903,7 @@ function ContentVariants(props) {
|
|
|
3836
3903
|
trustedHosts={props.trustedHosts}
|
|
3837
3904
|
/>;
|
|
3838
3905
|
}}</For5>
|
|
3839
|
-
</
|
|
3906
|
+
</Show11>
|
|
3840
3907
|
<Content_default
|
|
3841
3908
|
{...{}}
|
|
3842
3909
|
content={defaultContent()}
|
|
@@ -3847,6 +3914,7 @@ function ContentVariants(props) {
|
|
|
3847
3914
|
apiKey={props.apiKey}
|
|
3848
3915
|
apiVersion={props.apiVersion}
|
|
3849
3916
|
customComponents={props.customComponents}
|
|
3917
|
+
linkComponent={props.linkComponent}
|
|
3850
3918
|
canTrack={props.canTrack}
|
|
3851
3919
|
locale={props.locale}
|
|
3852
3920
|
includeRefs={props.includeRefs}
|
|
@@ -3891,7 +3959,7 @@ function Symbol(props) {
|
|
|
3891
3959
|
const [contentToUse, setContentToUse] = createSignal14(props.symbol?.content);
|
|
3892
3960
|
function className() {
|
|
3893
3961
|
return [
|
|
3894
|
-
...[props.attributes
|
|
3962
|
+
...[props.attributes[getClassPropName()]],
|
|
3895
3963
|
"builder-symbol",
|
|
3896
3964
|
props.symbol?.inline ? "builder-inline-symbol" : void 0,
|
|
3897
3965
|
props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0
|
|
@@ -3932,6 +4000,7 @@ function Symbol(props) {
|
|
|
3932
4000
|
}}
|
|
3933
4001
|
model={props.symbol?.model}
|
|
3934
4002
|
content={contentToUse()}
|
|
4003
|
+
linkComponent={props.builderLinkComponent}
|
|
3935
4004
|
/></div>;
|
|
3936
4005
|
}
|
|
3937
4006
|
var symbol_default = Symbol;
|