@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/dev.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) {
|
|
@@ -79,9 +127,6 @@ function isBrowser() {
|
|
|
79
127
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
80
128
|
}
|
|
81
129
|
|
|
82
|
-
// src/constants/target.ts
|
|
83
|
-
var TARGET = "solid";
|
|
84
|
-
|
|
85
130
|
// src/functions/is-iframe.ts
|
|
86
131
|
function isIframe() {
|
|
87
132
|
return isBrowser() && window.self !== window.top;
|
|
@@ -628,7 +673,7 @@ function BlockStyles(props) {
|
|
|
628
673
|
}
|
|
629
674
|
return true;
|
|
630
675
|
}
|
|
631
|
-
function
|
|
676
|
+
function css4() {
|
|
632
677
|
const processedBlock = getProcessedBlock({
|
|
633
678
|
block: props.block,
|
|
634
679
|
localState: props.context.localState,
|
|
@@ -671,7 +716,7 @@ function BlockStyles(props) {
|
|
|
671
716
|
}) : "";
|
|
672
717
|
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
673
718
|
}
|
|
674
|
-
return <Show2 when={TARGET !== "reactNative" &&
|
|
719
|
+
return <Show2 when={TARGET !== "reactNative" && css4() && canShowBlock()}><Inlined_styles_default styles={css4()} /></Show2>;
|
|
675
720
|
}
|
|
676
721
|
var Block_styles_default = BlockStyles;
|
|
677
722
|
|
|
@@ -717,6 +762,38 @@ function getBlockActions(options) {
|
|
|
717
762
|
return obj;
|
|
718
763
|
}
|
|
719
764
|
|
|
765
|
+
// src/functions/transform-style-property.ts
|
|
766
|
+
function transformStyleProperty({
|
|
767
|
+
style
|
|
768
|
+
}) {
|
|
769
|
+
return style;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// src/functions/get-style.ts
|
|
773
|
+
var getStyle = ({
|
|
774
|
+
block,
|
|
775
|
+
context
|
|
776
|
+
}) => {
|
|
777
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
778
|
+
style: block.style || {},
|
|
779
|
+
context,
|
|
780
|
+
block
|
|
781
|
+
}));
|
|
782
|
+
};
|
|
783
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
784
|
+
switch (TARGET) {
|
|
785
|
+
case "svelte":
|
|
786
|
+
case "vue":
|
|
787
|
+
case "solid":
|
|
788
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
789
|
+
case "qwik":
|
|
790
|
+
case "reactNative":
|
|
791
|
+
case "react":
|
|
792
|
+
case "rsc":
|
|
793
|
+
return style;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
720
797
|
// src/functions/transform-block-properties.ts
|
|
721
798
|
function transformBlockProperties({
|
|
722
799
|
properties
|
|
@@ -738,8 +815,11 @@ function getBlockProperties({
|
|
|
738
815
|
...extractRelevantRootBlockProperties(block),
|
|
739
816
|
...block.properties,
|
|
740
817
|
"builder-id": block.id,
|
|
741
|
-
style:
|
|
742
|
-
|
|
818
|
+
style: getStyle({
|
|
819
|
+
block,
|
|
820
|
+
context
|
|
821
|
+
}),
|
|
822
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
743
823
|
};
|
|
744
824
|
return transformBlockProperties({
|
|
745
825
|
properties,
|
|
@@ -747,53 +827,6 @@ function getBlockProperties({
|
|
|
747
827
|
block
|
|
748
828
|
});
|
|
749
829
|
}
|
|
750
|
-
function getStyleAttribute(style) {
|
|
751
|
-
switch (TARGET) {
|
|
752
|
-
case "svelte":
|
|
753
|
-
case "vue":
|
|
754
|
-
case "solid":
|
|
755
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
756
|
-
case "qwik":
|
|
757
|
-
case "reactNative":
|
|
758
|
-
case "react":
|
|
759
|
-
case "rsc":
|
|
760
|
-
return style;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
765
|
-
import { Show as Show3 } from "solid-js";
|
|
766
|
-
import { Dynamic } from "solid-js/web";
|
|
767
|
-
|
|
768
|
-
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
769
|
-
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
770
|
-
var isEmptyElement = (tagName) => {
|
|
771
|
-
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
772
|
-
};
|
|
773
|
-
|
|
774
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
775
|
-
function DynamicRenderer(props) {
|
|
776
|
-
return <Show3
|
|
777
|
-
fallback={<Dynamic
|
|
778
|
-
{...props.attributes}
|
|
779
|
-
{...props.actionAttributes}
|
|
780
|
-
component={props.TagName}
|
|
781
|
-
/>}
|
|
782
|
-
when={!isEmptyElement(props.TagName)}
|
|
783
|
-
><Show3
|
|
784
|
-
fallback={<Dynamic
|
|
785
|
-
{...props.attributes}
|
|
786
|
-
{...props.actionAttributes}
|
|
787
|
-
component={props.TagName}
|
|
788
|
-
>{props.children}</Dynamic>}
|
|
789
|
-
when={typeof props.TagName === "string"}
|
|
790
|
-
><Dynamic
|
|
791
|
-
{...props.attributes}
|
|
792
|
-
{...props.actionAttributes}
|
|
793
|
-
component={props.TagName}
|
|
794
|
-
>{props.children}</Dynamic></Show3></Show3>;
|
|
795
|
-
}
|
|
796
|
-
var Dynamic_renderer_default = DynamicRenderer;
|
|
797
830
|
|
|
798
831
|
// src/components/block/components/block-wrapper.tsx
|
|
799
832
|
function BlockWrapper(props) {
|
|
@@ -816,7 +849,7 @@ function BlockWrapper(props) {
|
|
|
816
849
|
var Block_wrapper_default = BlockWrapper;
|
|
817
850
|
|
|
818
851
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
819
|
-
import { Show as
|
|
852
|
+
import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
|
|
820
853
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
821
854
|
|
|
822
855
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -880,12 +913,13 @@ function ComponentRef(props) {
|
|
|
880
913
|
const [Wrapper, setWrapper] = createSignal2(
|
|
881
914
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
882
915
|
);
|
|
883
|
-
return <
|
|
916
|
+
return <Show3 when={props.componentRef}><Dynamic3
|
|
884
917
|
{...getWrapperProps({
|
|
885
918
|
componentOptions: props.componentOptions,
|
|
886
919
|
builderBlock: props.builderBlock,
|
|
887
920
|
context: props.context,
|
|
888
921
|
componentRef: props.componentRef,
|
|
922
|
+
linkComponent: props.linkComponent,
|
|
889
923
|
includeBlockProps: props.includeBlockProps,
|
|
890
924
|
isInteractive: props.isInteractive,
|
|
891
925
|
contextValue: props.context
|
|
@@ -898,8 +932,9 @@ function ComponentRef(props) {
|
|
|
898
932
|
block={child}
|
|
899
933
|
context={props.context}
|
|
900
934
|
registeredComponents={props.registeredComponents}
|
|
935
|
+
linkComponent={props.linkComponent}
|
|
901
936
|
/>;
|
|
902
|
-
}}</For></Dynamic3></
|
|
937
|
+
}}</For></Dynamic3></Show3>;
|
|
903
938
|
}
|
|
904
939
|
var Component_ref_default = ComponentRef;
|
|
905
940
|
|
|
@@ -911,6 +946,7 @@ function RepeatedBlock(props) {
|
|
|
911
946
|
block={props.block}
|
|
912
947
|
context={store()}
|
|
913
948
|
registeredComponents={props.registeredComponents}
|
|
949
|
+
linkComponent={props.linkComponent}
|
|
914
950
|
/></builder_context_default.Provider>;
|
|
915
951
|
}
|
|
916
952
|
var Repeated_block_default = RepeatedBlock;
|
|
@@ -942,6 +978,10 @@ function Block(props) {
|
|
|
942
978
|
});
|
|
943
979
|
}
|
|
944
980
|
function Tag() {
|
|
981
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
982
|
+
if (shouldUseLink) {
|
|
983
|
+
return props.linkComponent || "a";
|
|
984
|
+
}
|
|
945
985
|
return props.block.tagName || "div";
|
|
946
986
|
}
|
|
947
987
|
function canShowBlock() {
|
|
@@ -965,32 +1005,37 @@ function Block(props) {
|
|
|
965
1005
|
componentOptions: {
|
|
966
1006
|
...getBlockComponentOptions(processedBlock()),
|
|
967
1007
|
builderContext: props.context,
|
|
1008
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
1009
|
+
builderLinkComponent: props.linkComponent
|
|
1010
|
+
} : {},
|
|
968
1011
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
969
1012
|
builderComponents: props.registeredComponents
|
|
970
1013
|
} : {}
|
|
971
1014
|
},
|
|
972
1015
|
context: childrenContext(),
|
|
1016
|
+
linkComponent: props.linkComponent,
|
|
973
1017
|
registeredComponents: props.registeredComponents,
|
|
974
1018
|
builderBlock: processedBlock(),
|
|
975
1019
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
976
1020
|
isInteractive: !blockComponent()?.isRSC
|
|
977
1021
|
};
|
|
978
1022
|
}
|
|
979
|
-
return <
|
|
1023
|
+
return <Show4 when={canShowBlock()}>
|
|
980
1024
|
<Block_styles_default block={props.block} context={props.context} />
|
|
981
|
-
<
|
|
1025
|
+
<Show4
|
|
982
1026
|
fallback={<Component_ref_default
|
|
983
1027
|
componentRef={componentRefProps().componentRef}
|
|
984
1028
|
componentOptions={componentRefProps().componentOptions}
|
|
985
1029
|
blockChildren={componentRefProps().blockChildren}
|
|
986
1030
|
context={componentRefProps().context}
|
|
987
1031
|
registeredComponents={componentRefProps().registeredComponents}
|
|
1032
|
+
linkComponent={componentRefProps().linkComponent}
|
|
988
1033
|
builderBlock={componentRefProps().builderBlock}
|
|
989
1034
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
990
1035
|
isInteractive={componentRefProps().isInteractive}
|
|
991
1036
|
/>}
|
|
992
1037
|
when={!blockComponent()?.noWrap}
|
|
993
|
-
><
|
|
1038
|
+
><Show4
|
|
994
1039
|
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
995
1040
|
const index = _index();
|
|
996
1041
|
return <Repeated_block_default
|
|
@@ -998,6 +1043,7 @@ function Block(props) {
|
|
|
998
1043
|
repeatContext={data.context}
|
|
999
1044
|
block={data.block}
|
|
1000
1045
|
registeredComponents={props.registeredComponents}
|
|
1046
|
+
linkComponent={props.linkComponent}
|
|
1001
1047
|
/>;
|
|
1002
1048
|
}}</For2>}
|
|
1003
1049
|
when={!repeatItem()}
|
|
@@ -1005,6 +1051,7 @@ function Block(props) {
|
|
|
1005
1051
|
Wrapper={Tag()}
|
|
1006
1052
|
block={processedBlock()}
|
|
1007
1053
|
context={props.context}
|
|
1054
|
+
linkComponent={props.linkComponent}
|
|
1008
1055
|
>
|
|
1009
1056
|
<Component_ref_default
|
|
1010
1057
|
componentRef={componentRefProps().componentRef}
|
|
@@ -1012,6 +1059,7 @@ function Block(props) {
|
|
|
1012
1059
|
blockChildren={componentRefProps().blockChildren}
|
|
1013
1060
|
context={componentRefProps().context}
|
|
1014
1061
|
registeredComponents={componentRefProps().registeredComponents}
|
|
1062
|
+
linkComponent={componentRefProps().linkComponent}
|
|
1015
1063
|
builderBlock={componentRefProps().builderBlock}
|
|
1016
1064
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
1017
1065
|
isInteractive={componentRefProps().isInteractive}
|
|
@@ -1023,16 +1071,17 @@ function Block(props) {
|
|
|
1023
1071
|
block={child}
|
|
1024
1072
|
context={childrenContext()}
|
|
1025
1073
|
registeredComponents={props.registeredComponents}
|
|
1074
|
+
linkComponent={props.linkComponent}
|
|
1026
1075
|
/>;
|
|
1027
1076
|
}}</For2>
|
|
1028
|
-
</Block_wrapper_default></
|
|
1029
|
-
</
|
|
1077
|
+
</Block_wrapper_default></Show4></Show4>
|
|
1078
|
+
</Show4>;
|
|
1030
1079
|
}
|
|
1031
1080
|
var Block_default = Block;
|
|
1032
1081
|
|
|
1033
1082
|
// src/components/blocks/blocks-wrapper.tsx
|
|
1034
1083
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
1035
|
-
import { css
|
|
1084
|
+
import { css } from "solid-styled-components";
|
|
1036
1085
|
function BlocksWrapper(props) {
|
|
1037
1086
|
function className() {
|
|
1038
1087
|
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
@@ -1066,7 +1115,7 @@ function BlocksWrapper(props) {
|
|
|
1066
1115
|
}
|
|
1067
1116
|
}
|
|
1068
1117
|
return <Dynamic4
|
|
1069
|
-
class={className() + " " +
|
|
1118
|
+
class={className() + " " + css({
|
|
1070
1119
|
display: "flex",
|
|
1071
1120
|
flexDirection: "column",
|
|
1072
1121
|
alignItems: "stretch"
|
|
@@ -1095,15 +1144,16 @@ function Blocks(props) {
|
|
|
1095
1144
|
styleProp={props.styleProp}
|
|
1096
1145
|
BlocksWrapper={props.context?.BlocksWrapper}
|
|
1097
1146
|
BlocksWrapperProps={props.context?.BlocksWrapperProps}
|
|
1098
|
-
><
|
|
1147
|
+
><Show5 when={props.blocks}><For3 each={props.blocks}>{(block, _index) => {
|
|
1099
1148
|
const index = _index();
|
|
1100
1149
|
return <Block_default
|
|
1101
1150
|
key={block.id}
|
|
1102
1151
|
block={block}
|
|
1152
|
+
linkComponent={props.linkComponent}
|
|
1103
1153
|
context={props.context || builderContext}
|
|
1104
1154
|
registeredComponents={props.registeredComponents || componentsContext.registeredComponents}
|
|
1105
1155
|
/>;
|
|
1106
|
-
}}</For3></
|
|
1156
|
+
}}</For3></Show5></Blocks_wrapper_default>;
|
|
1107
1157
|
}
|
|
1108
1158
|
var Blocks_default = Blocks;
|
|
1109
1159
|
|
|
@@ -1152,7 +1202,13 @@ function Columns(props) {
|
|
|
1152
1202
|
const mobileWidth = "100%";
|
|
1153
1203
|
const mobileMarginLeft = 0;
|
|
1154
1204
|
const marginLeftKey = "margin-left";
|
|
1205
|
+
const sharedStyles = {
|
|
1206
|
+
display: "flex",
|
|
1207
|
+
flexDirection: "column",
|
|
1208
|
+
alignItems: "stretch"
|
|
1209
|
+
};
|
|
1155
1210
|
return {
|
|
1211
|
+
...sharedStyles,
|
|
1156
1212
|
width,
|
|
1157
1213
|
[marginLeftKey]: gutterPixels,
|
|
1158
1214
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1207,25 +1263,28 @@ function Columns(props) {
|
|
|
1207
1263
|
`;
|
|
1208
1264
|
}
|
|
1209
1265
|
return <div
|
|
1210
|
-
class={`builder-columns ${props.builderBlock.id}-breakpoints ` +
|
|
1266
|
+
class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
|
|
1211
1267
|
display: "flex",
|
|
1212
1268
|
lineHeight: "normal"
|
|
1213
1269
|
})}
|
|
1214
1270
|
style={columnsCssVars()}
|
|
1215
1271
|
{...{}}
|
|
1216
1272
|
>
|
|
1217
|
-
<
|
|
1273
|
+
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default styles={columnsStyles()} /></Show6>
|
|
1218
1274
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1219
1275
|
const index = _index();
|
|
1220
|
-
return <
|
|
1221
|
-
class={"builder-column " + css3({
|
|
1222
|
-
display: "flex",
|
|
1223
|
-
flexDirection: "column",
|
|
1224
|
-
alignItems: "stretch"
|
|
1225
|
-
})}
|
|
1226
|
-
style={columnCssVars(index)}
|
|
1227
|
-
{...{}}
|
|
1276
|
+
return <Dynamic_renderer_default
|
|
1228
1277
|
key={index}
|
|
1278
|
+
TagName={column.link ? props.builderLinkComponent || "a" : "div"}
|
|
1279
|
+
actionAttributes={{}}
|
|
1280
|
+
attributes={{
|
|
1281
|
+
...{},
|
|
1282
|
+
...column.link ? {
|
|
1283
|
+
href: column.link
|
|
1284
|
+
} : {},
|
|
1285
|
+
[getClassPropName()]: "builder-column",
|
|
1286
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1287
|
+
}}
|
|
1229
1288
|
><Blocks_default
|
|
1230
1289
|
path={`component.options.columns.${index}.blocks`}
|
|
1231
1290
|
parent={props.builderBlock.id}
|
|
@@ -1234,8 +1293,9 @@ function Columns(props) {
|
|
|
1234
1293
|
}}
|
|
1235
1294
|
context={props.builderContext}
|
|
1236
1295
|
registeredComponents={props.builderComponents}
|
|
1296
|
+
linkComponent={props.builderLinkComponent}
|
|
1237
1297
|
blocks={column.blocks}
|
|
1238
|
-
/></
|
|
1298
|
+
/></Dynamic_renderer_default>;
|
|
1239
1299
|
}}</For4>
|
|
1240
1300
|
</div>;
|
|
1241
1301
|
}
|
|
@@ -1248,8 +1308,8 @@ function FragmentComponent(props) {
|
|
|
1248
1308
|
var fragment_default = FragmentComponent;
|
|
1249
1309
|
|
|
1250
1310
|
// src/blocks/image/image.tsx
|
|
1251
|
-
import { Show as
|
|
1252
|
-
import { css as
|
|
1311
|
+
import { Show as Show7 } from "solid-js";
|
|
1312
|
+
import { css as css3 } from "solid-styled-components";
|
|
1253
1313
|
|
|
1254
1314
|
// src/blocks/image/image.helpers.ts
|
|
1255
1315
|
function removeProtocol(path) {
|
|
@@ -1338,9 +1398,9 @@ function Image(props) {
|
|
|
1338
1398
|
}
|
|
1339
1399
|
return <>
|
|
1340
1400
|
<picture>
|
|
1341
|
-
<
|
|
1401
|
+
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
1342
1402
|
<img
|
|
1343
|
-
class={"builder-image" + (props.className ? " " + props.className : "") + " " +
|
|
1403
|
+
class={"builder-image" + (props.className ? " " + props.className : "") + " " + css3({
|
|
1344
1404
|
opacity: "1",
|
|
1345
1405
|
transition: "opacity 0.2s ease-in-out"
|
|
1346
1406
|
})}
|
|
@@ -1357,10 +1417,10 @@ function Image(props) {
|
|
|
1357
1417
|
sizes={props.sizes}
|
|
1358
1418
|
/>
|
|
1359
1419
|
</picture>
|
|
1360
|
-
<
|
|
1420
|
+
<Show7
|
|
1361
1421
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
1362
1422
|
><div
|
|
1363
|
-
class={"builder-image-sizer " +
|
|
1423
|
+
class={"builder-image-sizer " + css3({
|
|
1364
1424
|
width: "100%",
|
|
1365
1425
|
pointerEvents: "none",
|
|
1366
1426
|
fontSize: "0"
|
|
@@ -1368,10 +1428,10 @@ function Image(props) {
|
|
|
1368
1428
|
style={{
|
|
1369
1429
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
1370
1430
|
}}
|
|
1371
|
-
/></
|
|
1372
|
-
<
|
|
1373
|
-
<
|
|
1374
|
-
class={
|
|
1431
|
+
/></Show7>
|
|
1432
|
+
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
1433
|
+
<Show7 when={!props.fitContent && props.children}><div
|
|
1434
|
+
class={css3({
|
|
1375
1435
|
display: "flex",
|
|
1376
1436
|
flexDirection: "column",
|
|
1377
1437
|
alignItems: "stretch",
|
|
@@ -1381,7 +1441,7 @@ function Image(props) {
|
|
|
1381
1441
|
width: "100%",
|
|
1382
1442
|
height: "100%"
|
|
1383
1443
|
})}
|
|
1384
|
-
>{props.children}</div></
|
|
1444
|
+
>{props.children}</div></Show7>
|
|
1385
1445
|
</>;
|
|
1386
1446
|
}
|
|
1387
1447
|
var image_default = Image;
|
|
@@ -1411,7 +1471,7 @@ var section_default = SectionComponent;
|
|
|
1411
1471
|
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as createSignal14 } from "solid-js";
|
|
1412
1472
|
|
|
1413
1473
|
// src/components/content-variants/content-variants.tsx
|
|
1414
|
-
import { Show as
|
|
1474
|
+
import { Show as Show11, For as For5, onMount as onMount3, createSignal as createSignal13 } from "solid-js";
|
|
1415
1475
|
|
|
1416
1476
|
// src/helpers/url.ts
|
|
1417
1477
|
var getTopLevelDomain = (host) => {
|
|
@@ -1605,7 +1665,7 @@ var handleABTesting = async ({
|
|
|
1605
1665
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1606
1666
|
|
|
1607
1667
|
// src/components/content/content.tsx
|
|
1608
|
-
import { Show as
|
|
1668
|
+
import { Show as Show10, createSignal as createSignal12 } from "solid-js";
|
|
1609
1669
|
|
|
1610
1670
|
// src/blocks/button/component-info.ts
|
|
1611
1671
|
var componentInfo = {
|
|
@@ -2414,7 +2474,7 @@ var componentInfo12 = {
|
|
|
2414
2474
|
};
|
|
2415
2475
|
|
|
2416
2476
|
// src/blocks/video/video.tsx
|
|
2417
|
-
import { Show as
|
|
2477
|
+
import { Show as Show8 } from "solid-js";
|
|
2418
2478
|
function Video(props) {
|
|
2419
2479
|
function videoProps() {
|
|
2420
2480
|
return {
|
|
@@ -2465,8 +2525,8 @@ function Video(props) {
|
|
|
2465
2525
|
}}
|
|
2466
2526
|
src={props.video || "no-src"}
|
|
2467
2527
|
poster={props.posterImage}
|
|
2468
|
-
><
|
|
2469
|
-
<
|
|
2528
|
+
><Show8 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show8></video>
|
|
2529
|
+
<Show8
|
|
2470
2530
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
2471
2531
|
><div
|
|
2472
2532
|
style={{
|
|
@@ -2475,15 +2535,15 @@ function Video(props) {
|
|
|
2475
2535
|
"pointer-events": "none",
|
|
2476
2536
|
"font-size": "0px"
|
|
2477
2537
|
}}
|
|
2478
|
-
/></
|
|
2479
|
-
<
|
|
2538
|
+
/></Show8>
|
|
2539
|
+
<Show8 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
2480
2540
|
style={{
|
|
2481
2541
|
display: "flex",
|
|
2482
2542
|
"flex-direction": "column",
|
|
2483
2543
|
"align-items": "stretch"
|
|
2484
2544
|
}}
|
|
2485
|
-
>{props.children}</div></
|
|
2486
|
-
<
|
|
2545
|
+
>{props.children}</div></Show8>
|
|
2546
|
+
<Show8 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
2487
2547
|
style={{
|
|
2488
2548
|
"pointer-events": "none",
|
|
2489
2549
|
display: "flex",
|
|
@@ -2495,7 +2555,7 @@ function Video(props) {
|
|
|
2495
2555
|
width: "100%",
|
|
2496
2556
|
height: "100%"
|
|
2497
2557
|
}}
|
|
2498
|
-
>{props.children}</div></
|
|
2558
|
+
>{props.children}</div></Show8>
|
|
2499
2559
|
</div>;
|
|
2500
2560
|
}
|
|
2501
2561
|
var video_default = Video;
|
|
@@ -2615,7 +2675,7 @@ function InlinedScript(props) {
|
|
|
2615
2675
|
var Inlined_script_default = InlinedScript;
|
|
2616
2676
|
|
|
2617
2677
|
// src/components/content/components/enable-editor.tsx
|
|
2618
|
-
import { Show as
|
|
2678
|
+
import { Show as Show9, onMount as onMount2, on as on2, createEffect as createEffect2, createSignal as createSignal10 } from "solid-js";
|
|
2619
2679
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
2620
2680
|
|
|
2621
2681
|
// src/helpers/preview-lru-cache/get.ts
|
|
@@ -3110,7 +3170,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
3110
3170
|
};
|
|
3111
3171
|
|
|
3112
3172
|
// src/constants/sdk-version.ts
|
|
3113
|
-
var SDK_VERSION = "0.12.
|
|
3173
|
+
var SDK_VERSION = "0.12.4";
|
|
3114
3174
|
|
|
3115
3175
|
// src/functions/register.ts
|
|
3116
3176
|
var registry = {};
|
|
@@ -3534,7 +3594,7 @@ function EnableEditor(props) {
|
|
|
3534
3594
|
}
|
|
3535
3595
|
}
|
|
3536
3596
|
createEffect2(on2(() => [props.locale], onUpdateFn_6));
|
|
3537
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
3597
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show9 when={props.builderContextSignal.content}><Dynamic5
|
|
3538
3598
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
3539
3599
|
{...{}}
|
|
3540
3600
|
key={forceReRenderCount()}
|
|
@@ -3549,7 +3609,7 @@ function EnableEditor(props) {
|
|
|
3549
3609
|
}}
|
|
3550
3610
|
{...props.contentWrapperProps}
|
|
3551
3611
|
component={ContentWrapper()}
|
|
3552
|
-
>{props.children}</Dynamic5></
|
|
3612
|
+
>{props.children}</Dynamic5></Show9></builder_context_default.Provider>;
|
|
3553
3613
|
}
|
|
3554
3614
|
var Enable_editor_default = EnableEditor;
|
|
3555
3615
|
|
|
@@ -3623,6 +3683,10 @@ ${getFontCss({
|
|
|
3623
3683
|
customFonts: props.customFonts
|
|
3624
3684
|
})}
|
|
3625
3685
|
|
|
3686
|
+
.builder-button {
|
|
3687
|
+
all: unset;
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3626
3690
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
3627
3691
|
margin: 0;
|
|
3628
3692
|
}
|
|
@@ -3767,21 +3831,23 @@ function ContentComponent(props) {
|
|
|
3767
3831
|
builderContextSignal={builderContextSignal()}
|
|
3768
3832
|
contentWrapper={props.contentWrapper}
|
|
3769
3833
|
contentWrapperProps={props.contentWrapperProps}
|
|
3834
|
+
linkComponent={props.linkComponent}
|
|
3770
3835
|
trustedHosts={props.trustedHosts}
|
|
3771
3836
|
{...{
|
|
3772
3837
|
setBuilderContextSignal
|
|
3773
3838
|
}}
|
|
3774
3839
|
>
|
|
3775
|
-
<
|
|
3776
|
-
<
|
|
3840
|
+
<Show10 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show10>
|
|
3841
|
+
<Show10 when={TARGET !== "reactNative"}><Styles_default
|
|
3777
3842
|
contentId={builderContextSignal().content?.id}
|
|
3778
3843
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
3779
3844
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
3780
|
-
/></
|
|
3845
|
+
/></Show10>
|
|
3781
3846
|
<Blocks_default
|
|
3782
3847
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
3783
3848
|
context={builderContextSignal()}
|
|
3784
3849
|
registeredComponents={registeredComponents()}
|
|
3850
|
+
linkComponent={props.linkComponent}
|
|
3785
3851
|
/>
|
|
3786
3852
|
</Enable_editor_default></components_context_default.Provider>;
|
|
3787
3853
|
}
|
|
@@ -3820,8 +3886,8 @@ function ContentVariants(props) {
|
|
|
3820
3886
|
setShouldRenderVariants(false);
|
|
3821
3887
|
});
|
|
3822
3888
|
return <>
|
|
3823
|
-
<
|
|
3824
|
-
<
|
|
3889
|
+
<Show11 when={!props.__isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show11>
|
|
3890
|
+
<Show11 when={shouldRenderVariants()}>
|
|
3825
3891
|
<Inlined_styles_default
|
|
3826
3892
|
id={`variants-styles-${props.content?.id}`}
|
|
3827
3893
|
styles={hideVariantsStyleString()}
|
|
@@ -3841,6 +3907,7 @@ function ContentVariants(props) {
|
|
|
3841
3907
|
apiKey={props.apiKey}
|
|
3842
3908
|
apiVersion={props.apiVersion}
|
|
3843
3909
|
customComponents={props.customComponents}
|
|
3910
|
+
linkComponent={props.linkComponent}
|
|
3844
3911
|
canTrack={props.canTrack}
|
|
3845
3912
|
locale={props.locale}
|
|
3846
3913
|
includeRefs={props.includeRefs}
|
|
@@ -3853,7 +3920,7 @@ function ContentVariants(props) {
|
|
|
3853
3920
|
trustedHosts={props.trustedHosts}
|
|
3854
3921
|
/>;
|
|
3855
3922
|
}}</For5>
|
|
3856
|
-
</
|
|
3923
|
+
</Show11>
|
|
3857
3924
|
<Content_default
|
|
3858
3925
|
{...{}}
|
|
3859
3926
|
content={defaultContent()}
|
|
@@ -3864,6 +3931,7 @@ function ContentVariants(props) {
|
|
|
3864
3931
|
apiKey={props.apiKey}
|
|
3865
3932
|
apiVersion={props.apiVersion}
|
|
3866
3933
|
customComponents={props.customComponents}
|
|
3934
|
+
linkComponent={props.linkComponent}
|
|
3867
3935
|
canTrack={props.canTrack}
|
|
3868
3936
|
locale={props.locale}
|
|
3869
3937
|
includeRefs={props.includeRefs}
|
|
@@ -3908,7 +3976,7 @@ function Symbol(props) {
|
|
|
3908
3976
|
const [contentToUse, setContentToUse] = createSignal14(props.symbol?.content);
|
|
3909
3977
|
function className() {
|
|
3910
3978
|
return [
|
|
3911
|
-
...[props.attributes
|
|
3979
|
+
...[props.attributes[getClassPropName()]],
|
|
3912
3980
|
"builder-symbol",
|
|
3913
3981
|
props.symbol?.inline ? "builder-inline-symbol" : void 0,
|
|
3914
3982
|
props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0
|
|
@@ -3949,6 +4017,7 @@ function Symbol(props) {
|
|
|
3949
4017
|
}}
|
|
3950
4018
|
model={props.symbol?.model}
|
|
3951
4019
|
content={contentToUse()}
|
|
4020
|
+
linkComponent={props.builderLinkComponent}
|
|
3952
4021
|
/></div>;
|
|
3953
4022
|
}
|
|
3954
4023
|
var symbol_default = Symbol;
|