@builder.io/sdk-solid 0.12.3 → 0.12.5
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 +269 -165
- package/lib/browser/dev.jsx +211 -122
- package/lib/browser/index.js +269 -165
- package/lib/browser/index.jsx +211 -122
- package/lib/edge/dev.js +269 -165
- package/lib/edge/dev.jsx +211 -122
- package/lib/edge/index.js +269 -165
- package/lib/edge/index.jsx +211 -122
- package/lib/node/dev.js +269 -165
- package/lib/node/dev.jsx +211 -122
- package/lib/node/index.js +269 -165
- package/lib/node/index.jsx +211 -122
- package/package.json +1 -1
package/lib/browser/index.jsx
CHANGED
|
@@ -1,31 +1,81 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
2
2
|
import { Show } from "solid-js";
|
|
3
|
-
|
|
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) {
|
|
4
13
|
return <Show
|
|
5
|
-
fallback={<
|
|
6
|
-
class={`builder-button ${props.attributes.class}`}
|
|
7
|
-
role="button"
|
|
8
|
-
{...{}}
|
|
14
|
+
fallback={<Dynamic
|
|
9
15
|
{...props.attributes}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
15
28
|
{...props.attributes}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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>;
|
|
20
70
|
}
|
|
21
71
|
var button_default = Button;
|
|
22
72
|
|
|
23
73
|
// src/blocks/columns/columns.tsx
|
|
24
|
-
import { Show as
|
|
74
|
+
import { Show as Show6, For as For4, createSignal as createSignal5 } from "solid-js";
|
|
25
75
|
import { css as css2 } from "solid-styled-components";
|
|
26
76
|
|
|
27
77
|
// src/components/blocks/blocks.tsx
|
|
28
|
-
import { useContext, Show as
|
|
78
|
+
import { useContext, Show as Show5, For as For3 } from "solid-js";
|
|
29
79
|
|
|
30
80
|
// src/context/builder.context.ts
|
|
31
81
|
import { createContext } from "solid-js";
|
|
@@ -49,7 +99,7 @@ import { createContext as createContext2 } from "solid-js";
|
|
|
49
99
|
var components_context_default = createContext2({ registeredComponents: {} });
|
|
50
100
|
|
|
51
101
|
// src/components/block/block.tsx
|
|
52
|
-
import { Show as
|
|
102
|
+
import { Show as Show4, For as For2, createSignal as createSignal4 } from "solid-js";
|
|
53
103
|
|
|
54
104
|
// src/functions/get-block-component-options.ts
|
|
55
105
|
function getBlockComponentOptions(block) {
|
|
@@ -76,9 +126,6 @@ function isBrowser() {
|
|
|
76
126
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
77
127
|
}
|
|
78
128
|
|
|
79
|
-
// src/constants/target.ts
|
|
80
|
-
var TARGET = "solid";
|
|
81
|
-
|
|
82
129
|
// src/functions/is-iframe.ts
|
|
83
130
|
function isIframe() {
|
|
84
131
|
return isBrowser() && window.self !== window.top;
|
|
@@ -208,8 +255,33 @@ function flattenState(rootState, localState, rootSetState) {
|
|
|
208
255
|
});
|
|
209
256
|
}
|
|
210
257
|
|
|
258
|
+
// src/helpers/nullable.ts
|
|
259
|
+
var checkIsDefined = (maybeT) => maybeT !== null && maybeT !== void 0;
|
|
260
|
+
|
|
261
|
+
// src/functions/is-node-runtime.ts
|
|
262
|
+
function isNodeRuntime() {
|
|
263
|
+
return typeof process !== "undefined" && checkIsDefined(process?.versions?.node);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// src/functions/evaluate/should-force-browser-runtime-in-node.ts
|
|
267
|
+
var shouldForceBrowserRuntimeInNode = () => {
|
|
268
|
+
if (!isNodeRuntime())
|
|
269
|
+
return false;
|
|
270
|
+
const isArm64 = process.arch === "arm64";
|
|
271
|
+
const isNode20 = process.version.startsWith("v20");
|
|
272
|
+
const hasNoNodeSnapshotNodeOption = process.env.NODE_OPTIONS?.includes("--no-node-snapshot");
|
|
273
|
+
if (isArm64 && isNode20 && !hasNoNodeSnapshotNodeOption) {
|
|
274
|
+
logger.log(`Skipping usage of \`isolated-vm\` to avoid crashes in Node v20 on an arm64 machine.
|
|
275
|
+
If you would like to use the \`isolated-vm\` package on this machine, please provide the \`NODE_OPTIONS=--no-node-snapshot\` config to your Node process.
|
|
276
|
+
See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.
|
|
277
|
+
`);
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
return false;
|
|
281
|
+
};
|
|
282
|
+
|
|
211
283
|
// src/functions/evaluate/choose-eval.ts
|
|
212
|
-
var chooseBrowserOrServerEval = (args) => isBrowser() ? runInBrowser(args) : runInBrowser(args);
|
|
284
|
+
var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(args) : runInBrowser(args);
|
|
213
285
|
|
|
214
286
|
// src/functions/evaluate/evaluate.ts
|
|
215
287
|
function evaluate({
|
|
@@ -438,9 +510,6 @@ var getSizesForBreakpoints = ({
|
|
|
438
510
|
// src/functions/camel-to-kebab-case.ts
|
|
439
511
|
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
440
512
|
|
|
441
|
-
// src/helpers/nullable.ts
|
|
442
|
-
var checkIsDefined = (maybeT) => maybeT !== null && maybeT !== void 0;
|
|
443
|
-
|
|
444
513
|
// src/helpers/css.ts
|
|
445
514
|
var convertStyleMapToCSSArray = (style) => {
|
|
446
515
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -584,6 +653,38 @@ function getBlockActions(options) {
|
|
|
584
653
|
return obj;
|
|
585
654
|
}
|
|
586
655
|
|
|
656
|
+
// src/functions/transform-style-property.ts
|
|
657
|
+
function transformStyleProperty({
|
|
658
|
+
style
|
|
659
|
+
}) {
|
|
660
|
+
return style;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
// src/functions/get-style.ts
|
|
664
|
+
var getStyle = ({
|
|
665
|
+
block,
|
|
666
|
+
context
|
|
667
|
+
}) => {
|
|
668
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
669
|
+
style: block.style || {},
|
|
670
|
+
context,
|
|
671
|
+
block
|
|
672
|
+
}));
|
|
673
|
+
};
|
|
674
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
675
|
+
switch (TARGET) {
|
|
676
|
+
case "svelte":
|
|
677
|
+
case "vue":
|
|
678
|
+
case "solid":
|
|
679
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
680
|
+
case "qwik":
|
|
681
|
+
case "reactNative":
|
|
682
|
+
case "react":
|
|
683
|
+
case "rsc":
|
|
684
|
+
return style;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
587
688
|
// src/functions/transform-block-properties.ts
|
|
588
689
|
function transformBlockProperties({
|
|
589
690
|
properties
|
|
@@ -605,8 +706,11 @@ function getBlockProperties({
|
|
|
605
706
|
...extractRelevantRootBlockProperties(block),
|
|
606
707
|
...block.properties,
|
|
607
708
|
"builder-id": block.id,
|
|
608
|
-
style:
|
|
609
|
-
|
|
709
|
+
style: getStyle({
|
|
710
|
+
block,
|
|
711
|
+
context
|
|
712
|
+
}),
|
|
713
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
610
714
|
};
|
|
611
715
|
return transformBlockProperties({
|
|
612
716
|
properties,
|
|
@@ -614,53 +718,6 @@ function getBlockProperties({
|
|
|
614
718
|
block
|
|
615
719
|
});
|
|
616
720
|
}
|
|
617
|
-
function getStyleAttribute(style) {
|
|
618
|
-
switch (TARGET) {
|
|
619
|
-
case "svelte":
|
|
620
|
-
case "vue":
|
|
621
|
-
case "solid":
|
|
622
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
623
|
-
case "qwik":
|
|
624
|
-
case "reactNative":
|
|
625
|
-
case "react":
|
|
626
|
-
case "rsc":
|
|
627
|
-
return style;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
632
|
-
import { Show as Show3 } from "solid-js";
|
|
633
|
-
import { Dynamic } from "solid-js/web";
|
|
634
|
-
|
|
635
|
-
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
636
|
-
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
637
|
-
var isEmptyElement = (tagName) => {
|
|
638
|
-
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
639
|
-
};
|
|
640
|
-
|
|
641
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
642
|
-
function DynamicRenderer(props) {
|
|
643
|
-
return <Show3
|
|
644
|
-
fallback={<Dynamic
|
|
645
|
-
{...props.attributes}
|
|
646
|
-
{...props.actionAttributes}
|
|
647
|
-
component={props.TagName}
|
|
648
|
-
/>}
|
|
649
|
-
when={!isEmptyElement(props.TagName)}
|
|
650
|
-
><Show3
|
|
651
|
-
fallback={<Dynamic
|
|
652
|
-
{...props.attributes}
|
|
653
|
-
{...props.actionAttributes}
|
|
654
|
-
component={props.TagName}
|
|
655
|
-
>{props.children}</Dynamic>}
|
|
656
|
-
when={typeof props.TagName === "string"}
|
|
657
|
-
><Dynamic
|
|
658
|
-
{...props.attributes}
|
|
659
|
-
{...props.actionAttributes}
|
|
660
|
-
component={props.TagName}
|
|
661
|
-
>{props.children}</Dynamic></Show3></Show3>;
|
|
662
|
-
}
|
|
663
|
-
var Dynamic_renderer_default = DynamicRenderer;
|
|
664
721
|
|
|
665
722
|
// src/components/block/components/block-wrapper.tsx
|
|
666
723
|
function BlockWrapper(props) {
|
|
@@ -683,7 +740,7 @@ function BlockWrapper(props) {
|
|
|
683
740
|
var Block_wrapper_default = BlockWrapper;
|
|
684
741
|
|
|
685
742
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
686
|
-
import { Show as
|
|
743
|
+
import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
|
|
687
744
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
688
745
|
|
|
689
746
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -747,12 +804,13 @@ function ComponentRef(props) {
|
|
|
747
804
|
const [Wrapper, setWrapper] = createSignal2(
|
|
748
805
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
749
806
|
);
|
|
750
|
-
return <
|
|
807
|
+
return <Show3 when={props.componentRef}><Dynamic3
|
|
751
808
|
{...getWrapperProps({
|
|
752
809
|
componentOptions: props.componentOptions,
|
|
753
810
|
builderBlock: props.builderBlock,
|
|
754
811
|
context: props.context,
|
|
755
812
|
componentRef: props.componentRef,
|
|
813
|
+
linkComponent: props.linkComponent,
|
|
756
814
|
includeBlockProps: props.includeBlockProps,
|
|
757
815
|
isInteractive: props.isInteractive,
|
|
758
816
|
contextValue: props.context
|
|
@@ -765,8 +823,9 @@ function ComponentRef(props) {
|
|
|
765
823
|
block={child}
|
|
766
824
|
context={props.context}
|
|
767
825
|
registeredComponents={props.registeredComponents}
|
|
826
|
+
linkComponent={props.linkComponent}
|
|
768
827
|
/>;
|
|
769
|
-
}}</For></Dynamic3></
|
|
828
|
+
}}</For></Dynamic3></Show3>;
|
|
770
829
|
}
|
|
771
830
|
var Component_ref_default = ComponentRef;
|
|
772
831
|
|
|
@@ -778,6 +837,7 @@ function RepeatedBlock(props) {
|
|
|
778
837
|
block={props.block}
|
|
779
838
|
context={store()}
|
|
780
839
|
registeredComponents={props.registeredComponents}
|
|
840
|
+
linkComponent={props.linkComponent}
|
|
781
841
|
/></builder_context_default.Provider>;
|
|
782
842
|
}
|
|
783
843
|
var Repeated_block_default = RepeatedBlock;
|
|
@@ -809,6 +869,10 @@ function Block(props) {
|
|
|
809
869
|
});
|
|
810
870
|
}
|
|
811
871
|
function Tag() {
|
|
872
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
873
|
+
if (shouldUseLink) {
|
|
874
|
+
return props.linkComponent || "a";
|
|
875
|
+
}
|
|
812
876
|
return props.block.tagName || "div";
|
|
813
877
|
}
|
|
814
878
|
function canShowBlock() {
|
|
@@ -832,32 +896,37 @@ function Block(props) {
|
|
|
832
896
|
componentOptions: {
|
|
833
897
|
...getBlockComponentOptions(processedBlock()),
|
|
834
898
|
builderContext: props.context,
|
|
899
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
900
|
+
builderLinkComponent: props.linkComponent
|
|
901
|
+
} : {},
|
|
835
902
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
836
903
|
builderComponents: props.registeredComponents
|
|
837
904
|
} : {}
|
|
838
905
|
},
|
|
839
906
|
context: childrenContext(),
|
|
907
|
+
linkComponent: props.linkComponent,
|
|
840
908
|
registeredComponents: props.registeredComponents,
|
|
841
909
|
builderBlock: processedBlock(),
|
|
842
910
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
843
911
|
isInteractive: !blockComponent()?.isRSC
|
|
844
912
|
};
|
|
845
913
|
}
|
|
846
|
-
return <
|
|
914
|
+
return <Show4 when={canShowBlock()}>
|
|
847
915
|
<Block_styles_default block={props.block} context={props.context} />
|
|
848
|
-
<
|
|
916
|
+
<Show4
|
|
849
917
|
fallback={<Component_ref_default
|
|
850
918
|
componentRef={componentRefProps().componentRef}
|
|
851
919
|
componentOptions={componentRefProps().componentOptions}
|
|
852
920
|
blockChildren={componentRefProps().blockChildren}
|
|
853
921
|
context={componentRefProps().context}
|
|
854
922
|
registeredComponents={componentRefProps().registeredComponents}
|
|
923
|
+
linkComponent={componentRefProps().linkComponent}
|
|
855
924
|
builderBlock={componentRefProps().builderBlock}
|
|
856
925
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
857
926
|
isInteractive={componentRefProps().isInteractive}
|
|
858
927
|
/>}
|
|
859
928
|
when={!blockComponent()?.noWrap}
|
|
860
|
-
><
|
|
929
|
+
><Show4
|
|
861
930
|
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
862
931
|
const index = _index();
|
|
863
932
|
return <Repeated_block_default
|
|
@@ -865,6 +934,7 @@ function Block(props) {
|
|
|
865
934
|
repeatContext={data.context}
|
|
866
935
|
block={data.block}
|
|
867
936
|
registeredComponents={props.registeredComponents}
|
|
937
|
+
linkComponent={props.linkComponent}
|
|
868
938
|
/>;
|
|
869
939
|
}}</For2>}
|
|
870
940
|
when={!repeatItem()}
|
|
@@ -872,6 +942,7 @@ function Block(props) {
|
|
|
872
942
|
Wrapper={Tag()}
|
|
873
943
|
block={processedBlock()}
|
|
874
944
|
context={props.context}
|
|
945
|
+
linkComponent={props.linkComponent}
|
|
875
946
|
>
|
|
876
947
|
<Component_ref_default
|
|
877
948
|
componentRef={componentRefProps().componentRef}
|
|
@@ -879,6 +950,7 @@ function Block(props) {
|
|
|
879
950
|
blockChildren={componentRefProps().blockChildren}
|
|
880
951
|
context={componentRefProps().context}
|
|
881
952
|
registeredComponents={componentRefProps().registeredComponents}
|
|
953
|
+
linkComponent={componentRefProps().linkComponent}
|
|
882
954
|
builderBlock={componentRefProps().builderBlock}
|
|
883
955
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
884
956
|
isInteractive={componentRefProps().isInteractive}
|
|
@@ -890,10 +962,11 @@ function Block(props) {
|
|
|
890
962
|
block={child}
|
|
891
963
|
context={childrenContext()}
|
|
892
964
|
registeredComponents={props.registeredComponents}
|
|
965
|
+
linkComponent={props.linkComponent}
|
|
893
966
|
/>;
|
|
894
967
|
}}</For2>
|
|
895
|
-
</Block_wrapper_default></
|
|
896
|
-
</
|
|
968
|
+
</Block_wrapper_default></Show4></Show4>
|
|
969
|
+
</Show4>;
|
|
897
970
|
}
|
|
898
971
|
var Block_default = Block;
|
|
899
972
|
|
|
@@ -962,15 +1035,16 @@ function Blocks(props) {
|
|
|
962
1035
|
styleProp={props.styleProp}
|
|
963
1036
|
BlocksWrapper={props.context?.BlocksWrapper}
|
|
964
1037
|
BlocksWrapperProps={props.context?.BlocksWrapperProps}
|
|
965
|
-
><
|
|
1038
|
+
><Show5 when={props.blocks}><For3 each={props.blocks}>{(block, _index) => {
|
|
966
1039
|
const index = _index();
|
|
967
1040
|
return <Block_default
|
|
968
1041
|
key={block.id}
|
|
969
1042
|
block={block}
|
|
1043
|
+
linkComponent={props.linkComponent}
|
|
970
1044
|
context={props.context || builderContext}
|
|
971
1045
|
registeredComponents={props.registeredComponents || componentsContext.registeredComponents}
|
|
972
1046
|
/>;
|
|
973
|
-
}}</For3></
|
|
1047
|
+
}}</For3></Show5></Blocks_wrapper_default>;
|
|
974
1048
|
}
|
|
975
1049
|
var Blocks_default = Blocks;
|
|
976
1050
|
|
|
@@ -1019,7 +1093,13 @@ function Columns(props) {
|
|
|
1019
1093
|
const mobileWidth = "100%";
|
|
1020
1094
|
const mobileMarginLeft = 0;
|
|
1021
1095
|
const marginLeftKey = "margin-left";
|
|
1096
|
+
const sharedStyles = {
|
|
1097
|
+
display: "flex",
|
|
1098
|
+
flexDirection: "column",
|
|
1099
|
+
alignItems: "stretch"
|
|
1100
|
+
};
|
|
1022
1101
|
return {
|
|
1102
|
+
...sharedStyles,
|
|
1023
1103
|
width,
|
|
1024
1104
|
[marginLeftKey]: gutterPixels,
|
|
1025
1105
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1081,18 +1161,21 @@ function Columns(props) {
|
|
|
1081
1161
|
style={columnsCssVars()}
|
|
1082
1162
|
{...{}}
|
|
1083
1163
|
>
|
|
1084
|
-
<
|
|
1164
|
+
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default styles={columnsStyles()} /></Show6>
|
|
1085
1165
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1086
1166
|
const index = _index();
|
|
1087
|
-
return <
|
|
1088
|
-
class={"builder-column " + css2({
|
|
1089
|
-
display: "flex",
|
|
1090
|
-
flexDirection: "column",
|
|
1091
|
-
alignItems: "stretch"
|
|
1092
|
-
})}
|
|
1093
|
-
style={columnCssVars(index)}
|
|
1094
|
-
{...{}}
|
|
1167
|
+
return <Dynamic_renderer_default
|
|
1095
1168
|
key={index}
|
|
1169
|
+
TagName={column.link ? props.builderLinkComponent || "a" : "div"}
|
|
1170
|
+
actionAttributes={{}}
|
|
1171
|
+
attributes={{
|
|
1172
|
+
...{},
|
|
1173
|
+
...column.link ? {
|
|
1174
|
+
href: column.link
|
|
1175
|
+
} : {},
|
|
1176
|
+
[getClassPropName()]: "builder-column",
|
|
1177
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1178
|
+
}}
|
|
1096
1179
|
><Blocks_default
|
|
1097
1180
|
path={`component.options.columns.${index}.blocks`}
|
|
1098
1181
|
parent={props.builderBlock.id}
|
|
@@ -1101,8 +1184,9 @@ function Columns(props) {
|
|
|
1101
1184
|
}}
|
|
1102
1185
|
context={props.builderContext}
|
|
1103
1186
|
registeredComponents={props.builderComponents}
|
|
1187
|
+
linkComponent={props.builderLinkComponent}
|
|
1104
1188
|
blocks={column.blocks}
|
|
1105
|
-
/></
|
|
1189
|
+
/></Dynamic_renderer_default>;
|
|
1106
1190
|
}}</For4>
|
|
1107
1191
|
</div>;
|
|
1108
1192
|
}
|
|
@@ -1115,7 +1199,7 @@ function FragmentComponent(props) {
|
|
|
1115
1199
|
var fragment_default = FragmentComponent;
|
|
1116
1200
|
|
|
1117
1201
|
// src/blocks/image/image.tsx
|
|
1118
|
-
import { Show as
|
|
1202
|
+
import { Show as Show7 } from "solid-js";
|
|
1119
1203
|
import { css as css3 } from "solid-styled-components";
|
|
1120
1204
|
|
|
1121
1205
|
// src/blocks/image/image.helpers.ts
|
|
@@ -1204,7 +1288,7 @@ function Image(props) {
|
|
|
1204
1288
|
}
|
|
1205
1289
|
return <>
|
|
1206
1290
|
<picture>
|
|
1207
|
-
<
|
|
1291
|
+
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
1208
1292
|
<img
|
|
1209
1293
|
class={"builder-image" + (props.className ? " " + props.className : "") + " " + css3({
|
|
1210
1294
|
opacity: "1",
|
|
@@ -1223,7 +1307,7 @@ function Image(props) {
|
|
|
1223
1307
|
sizes={props.sizes}
|
|
1224
1308
|
/>
|
|
1225
1309
|
</picture>
|
|
1226
|
-
<
|
|
1310
|
+
<Show7
|
|
1227
1311
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
1228
1312
|
><div
|
|
1229
1313
|
class={"builder-image-sizer " + css3({
|
|
@@ -1234,9 +1318,9 @@ function Image(props) {
|
|
|
1234
1318
|
style={{
|
|
1235
1319
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
1236
1320
|
}}
|
|
1237
|
-
/></
|
|
1238
|
-
<
|
|
1239
|
-
<
|
|
1321
|
+
/></Show7>
|
|
1322
|
+
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
1323
|
+
<Show7 when={!props.fitContent && props.children}><div
|
|
1240
1324
|
class={css3({
|
|
1241
1325
|
display: "flex",
|
|
1242
1326
|
flexDirection: "column",
|
|
@@ -1247,7 +1331,7 @@ function Image(props) {
|
|
|
1247
1331
|
width: "100%",
|
|
1248
1332
|
height: "100%"
|
|
1249
1333
|
})}
|
|
1250
|
-
>{props.children}</div></
|
|
1334
|
+
>{props.children}</div></Show7>
|
|
1251
1335
|
</>;
|
|
1252
1336
|
}
|
|
1253
1337
|
var image_default = Image;
|
|
@@ -1277,7 +1361,7 @@ var section_default = SectionComponent;
|
|
|
1277
1361
|
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as createSignal14 } from "solid-js";
|
|
1278
1362
|
|
|
1279
1363
|
// src/components/content-variants/content-variants.tsx
|
|
1280
|
-
import { Show as
|
|
1364
|
+
import { Show as Show11, For as For5, onMount as onMount3, createSignal as createSignal13 } from "solid-js";
|
|
1281
1365
|
|
|
1282
1366
|
// src/helpers/url.ts
|
|
1283
1367
|
var getTopLevelDomain = (host) => {
|
|
@@ -1471,7 +1555,7 @@ var handleABTesting = async ({
|
|
|
1471
1555
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1472
1556
|
|
|
1473
1557
|
// src/components/content/content.tsx
|
|
1474
|
-
import { Show as
|
|
1558
|
+
import { Show as Show10, createSignal as createSignal12 } from "solid-js";
|
|
1475
1559
|
|
|
1476
1560
|
// src/blocks/button/component-info.ts
|
|
1477
1561
|
var componentInfo = {
|
|
@@ -2277,7 +2361,7 @@ var componentInfo12 = {
|
|
|
2277
2361
|
};
|
|
2278
2362
|
|
|
2279
2363
|
// src/blocks/video/video.tsx
|
|
2280
|
-
import { Show as
|
|
2364
|
+
import { Show as Show8 } from "solid-js";
|
|
2281
2365
|
function Video(props) {
|
|
2282
2366
|
function videoProps() {
|
|
2283
2367
|
return {
|
|
@@ -2328,8 +2412,8 @@ function Video(props) {
|
|
|
2328
2412
|
}}
|
|
2329
2413
|
src={props.video || "no-src"}
|
|
2330
2414
|
poster={props.posterImage}
|
|
2331
|
-
><
|
|
2332
|
-
<
|
|
2415
|
+
><Show8 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show8></video>
|
|
2416
|
+
<Show8
|
|
2333
2417
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
2334
2418
|
><div
|
|
2335
2419
|
style={{
|
|
@@ -2338,15 +2422,15 @@ function Video(props) {
|
|
|
2338
2422
|
"pointer-events": "none",
|
|
2339
2423
|
"font-size": "0px"
|
|
2340
2424
|
}}
|
|
2341
|
-
/></
|
|
2342
|
-
<
|
|
2425
|
+
/></Show8>
|
|
2426
|
+
<Show8 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
2343
2427
|
style={{
|
|
2344
2428
|
display: "flex",
|
|
2345
2429
|
"flex-direction": "column",
|
|
2346
2430
|
"align-items": "stretch"
|
|
2347
2431
|
}}
|
|
2348
|
-
>{props.children}</div></
|
|
2349
|
-
<
|
|
2432
|
+
>{props.children}</div></Show8>
|
|
2433
|
+
<Show8 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
2350
2434
|
style={{
|
|
2351
2435
|
"pointer-events": "none",
|
|
2352
2436
|
display: "flex",
|
|
@@ -2358,7 +2442,7 @@ function Video(props) {
|
|
|
2358
2442
|
width: "100%",
|
|
2359
2443
|
height: "100%"
|
|
2360
2444
|
}}
|
|
2361
|
-
>{props.children}</div></
|
|
2445
|
+
>{props.children}</div></Show8>
|
|
2362
2446
|
</div>;
|
|
2363
2447
|
}
|
|
2364
2448
|
var video_default = Video;
|
|
@@ -2478,7 +2562,7 @@ function InlinedScript(props) {
|
|
|
2478
2562
|
var Inlined_script_default = InlinedScript;
|
|
2479
2563
|
|
|
2480
2564
|
// src/components/content/components/enable-editor.tsx
|
|
2481
|
-
import { Show as
|
|
2565
|
+
import { Show as Show9, onMount as onMount2, on as on2, createEffect as createEffect2, createSignal as createSignal10 } from "solid-js";
|
|
2482
2566
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
2483
2567
|
|
|
2484
2568
|
// src/helpers/preview-lru-cache/get.ts
|
|
@@ -2968,7 +3052,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
2968
3052
|
};
|
|
2969
3053
|
|
|
2970
3054
|
// src/constants/sdk-version.ts
|
|
2971
|
-
var SDK_VERSION = "0.12.
|
|
3055
|
+
var SDK_VERSION = "0.12.5";
|
|
2972
3056
|
|
|
2973
3057
|
// src/functions/register.ts
|
|
2974
3058
|
var registry = {};
|
|
@@ -3390,7 +3474,7 @@ function EnableEditor(props) {
|
|
|
3390
3474
|
}
|
|
3391
3475
|
}
|
|
3392
3476
|
createEffect2(on2(() => [props.locale], onUpdateFn_6));
|
|
3393
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
3477
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show9 when={props.builderContextSignal.content}><Dynamic5
|
|
3394
3478
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
3395
3479
|
{...{}}
|
|
3396
3480
|
key={forceReRenderCount()}
|
|
@@ -3405,7 +3489,7 @@ function EnableEditor(props) {
|
|
|
3405
3489
|
}}
|
|
3406
3490
|
{...props.contentWrapperProps}
|
|
3407
3491
|
component={ContentWrapper()}
|
|
3408
|
-
>{props.children}</Dynamic5></
|
|
3492
|
+
>{props.children}</Dynamic5></Show9></builder_context_default.Provider>;
|
|
3409
3493
|
}
|
|
3410
3494
|
var Enable_editor_default = EnableEditor;
|
|
3411
3495
|
|
|
@@ -3627,21 +3711,23 @@ function ContentComponent(props) {
|
|
|
3627
3711
|
builderContextSignal={builderContextSignal()}
|
|
3628
3712
|
contentWrapper={props.contentWrapper}
|
|
3629
3713
|
contentWrapperProps={props.contentWrapperProps}
|
|
3714
|
+
linkComponent={props.linkComponent}
|
|
3630
3715
|
trustedHosts={props.trustedHosts}
|
|
3631
3716
|
{...{
|
|
3632
3717
|
setBuilderContextSignal
|
|
3633
3718
|
}}
|
|
3634
3719
|
>
|
|
3635
|
-
<
|
|
3636
|
-
<
|
|
3720
|
+
<Show10 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show10>
|
|
3721
|
+
<Show10 when={TARGET !== "reactNative"}><Styles_default
|
|
3637
3722
|
contentId={builderContextSignal().content?.id}
|
|
3638
3723
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
3639
3724
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
3640
|
-
/></
|
|
3725
|
+
/></Show10>
|
|
3641
3726
|
<Blocks_default
|
|
3642
3727
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
3643
3728
|
context={builderContextSignal()}
|
|
3644
3729
|
registeredComponents={registeredComponents()}
|
|
3730
|
+
linkComponent={props.linkComponent}
|
|
3645
3731
|
/>
|
|
3646
3732
|
</Enable_editor_default></components_context_default.Provider>;
|
|
3647
3733
|
}
|
|
@@ -3680,8 +3766,8 @@ function ContentVariants(props) {
|
|
|
3680
3766
|
setShouldRenderVariants(false);
|
|
3681
3767
|
});
|
|
3682
3768
|
return <>
|
|
3683
|
-
<
|
|
3684
|
-
<
|
|
3769
|
+
<Show11 when={!props.__isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show11>
|
|
3770
|
+
<Show11 when={shouldRenderVariants()}>
|
|
3685
3771
|
<Inlined_styles_default
|
|
3686
3772
|
id={`variants-styles-${props.content?.id}`}
|
|
3687
3773
|
styles={hideVariantsStyleString()}
|
|
@@ -3701,6 +3787,7 @@ function ContentVariants(props) {
|
|
|
3701
3787
|
apiKey={props.apiKey}
|
|
3702
3788
|
apiVersion={props.apiVersion}
|
|
3703
3789
|
customComponents={props.customComponents}
|
|
3790
|
+
linkComponent={props.linkComponent}
|
|
3704
3791
|
canTrack={props.canTrack}
|
|
3705
3792
|
locale={props.locale}
|
|
3706
3793
|
includeRefs={props.includeRefs}
|
|
@@ -3713,7 +3800,7 @@ function ContentVariants(props) {
|
|
|
3713
3800
|
trustedHosts={props.trustedHosts}
|
|
3714
3801
|
/>;
|
|
3715
3802
|
}}</For5>
|
|
3716
|
-
</
|
|
3803
|
+
</Show11>
|
|
3717
3804
|
<Content_default
|
|
3718
3805
|
{...{}}
|
|
3719
3806
|
content={defaultContent()}
|
|
@@ -3724,6 +3811,7 @@ function ContentVariants(props) {
|
|
|
3724
3811
|
apiKey={props.apiKey}
|
|
3725
3812
|
apiVersion={props.apiVersion}
|
|
3726
3813
|
customComponents={props.customComponents}
|
|
3814
|
+
linkComponent={props.linkComponent}
|
|
3727
3815
|
canTrack={props.canTrack}
|
|
3728
3816
|
locale={props.locale}
|
|
3729
3817
|
includeRefs={props.includeRefs}
|
|
@@ -3768,7 +3856,7 @@ function Symbol(props) {
|
|
|
3768
3856
|
const [contentToUse, setContentToUse] = createSignal14(props.symbol?.content);
|
|
3769
3857
|
function className() {
|
|
3770
3858
|
return [
|
|
3771
|
-
...[props.attributes
|
|
3859
|
+
...[props.attributes[getClassPropName()]],
|
|
3772
3860
|
"builder-symbol",
|
|
3773
3861
|
props.symbol?.inline ? "builder-inline-symbol" : void 0,
|
|
3774
3862
|
props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0
|
|
@@ -3809,6 +3897,7 @@ function Symbol(props) {
|
|
|
3809
3897
|
}}
|
|
3810
3898
|
model={props.symbol?.model}
|
|
3811
3899
|
content={contentToUse()}
|
|
3900
|
+
linkComponent={props.builderLinkComponent}
|
|
3812
3901
|
/></div>;
|
|
3813
3902
|
}
|
|
3814
3903
|
var symbol_default = Symbol;
|