@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/browser/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;
|
|
@@ -497,7 +542,7 @@ function BlockStyles(props) {
|
|
|
497
542
|
}
|
|
498
543
|
return true;
|
|
499
544
|
}
|
|
500
|
-
function
|
|
545
|
+
function css4() {
|
|
501
546
|
const processedBlock = getProcessedBlock({
|
|
502
547
|
block: props.block,
|
|
503
548
|
localState: props.context.localState,
|
|
@@ -540,7 +585,7 @@ function BlockStyles(props) {
|
|
|
540
585
|
}) : "";
|
|
541
586
|
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
542
587
|
}
|
|
543
|
-
return <Show2 when={TARGET !== "reactNative" &&
|
|
588
|
+
return <Show2 when={TARGET !== "reactNative" && css4() && canShowBlock()}><Inlined_styles_default styles={css4()} /></Show2>;
|
|
544
589
|
}
|
|
545
590
|
var Block_styles_default = BlockStyles;
|
|
546
591
|
|
|
@@ -586,6 +631,38 @@ function getBlockActions(options) {
|
|
|
586
631
|
return obj;
|
|
587
632
|
}
|
|
588
633
|
|
|
634
|
+
// src/functions/transform-style-property.ts
|
|
635
|
+
function transformStyleProperty({
|
|
636
|
+
style
|
|
637
|
+
}) {
|
|
638
|
+
return style;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// src/functions/get-style.ts
|
|
642
|
+
var getStyle = ({
|
|
643
|
+
block,
|
|
644
|
+
context
|
|
645
|
+
}) => {
|
|
646
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
647
|
+
style: block.style || {},
|
|
648
|
+
context,
|
|
649
|
+
block
|
|
650
|
+
}));
|
|
651
|
+
};
|
|
652
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
653
|
+
switch (TARGET) {
|
|
654
|
+
case "svelte":
|
|
655
|
+
case "vue":
|
|
656
|
+
case "solid":
|
|
657
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
658
|
+
case "qwik":
|
|
659
|
+
case "reactNative":
|
|
660
|
+
case "react":
|
|
661
|
+
case "rsc":
|
|
662
|
+
return style;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
589
666
|
// src/functions/transform-block-properties.ts
|
|
590
667
|
function transformBlockProperties({
|
|
591
668
|
properties
|
|
@@ -607,8 +684,11 @@ function getBlockProperties({
|
|
|
607
684
|
...extractRelevantRootBlockProperties(block),
|
|
608
685
|
...block.properties,
|
|
609
686
|
"builder-id": block.id,
|
|
610
|
-
style:
|
|
611
|
-
|
|
687
|
+
style: getStyle({
|
|
688
|
+
block,
|
|
689
|
+
context
|
|
690
|
+
}),
|
|
691
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
612
692
|
};
|
|
613
693
|
return transformBlockProperties({
|
|
614
694
|
properties,
|
|
@@ -616,53 +696,6 @@ function getBlockProperties({
|
|
|
616
696
|
block
|
|
617
697
|
});
|
|
618
698
|
}
|
|
619
|
-
function getStyleAttribute(style) {
|
|
620
|
-
switch (TARGET) {
|
|
621
|
-
case "svelte":
|
|
622
|
-
case "vue":
|
|
623
|
-
case "solid":
|
|
624
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
625
|
-
case "qwik":
|
|
626
|
-
case "reactNative":
|
|
627
|
-
case "react":
|
|
628
|
-
case "rsc":
|
|
629
|
-
return style;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
634
|
-
import { Show as Show3 } from "solid-js";
|
|
635
|
-
import { Dynamic } from "solid-js/web";
|
|
636
|
-
|
|
637
|
-
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
638
|
-
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
639
|
-
var isEmptyElement = (tagName) => {
|
|
640
|
-
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
644
|
-
function DynamicRenderer(props) {
|
|
645
|
-
return <Show3
|
|
646
|
-
fallback={<Dynamic
|
|
647
|
-
{...props.attributes}
|
|
648
|
-
{...props.actionAttributes}
|
|
649
|
-
component={props.TagName}
|
|
650
|
-
/>}
|
|
651
|
-
when={!isEmptyElement(props.TagName)}
|
|
652
|
-
><Show3
|
|
653
|
-
fallback={<Dynamic
|
|
654
|
-
{...props.attributes}
|
|
655
|
-
{...props.actionAttributes}
|
|
656
|
-
component={props.TagName}
|
|
657
|
-
>{props.children}</Dynamic>}
|
|
658
|
-
when={typeof props.TagName === "string"}
|
|
659
|
-
><Dynamic
|
|
660
|
-
{...props.attributes}
|
|
661
|
-
{...props.actionAttributes}
|
|
662
|
-
component={props.TagName}
|
|
663
|
-
>{props.children}</Dynamic></Show3></Show3>;
|
|
664
|
-
}
|
|
665
|
-
var Dynamic_renderer_default = DynamicRenderer;
|
|
666
699
|
|
|
667
700
|
// src/components/block/components/block-wrapper.tsx
|
|
668
701
|
function BlockWrapper(props) {
|
|
@@ -685,7 +718,7 @@ function BlockWrapper(props) {
|
|
|
685
718
|
var Block_wrapper_default = BlockWrapper;
|
|
686
719
|
|
|
687
720
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
688
|
-
import { Show as
|
|
721
|
+
import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
|
|
689
722
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
690
723
|
|
|
691
724
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -749,12 +782,13 @@ function ComponentRef(props) {
|
|
|
749
782
|
const [Wrapper, setWrapper] = createSignal2(
|
|
750
783
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
751
784
|
);
|
|
752
|
-
return <
|
|
785
|
+
return <Show3 when={props.componentRef}><Dynamic3
|
|
753
786
|
{...getWrapperProps({
|
|
754
787
|
componentOptions: props.componentOptions,
|
|
755
788
|
builderBlock: props.builderBlock,
|
|
756
789
|
context: props.context,
|
|
757
790
|
componentRef: props.componentRef,
|
|
791
|
+
linkComponent: props.linkComponent,
|
|
758
792
|
includeBlockProps: props.includeBlockProps,
|
|
759
793
|
isInteractive: props.isInteractive,
|
|
760
794
|
contextValue: props.context
|
|
@@ -767,8 +801,9 @@ function ComponentRef(props) {
|
|
|
767
801
|
block={child}
|
|
768
802
|
context={props.context}
|
|
769
803
|
registeredComponents={props.registeredComponents}
|
|
804
|
+
linkComponent={props.linkComponent}
|
|
770
805
|
/>;
|
|
771
|
-
}}</For></Dynamic3></
|
|
806
|
+
}}</For></Dynamic3></Show3>;
|
|
772
807
|
}
|
|
773
808
|
var Component_ref_default = ComponentRef;
|
|
774
809
|
|
|
@@ -780,6 +815,7 @@ function RepeatedBlock(props) {
|
|
|
780
815
|
block={props.block}
|
|
781
816
|
context={store()}
|
|
782
817
|
registeredComponents={props.registeredComponents}
|
|
818
|
+
linkComponent={props.linkComponent}
|
|
783
819
|
/></builder_context_default.Provider>;
|
|
784
820
|
}
|
|
785
821
|
var Repeated_block_default = RepeatedBlock;
|
|
@@ -811,6 +847,10 @@ function Block(props) {
|
|
|
811
847
|
});
|
|
812
848
|
}
|
|
813
849
|
function Tag() {
|
|
850
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
851
|
+
if (shouldUseLink) {
|
|
852
|
+
return props.linkComponent || "a";
|
|
853
|
+
}
|
|
814
854
|
return props.block.tagName || "div";
|
|
815
855
|
}
|
|
816
856
|
function canShowBlock() {
|
|
@@ -834,32 +874,37 @@ function Block(props) {
|
|
|
834
874
|
componentOptions: {
|
|
835
875
|
...getBlockComponentOptions(processedBlock()),
|
|
836
876
|
builderContext: props.context,
|
|
877
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
878
|
+
builderLinkComponent: props.linkComponent
|
|
879
|
+
} : {},
|
|
837
880
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
838
881
|
builderComponents: props.registeredComponents
|
|
839
882
|
} : {}
|
|
840
883
|
},
|
|
841
884
|
context: childrenContext(),
|
|
885
|
+
linkComponent: props.linkComponent,
|
|
842
886
|
registeredComponents: props.registeredComponents,
|
|
843
887
|
builderBlock: processedBlock(),
|
|
844
888
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
845
889
|
isInteractive: !blockComponent()?.isRSC
|
|
846
890
|
};
|
|
847
891
|
}
|
|
848
|
-
return <
|
|
892
|
+
return <Show4 when={canShowBlock()}>
|
|
849
893
|
<Block_styles_default block={props.block} context={props.context} />
|
|
850
|
-
<
|
|
894
|
+
<Show4
|
|
851
895
|
fallback={<Component_ref_default
|
|
852
896
|
componentRef={componentRefProps().componentRef}
|
|
853
897
|
componentOptions={componentRefProps().componentOptions}
|
|
854
898
|
blockChildren={componentRefProps().blockChildren}
|
|
855
899
|
context={componentRefProps().context}
|
|
856
900
|
registeredComponents={componentRefProps().registeredComponents}
|
|
901
|
+
linkComponent={componentRefProps().linkComponent}
|
|
857
902
|
builderBlock={componentRefProps().builderBlock}
|
|
858
903
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
859
904
|
isInteractive={componentRefProps().isInteractive}
|
|
860
905
|
/>}
|
|
861
906
|
when={!blockComponent()?.noWrap}
|
|
862
|
-
><
|
|
907
|
+
><Show4
|
|
863
908
|
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
864
909
|
const index = _index();
|
|
865
910
|
return <Repeated_block_default
|
|
@@ -867,6 +912,7 @@ function Block(props) {
|
|
|
867
912
|
repeatContext={data.context}
|
|
868
913
|
block={data.block}
|
|
869
914
|
registeredComponents={props.registeredComponents}
|
|
915
|
+
linkComponent={props.linkComponent}
|
|
870
916
|
/>;
|
|
871
917
|
}}</For2>}
|
|
872
918
|
when={!repeatItem()}
|
|
@@ -874,6 +920,7 @@ function Block(props) {
|
|
|
874
920
|
Wrapper={Tag()}
|
|
875
921
|
block={processedBlock()}
|
|
876
922
|
context={props.context}
|
|
923
|
+
linkComponent={props.linkComponent}
|
|
877
924
|
>
|
|
878
925
|
<Component_ref_default
|
|
879
926
|
componentRef={componentRefProps().componentRef}
|
|
@@ -881,6 +928,7 @@ function Block(props) {
|
|
|
881
928
|
blockChildren={componentRefProps().blockChildren}
|
|
882
929
|
context={componentRefProps().context}
|
|
883
930
|
registeredComponents={componentRefProps().registeredComponents}
|
|
931
|
+
linkComponent={componentRefProps().linkComponent}
|
|
884
932
|
builderBlock={componentRefProps().builderBlock}
|
|
885
933
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
886
934
|
isInteractive={componentRefProps().isInteractive}
|
|
@@ -892,16 +940,17 @@ function Block(props) {
|
|
|
892
940
|
block={child}
|
|
893
941
|
context={childrenContext()}
|
|
894
942
|
registeredComponents={props.registeredComponents}
|
|
943
|
+
linkComponent={props.linkComponent}
|
|
895
944
|
/>;
|
|
896
945
|
}}</For2>
|
|
897
|
-
</Block_wrapper_default></
|
|
898
|
-
</
|
|
946
|
+
</Block_wrapper_default></Show4></Show4>
|
|
947
|
+
</Show4>;
|
|
899
948
|
}
|
|
900
949
|
var Block_default = Block;
|
|
901
950
|
|
|
902
951
|
// src/components/blocks/blocks-wrapper.tsx
|
|
903
952
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
904
|
-
import { css
|
|
953
|
+
import { css } from "solid-styled-components";
|
|
905
954
|
function BlocksWrapper(props) {
|
|
906
955
|
function className() {
|
|
907
956
|
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
@@ -935,7 +984,7 @@ function BlocksWrapper(props) {
|
|
|
935
984
|
}
|
|
936
985
|
}
|
|
937
986
|
return <Dynamic4
|
|
938
|
-
class={className() + " " +
|
|
987
|
+
class={className() + " " + css({
|
|
939
988
|
display: "flex",
|
|
940
989
|
flexDirection: "column",
|
|
941
990
|
alignItems: "stretch"
|
|
@@ -964,15 +1013,16 @@ function Blocks(props) {
|
|
|
964
1013
|
styleProp={props.styleProp}
|
|
965
1014
|
BlocksWrapper={props.context?.BlocksWrapper}
|
|
966
1015
|
BlocksWrapperProps={props.context?.BlocksWrapperProps}
|
|
967
|
-
><
|
|
1016
|
+
><Show5 when={props.blocks}><For3 each={props.blocks}>{(block, _index) => {
|
|
968
1017
|
const index = _index();
|
|
969
1018
|
return <Block_default
|
|
970
1019
|
key={block.id}
|
|
971
1020
|
block={block}
|
|
1021
|
+
linkComponent={props.linkComponent}
|
|
972
1022
|
context={props.context || builderContext}
|
|
973
1023
|
registeredComponents={props.registeredComponents || componentsContext.registeredComponents}
|
|
974
1024
|
/>;
|
|
975
|
-
}}</For3></
|
|
1025
|
+
}}</For3></Show5></Blocks_wrapper_default>;
|
|
976
1026
|
}
|
|
977
1027
|
var Blocks_default = Blocks;
|
|
978
1028
|
|
|
@@ -1021,7 +1071,13 @@ function Columns(props) {
|
|
|
1021
1071
|
const mobileWidth = "100%";
|
|
1022
1072
|
const mobileMarginLeft = 0;
|
|
1023
1073
|
const marginLeftKey = "margin-left";
|
|
1074
|
+
const sharedStyles = {
|
|
1075
|
+
display: "flex",
|
|
1076
|
+
flexDirection: "column",
|
|
1077
|
+
alignItems: "stretch"
|
|
1078
|
+
};
|
|
1024
1079
|
return {
|
|
1080
|
+
...sharedStyles,
|
|
1025
1081
|
width,
|
|
1026
1082
|
[marginLeftKey]: gutterPixels,
|
|
1027
1083
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1076,25 +1132,28 @@ function Columns(props) {
|
|
|
1076
1132
|
`;
|
|
1077
1133
|
}
|
|
1078
1134
|
return <div
|
|
1079
|
-
class={`builder-columns ${props.builderBlock.id}-breakpoints ` +
|
|
1135
|
+
class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
|
|
1080
1136
|
display: "flex",
|
|
1081
1137
|
lineHeight: "normal"
|
|
1082
1138
|
})}
|
|
1083
1139
|
style={columnsCssVars()}
|
|
1084
1140
|
{...{}}
|
|
1085
1141
|
>
|
|
1086
|
-
<
|
|
1142
|
+
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default styles={columnsStyles()} /></Show6>
|
|
1087
1143
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1088
1144
|
const index = _index();
|
|
1089
|
-
return <
|
|
1090
|
-
class={"builder-column " + css3({
|
|
1091
|
-
display: "flex",
|
|
1092
|
-
flexDirection: "column",
|
|
1093
|
-
alignItems: "stretch"
|
|
1094
|
-
})}
|
|
1095
|
-
style={columnCssVars(index)}
|
|
1096
|
-
{...{}}
|
|
1145
|
+
return <Dynamic_renderer_default
|
|
1097
1146
|
key={index}
|
|
1147
|
+
TagName={column.link ? props.builderLinkComponent || "a" : "div"}
|
|
1148
|
+
actionAttributes={{}}
|
|
1149
|
+
attributes={{
|
|
1150
|
+
...{},
|
|
1151
|
+
...column.link ? {
|
|
1152
|
+
href: column.link
|
|
1153
|
+
} : {},
|
|
1154
|
+
[getClassPropName()]: "builder-column",
|
|
1155
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1156
|
+
}}
|
|
1098
1157
|
><Blocks_default
|
|
1099
1158
|
path={`component.options.columns.${index}.blocks`}
|
|
1100
1159
|
parent={props.builderBlock.id}
|
|
@@ -1103,8 +1162,9 @@ function Columns(props) {
|
|
|
1103
1162
|
}}
|
|
1104
1163
|
context={props.builderContext}
|
|
1105
1164
|
registeredComponents={props.builderComponents}
|
|
1165
|
+
linkComponent={props.builderLinkComponent}
|
|
1106
1166
|
blocks={column.blocks}
|
|
1107
|
-
/></
|
|
1167
|
+
/></Dynamic_renderer_default>;
|
|
1108
1168
|
}}</For4>
|
|
1109
1169
|
</div>;
|
|
1110
1170
|
}
|
|
@@ -1117,8 +1177,8 @@ function FragmentComponent(props) {
|
|
|
1117
1177
|
var fragment_default = FragmentComponent;
|
|
1118
1178
|
|
|
1119
1179
|
// src/blocks/image/image.tsx
|
|
1120
|
-
import { Show as
|
|
1121
|
-
import { css as
|
|
1180
|
+
import { Show as Show7 } from "solid-js";
|
|
1181
|
+
import { css as css3 } from "solid-styled-components";
|
|
1122
1182
|
|
|
1123
1183
|
// src/blocks/image/image.helpers.ts
|
|
1124
1184
|
function removeProtocol(path) {
|
|
@@ -1206,9 +1266,9 @@ function Image(props) {
|
|
|
1206
1266
|
}
|
|
1207
1267
|
return <>
|
|
1208
1268
|
<picture>
|
|
1209
|
-
<
|
|
1269
|
+
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
1210
1270
|
<img
|
|
1211
|
-
class={"builder-image" + (props.className ? " " + props.className : "") + " " +
|
|
1271
|
+
class={"builder-image" + (props.className ? " " + props.className : "") + " " + css3({
|
|
1212
1272
|
opacity: "1",
|
|
1213
1273
|
transition: "opacity 0.2s ease-in-out"
|
|
1214
1274
|
})}
|
|
@@ -1225,10 +1285,10 @@ function Image(props) {
|
|
|
1225
1285
|
sizes={props.sizes}
|
|
1226
1286
|
/>
|
|
1227
1287
|
</picture>
|
|
1228
|
-
<
|
|
1288
|
+
<Show7
|
|
1229
1289
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
1230
1290
|
><div
|
|
1231
|
-
class={"builder-image-sizer " +
|
|
1291
|
+
class={"builder-image-sizer " + css3({
|
|
1232
1292
|
width: "100%",
|
|
1233
1293
|
pointerEvents: "none",
|
|
1234
1294
|
fontSize: "0"
|
|
@@ -1236,10 +1296,10 @@ function Image(props) {
|
|
|
1236
1296
|
style={{
|
|
1237
1297
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
1238
1298
|
}}
|
|
1239
|
-
/></
|
|
1240
|
-
<
|
|
1241
|
-
<
|
|
1242
|
-
class={
|
|
1299
|
+
/></Show7>
|
|
1300
|
+
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
1301
|
+
<Show7 when={!props.fitContent && props.children}><div
|
|
1302
|
+
class={css3({
|
|
1243
1303
|
display: "flex",
|
|
1244
1304
|
flexDirection: "column",
|
|
1245
1305
|
alignItems: "stretch",
|
|
@@ -1249,7 +1309,7 @@ function Image(props) {
|
|
|
1249
1309
|
width: "100%",
|
|
1250
1310
|
height: "100%"
|
|
1251
1311
|
})}
|
|
1252
|
-
>{props.children}</div></
|
|
1312
|
+
>{props.children}</div></Show7>
|
|
1253
1313
|
</>;
|
|
1254
1314
|
}
|
|
1255
1315
|
var image_default = Image;
|
|
@@ -1279,7 +1339,7 @@ var section_default = SectionComponent;
|
|
|
1279
1339
|
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as createSignal14 } from "solid-js";
|
|
1280
1340
|
|
|
1281
1341
|
// src/components/content-variants/content-variants.tsx
|
|
1282
|
-
import { Show as
|
|
1342
|
+
import { Show as Show11, For as For5, onMount as onMount3, createSignal as createSignal13 } from "solid-js";
|
|
1283
1343
|
|
|
1284
1344
|
// src/helpers/url.ts
|
|
1285
1345
|
var getTopLevelDomain = (host) => {
|
|
@@ -1473,7 +1533,7 @@ var handleABTesting = async ({
|
|
|
1473
1533
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1474
1534
|
|
|
1475
1535
|
// src/components/content/content.tsx
|
|
1476
|
-
import { Show as
|
|
1536
|
+
import { Show as Show10, createSignal as createSignal12 } from "solid-js";
|
|
1477
1537
|
|
|
1478
1538
|
// src/blocks/button/component-info.ts
|
|
1479
1539
|
var componentInfo = {
|
|
@@ -2279,7 +2339,7 @@ var componentInfo12 = {
|
|
|
2279
2339
|
};
|
|
2280
2340
|
|
|
2281
2341
|
// src/blocks/video/video.tsx
|
|
2282
|
-
import { Show as
|
|
2342
|
+
import { Show as Show8 } from "solid-js";
|
|
2283
2343
|
function Video(props) {
|
|
2284
2344
|
function videoProps() {
|
|
2285
2345
|
return {
|
|
@@ -2330,8 +2390,8 @@ function Video(props) {
|
|
|
2330
2390
|
}}
|
|
2331
2391
|
src={props.video || "no-src"}
|
|
2332
2392
|
poster={props.posterImage}
|
|
2333
|
-
><
|
|
2334
|
-
<
|
|
2393
|
+
><Show8 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show8></video>
|
|
2394
|
+
<Show8
|
|
2335
2395
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
2336
2396
|
><div
|
|
2337
2397
|
style={{
|
|
@@ -2340,15 +2400,15 @@ function Video(props) {
|
|
|
2340
2400
|
"pointer-events": "none",
|
|
2341
2401
|
"font-size": "0px"
|
|
2342
2402
|
}}
|
|
2343
|
-
/></
|
|
2344
|
-
<
|
|
2403
|
+
/></Show8>
|
|
2404
|
+
<Show8 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
2345
2405
|
style={{
|
|
2346
2406
|
display: "flex",
|
|
2347
2407
|
"flex-direction": "column",
|
|
2348
2408
|
"align-items": "stretch"
|
|
2349
2409
|
}}
|
|
2350
|
-
>{props.children}</div></
|
|
2351
|
-
<
|
|
2410
|
+
>{props.children}</div></Show8>
|
|
2411
|
+
<Show8 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
2352
2412
|
style={{
|
|
2353
2413
|
"pointer-events": "none",
|
|
2354
2414
|
display: "flex",
|
|
@@ -2360,7 +2420,7 @@ function Video(props) {
|
|
|
2360
2420
|
width: "100%",
|
|
2361
2421
|
height: "100%"
|
|
2362
2422
|
}}
|
|
2363
|
-
>{props.children}</div></
|
|
2423
|
+
>{props.children}</div></Show8>
|
|
2364
2424
|
</div>;
|
|
2365
2425
|
}
|
|
2366
2426
|
var video_default = Video;
|
|
@@ -2480,7 +2540,7 @@ function InlinedScript(props) {
|
|
|
2480
2540
|
var Inlined_script_default = InlinedScript;
|
|
2481
2541
|
|
|
2482
2542
|
// src/components/content/components/enable-editor.tsx
|
|
2483
|
-
import { Show as
|
|
2543
|
+
import { Show as Show9, onMount as onMount2, on as on2, createEffect as createEffect2, createSignal as createSignal10 } from "solid-js";
|
|
2484
2544
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
2485
2545
|
|
|
2486
2546
|
// src/helpers/preview-lru-cache/get.ts
|
|
@@ -2970,7 +3030,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
2970
3030
|
};
|
|
2971
3031
|
|
|
2972
3032
|
// src/constants/sdk-version.ts
|
|
2973
|
-
var SDK_VERSION = "0.12.
|
|
3033
|
+
var SDK_VERSION = "0.12.4";
|
|
2974
3034
|
|
|
2975
3035
|
// src/functions/register.ts
|
|
2976
3036
|
var registry = {};
|
|
@@ -3392,7 +3452,7 @@ function EnableEditor(props) {
|
|
|
3392
3452
|
}
|
|
3393
3453
|
}
|
|
3394
3454
|
createEffect2(on2(() => [props.locale], onUpdateFn_6));
|
|
3395
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
3455
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show9 when={props.builderContextSignal.content}><Dynamic5
|
|
3396
3456
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
3397
3457
|
{...{}}
|
|
3398
3458
|
key={forceReRenderCount()}
|
|
@@ -3407,7 +3467,7 @@ function EnableEditor(props) {
|
|
|
3407
3467
|
}}
|
|
3408
3468
|
{...props.contentWrapperProps}
|
|
3409
3469
|
component={ContentWrapper()}
|
|
3410
|
-
>{props.children}</Dynamic5></
|
|
3470
|
+
>{props.children}</Dynamic5></Show9></builder_context_default.Provider>;
|
|
3411
3471
|
}
|
|
3412
3472
|
var Enable_editor_default = EnableEditor;
|
|
3413
3473
|
|
|
@@ -3481,6 +3541,10 @@ ${getFontCss({
|
|
|
3481
3541
|
customFonts: props.customFonts
|
|
3482
3542
|
})}
|
|
3483
3543
|
|
|
3544
|
+
.builder-button {
|
|
3545
|
+
all: unset;
|
|
3546
|
+
}
|
|
3547
|
+
|
|
3484
3548
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
3485
3549
|
margin: 0;
|
|
3486
3550
|
}
|
|
@@ -3625,21 +3689,23 @@ function ContentComponent(props) {
|
|
|
3625
3689
|
builderContextSignal={builderContextSignal()}
|
|
3626
3690
|
contentWrapper={props.contentWrapper}
|
|
3627
3691
|
contentWrapperProps={props.contentWrapperProps}
|
|
3692
|
+
linkComponent={props.linkComponent}
|
|
3628
3693
|
trustedHosts={props.trustedHosts}
|
|
3629
3694
|
{...{
|
|
3630
3695
|
setBuilderContextSignal
|
|
3631
3696
|
}}
|
|
3632
3697
|
>
|
|
3633
|
-
<
|
|
3634
|
-
<
|
|
3698
|
+
<Show10 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show10>
|
|
3699
|
+
<Show10 when={TARGET !== "reactNative"}><Styles_default
|
|
3635
3700
|
contentId={builderContextSignal().content?.id}
|
|
3636
3701
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
3637
3702
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
3638
|
-
/></
|
|
3703
|
+
/></Show10>
|
|
3639
3704
|
<Blocks_default
|
|
3640
3705
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
3641
3706
|
context={builderContextSignal()}
|
|
3642
3707
|
registeredComponents={registeredComponents()}
|
|
3708
|
+
linkComponent={props.linkComponent}
|
|
3643
3709
|
/>
|
|
3644
3710
|
</Enable_editor_default></components_context_default.Provider>;
|
|
3645
3711
|
}
|
|
@@ -3678,8 +3744,8 @@ function ContentVariants(props) {
|
|
|
3678
3744
|
setShouldRenderVariants(false);
|
|
3679
3745
|
});
|
|
3680
3746
|
return <>
|
|
3681
|
-
<
|
|
3682
|
-
<
|
|
3747
|
+
<Show11 when={!props.__isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show11>
|
|
3748
|
+
<Show11 when={shouldRenderVariants()}>
|
|
3683
3749
|
<Inlined_styles_default
|
|
3684
3750
|
id={`variants-styles-${props.content?.id}`}
|
|
3685
3751
|
styles={hideVariantsStyleString()}
|
|
@@ -3699,6 +3765,7 @@ function ContentVariants(props) {
|
|
|
3699
3765
|
apiKey={props.apiKey}
|
|
3700
3766
|
apiVersion={props.apiVersion}
|
|
3701
3767
|
customComponents={props.customComponents}
|
|
3768
|
+
linkComponent={props.linkComponent}
|
|
3702
3769
|
canTrack={props.canTrack}
|
|
3703
3770
|
locale={props.locale}
|
|
3704
3771
|
includeRefs={props.includeRefs}
|
|
@@ -3711,7 +3778,7 @@ function ContentVariants(props) {
|
|
|
3711
3778
|
trustedHosts={props.trustedHosts}
|
|
3712
3779
|
/>;
|
|
3713
3780
|
}}</For5>
|
|
3714
|
-
</
|
|
3781
|
+
</Show11>
|
|
3715
3782
|
<Content_default
|
|
3716
3783
|
{...{}}
|
|
3717
3784
|
content={defaultContent()}
|
|
@@ -3722,6 +3789,7 @@ function ContentVariants(props) {
|
|
|
3722
3789
|
apiKey={props.apiKey}
|
|
3723
3790
|
apiVersion={props.apiVersion}
|
|
3724
3791
|
customComponents={props.customComponents}
|
|
3792
|
+
linkComponent={props.linkComponent}
|
|
3725
3793
|
canTrack={props.canTrack}
|
|
3726
3794
|
locale={props.locale}
|
|
3727
3795
|
includeRefs={props.includeRefs}
|
|
@@ -3766,7 +3834,7 @@ function Symbol(props) {
|
|
|
3766
3834
|
const [contentToUse, setContentToUse] = createSignal14(props.symbol?.content);
|
|
3767
3835
|
function className() {
|
|
3768
3836
|
return [
|
|
3769
|
-
...[props.attributes
|
|
3837
|
+
...[props.attributes[getClassPropName()]],
|
|
3770
3838
|
"builder-symbol",
|
|
3771
3839
|
props.symbol?.inline ? "builder-inline-symbol" : void 0,
|
|
3772
3840
|
props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0
|
|
@@ -3807,6 +3875,7 @@ function Symbol(props) {
|
|
|
3807
3875
|
}}
|
|
3808
3876
|
model={props.symbol?.model}
|
|
3809
3877
|
content={contentToUse()}
|
|
3878
|
+
linkComponent={props.builderLinkComponent}
|
|
3810
3879
|
/></div>;
|
|
3811
3880
|
}
|
|
3812
3881
|
var symbol_default = Symbol;
|