@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/dev.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) {
|
|
@@ -77,9 +127,6 @@ function isBrowser() {
|
|
|
77
127
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
78
128
|
}
|
|
79
129
|
|
|
80
|
-
// src/constants/target.ts
|
|
81
|
-
var TARGET = "solid";
|
|
82
|
-
|
|
83
130
|
// src/functions/is-iframe.ts
|
|
84
131
|
function isIframe() {
|
|
85
132
|
return isBrowser() && window.self !== window.top;
|
|
@@ -210,8 +257,33 @@ function flattenState(rootState, localState, rootSetState) {
|
|
|
210
257
|
});
|
|
211
258
|
}
|
|
212
259
|
|
|
260
|
+
// src/helpers/nullable.ts
|
|
261
|
+
var checkIsDefined = (maybeT) => maybeT !== null && maybeT !== void 0;
|
|
262
|
+
|
|
263
|
+
// src/functions/is-node-runtime.ts
|
|
264
|
+
function isNodeRuntime() {
|
|
265
|
+
return typeof process !== "undefined" && checkIsDefined(process?.versions?.node);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// src/functions/evaluate/should-force-browser-runtime-in-node.ts
|
|
269
|
+
var shouldForceBrowserRuntimeInNode = () => {
|
|
270
|
+
if (!isNodeRuntime())
|
|
271
|
+
return false;
|
|
272
|
+
const isArm64 = process.arch === "arm64";
|
|
273
|
+
const isNode20 = process.version.startsWith("v20");
|
|
274
|
+
const hasNoNodeSnapshotNodeOption = process.env.NODE_OPTIONS?.includes("--no-node-snapshot");
|
|
275
|
+
if (isArm64 && isNode20 && !hasNoNodeSnapshotNodeOption) {
|
|
276
|
+
logger.log(`Skipping usage of \`isolated-vm\` to avoid crashes in Node v20 on an arm64 machine.
|
|
277
|
+
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.
|
|
278
|
+
See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.
|
|
279
|
+
`);
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
return false;
|
|
283
|
+
};
|
|
284
|
+
|
|
213
285
|
// src/functions/evaluate/choose-eval.ts
|
|
214
|
-
var chooseBrowserOrServerEval = (args) => isBrowser() ? runInBrowser(args) : runInBrowser(args);
|
|
286
|
+
var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(args) : runInBrowser(args);
|
|
215
287
|
|
|
216
288
|
// src/functions/evaluate/evaluate.ts
|
|
217
289
|
function evaluate({
|
|
@@ -443,9 +515,6 @@ var getSizesForBreakpoints = ({
|
|
|
443
515
|
// src/functions/camel-to-kebab-case.ts
|
|
444
516
|
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
445
517
|
|
|
446
|
-
// src/helpers/nullable.ts
|
|
447
|
-
var checkIsDefined = (maybeT) => maybeT !== null && maybeT !== void 0;
|
|
448
|
-
|
|
449
518
|
// src/helpers/css.ts
|
|
450
519
|
var convertStyleMapToCSSArray = (style) => {
|
|
451
520
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -589,6 +658,38 @@ function getBlockActions(options) {
|
|
|
589
658
|
return obj;
|
|
590
659
|
}
|
|
591
660
|
|
|
661
|
+
// src/functions/transform-style-property.ts
|
|
662
|
+
function transformStyleProperty({
|
|
663
|
+
style
|
|
664
|
+
}) {
|
|
665
|
+
return style;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// src/functions/get-style.ts
|
|
669
|
+
var getStyle = ({
|
|
670
|
+
block,
|
|
671
|
+
context
|
|
672
|
+
}) => {
|
|
673
|
+
return mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
674
|
+
style: block.style || {},
|
|
675
|
+
context,
|
|
676
|
+
block
|
|
677
|
+
}));
|
|
678
|
+
};
|
|
679
|
+
function mapStyleObjToStrIfNeeded(style) {
|
|
680
|
+
switch (TARGET) {
|
|
681
|
+
case "svelte":
|
|
682
|
+
case "vue":
|
|
683
|
+
case "solid":
|
|
684
|
+
return convertStyleMapToCSSArray(style).join(" ");
|
|
685
|
+
case "qwik":
|
|
686
|
+
case "reactNative":
|
|
687
|
+
case "react":
|
|
688
|
+
case "rsc":
|
|
689
|
+
return style;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
592
693
|
// src/functions/transform-block-properties.ts
|
|
593
694
|
function transformBlockProperties({
|
|
594
695
|
properties
|
|
@@ -610,8 +711,11 @@ function getBlockProperties({
|
|
|
610
711
|
...extractRelevantRootBlockProperties(block),
|
|
611
712
|
...block.properties,
|
|
612
713
|
"builder-id": block.id,
|
|
613
|
-
style:
|
|
614
|
-
|
|
714
|
+
style: getStyle({
|
|
715
|
+
block,
|
|
716
|
+
context
|
|
717
|
+
}),
|
|
718
|
+
[getClassPropName()]: [block.id, "builder-block", block.class, block.properties?.class].filter(Boolean).join(" ")
|
|
615
719
|
};
|
|
616
720
|
return transformBlockProperties({
|
|
617
721
|
properties,
|
|
@@ -619,53 +723,6 @@ function getBlockProperties({
|
|
|
619
723
|
block
|
|
620
724
|
});
|
|
621
725
|
}
|
|
622
|
-
function getStyleAttribute(style) {
|
|
623
|
-
switch (TARGET) {
|
|
624
|
-
case "svelte":
|
|
625
|
-
case "vue":
|
|
626
|
-
case "solid":
|
|
627
|
-
return convertStyleMapToCSSArray(style).join(" ");
|
|
628
|
-
case "qwik":
|
|
629
|
-
case "reactNative":
|
|
630
|
-
case "react":
|
|
631
|
-
case "rsc":
|
|
632
|
-
return style;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
637
|
-
import { Show as Show3 } from "solid-js";
|
|
638
|
-
import { Dynamic } from "solid-js/web";
|
|
639
|
-
|
|
640
|
-
// src/components/dynamic-renderer/dynamic-renderer.helpers.ts
|
|
641
|
-
var EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
642
|
-
var isEmptyElement = (tagName) => {
|
|
643
|
-
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
644
|
-
};
|
|
645
|
-
|
|
646
|
-
// src/components/dynamic-renderer/dynamic-renderer.tsx
|
|
647
|
-
function DynamicRenderer(props) {
|
|
648
|
-
return <Show3
|
|
649
|
-
fallback={<Dynamic
|
|
650
|
-
{...props.attributes}
|
|
651
|
-
{...props.actionAttributes}
|
|
652
|
-
component={props.TagName}
|
|
653
|
-
/>}
|
|
654
|
-
when={!isEmptyElement(props.TagName)}
|
|
655
|
-
><Show3
|
|
656
|
-
fallback={<Dynamic
|
|
657
|
-
{...props.attributes}
|
|
658
|
-
{...props.actionAttributes}
|
|
659
|
-
component={props.TagName}
|
|
660
|
-
>{props.children}</Dynamic>}
|
|
661
|
-
when={typeof props.TagName === "string"}
|
|
662
|
-
><Dynamic
|
|
663
|
-
{...props.attributes}
|
|
664
|
-
{...props.actionAttributes}
|
|
665
|
-
component={props.TagName}
|
|
666
|
-
>{props.children}</Dynamic></Show3></Show3>;
|
|
667
|
-
}
|
|
668
|
-
var Dynamic_renderer_default = DynamicRenderer;
|
|
669
726
|
|
|
670
727
|
// src/components/block/components/block-wrapper.tsx
|
|
671
728
|
function BlockWrapper(props) {
|
|
@@ -688,7 +745,7 @@ function BlockWrapper(props) {
|
|
|
688
745
|
var Block_wrapper_default = BlockWrapper;
|
|
689
746
|
|
|
690
747
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
691
|
-
import { Show as
|
|
748
|
+
import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
|
|
692
749
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
693
750
|
|
|
694
751
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -752,12 +809,13 @@ function ComponentRef(props) {
|
|
|
752
809
|
const [Wrapper, setWrapper] = createSignal2(
|
|
753
810
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
754
811
|
);
|
|
755
|
-
return <
|
|
812
|
+
return <Show3 when={props.componentRef}><Dynamic3
|
|
756
813
|
{...getWrapperProps({
|
|
757
814
|
componentOptions: props.componentOptions,
|
|
758
815
|
builderBlock: props.builderBlock,
|
|
759
816
|
context: props.context,
|
|
760
817
|
componentRef: props.componentRef,
|
|
818
|
+
linkComponent: props.linkComponent,
|
|
761
819
|
includeBlockProps: props.includeBlockProps,
|
|
762
820
|
isInteractive: props.isInteractive,
|
|
763
821
|
contextValue: props.context
|
|
@@ -770,8 +828,9 @@ function ComponentRef(props) {
|
|
|
770
828
|
block={child}
|
|
771
829
|
context={props.context}
|
|
772
830
|
registeredComponents={props.registeredComponents}
|
|
831
|
+
linkComponent={props.linkComponent}
|
|
773
832
|
/>;
|
|
774
|
-
}}</For></Dynamic3></
|
|
833
|
+
}}</For></Dynamic3></Show3>;
|
|
775
834
|
}
|
|
776
835
|
var Component_ref_default = ComponentRef;
|
|
777
836
|
|
|
@@ -783,6 +842,7 @@ function RepeatedBlock(props) {
|
|
|
783
842
|
block={props.block}
|
|
784
843
|
context={store()}
|
|
785
844
|
registeredComponents={props.registeredComponents}
|
|
845
|
+
linkComponent={props.linkComponent}
|
|
786
846
|
/></builder_context_default.Provider>;
|
|
787
847
|
}
|
|
788
848
|
var Repeated_block_default = RepeatedBlock;
|
|
@@ -814,6 +874,10 @@ function Block(props) {
|
|
|
814
874
|
});
|
|
815
875
|
}
|
|
816
876
|
function Tag() {
|
|
877
|
+
const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
|
|
878
|
+
if (shouldUseLink) {
|
|
879
|
+
return props.linkComponent || "a";
|
|
880
|
+
}
|
|
817
881
|
return props.block.tagName || "div";
|
|
818
882
|
}
|
|
819
883
|
function canShowBlock() {
|
|
@@ -837,32 +901,37 @@ function Block(props) {
|
|
|
837
901
|
componentOptions: {
|
|
838
902
|
...getBlockComponentOptions(processedBlock()),
|
|
839
903
|
builderContext: props.context,
|
|
904
|
+
...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
905
|
+
builderLinkComponent: props.linkComponent
|
|
906
|
+
} : {},
|
|
840
907
|
...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" ? {
|
|
841
908
|
builderComponents: props.registeredComponents
|
|
842
909
|
} : {}
|
|
843
910
|
},
|
|
844
911
|
context: childrenContext(),
|
|
912
|
+
linkComponent: props.linkComponent,
|
|
845
913
|
registeredComponents: props.registeredComponents,
|
|
846
914
|
builderBlock: processedBlock(),
|
|
847
915
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
848
916
|
isInteractive: !blockComponent()?.isRSC
|
|
849
917
|
};
|
|
850
918
|
}
|
|
851
|
-
return <
|
|
919
|
+
return <Show4 when={canShowBlock()}>
|
|
852
920
|
<Block_styles_default block={props.block} context={props.context} />
|
|
853
|
-
<
|
|
921
|
+
<Show4
|
|
854
922
|
fallback={<Component_ref_default
|
|
855
923
|
componentRef={componentRefProps().componentRef}
|
|
856
924
|
componentOptions={componentRefProps().componentOptions}
|
|
857
925
|
blockChildren={componentRefProps().blockChildren}
|
|
858
926
|
context={componentRefProps().context}
|
|
859
927
|
registeredComponents={componentRefProps().registeredComponents}
|
|
928
|
+
linkComponent={componentRefProps().linkComponent}
|
|
860
929
|
builderBlock={componentRefProps().builderBlock}
|
|
861
930
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
862
931
|
isInteractive={componentRefProps().isInteractive}
|
|
863
932
|
/>}
|
|
864
933
|
when={!blockComponent()?.noWrap}
|
|
865
|
-
><
|
|
934
|
+
><Show4
|
|
866
935
|
fallback={<For2 each={repeatItem()}>{(data, _index) => {
|
|
867
936
|
const index = _index();
|
|
868
937
|
return <Repeated_block_default
|
|
@@ -870,6 +939,7 @@ function Block(props) {
|
|
|
870
939
|
repeatContext={data.context}
|
|
871
940
|
block={data.block}
|
|
872
941
|
registeredComponents={props.registeredComponents}
|
|
942
|
+
linkComponent={props.linkComponent}
|
|
873
943
|
/>;
|
|
874
944
|
}}</For2>}
|
|
875
945
|
when={!repeatItem()}
|
|
@@ -877,6 +947,7 @@ function Block(props) {
|
|
|
877
947
|
Wrapper={Tag()}
|
|
878
948
|
block={processedBlock()}
|
|
879
949
|
context={props.context}
|
|
950
|
+
linkComponent={props.linkComponent}
|
|
880
951
|
>
|
|
881
952
|
<Component_ref_default
|
|
882
953
|
componentRef={componentRefProps().componentRef}
|
|
@@ -884,6 +955,7 @@ function Block(props) {
|
|
|
884
955
|
blockChildren={componentRefProps().blockChildren}
|
|
885
956
|
context={componentRefProps().context}
|
|
886
957
|
registeredComponents={componentRefProps().registeredComponents}
|
|
958
|
+
linkComponent={componentRefProps().linkComponent}
|
|
887
959
|
builderBlock={componentRefProps().builderBlock}
|
|
888
960
|
includeBlockProps={componentRefProps().includeBlockProps}
|
|
889
961
|
isInteractive={componentRefProps().isInteractive}
|
|
@@ -895,10 +967,11 @@ function Block(props) {
|
|
|
895
967
|
block={child}
|
|
896
968
|
context={childrenContext()}
|
|
897
969
|
registeredComponents={props.registeredComponents}
|
|
970
|
+
linkComponent={props.linkComponent}
|
|
898
971
|
/>;
|
|
899
972
|
}}</For2>
|
|
900
|
-
</Block_wrapper_default></
|
|
901
|
-
</
|
|
973
|
+
</Block_wrapper_default></Show4></Show4>
|
|
974
|
+
</Show4>;
|
|
902
975
|
}
|
|
903
976
|
var Block_default = Block;
|
|
904
977
|
|
|
@@ -967,15 +1040,16 @@ function Blocks(props) {
|
|
|
967
1040
|
styleProp={props.styleProp}
|
|
968
1041
|
BlocksWrapper={props.context?.BlocksWrapper}
|
|
969
1042
|
BlocksWrapperProps={props.context?.BlocksWrapperProps}
|
|
970
|
-
><
|
|
1043
|
+
><Show5 when={props.blocks}><For3 each={props.blocks}>{(block, _index) => {
|
|
971
1044
|
const index = _index();
|
|
972
1045
|
return <Block_default
|
|
973
1046
|
key={block.id}
|
|
974
1047
|
block={block}
|
|
1048
|
+
linkComponent={props.linkComponent}
|
|
975
1049
|
context={props.context || builderContext}
|
|
976
1050
|
registeredComponents={props.registeredComponents || componentsContext.registeredComponents}
|
|
977
1051
|
/>;
|
|
978
|
-
}}</For3></
|
|
1052
|
+
}}</For3></Show5></Blocks_wrapper_default>;
|
|
979
1053
|
}
|
|
980
1054
|
var Blocks_default = Blocks;
|
|
981
1055
|
|
|
@@ -1024,7 +1098,13 @@ function Columns(props) {
|
|
|
1024
1098
|
const mobileWidth = "100%";
|
|
1025
1099
|
const mobileMarginLeft = 0;
|
|
1026
1100
|
const marginLeftKey = "margin-left";
|
|
1101
|
+
const sharedStyles = {
|
|
1102
|
+
display: "flex",
|
|
1103
|
+
flexDirection: "column",
|
|
1104
|
+
alignItems: "stretch"
|
|
1105
|
+
};
|
|
1027
1106
|
return {
|
|
1107
|
+
...sharedStyles,
|
|
1028
1108
|
width,
|
|
1029
1109
|
[marginLeftKey]: gutterPixels,
|
|
1030
1110
|
"--column-width-mobile": getMobileStyle({
|
|
@@ -1086,18 +1166,21 @@ function Columns(props) {
|
|
|
1086
1166
|
style={columnsCssVars()}
|
|
1087
1167
|
{...{}}
|
|
1088
1168
|
>
|
|
1089
|
-
<
|
|
1169
|
+
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default styles={columnsStyles()} /></Show6>
|
|
1090
1170
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1091
1171
|
const index = _index();
|
|
1092
|
-
return <
|
|
1093
|
-
class={"builder-column " + css2({
|
|
1094
|
-
display: "flex",
|
|
1095
|
-
flexDirection: "column",
|
|
1096
|
-
alignItems: "stretch"
|
|
1097
|
-
})}
|
|
1098
|
-
style={columnCssVars(index)}
|
|
1099
|
-
{...{}}
|
|
1172
|
+
return <Dynamic_renderer_default
|
|
1100
1173
|
key={index}
|
|
1174
|
+
TagName={column.link ? props.builderLinkComponent || "a" : "div"}
|
|
1175
|
+
actionAttributes={{}}
|
|
1176
|
+
attributes={{
|
|
1177
|
+
...{},
|
|
1178
|
+
...column.link ? {
|
|
1179
|
+
href: column.link
|
|
1180
|
+
} : {},
|
|
1181
|
+
[getClassPropName()]: "builder-column",
|
|
1182
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1183
|
+
}}
|
|
1101
1184
|
><Blocks_default
|
|
1102
1185
|
path={`component.options.columns.${index}.blocks`}
|
|
1103
1186
|
parent={props.builderBlock.id}
|
|
@@ -1106,8 +1189,9 @@ function Columns(props) {
|
|
|
1106
1189
|
}}
|
|
1107
1190
|
context={props.builderContext}
|
|
1108
1191
|
registeredComponents={props.builderComponents}
|
|
1192
|
+
linkComponent={props.builderLinkComponent}
|
|
1109
1193
|
blocks={column.blocks}
|
|
1110
|
-
/></
|
|
1194
|
+
/></Dynamic_renderer_default>;
|
|
1111
1195
|
}}</For4>
|
|
1112
1196
|
</div>;
|
|
1113
1197
|
}
|
|
@@ -1120,7 +1204,7 @@ function FragmentComponent(props) {
|
|
|
1120
1204
|
var fragment_default = FragmentComponent;
|
|
1121
1205
|
|
|
1122
1206
|
// src/blocks/image/image.tsx
|
|
1123
|
-
import { Show as
|
|
1207
|
+
import { Show as Show7 } from "solid-js";
|
|
1124
1208
|
import { css as css3 } from "solid-styled-components";
|
|
1125
1209
|
|
|
1126
1210
|
// src/blocks/image/image.helpers.ts
|
|
@@ -1210,7 +1294,7 @@ function Image(props) {
|
|
|
1210
1294
|
}
|
|
1211
1295
|
return <>
|
|
1212
1296
|
<picture>
|
|
1213
|
-
<
|
|
1297
|
+
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
1214
1298
|
<img
|
|
1215
1299
|
class={"builder-image" + (props.className ? " " + props.className : "") + " " + css3({
|
|
1216
1300
|
opacity: "1",
|
|
@@ -1229,7 +1313,7 @@ function Image(props) {
|
|
|
1229
1313
|
sizes={props.sizes}
|
|
1230
1314
|
/>
|
|
1231
1315
|
</picture>
|
|
1232
|
-
<
|
|
1316
|
+
<Show7
|
|
1233
1317
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
1234
1318
|
><div
|
|
1235
1319
|
class={"builder-image-sizer " + css3({
|
|
@@ -1240,9 +1324,9 @@ function Image(props) {
|
|
|
1240
1324
|
style={{
|
|
1241
1325
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
1242
1326
|
}}
|
|
1243
|
-
/></
|
|
1244
|
-
<
|
|
1245
|
-
<
|
|
1327
|
+
/></Show7>
|
|
1328
|
+
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
1329
|
+
<Show7 when={!props.fitContent && props.children}><div
|
|
1246
1330
|
class={css3({
|
|
1247
1331
|
display: "flex",
|
|
1248
1332
|
flexDirection: "column",
|
|
@@ -1253,7 +1337,7 @@ function Image(props) {
|
|
|
1253
1337
|
width: "100%",
|
|
1254
1338
|
height: "100%"
|
|
1255
1339
|
})}
|
|
1256
|
-
>{props.children}</div></
|
|
1340
|
+
>{props.children}</div></Show7>
|
|
1257
1341
|
</>;
|
|
1258
1342
|
}
|
|
1259
1343
|
var image_default = Image;
|
|
@@ -1283,7 +1367,7 @@ var section_default = SectionComponent;
|
|
|
1283
1367
|
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as createSignal14 } from "solid-js";
|
|
1284
1368
|
|
|
1285
1369
|
// src/components/content-variants/content-variants.tsx
|
|
1286
|
-
import { Show as
|
|
1370
|
+
import { Show as Show11, For as For5, onMount as onMount3, createSignal as createSignal13 } from "solid-js";
|
|
1287
1371
|
|
|
1288
1372
|
// src/helpers/url.ts
|
|
1289
1373
|
var getTopLevelDomain = (host) => {
|
|
@@ -1477,7 +1561,7 @@ var handleABTesting = async ({
|
|
|
1477
1561
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1478
1562
|
|
|
1479
1563
|
// src/components/content/content.tsx
|
|
1480
|
-
import { Show as
|
|
1564
|
+
import { Show as Show10, createSignal as createSignal12 } from "solid-js";
|
|
1481
1565
|
|
|
1482
1566
|
// src/blocks/button/component-info.ts
|
|
1483
1567
|
var componentInfo = {
|
|
@@ -2286,7 +2370,7 @@ var componentInfo12 = {
|
|
|
2286
2370
|
};
|
|
2287
2371
|
|
|
2288
2372
|
// src/blocks/video/video.tsx
|
|
2289
|
-
import { Show as
|
|
2373
|
+
import { Show as Show8 } from "solid-js";
|
|
2290
2374
|
function Video(props) {
|
|
2291
2375
|
function videoProps() {
|
|
2292
2376
|
return {
|
|
@@ -2337,8 +2421,8 @@ function Video(props) {
|
|
|
2337
2421
|
}}
|
|
2338
2422
|
src={props.video || "no-src"}
|
|
2339
2423
|
poster={props.posterImage}
|
|
2340
|
-
><
|
|
2341
|
-
<
|
|
2424
|
+
><Show8 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show8></video>
|
|
2425
|
+
<Show8
|
|
2342
2426
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
2343
2427
|
><div
|
|
2344
2428
|
style={{
|
|
@@ -2347,15 +2431,15 @@ function Video(props) {
|
|
|
2347
2431
|
"pointer-events": "none",
|
|
2348
2432
|
"font-size": "0px"
|
|
2349
2433
|
}}
|
|
2350
|
-
/></
|
|
2351
|
-
<
|
|
2434
|
+
/></Show8>
|
|
2435
|
+
<Show8 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
2352
2436
|
style={{
|
|
2353
2437
|
display: "flex",
|
|
2354
2438
|
"flex-direction": "column",
|
|
2355
2439
|
"align-items": "stretch"
|
|
2356
2440
|
}}
|
|
2357
|
-
>{props.children}</div></
|
|
2358
|
-
<
|
|
2441
|
+
>{props.children}</div></Show8>
|
|
2442
|
+
<Show8 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
2359
2443
|
style={{
|
|
2360
2444
|
"pointer-events": "none",
|
|
2361
2445
|
display: "flex",
|
|
@@ -2367,7 +2451,7 @@ function Video(props) {
|
|
|
2367
2451
|
width: "100%",
|
|
2368
2452
|
height: "100%"
|
|
2369
2453
|
}}
|
|
2370
|
-
>{props.children}</div></
|
|
2454
|
+
>{props.children}</div></Show8>
|
|
2371
2455
|
</div>;
|
|
2372
2456
|
}
|
|
2373
2457
|
var video_default = Video;
|
|
@@ -2487,7 +2571,7 @@ function InlinedScript(props) {
|
|
|
2487
2571
|
var Inlined_script_default = InlinedScript;
|
|
2488
2572
|
|
|
2489
2573
|
// src/components/content/components/enable-editor.tsx
|
|
2490
|
-
import { Show as
|
|
2574
|
+
import { Show as Show9, onMount as onMount2, on as on2, createEffect as createEffect2, createSignal as createSignal10 } from "solid-js";
|
|
2491
2575
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
2492
2576
|
|
|
2493
2577
|
// src/helpers/preview-lru-cache/get.ts
|
|
@@ -2982,7 +3066,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
2982
3066
|
};
|
|
2983
3067
|
|
|
2984
3068
|
// src/constants/sdk-version.ts
|
|
2985
|
-
var SDK_VERSION = "0.12.
|
|
3069
|
+
var SDK_VERSION = "0.12.5";
|
|
2986
3070
|
|
|
2987
3071
|
// src/functions/register.ts
|
|
2988
3072
|
var registry = {};
|
|
@@ -3406,7 +3490,7 @@ function EnableEditor(props) {
|
|
|
3406
3490
|
}
|
|
3407
3491
|
}
|
|
3408
3492
|
createEffect2(on2(() => [props.locale], onUpdateFn_6));
|
|
3409
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
3493
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show9 when={props.builderContextSignal.content}><Dynamic5
|
|
3410
3494
|
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
3411
3495
|
{...{}}
|
|
3412
3496
|
key={forceReRenderCount()}
|
|
@@ -3421,7 +3505,7 @@ function EnableEditor(props) {
|
|
|
3421
3505
|
}}
|
|
3422
3506
|
{...props.contentWrapperProps}
|
|
3423
3507
|
component={ContentWrapper()}
|
|
3424
|
-
>{props.children}</Dynamic5></
|
|
3508
|
+
>{props.children}</Dynamic5></Show9></builder_context_default.Provider>;
|
|
3425
3509
|
}
|
|
3426
3510
|
var Enable_editor_default = EnableEditor;
|
|
3427
3511
|
|
|
@@ -3643,21 +3727,23 @@ function ContentComponent(props) {
|
|
|
3643
3727
|
builderContextSignal={builderContextSignal()}
|
|
3644
3728
|
contentWrapper={props.contentWrapper}
|
|
3645
3729
|
contentWrapperProps={props.contentWrapperProps}
|
|
3730
|
+
linkComponent={props.linkComponent}
|
|
3646
3731
|
trustedHosts={props.trustedHosts}
|
|
3647
3732
|
{...{
|
|
3648
3733
|
setBuilderContextSignal
|
|
3649
3734
|
}}
|
|
3650
3735
|
>
|
|
3651
|
-
<
|
|
3652
|
-
<
|
|
3736
|
+
<Show10 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show10>
|
|
3737
|
+
<Show10 when={TARGET !== "reactNative"}><Styles_default
|
|
3653
3738
|
contentId={builderContextSignal().content?.id}
|
|
3654
3739
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
3655
3740
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
3656
|
-
/></
|
|
3741
|
+
/></Show10>
|
|
3657
3742
|
<Blocks_default
|
|
3658
3743
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
3659
3744
|
context={builderContextSignal()}
|
|
3660
3745
|
registeredComponents={registeredComponents()}
|
|
3746
|
+
linkComponent={props.linkComponent}
|
|
3661
3747
|
/>
|
|
3662
3748
|
</Enable_editor_default></components_context_default.Provider>;
|
|
3663
3749
|
}
|
|
@@ -3696,8 +3782,8 @@ function ContentVariants(props) {
|
|
|
3696
3782
|
setShouldRenderVariants(false);
|
|
3697
3783
|
});
|
|
3698
3784
|
return <>
|
|
3699
|
-
<
|
|
3700
|
-
<
|
|
3785
|
+
<Show11 when={!props.__isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show11>
|
|
3786
|
+
<Show11 when={shouldRenderVariants()}>
|
|
3701
3787
|
<Inlined_styles_default
|
|
3702
3788
|
id={`variants-styles-${props.content?.id}`}
|
|
3703
3789
|
styles={hideVariantsStyleString()}
|
|
@@ -3717,6 +3803,7 @@ function ContentVariants(props) {
|
|
|
3717
3803
|
apiKey={props.apiKey}
|
|
3718
3804
|
apiVersion={props.apiVersion}
|
|
3719
3805
|
customComponents={props.customComponents}
|
|
3806
|
+
linkComponent={props.linkComponent}
|
|
3720
3807
|
canTrack={props.canTrack}
|
|
3721
3808
|
locale={props.locale}
|
|
3722
3809
|
includeRefs={props.includeRefs}
|
|
@@ -3729,7 +3816,7 @@ function ContentVariants(props) {
|
|
|
3729
3816
|
trustedHosts={props.trustedHosts}
|
|
3730
3817
|
/>;
|
|
3731
3818
|
}}</For5>
|
|
3732
|
-
</
|
|
3819
|
+
</Show11>
|
|
3733
3820
|
<Content_default
|
|
3734
3821
|
{...{}}
|
|
3735
3822
|
content={defaultContent()}
|
|
@@ -3740,6 +3827,7 @@ function ContentVariants(props) {
|
|
|
3740
3827
|
apiKey={props.apiKey}
|
|
3741
3828
|
apiVersion={props.apiVersion}
|
|
3742
3829
|
customComponents={props.customComponents}
|
|
3830
|
+
linkComponent={props.linkComponent}
|
|
3743
3831
|
canTrack={props.canTrack}
|
|
3744
3832
|
locale={props.locale}
|
|
3745
3833
|
includeRefs={props.includeRefs}
|
|
@@ -3784,7 +3872,7 @@ function Symbol(props) {
|
|
|
3784
3872
|
const [contentToUse, setContentToUse] = createSignal14(props.symbol?.content);
|
|
3785
3873
|
function className() {
|
|
3786
3874
|
return [
|
|
3787
|
-
...[props.attributes
|
|
3875
|
+
...[props.attributes[getClassPropName()]],
|
|
3788
3876
|
"builder-symbol",
|
|
3789
3877
|
props.symbol?.inline ? "builder-inline-symbol" : void 0,
|
|
3790
3878
|
props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0
|
|
@@ -3825,6 +3913,7 @@ function Symbol(props) {
|
|
|
3825
3913
|
}}
|
|
3826
3914
|
model={props.symbol?.model}
|
|
3827
3915
|
content={contentToUse()}
|
|
3916
|
+
linkComponent={props.builderLinkComponent}
|
|
3828
3917
|
/></div>;
|
|
3829
3918
|
}
|
|
3830
3919
|
var symbol_default = Symbol;
|