@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/node/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;
|
|
@@ -346,8 +393,33 @@ var runInNode = ({
|
|
|
346
393
|
}
|
|
347
394
|
};
|
|
348
395
|
|
|
396
|
+
// src/helpers/nullable.ts
|
|
397
|
+
var checkIsDefined = (maybeT) => maybeT !== null && maybeT !== void 0;
|
|
398
|
+
|
|
399
|
+
// src/functions/is-node-runtime.ts
|
|
400
|
+
function isNodeRuntime() {
|
|
401
|
+
return typeof process !== "undefined" && checkIsDefined(process?.versions?.node);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// src/functions/evaluate/should-force-browser-runtime-in-node.ts
|
|
405
|
+
var shouldForceBrowserRuntimeInNode = () => {
|
|
406
|
+
if (!isNodeRuntime())
|
|
407
|
+
return false;
|
|
408
|
+
const isArm64 = process.arch === "arm64";
|
|
409
|
+
const isNode20 = process.version.startsWith("v20");
|
|
410
|
+
const hasNoNodeSnapshotNodeOption = process.env.NODE_OPTIONS?.includes("--no-node-snapshot");
|
|
411
|
+
if (isArm64 && isNode20 && !hasNoNodeSnapshotNodeOption) {
|
|
412
|
+
logger.log(`Skipping usage of \`isolated-vm\` to avoid crashes in Node v20 on an arm64 machine.
|
|
413
|
+
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.
|
|
414
|
+
See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.
|
|
415
|
+
`);
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
return false;
|
|
419
|
+
};
|
|
420
|
+
|
|
349
421
|
// src/functions/evaluate/choose-eval.ts
|
|
350
|
-
var chooseBrowserOrServerEval = (args) => isBrowser() ? runInBrowser(args) : runInNode(args);
|
|
422
|
+
var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(args) : runInNode(args);
|
|
351
423
|
|
|
352
424
|
// src/functions/evaluate/evaluate.ts
|
|
353
425
|
function evaluate({
|
|
@@ -563,9 +635,6 @@ var getSizesForBreakpoints = ({
|
|
|
563
635
|
// src/functions/camel-to-kebab-case.ts
|
|
564
636
|
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
565
637
|
|
|
566
|
-
// src/helpers/nullable.ts
|
|
567
|
-
var checkIsDefined = (maybeT) => maybeT !== null && maybeT !== void 0;
|
|
568
|
-
|
|
569
638
|
// src/helpers/css.ts
|
|
570
639
|
var convertStyleMapToCSSArray = (style) => {
|
|
571
640
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -709,6 +778,38 @@ function getBlockActions(options) {
|
|
|
709
778
|
return obj;
|
|
710
779
|
}
|
|
711
780
|
|
|
781
|
+
// src/functions/transform-style-property.ts
|
|
782
|
+
function transformStyleProperty({
|
|
783
|
+
style
|
|
784
|
+
}) {
|
|
785
|
+
return style;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// src/functions/get-style.ts
|
|
789
|
+
var getStyle = ({
|
|
790
|
+
block,
|
|
791
|
+
context
|
|
792
|
+
}) => {
|
|
793
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
794
|
+
style: block.style || {},
|
|
795
|
+
context,
|
|
796
|
+
block
|
|
797
|
+
}));
|
|
798
|
+
};
|
|
799
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
800
|
+
switch (TARGET) {
|
|
801
|
+
case "svelte":
|
|
802
|
+
case "vue":
|
|
803
|
+
case "solid":
|
|
804
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
805
|
+
case "qwik":
|
|
806
|
+
case "reactNative":
|
|
807
|
+
case "react":
|
|
808
|
+
case "rsc":
|
|
809
|
+
return style;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
|
|
712
813
|
// src/functions/transform-block-properties.ts
|
|
713
814
|
function transformBlockProperties({
|
|
714
815
|
properties
|
|
@@ -730,8 +831,11 @@ function getBlockProperties({
|
|
|
730
831
|
...extractRelevantRootBlockProperties(block),
|
|
731
832
|
...block.properties,
|
|
732
833
|
"builder-id": block.id,
|
|
733
|
-
style:
|
|
734
|
-
|
|
834
|
+
style: getStyle({
|
|
835
|
+
block,
|
|
836
|
+
context
|
|
837
|
+
}),
|
|
838
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
735
839
|
};
|
|
736
840
|
return transformBlockProperties({
|
|
737
841
|
properties,
|
|
@@ -739,53 +843,6 @@ function getBlockProperties({
|
|
|
739
843
|
block
|
|
740
844
|
});
|
|
741
845
|
}
|
|
742
|
-
function getStyleAttribute(style) {
|
|
743
|
-
switch (TARGET) {
|
|
744
|
-
case "svelte":
|
|
745
|
-
case "vue":
|
|
746
|
-
case "solid":
|
|
747
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
748
|
-
case "qwik":
|
|
749
|
-
case "reactNative":
|
|
750
|
-
case "react":
|
|
751
|
-
case "rsc":
|
|
752
|
-
return style;
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
757
|
-
import { Show as Show3 } from "solid-js";
|
|
758
|
-
import { Dynamic } from "solid-js/web";
|
|
759
|
-
|
|
760
|
-
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
761
|
-
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
762
|
-
var isEmptyElement = (tagName) => {
|
|
763
|
-
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
764
|
-
};
|
|
765
|
-
|
|
766
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
767
|
-
function DynamicRenderer(props) {
|
|
768
|
-
return <Show3
|
|
769
|
-
fallback={<Dynamic
|
|
770
|
-
{...props.attributes}
|
|
771
|
-
{...props.actionAttributes}
|
|
772
|
-
component={props.TagName}
|
|
773
|
-
/>}
|
|
774
|
-
when={!isEmptyElement(props.TagName)}
|
|
775
|
-
><Show3
|
|
776
|
-
fallback={<Dynamic
|
|
777
|
-
{...props.attributes}
|
|
778
|
-
{...props.actionAttributes}
|
|
779
|
-
component={props.TagName}
|
|
780
|
-
>{props.children}</Dynamic>}
|
|
781
|
-
when={typeof props.TagName === "string"}
|
|
782
|
-
><Dynamic
|
|
783
|
-
{...props.attributes}
|
|
784
|
-
{...props.actionAttributes}
|
|
785
|
-
component={props.TagName}
|
|
786
|
-
>{props.children}</Dynamic></Show3></Show3>;
|
|
787
|
-
}
|
|
788
|
-
var Dynamic_renderer_default = DynamicRenderer;
|
|
789
846
|
|
|
790
847
|
// src/components/block/components/block-wrapper.tsx
|
|
791
848
|
function BlockWrapper(props) {
|
|
@@ -808,7 +865,7 @@ function BlockWrapper(props) {
|
|
|
808
865
|
var Block_wrapper_default = BlockWrapper;
|
|
809
866
|
|
|
810
867
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
811
|
-
import { Show as
|
|
868
|
+
import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
|
|
812
869
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
813
870
|
|
|
814
871
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -872,12 +929,13 @@ function ComponentRef(props) {
|
|
|
872
929
|
const [Wrapper, setWrapper] = createSignal2(
|
|
873
930
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
874
931
|
);
|
|
875
|
-
return <
|
|
932
|
+
return <Show3 when={props.componentRef}><Dynamic3
|
|
876
933
|
{...getWrapperProps({
|
|
877
934
|
componentOptions: props.componentOptions,
|
|
878
935
|
builderBlock: props.builderBlock,
|
|
879
936
|
context: props.context,
|
|
880
937
|
componentRef: props.componentRef,
|
|
938
|
+
linkComponent: props.linkComponent,
|
|
881
939
|
includeBlockProps: props.includeBlockProps,
|
|
882
940
|
isInteractive: props.isInteractive,
|
|
883
941
|
contextValue: props.context
|
|
@@ -890,8 +948,9 @@ function ComponentRef(props) {
|
|
|
890
948
|
block={child}
|
|
891
949
|
context={props.context}
|
|
892
950
|
registeredComponents={props.registeredComponents}
|
|
951
|
+
linkComponent={props.linkComponent}
|
|
893
952
|
/>;
|
|
894
|
-
}}</For></Dynamic3></
|
|
953
|
+
}}</For></Dynamic3></Show3>;
|
|
895
954
|
}
|
|
896
955
|
var Component_ref_default = ComponentRef;
|
|
897
956
|
|
|
@@ -903,6 +962,7 @@ function RepeatedBlock(props) {
|
|
|
903
962
|
block={props.block}
|
|
904
963
|
context={store()}
|
|
905
964
|
registeredComponents={props.registeredComponents}
|
|
965
|
+
linkComponent={props.linkComponent}
|
|
906
966
|
/></builder_context_default.Provider>;
|
|
907
967
|
}
|
|
908
968
|
var Repeated_block_default = RepeatedBlock;
|
|
@@ -934,6 +994,10 @@ function Block(props) {
|
|
|
934
994
|
});
|
|
935
995
|
}
|
|
936
996
|
function Tag() {
|
|
997
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
998
|
+
if (shouldUseLink) {
|
|
999
|
+
return props.linkComponent || "a";
|
|
1000
|
+
}
|
|
937
1001
|
return props.block.tagName || "div";
|
|
938
1002
|
}
|
|
939
1003
|
function canShowBlock() {
|
|
@@ -957,32 +1021,37 @@ function Block(props) {
|
|
|
957
1021
|
componentOptions: {
|
|
958
1022
|
...getBlockComponentOptions(processedBlock()),
|
|
959
1023
|
builderContext: props.context,
|
|
1024
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
1025
|
+
builderLinkComponent: props.linkComponent
|
|
1026
|
+
} : {},
|
|
960
1027
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
961
1028
|
builderComponents: props.registeredComponents
|
|
962
1029
|
} : {}
|
|
963
1030
|
},
|
|
964
1031
|
context: childrenContext(),
|
|
1032
|
+
linkComponent: props.linkComponent,
|
|
965
1033
|
registeredComponents: props.registeredComponents,
|
|
966
1034
|
builderBlock: processedBlock(),
|
|
967
1035
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
968
1036
|
isInteractive: !blockComponent()?.isRSC
|
|
969
1037
|
};
|
|
970
1038
|
}
|
|
971
|
-
return <
|
|
1039
|
+
return <Show4 when={canShowBlock()}>
|
|
972
1040
|
<Block_styles_default block={props.block} context={props.context} />
|
|
973
|
-
<
|
|
1041
|
+
<Show4
|
|
974
1042
|
fallback={<Component_ref_default
|
|
975
1043
|
componentRef={componentRefProps().componentRef}
|
|
976
1044
|
componentOptions={componentRefProps().componentOptions}
|
|
977
1045
|
blockChildren={componentRefProps().blockChildren}
|
|
978
1046
|
context={componentRefProps().context}
|
|
979
1047
|
registeredComponents={componentRefProps().registeredComponents}
|
|
1048
|
+
linkComponent={componentRefProps().linkComponent}
|
|
980
1049
|
builderBlock={componentRefProps().builderBlock}
|
|
981
1050
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
982
1051
|
isInteractive={componentRefProps().isInteractive}
|
|
983
1052
|
/>}
|
|
984
1053
|
when={!blockComponent()?.noWrap}
|
|
985
|
-
><
|
|
1054
|
+
><Show4
|
|
986
1055
|
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
987
1056
|
const index = _index();
|
|
988
1057
|
return <Repeated_block_default
|
|
@@ -990,6 +1059,7 @@ function Block(props) {
|
|
|
990
1059
|
repeatContext={data.context}
|
|
991
1060
|
block={data.block}
|
|
992
1061
|
registeredComponents={props.registeredComponents}
|
|
1062
|
+
linkComponent={props.linkComponent}
|
|
993
1063
|
/>;
|
|
994
1064
|
}}</For2>}
|
|
995
1065
|
when={!repeatItem()}
|
|
@@ -997,6 +1067,7 @@ function Block(props) {
|
|
|
997
1067
|
Wrapper={Tag()}
|
|
998
1068
|
block={processedBlock()}
|
|
999
1069
|
context={props.context}
|
|
1070
|
+
linkComponent={props.linkComponent}
|
|
1000
1071
|
>
|
|
1001
1072
|
<Component_ref_default
|
|
1002
1073
|
componentRef={componentRefProps().componentRef}
|
|
@@ -1004,6 +1075,7 @@ function Block(props) {
|
|
|
1004
1075
|
blockChildren={componentRefProps().blockChildren}
|
|
1005
1076
|
context={componentRefProps().context}
|
|
1006
1077
|
registeredComponents={componentRefProps().registeredComponents}
|
|
1078
|
+
linkComponent={componentRefProps().linkComponent}
|
|
1007
1079
|
builderBlock={componentRefProps().builderBlock}
|
|
1008
1080
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
1009
1081
|
isInteractive={componentRefProps().isInteractive}
|
|
@@ -1015,10 +1087,11 @@ function Block(props) {
|
|
|
1015
1087
|
block={child}
|
|
1016
1088
|
context={childrenContext()}
|
|
1017
1089
|
registeredComponents={props.registeredComponents}
|
|
1090
|
+
linkComponent={props.linkComponent}
|
|
1018
1091
|
/>;
|
|
1019
1092
|
}}</For2>
|
|
1020
|
-
</Block_wrapper_default></
|
|
1021
|
-
</
|
|
1093
|
+
</Block_wrapper_default></Show4></Show4>
|
|
1094
|
+
</Show4>;
|
|
1022
1095
|
}
|
|
1023
1096
|
var Block_default = Block;
|
|
1024
1097
|
|
|
@@ -1087,15 +1160,16 @@ function Blocks(props) {
|
|
|
1087
1160
|
styleProp={props.styleProp}
|
|
1088
1161
|
BlocksWrapper={props.context?.BlocksWrapper}
|
|
1089
1162
|
BlocksWrapperProps={props.context?.BlocksWrapperProps}
|
|
1090
|
-
><
|
|
1163
|
+
><Show5 when={props.blocks}><For3 each={props.blocks}>{(block, _index) => {
|
|
1091
1164
|
const index = _index();
|
|
1092
1165
|
return <Block_default
|
|
1093
1166
|
key={block.id}
|
|
1094
1167
|
block={block}
|
|
1168
|
+
linkComponent={props.linkComponent}
|
|
1095
1169
|
context={props.context || builderContext}
|
|
1096
1170
|
registeredComponents={props.registeredComponents || componentsContext.registeredComponents}
|
|
1097
1171
|
/>;
|
|
1098
|
-
}}</For3></
|
|
1172
|
+
}}</For3></Show5></Blocks_wrapper_default>;
|
|
1099
1173
|
}
|
|
1100
1174
|
var Blocks_default = Blocks;
|
|
1101
1175
|
|
|
@@ -1144,7 +1218,13 @@ function Columns(props) {
|
|
|
1144
1218
|
const mobileWidth = "100%";
|
|
1145
1219
|
const mobileMarginLeft = 0;
|
|
1146
1220
|
const marginLeftKey = "margin-left";
|
|
1221
|
+
const sharedStyles = {
|
|
1222
|
+
display: "flex",
|
|
1223
|
+
flexDirection: "column",
|
|
1224
|
+
alignItems: "stretch"
|
|
1225
|
+
};
|
|
1147
1226
|
return {
|
|
1227
|
+
...sharedStyles,
|
|
1148
1228
|
width,
|
|
1149
1229
|
[marginLeftKey]: gutterPixels,
|
|
1150
1230
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1206,18 +1286,21 @@ function Columns(props) {
|
|
|
1206
1286
|
style={columnsCssVars()}
|
|
1207
1287
|
{...{}}
|
|
1208
1288
|
>
|
|
1209
|
-
<
|
|
1289
|
+
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default styles={columnsStyles()} /></Show6>
|
|
1210
1290
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1211
1291
|
const index = _index();
|
|
1212
|
-
return <
|
|
1213
|
-
class={"builder-column " + css2({
|
|
1214
|
-
display: "flex",
|
|
1215
|
-
flexDirection: "column",
|
|
1216
|
-
alignItems: "stretch"
|
|
1217
|
-
})}
|
|
1218
|
-
style={columnCssVars(index)}
|
|
1219
|
-
{...{}}
|
|
1292
|
+
return <Dynamic_renderer_default
|
|
1220
1293
|
key={index}
|
|
1294
|
+
TagName={column.link ? props.builderLinkComponent || "a" : "div"}
|
|
1295
|
+
actionAttributes={{}}
|
|
1296
|
+
attributes={{
|
|
1297
|
+
...{},
|
|
1298
|
+
...column.link ? {
|
|
1299
|
+
href: column.link
|
|
1300
|
+
} : {},
|
|
1301
|
+
[getClassPropName()]: "builder-column",
|
|
1302
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1303
|
+
}}
|
|
1221
1304
|
><Blocks_default
|
|
1222
1305
|
path={`component.options.columns.${index}.blocks`}
|
|
1223
1306
|
parent={props.builderBlock.id}
|
|
@@ -1226,8 +1309,9 @@ function Columns(props) {
|
|
|
1226
1309
|
}}
|
|
1227
1310
|
context={props.builderContext}
|
|
1228
1311
|
registeredComponents={props.builderComponents}
|
|
1312
|
+
linkComponent={props.builderLinkComponent}
|
|
1229
1313
|
blocks={column.blocks}
|
|
1230
|
-
/></
|
|
1314
|
+
/></Dynamic_renderer_default>;
|
|
1231
1315
|
}}</For4>
|
|
1232
1316
|
</div>;
|
|
1233
1317
|
}
|
|
@@ -1240,7 +1324,7 @@ function FragmentComponent(props) {
|
|
|
1240
1324
|
var fragment_default = FragmentComponent;
|
|
1241
1325
|
|
|
1242
1326
|
// src/blocks/image/image.tsx
|
|
1243
|
-
import { Show as
|
|
1327
|
+
import { Show as Show7 } from "solid-js";
|
|
1244
1328
|
import { css as css3 } from "solid-styled-components";
|
|
1245
1329
|
|
|
1246
1330
|
// src/blocks/image/image.helpers.ts
|
|
@@ -1329,7 +1413,7 @@ function Image(props) {
|
|
|
1329
1413
|
}
|
|
1330
1414
|
return <>
|
|
1331
1415
|
<picture>
|
|
1332
|
-
<
|
|
1416
|
+
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
1333
1417
|
<img
|
|
1334
1418
|
class={"builder-image" + (props.className ? " " + props.className : "") + " " + css3({
|
|
1335
1419
|
opacity: "1",
|
|
@@ -1348,7 +1432,7 @@ function Image(props) {
|
|
|
1348
1432
|
sizes={props.sizes}
|
|
1349
1433
|
/>
|
|
1350
1434
|
</picture>
|
|
1351
|
-
<
|
|
1435
|
+
<Show7
|
|
1352
1436
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
1353
1437
|
><div
|
|
1354
1438
|
class={"builder-image-sizer " + css3({
|
|
@@ -1359,9 +1443,9 @@ function Image(props) {
|
|
|
1359
1443
|
style={{
|
|
1360
1444
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
1361
1445
|
}}
|
|
1362
|
-
/></
|
|
1363
|
-
<
|
|
1364
|
-
<
|
|
1446
|
+
/></Show7>
|
|
1447
|
+
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
1448
|
+
<Show7 when={!props.fitContent && props.children}><div
|
|
1365
1449
|
class={css3({
|
|
1366
1450
|
display: "flex",
|
|
1367
1451
|
flexDirection: "column",
|
|
@@ -1372,7 +1456,7 @@ function Image(props) {
|
|
|
1372
1456
|
width: "100%",
|
|
1373
1457
|
height: "100%"
|
|
1374
1458
|
})}
|
|
1375
|
-
>{props.children}</div></
|
|
1459
|
+
>{props.children}</div></Show7>
|
|
1376
1460
|
</>;
|
|
1377
1461
|
}
|
|
1378
1462
|
var image_default = Image;
|
|
@@ -1402,7 +1486,7 @@ var section_default = SectionComponent;
|
|
|
1402
1486
|
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as createSignal14 } from "solid-js";
|
|
1403
1487
|
|
|
1404
1488
|
// src/components/content-variants/content-variants.tsx
|
|
1405
|
-
import { Show as
|
|
1489
|
+
import { Show as Show11, For as For5, onMount as onMount3, createSignal as createSignal13 } from "solid-js";
|
|
1406
1490
|
|
|
1407
1491
|
// src/helpers/url.ts
|
|
1408
1492
|
var getTopLevelDomain = (host) => {
|
|
@@ -1596,7 +1680,7 @@ var handleABTesting = async ({
|
|
|
1596
1680
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1597
1681
|
|
|
1598
1682
|
// src/components/content/content.tsx
|
|
1599
|
-
import { Show as
|
|
1683
|
+
import { Show as Show10, createSignal as createSignal12 } from "solid-js";
|
|
1600
1684
|
|
|
1601
1685
|
// src/blocks/button/component-info.ts
|
|
1602
1686
|
var componentInfo = {
|
|
@@ -2402,7 +2486,7 @@ var componentInfo12 = {
|
|
|
2402
2486
|
};
|
|
2403
2487
|
|
|
2404
2488
|
// src/blocks/video/video.tsx
|
|
2405
|
-
import { Show as
|
|
2489
|
+
import { Show as Show8 } from "solid-js";
|
|
2406
2490
|
function Video(props) {
|
|
2407
2491
|
function videoProps() {
|
|
2408
2492
|
return {
|
|
@@ -2453,8 +2537,8 @@ function Video(props) {
|
|
|
2453
2537
|
}}
|
|
2454
2538
|
src={props.video || "no-src"}
|
|
2455
2539
|
poster={props.posterImage}
|
|
2456
|
-
><
|
|
2457
|
-
<
|
|
2540
|
+
><Show8 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show8></video>
|
|
2541
|
+
<Show8
|
|
2458
2542
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
2459
2543
|
><div
|
|
2460
2544
|
style={{
|
|
@@ -2463,15 +2547,15 @@ function Video(props) {
|
|
|
2463
2547
|
"pointer-events": "none",
|
|
2464
2548
|
"font-size": "0px"
|
|
2465
2549
|
}}
|
|
2466
|
-
/></
|
|
2467
|
-
<
|
|
2550
|
+
/></Show8>
|
|
2551
|
+
<Show8 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
2468
2552
|
style={{
|
|
2469
2553
|
display: "flex",
|
|
2470
2554
|
"flex-direction": "column",
|
|
2471
2555
|
"align-items": "stretch"
|
|
2472
2556
|
}}
|
|
2473
|
-
>{props.children}</div></
|
|
2474
|
-
<
|
|
2557
|
+
>{props.children}</div></Show8>
|
|
2558
|
+
<Show8 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
2475
2559
|
style={{
|
|
2476
2560
|
"pointer-events": "none",
|
|
2477
2561
|
display: "flex",
|
|
@@ -2483,7 +2567,7 @@ function Video(props) {
|
|
|
2483
2567
|
width: "100%",
|
|
2484
2568
|
height: "100%"
|
|
2485
2569
|
}}
|
|
2486
|
-
>{props.children}</div></
|
|
2570
|
+
>{props.children}</div></Show8>
|
|
2487
2571
|
</div>;
|
|
2488
2572
|
}
|
|
2489
2573
|
var video_default = Video;
|
|
@@ -2603,7 +2687,7 @@ function InlinedScript(props) {
|
|
|
2603
2687
|
var Inlined_script_default = InlinedScript;
|
|
2604
2688
|
|
|
2605
2689
|
// src/components/content/components/enable-editor.tsx
|
|
2606
|
-
import { Show as
|
|
2690
|
+
import { Show as Show9, onMount as onMount2, on as on2, createEffect as createEffect2, createSignal as createSignal10 } from "solid-js";
|
|
2607
2691
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
2608
2692
|
|
|
2609
2693
|
// src/helpers/preview-lru-cache/get.ts
|
|
@@ -3093,7 +3177,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
3093
3177
|
};
|
|
3094
3178
|
|
|
3095
3179
|
// src/constants/sdk-version.ts
|
|
3096
|
-
var SDK_VERSION = "0.12.
|
|
3180
|
+
var SDK_VERSION = "0.12.5";
|
|
3097
3181
|
|
|
3098
3182
|
// src/functions/register.ts
|
|
3099
3183
|
var registry = {};
|
|
@@ -3515,7 +3599,7 @@ function EnableEditor(props) {
|
|
|
3515
3599
|
}
|
|
3516
3600
|
}
|
|
3517
3601
|
createEffect2(on2(() => [props.locale], onUpdateFn_6));
|
|
3518
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
3602
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show9 when={props.builderContextSignal.content}><Dynamic5
|
|
3519
3603
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
3520
3604
|
{...{}}
|
|
3521
3605
|
key={forceReRenderCount()}
|
|
@@ -3530,7 +3614,7 @@ function EnableEditor(props) {
|
|
|
3530
3614
|
}}
|
|
3531
3615
|
{...props.contentWrapperProps}
|
|
3532
3616
|
component={ContentWrapper()}
|
|
3533
|
-
>{props.children}</Dynamic5></
|
|
3617
|
+
>{props.children}</Dynamic5></Show9></builder_context_default.Provider>;
|
|
3534
3618
|
}
|
|
3535
3619
|
var Enable_editor_default = EnableEditor;
|
|
3536
3620
|
|
|
@@ -3752,21 +3836,23 @@ function ContentComponent(props) {
|
|
|
3752
3836
|
builderContextSignal={builderContextSignal()}
|
|
3753
3837
|
contentWrapper={props.contentWrapper}
|
|
3754
3838
|
contentWrapperProps={props.contentWrapperProps}
|
|
3839
|
+
linkComponent={props.linkComponent}
|
|
3755
3840
|
trustedHosts={props.trustedHosts}
|
|
3756
3841
|
{...{
|
|
3757
3842
|
setBuilderContextSignal
|
|
3758
3843
|
}}
|
|
3759
3844
|
>
|
|
3760
|
-
<
|
|
3761
|
-
<
|
|
3845
|
+
<Show10 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show10>
|
|
3846
|
+
<Show10 when={TARGET !== "reactNative"}><Styles_default
|
|
3762
3847
|
contentId={builderContextSignal().content?.id}
|
|
3763
3848
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
3764
3849
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
3765
|
-
/></
|
|
3850
|
+
/></Show10>
|
|
3766
3851
|
<Blocks_default
|
|
3767
3852
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
3768
3853
|
context={builderContextSignal()}
|
|
3769
3854
|
registeredComponents={registeredComponents()}
|
|
3855
|
+
linkComponent={props.linkComponent}
|
|
3770
3856
|
/>
|
|
3771
3857
|
</Enable_editor_default></components_context_default.Provider>;
|
|
3772
3858
|
}
|
|
@@ -3805,8 +3891,8 @@ function ContentVariants(props) {
|
|
|
3805
3891
|
setShouldRenderVariants(false);
|
|
3806
3892
|
});
|
|
3807
3893
|
return <>
|
|
3808
|
-
<
|
|
3809
|
-
<
|
|
3894
|
+
<Show11 when={!props.__isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show11>
|
|
3895
|
+
<Show11 when={shouldRenderVariants()}>
|
|
3810
3896
|
<Inlined_styles_default
|
|
3811
3897
|
id={`variants-styles-${props.content?.id}`}
|
|
3812
3898
|
styles={hideVariantsStyleString()}
|
|
@@ -3826,6 +3912,7 @@ function ContentVariants(props) {
|
|
|
3826
3912
|
apiKey={props.apiKey}
|
|
3827
3913
|
apiVersion={props.apiVersion}
|
|
3828
3914
|
customComponents={props.customComponents}
|
|
3915
|
+
linkComponent={props.linkComponent}
|
|
3829
3916
|
canTrack={props.canTrack}
|
|
3830
3917
|
locale={props.locale}
|
|
3831
3918
|
includeRefs={props.includeRefs}
|
|
@@ -3838,7 +3925,7 @@ function ContentVariants(props) {
|
|
|
3838
3925
|
trustedHosts={props.trustedHosts}
|
|
3839
3926
|
/>;
|
|
3840
3927
|
}}</For5>
|
|
3841
|
-
</
|
|
3928
|
+
</Show11>
|
|
3842
3929
|
<Content_default
|
|
3843
3930
|
{...{}}
|
|
3844
3931
|
content={defaultContent()}
|
|
@@ -3849,6 +3936,7 @@ function ContentVariants(props) {
|
|
|
3849
3936
|
apiKey={props.apiKey}
|
|
3850
3937
|
apiVersion={props.apiVersion}
|
|
3851
3938
|
customComponents={props.customComponents}
|
|
3939
|
+
linkComponent={props.linkComponent}
|
|
3852
3940
|
canTrack={props.canTrack}
|
|
3853
3941
|
locale={props.locale}
|
|
3854
3942
|
includeRefs={props.includeRefs}
|
|
@@ -3893,7 +3981,7 @@ function Symbol(props) {
|
|
|
3893
3981
|
const [contentToUse, setContentToUse] = createSignal14(props.symbol?.content);
|
|
3894
3982
|
function className() {
|
|
3895
3983
|
return [
|
|
3896
|
-
...[props.attributes
|
|
3984
|
+
...[props.attributes[getClassPropName()]],
|
|
3897
3985
|
"builder-symbol",
|
|
3898
3986
|
props.symbol?.inline ? "builder-inline-symbol" : void 0,
|
|
3899
3987
|
props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0
|
|
@@ -3934,6 +4022,7 @@ function Symbol(props) {
|
|
|
3934
4022
|
}}
|
|
3935
4023
|
model={props.symbol?.model}
|
|
3936
4024
|
content={contentToUse()}
|
|
4025
|
+
linkComponent={props.builderLinkComponent}
|
|
3937
4026
|
/></div>;
|
|
3938
4027
|
}
|
|
3939
4028
|
var symbol_default = Symbol;
|