@builder.io/sdk-solid 1.0.27 → 1.0.28
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 +1 -1
- package/lib/browser/dev.js +379 -65
- package/lib/browser/dev.jsx +393 -115
- package/lib/browser/index.js +379 -65
- package/lib/browser/index.jsx +393 -115
- package/lib/edge/dev.js +379 -65
- package/lib/edge/dev.jsx +393 -115
- package/lib/edge/index.js +379 -65
- package/lib/edge/index.jsx +393 -115
- package/lib/node/dev.js +379 -65
- package/lib/node/dev.jsx +393 -115
- package/lib/node/index.js +379 -65
- package/lib/node/index.jsx +393 -115
- package/package.json +1 -1
package/lib/node/dev.jsx
CHANGED
|
@@ -627,6 +627,9 @@ function getProcessedBlock({
|
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
|
|
630
|
+
// src/functions/camel-to-kebab-case.ts
|
|
631
|
+
var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
632
|
+
|
|
630
633
|
// src/components/block/animator.ts
|
|
631
634
|
function throttle(func, wait, options = {}) {
|
|
632
635
|
let context;
|
|
@@ -677,7 +680,6 @@ function assign(target, ..._args) {
|
|
|
677
680
|
}
|
|
678
681
|
return to;
|
|
679
682
|
}
|
|
680
|
-
var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
681
683
|
function bindAnimations(animations) {
|
|
682
684
|
for (const animation of animations) {
|
|
683
685
|
switch (animation.trigger) {
|
|
@@ -730,7 +732,7 @@ function triggerAnimation(animation) {
|
|
|
730
732
|
element.style.transitionDelay = "0";
|
|
731
733
|
assign(element.style, animation.steps[0].styles);
|
|
732
734
|
setTimeout(() => {
|
|
733
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
735
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
734
736
|
if (animation.delay) {
|
|
735
737
|
element.style.transitionDelay = animation.delay + "s";
|
|
736
738
|
}
|
|
@@ -790,7 +792,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
790
792
|
}
|
|
791
793
|
attachDefaultState();
|
|
792
794
|
setTimeout(() => {
|
|
793
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
795
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
794
796
|
if (animation.delay) {
|
|
795
797
|
element.style.transitionDelay = animation.delay + "s";
|
|
796
798
|
}
|
|
@@ -803,9 +805,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
803
805
|
});
|
|
804
806
|
}
|
|
805
807
|
|
|
806
|
-
// src/functions/camel-to-kebab-case.ts
|
|
807
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
808
|
-
|
|
809
808
|
// src/helpers/css.ts
|
|
810
809
|
var convertStyleMapToCSSArray = (style) => {
|
|
811
810
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -935,10 +934,10 @@ var getRepeatItemData = ({
|
|
|
935
934
|
return repeatArray;
|
|
936
935
|
};
|
|
937
936
|
var shouldPassLinkComponent = (block) => {
|
|
938
|
-
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
937
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
939
938
|
};
|
|
940
939
|
var shouldPassRegisteredComponents = (block) => {
|
|
941
|
-
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
940
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
942
941
|
};
|
|
943
942
|
|
|
944
943
|
// src/components/block/components/block-styles.tsx
|
|
@@ -1067,7 +1066,7 @@ function BlockStyles(props) {
|
|
|
1067
1066
|
className: `${className}:hover`,
|
|
1068
1067
|
styles: {
|
|
1069
1068
|
...hoverStyles,
|
|
1070
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
1069
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
|
|
1071
1070
|
hoverAnimation.easing
|
|
1072
1071
|
)}`,
|
|
1073
1072
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
@@ -1832,10 +1831,10 @@ function SectionComponent(props) {
|
|
|
1832
1831
|
var section_default = SectionComponent;
|
|
1833
1832
|
|
|
1834
1833
|
// src/blocks/symbol/symbol.tsx
|
|
1835
|
-
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as
|
|
1834
|
+
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
|
|
1836
1835
|
|
|
1837
1836
|
// src/components/content-variants/content-variants.tsx
|
|
1838
|
-
import { Show as
|
|
1837
|
+
import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
|
|
1839
1838
|
|
|
1840
1839
|
// src/helpers/url.ts
|
|
1841
1840
|
var getTopLevelDomain = (host) => {
|
|
@@ -2029,7 +2028,7 @@ var handleABTesting = async ({
|
|
|
2029
2028
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2030
2029
|
|
|
2031
2030
|
// src/components/content/content.tsx
|
|
2032
|
-
import { Show as
|
|
2031
|
+
import { Show as Show13, createSignal as createSignal17 } from "solid-js";
|
|
2033
2032
|
|
|
2034
2033
|
// src/blocks/button/component-info.ts
|
|
2035
2034
|
var componentInfo = {
|
|
@@ -2680,8 +2679,12 @@ function Tabs(props) {
|
|
|
2680
2679
|
function activeTabContent(active) {
|
|
2681
2680
|
return props.tabs && props.tabs[active].content;
|
|
2682
2681
|
}
|
|
2683
|
-
function
|
|
2684
|
-
|
|
2682
|
+
function onClick(index) {
|
|
2683
|
+
if (index === activeTab() && props.collapsible) {
|
|
2684
|
+
setActiveTab(-1);
|
|
2685
|
+
} else {
|
|
2686
|
+
setActiveTab(index);
|
|
2687
|
+
}
|
|
2685
2688
|
}
|
|
2686
2689
|
return <div>
|
|
2687
2690
|
<div
|
|
@@ -2697,14 +2700,10 @@ function Tabs(props) {
|
|
|
2697
2700
|
return <span
|
|
2698
2701
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
2699
2702
|
key={index}
|
|
2700
|
-
style={
|
|
2701
|
-
|
|
2702
|
-
if (index === activeTab() && props.collapsible) {
|
|
2703
|
-
setActiveTab(-1);
|
|
2704
|
-
} else {
|
|
2705
|
-
setActiveTab(index);
|
|
2706
|
-
}
|
|
2703
|
+
style={{
|
|
2704
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
2707
2705
|
}}
|
|
2706
|
+
onClick={(event) => onClick(index)}
|
|
2708
2707
|
><Blocks_default
|
|
2709
2708
|
parent={props.builderBlock.id}
|
|
2710
2709
|
path={`component.options.tabs.${index}.label`}
|
|
@@ -2759,8 +2758,284 @@ function Text(props) {
|
|
|
2759
2758
|
}
|
|
2760
2759
|
var text_default = Text;
|
|
2761
2760
|
|
|
2762
|
-
// src/blocks/
|
|
2761
|
+
// src/blocks/accordion/accordion.tsx
|
|
2762
|
+
import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
|
|
2763
|
+
|
|
2764
|
+
// src/blocks/accordion/helpers.ts
|
|
2765
|
+
var convertOrderNumberToString = (order) => {
|
|
2766
|
+
return order.toString();
|
|
2767
|
+
};
|
|
2768
|
+
|
|
2769
|
+
// src/blocks/accordion/accordion.tsx
|
|
2770
|
+
function Accordion(props) {
|
|
2771
|
+
const [open, setOpen] = createSignal10([]);
|
|
2772
|
+
const onlyOneAtATime = createMemo10(() => {
|
|
2773
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
2774
|
+
});
|
|
2775
|
+
const accordionStyles = createMemo10(() => {
|
|
2776
|
+
const styles = {
|
|
2777
|
+
display: "flex",
|
|
2778
|
+
alignItems: "stretch",
|
|
2779
|
+
flexDirection: "column",
|
|
2780
|
+
...props.grid && {
|
|
2781
|
+
flexDirection: "row",
|
|
2782
|
+
alignItems: "flex-start",
|
|
2783
|
+
flexWrap: "wrap"
|
|
2784
|
+
}
|
|
2785
|
+
};
|
|
2786
|
+
return Object.fromEntries(
|
|
2787
|
+
Object.entries(styles).map(([key, value]) => [
|
|
2788
|
+
camelToKebabCase(key),
|
|
2789
|
+
value
|
|
2790
|
+
])
|
|
2791
|
+
);
|
|
2792
|
+
});
|
|
2793
|
+
const accordionTitleStyles = createMemo10(() => {
|
|
2794
|
+
const shared = {
|
|
2795
|
+
display: "flex",
|
|
2796
|
+
flexDirection: "column"
|
|
2797
|
+
};
|
|
2798
|
+
const styles = Object.fromEntries(
|
|
2799
|
+
Object.entries({
|
|
2800
|
+
...shared,
|
|
2801
|
+
alignItems: "stretch",
|
|
2802
|
+
cursor: "pointer"
|
|
2803
|
+
}).map(([key, value]) => [camelToKebabCase(key), value])
|
|
2804
|
+
);
|
|
2805
|
+
return Object.fromEntries(
|
|
2806
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2807
|
+
);
|
|
2808
|
+
});
|
|
2809
|
+
function getAccordionTitleClassName(index) {
|
|
2810
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
2811
|
+
}
|
|
2812
|
+
function getAccordionDetailClassName(index) {
|
|
2813
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
2814
|
+
}
|
|
2815
|
+
const openGridItemOrder = createMemo10(() => {
|
|
2816
|
+
let itemOrder = null;
|
|
2817
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
2818
|
+
if (getOpenGridItemPosition && document) {
|
|
2819
|
+
const openItemIndex = open()[0];
|
|
2820
|
+
const openItem = document.querySelector(
|
|
2821
|
+
`.builder-accordion-title[data-index="${openItemIndex}"]`
|
|
2822
|
+
);
|
|
2823
|
+
let subjectItem = openItem;
|
|
2824
|
+
itemOrder = openItemIndex;
|
|
2825
|
+
if (subjectItem) {
|
|
2826
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
2827
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
2828
|
+
if (subjectItem) {
|
|
2829
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
2830
|
+
continue;
|
|
2831
|
+
}
|
|
2832
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
2833
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
2834
|
+
const index = parseInt(
|
|
2835
|
+
subjectItem.getAttribute("data-index") || "",
|
|
2836
|
+
10
|
|
2837
|
+
);
|
|
2838
|
+
if (!isNaN(index)) {
|
|
2839
|
+
prevItemRect = subjectItemRect;
|
|
2840
|
+
itemOrder = index;
|
|
2841
|
+
}
|
|
2842
|
+
} else {
|
|
2843
|
+
break;
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
if (typeof itemOrder === "number") {
|
|
2850
|
+
itemOrder = itemOrder + 1;
|
|
2851
|
+
}
|
|
2852
|
+
return itemOrder;
|
|
2853
|
+
});
|
|
2854
|
+
const accordionDetailStyles = createMemo10(() => {
|
|
2855
|
+
const styles = {
|
|
2856
|
+
...{
|
|
2857
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
2858
|
+
},
|
|
2859
|
+
...props.grid && {
|
|
2860
|
+
width: "100%"
|
|
2861
|
+
}
|
|
2862
|
+
};
|
|
2863
|
+
return Object.fromEntries(
|
|
2864
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2865
|
+
);
|
|
2866
|
+
});
|
|
2867
|
+
function onClick(index) {
|
|
2868
|
+
if (open().includes(index)) {
|
|
2869
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
2870
|
+
} else {
|
|
2871
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
|
|
2875
|
+
const index = _index();
|
|
2876
|
+
return <>
|
|
2877
|
+
<div
|
|
2878
|
+
class={getAccordionTitleClassName(index)}
|
|
2879
|
+
style={{
|
|
2880
|
+
...accordionTitleStyles(),
|
|
2881
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
2882
|
+
...{
|
|
2883
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
2884
|
+
}
|
|
2885
|
+
}}
|
|
2886
|
+
data-index={index}
|
|
2887
|
+
onClick={(event) => onClick(index)}
|
|
2888
|
+
><Blocks_default
|
|
2889
|
+
blocks={item.title}
|
|
2890
|
+
path={`items.${index}.title`}
|
|
2891
|
+
parent={props.builderBlock.id}
|
|
2892
|
+
context={props.builderContext}
|
|
2893
|
+
registeredComponents={props.builderComponents}
|
|
2894
|
+
linkComponent={props.builderLinkComponent}
|
|
2895
|
+
/></div>
|
|
2896
|
+
<Show9 when={open().includes(index)}><div
|
|
2897
|
+
class={getAccordionDetailClassName(index)}
|
|
2898
|
+
style={accordionDetailStyles()}
|
|
2899
|
+
><Blocks_default
|
|
2900
|
+
blocks={item.detail}
|
|
2901
|
+
path={`items.${index}.detail`}
|
|
2902
|
+
parent={props.builderBlock.id}
|
|
2903
|
+
context={props.builderContext}
|
|
2904
|
+
registeredComponents={props.builderComponents}
|
|
2905
|
+
linkComponent={props.builderLinkComponent}
|
|
2906
|
+
/></div></Show9>
|
|
2907
|
+
</>;
|
|
2908
|
+
}}</For6></div>;
|
|
2909
|
+
}
|
|
2910
|
+
var accordion_default = Accordion;
|
|
2911
|
+
|
|
2912
|
+
// src/blocks/accordion/component-info.ts
|
|
2913
|
+
var defaultTitle = {
|
|
2914
|
+
"@type": "@builder.io/sdk:Element",
|
|
2915
|
+
layerName: "Accordion item title",
|
|
2916
|
+
responsiveStyles: {
|
|
2917
|
+
large: {
|
|
2918
|
+
marginTop: "10px",
|
|
2919
|
+
position: "relative",
|
|
2920
|
+
display: "flex",
|
|
2921
|
+
alignItems: "stretch",
|
|
2922
|
+
flexDirection: "column",
|
|
2923
|
+
paddingBottom: "10px"
|
|
2924
|
+
}
|
|
2925
|
+
},
|
|
2926
|
+
children: [{
|
|
2927
|
+
"@type": "@builder.io/sdk:Element",
|
|
2928
|
+
responsiveStyles: {
|
|
2929
|
+
large: {
|
|
2930
|
+
textAlign: "left",
|
|
2931
|
+
display: "flex",
|
|
2932
|
+
flexDirection: "column"
|
|
2933
|
+
}
|
|
2934
|
+
},
|
|
2935
|
+
component: {
|
|
2936
|
+
name: "Text",
|
|
2937
|
+
options: {
|
|
2938
|
+
text: "I am an accordion title. Click me!"
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
}]
|
|
2942
|
+
};
|
|
2943
|
+
var defaultDetail = {
|
|
2944
|
+
"@type": "@builder.io/sdk:Element",
|
|
2945
|
+
layerName: "Accordion item detail",
|
|
2946
|
+
responsiveStyles: {
|
|
2947
|
+
large: {
|
|
2948
|
+
position: "relative",
|
|
2949
|
+
display: "flex",
|
|
2950
|
+
alignItems: "stretch",
|
|
2951
|
+
flexDirection: "column",
|
|
2952
|
+
marginTop: "10px",
|
|
2953
|
+
paddingBottom: "10px"
|
|
2954
|
+
}
|
|
2955
|
+
},
|
|
2956
|
+
children: [{
|
|
2957
|
+
"@type": "@builder.io/sdk:Element",
|
|
2958
|
+
responsiveStyles: {
|
|
2959
|
+
large: {
|
|
2960
|
+
paddingTop: "50px",
|
|
2961
|
+
textAlign: "left",
|
|
2962
|
+
display: "flex",
|
|
2963
|
+
flexDirection: "column",
|
|
2964
|
+
paddingBottom: "50px"
|
|
2965
|
+
}
|
|
2966
|
+
},
|
|
2967
|
+
component: {
|
|
2968
|
+
name: "Text",
|
|
2969
|
+
options: {
|
|
2970
|
+
text: "I am an accordion detail, hello!"
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
}]
|
|
2974
|
+
};
|
|
2763
2975
|
var componentInfo10 = {
|
|
2976
|
+
name: "Builder:Accordion",
|
|
2977
|
+
canHaveChildren: true,
|
|
2978
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
2979
|
+
defaultStyles: {
|
|
2980
|
+
display: "flex",
|
|
2981
|
+
flexDirection: "column",
|
|
2982
|
+
alignItems: "stretch"
|
|
2983
|
+
},
|
|
2984
|
+
inputs: [{
|
|
2985
|
+
name: "items",
|
|
2986
|
+
type: "list",
|
|
2987
|
+
broadcast: true,
|
|
2988
|
+
subFields: [{
|
|
2989
|
+
name: "title",
|
|
2990
|
+
type: "uiBlocks",
|
|
2991
|
+
hideFromUI: true,
|
|
2992
|
+
defaultValue: [defaultTitle]
|
|
2993
|
+
}, {
|
|
2994
|
+
name: "detail",
|
|
2995
|
+
type: "uiBlocks",
|
|
2996
|
+
hideFromUI: true,
|
|
2997
|
+
defaultValue: [defaultDetail]
|
|
2998
|
+
}],
|
|
2999
|
+
defaultValue: [{
|
|
3000
|
+
title: [defaultTitle],
|
|
3001
|
+
detail: [defaultDetail]
|
|
3002
|
+
}, {
|
|
3003
|
+
title: [defaultTitle],
|
|
3004
|
+
detail: [defaultDetail]
|
|
3005
|
+
}],
|
|
3006
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
3007
|
+
}, {
|
|
3008
|
+
name: "oneAtATime",
|
|
3009
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
3010
|
+
type: "boolean",
|
|
3011
|
+
defaultValue: false
|
|
3012
|
+
}, {
|
|
3013
|
+
name: "grid",
|
|
3014
|
+
helperText: "Display as a grid",
|
|
3015
|
+
type: "boolean",
|
|
3016
|
+
defaultValue: false
|
|
3017
|
+
}, {
|
|
3018
|
+
name: "gridRowWidth",
|
|
3019
|
+
helperText: "Display as a grid",
|
|
3020
|
+
type: "string",
|
|
3021
|
+
showIf: (options) => options.get("grid"),
|
|
3022
|
+
defaultValue: "25%"
|
|
3023
|
+
}, {
|
|
3024
|
+
name: "useChildrenForItems",
|
|
3025
|
+
type: "boolean",
|
|
3026
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
3027
|
+
advanced: true,
|
|
3028
|
+
defaultValue: false,
|
|
3029
|
+
onChange: (options) => {
|
|
3030
|
+
if (options.get("useChildrenForItems") === true) {
|
|
3031
|
+
options.set("items", []);
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
}]
|
|
3035
|
+
};
|
|
3036
|
+
|
|
3037
|
+
// src/blocks/custom-code/component-info.ts
|
|
3038
|
+
var componentInfo11 = {
|
|
2764
3039
|
name: "Custom Code",
|
|
2765
3040
|
static: true,
|
|
2766
3041
|
requiredPermissions: ["editCode"],
|
|
@@ -2785,10 +3060,10 @@ var componentInfo10 = {
|
|
|
2785
3060
|
};
|
|
2786
3061
|
|
|
2787
3062
|
// src/blocks/custom-code/custom-code.tsx
|
|
2788
|
-
import { onMount as onMount2, createSignal as
|
|
3063
|
+
import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
|
|
2789
3064
|
function CustomCode(props) {
|
|
2790
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2791
|
-
const [scriptsRun, setScriptsRun] =
|
|
3065
|
+
const [scriptsInserted, setScriptsInserted] = createSignal11([]);
|
|
3066
|
+
const [scriptsRun, setScriptsRun] = createSignal11([]);
|
|
2792
3067
|
let elementRef;
|
|
2793
3068
|
onMount2(() => {
|
|
2794
3069
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
@@ -2832,7 +3107,7 @@ function CustomCode(props) {
|
|
|
2832
3107
|
var custom_code_default = CustomCode;
|
|
2833
3108
|
|
|
2834
3109
|
// src/blocks/embed/component-info.ts
|
|
2835
|
-
var
|
|
3110
|
+
var componentInfo12 = {
|
|
2836
3111
|
name: "Embed",
|
|
2837
3112
|
static: true,
|
|
2838
3113
|
inputs: [{
|
|
@@ -2870,7 +3145,7 @@ var componentInfo11 = {
|
|
|
2870
3145
|
};
|
|
2871
3146
|
|
|
2872
3147
|
// src/blocks/embed/embed.tsx
|
|
2873
|
-
import { on, createEffect, createMemo as
|
|
3148
|
+
import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
2874
3149
|
|
|
2875
3150
|
// src/blocks/embed/helpers.ts
|
|
2876
3151
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -2878,9 +3153,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
2878
3153
|
|
|
2879
3154
|
// src/blocks/embed/embed.tsx
|
|
2880
3155
|
function Embed(props) {
|
|
2881
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2882
|
-
const [scriptsRun, setScriptsRun] =
|
|
2883
|
-
const [ranInitFn, setRanInitFn] =
|
|
3156
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3157
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
3158
|
+
const [ranInitFn, setRanInitFn] = createSignal12(false);
|
|
2884
3159
|
function findAndRunScripts() {
|
|
2885
3160
|
if (!elem || !elem.getElementsByTagName)
|
|
2886
3161
|
return;
|
|
@@ -2904,8 +3179,8 @@ function Embed(props) {
|
|
|
2904
3179
|
}
|
|
2905
3180
|
}
|
|
2906
3181
|
let elem;
|
|
2907
|
-
const onUpdateFn_0_elem =
|
|
2908
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
3182
|
+
const onUpdateFn_0_elem = createMemo12(() => elem);
|
|
3183
|
+
const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
|
|
2909
3184
|
function onUpdateFn_0() {
|
|
2910
3185
|
if (elem && !ranInitFn()) {
|
|
2911
3186
|
setRanInitFn(true);
|
|
@@ -2920,7 +3195,7 @@ function Embed(props) {
|
|
|
2920
3195
|
var embed_default = Embed;
|
|
2921
3196
|
|
|
2922
3197
|
// src/blocks/form/form/component-info.ts
|
|
2923
|
-
var
|
|
3198
|
+
var componentInfo13 = {
|
|
2924
3199
|
name: "Form:Form",
|
|
2925
3200
|
// editableTags: ['builder-form-error']
|
|
2926
3201
|
defaults: {
|
|
@@ -3154,7 +3429,7 @@ var componentInfo12 = {
|
|
|
3154
3429
|
};
|
|
3155
3430
|
|
|
3156
3431
|
// src/blocks/form/form/form.tsx
|
|
3157
|
-
import { Show as
|
|
3432
|
+
import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
|
|
3158
3433
|
import { css as css4 } from "solid-styled-components";
|
|
3159
3434
|
|
|
3160
3435
|
// src/functions/get-env.ts
|
|
@@ -3172,9 +3447,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
3172
3447
|
|
|
3173
3448
|
// src/blocks/form/form/form.tsx
|
|
3174
3449
|
function FormComponent(props) {
|
|
3175
|
-
const [formState, setFormState] =
|
|
3176
|
-
const [responseData, setResponseData] =
|
|
3177
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
3450
|
+
const [formState, setFormState] = createSignal13("unsubmitted");
|
|
3451
|
+
const [responseData, setResponseData] = createSignal13(null);
|
|
3452
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal13("");
|
|
3178
3453
|
function mergeNewRootState(newData) {
|
|
3179
3454
|
const combinedState = {
|
|
3180
3455
|
...props.builderContext.rootState,
|
|
@@ -3370,7 +3645,7 @@ function FormComponent(props) {
|
|
|
3370
3645
|
{...{}}
|
|
3371
3646
|
{...props.attributes}
|
|
3372
3647
|
>
|
|
3373
|
-
<
|
|
3648
|
+
<Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
|
|
3374
3649
|
const idx = _index();
|
|
3375
3650
|
return <Block_default
|
|
3376
3651
|
key={`form-block-${idx}`}
|
|
@@ -3379,35 +3654,35 @@ function FormComponent(props) {
|
|
|
3379
3654
|
registeredComponents={props.builderComponents}
|
|
3380
3655
|
linkComponent={props.builderLinkComponent}
|
|
3381
3656
|
/>;
|
|
3382
|
-
}}</
|
|
3383
|
-
<
|
|
3657
|
+
}}</For7></Show10>
|
|
3658
|
+
<Show10 when={submissionState() === "error"}><Blocks_default
|
|
3384
3659
|
path="errorMessage"
|
|
3385
3660
|
blocks={props.errorMessage}
|
|
3386
3661
|
context={props.builderContext}
|
|
3387
|
-
/></
|
|
3388
|
-
<
|
|
3662
|
+
/></Show10>
|
|
3663
|
+
<Show10 when={submissionState() === "sending"}><Blocks_default
|
|
3389
3664
|
path="sendingMessage"
|
|
3390
3665
|
blocks={props.sendingMessage}
|
|
3391
3666
|
context={props.builderContext}
|
|
3392
|
-
/></
|
|
3393
|
-
<
|
|
3667
|
+
/></Show10>
|
|
3668
|
+
<Show10 when={submissionState() === "error" && responseData()}><pre
|
|
3394
3669
|
class={"builder-form-error-text " + css4({
|
|
3395
3670
|
padding: "10px",
|
|
3396
3671
|
color: "red",
|
|
3397
3672
|
textAlign: "center"
|
|
3398
3673
|
})}
|
|
3399
|
-
>{JSON.stringify(responseData(), null, 2)}</pre></
|
|
3400
|
-
<
|
|
3674
|
+
>{JSON.stringify(responseData(), null, 2)}</pre></Show10>
|
|
3675
|
+
<Show10 when={submissionState() === "success"}><Blocks_default
|
|
3401
3676
|
path="successMessage"
|
|
3402
3677
|
blocks={props.successMessage}
|
|
3403
3678
|
context={props.builderContext}
|
|
3404
|
-
/></
|
|
3679
|
+
/></Show10>
|
|
3405
3680
|
</form>;
|
|
3406
3681
|
}
|
|
3407
3682
|
var form_default = FormComponent;
|
|
3408
3683
|
|
|
3409
3684
|
// src/blocks/form/input/component-info.ts
|
|
3410
|
-
var
|
|
3685
|
+
var componentInfo14 = {
|
|
3411
3686
|
name: "Form:Input",
|
|
3412
3687
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3413
3688
|
inputs: [
|
|
@@ -3477,7 +3752,7 @@ function FormInputComponent(props) {
|
|
|
3477
3752
|
var input_default = FormInputComponent;
|
|
3478
3753
|
|
|
3479
3754
|
// src/blocks/form/select/component-info.ts
|
|
3480
|
-
var
|
|
3755
|
+
var componentInfo15 = {
|
|
3481
3756
|
name: "Form:Select",
|
|
3482
3757
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3483
3758
|
defaultStyles: {
|
|
@@ -3522,7 +3797,7 @@ var componentInfo14 = {
|
|
|
3522
3797
|
};
|
|
3523
3798
|
|
|
3524
3799
|
// src/blocks/form/select/select.tsx
|
|
3525
|
-
import { For as
|
|
3800
|
+
import { For as For8 } from "solid-js";
|
|
3526
3801
|
function SelectComponent(props) {
|
|
3527
3802
|
return <select
|
|
3528
3803
|
{...{}}
|
|
@@ -3531,15 +3806,15 @@ function SelectComponent(props) {
|
|
|
3531
3806
|
key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
|
|
3532
3807
|
defaultValue={props.defaultValue}
|
|
3533
3808
|
name={props.name}
|
|
3534
|
-
><
|
|
3809
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
3535
3810
|
const index = _index();
|
|
3536
3811
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
3537
|
-
}}</
|
|
3812
|
+
}}</For8></select>;
|
|
3538
3813
|
}
|
|
3539
3814
|
var select_default = SelectComponent;
|
|
3540
3815
|
|
|
3541
3816
|
// src/blocks/form/submit-button/component-info.ts
|
|
3542
|
-
var
|
|
3817
|
+
var componentInfo16 = {
|
|
3543
3818
|
name: "Form:SubmitButton",
|
|
3544
3819
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3545
3820
|
defaultStyles: {
|
|
@@ -3573,7 +3848,7 @@ function SubmitButton(props) {
|
|
|
3573
3848
|
var submit_button_default = SubmitButton;
|
|
3574
3849
|
|
|
3575
3850
|
// src/blocks/img/component-info.ts
|
|
3576
|
-
var
|
|
3851
|
+
var componentInfo17 = {
|
|
3577
3852
|
// friendlyName?
|
|
3578
3853
|
name: "Raw:Img",
|
|
3579
3854
|
hideFromInsertMenu: true,
|
|
@@ -3606,7 +3881,7 @@ function ImgComponent(props) {
|
|
|
3606
3881
|
var img_default = ImgComponent;
|
|
3607
3882
|
|
|
3608
3883
|
// src/blocks/video/component-info.ts
|
|
3609
|
-
var
|
|
3884
|
+
var componentInfo18 = {
|
|
3610
3885
|
name: "Video",
|
|
3611
3886
|
canHaveChildren: true,
|
|
3612
3887
|
defaultStyles: {
|
|
@@ -3690,9 +3965,9 @@ var componentInfo17 = {
|
|
|
3690
3965
|
};
|
|
3691
3966
|
|
|
3692
3967
|
// src/blocks/video/video.tsx
|
|
3693
|
-
import { Show as
|
|
3968
|
+
import { Show as Show11, createMemo as createMemo14 } from "solid-js";
|
|
3694
3969
|
function Video(props) {
|
|
3695
|
-
const videoProps =
|
|
3970
|
+
const videoProps = createMemo14(() => {
|
|
3696
3971
|
return {
|
|
3697
3972
|
...props.autoPlay === true ? {
|
|
3698
3973
|
autoPlay: true
|
|
@@ -3711,7 +3986,7 @@ function Video(props) {
|
|
|
3711
3986
|
} : {}
|
|
3712
3987
|
};
|
|
3713
3988
|
});
|
|
3714
|
-
const spreadProps =
|
|
3989
|
+
const spreadProps = createMemo14(() => {
|
|
3715
3990
|
return {
|
|
3716
3991
|
...videoProps()
|
|
3717
3992
|
};
|
|
@@ -3741,8 +4016,8 @@ function Video(props) {
|
|
|
3741
4016
|
}}
|
|
3742
4017
|
src={props.video || "no-src"}
|
|
3743
4018
|
poster={props.posterImage}
|
|
3744
|
-
><
|
|
3745
|
-
<
|
|
4019
|
+
><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
|
|
4020
|
+
<Show11
|
|
3746
4021
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
3747
4022
|
><div
|
|
3748
4023
|
style={{
|
|
@@ -3751,15 +4026,15 @@ function Video(props) {
|
|
|
3751
4026
|
"pointer-events": "none",
|
|
3752
4027
|
"font-size": "0px"
|
|
3753
4028
|
}}
|
|
3754
|
-
/></
|
|
3755
|
-
<
|
|
4029
|
+
/></Show11>
|
|
4030
|
+
<Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
3756
4031
|
style={{
|
|
3757
4032
|
display: "flex",
|
|
3758
4033
|
"flex-direction": "column",
|
|
3759
4034
|
"align-items": "stretch"
|
|
3760
4035
|
}}
|
|
3761
|
-
>{props.children}</div></
|
|
3762
|
-
<
|
|
4036
|
+
>{props.children}</div></Show11>
|
|
4037
|
+
<Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
3763
4038
|
style={{
|
|
3764
4039
|
"pointer-events": "none",
|
|
3765
4040
|
display: "flex",
|
|
@@ -3771,7 +4046,7 @@ function Video(props) {
|
|
|
3771
4046
|
width: "100%",
|
|
3772
4047
|
height: "100%"
|
|
3773
4048
|
}}
|
|
3774
|
-
>{props.children}</div></
|
|
4049
|
+
>{props.children}</div></Show11>
|
|
3775
4050
|
</div>;
|
|
3776
4051
|
}
|
|
3777
4052
|
var video_default = Video;
|
|
@@ -3779,28 +4054,28 @@ var video_default = Video;
|
|
|
3779
4054
|
// src/constants/extra-components.ts
|
|
3780
4055
|
var getExtraComponents = () => [{
|
|
3781
4056
|
component: custom_code_default,
|
|
3782
|
-
...
|
|
4057
|
+
...componentInfo11
|
|
3783
4058
|
}, {
|
|
3784
4059
|
component: embed_default,
|
|
3785
|
-
...
|
|
4060
|
+
...componentInfo12
|
|
3786
4061
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3787
4062
|
component: form_default,
|
|
3788
|
-
...
|
|
4063
|
+
...componentInfo13
|
|
3789
4064
|
}, {
|
|
3790
4065
|
component: input_default,
|
|
3791
|
-
...
|
|
4066
|
+
...componentInfo14
|
|
3792
4067
|
}, {
|
|
3793
4068
|
component: submit_button_default,
|
|
3794
|
-
...
|
|
4069
|
+
...componentInfo16
|
|
3795
4070
|
}, {
|
|
3796
4071
|
component: select_default,
|
|
3797
|
-
...
|
|
4072
|
+
...componentInfo15
|
|
3798
4073
|
}], {
|
|
3799
4074
|
component: img_default,
|
|
3800
|
-
...
|
|
4075
|
+
...componentInfo17
|
|
3801
4076
|
}, {
|
|
3802
4077
|
component: video_default,
|
|
3803
|
-
...
|
|
4078
|
+
...componentInfo18
|
|
3804
4079
|
}];
|
|
3805
4080
|
|
|
3806
4081
|
// src/constants/builder-registered-components.ts
|
|
@@ -3831,6 +4106,9 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3831
4106
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3832
4107
|
component: tabs_default,
|
|
3833
4108
|
...componentInfo8
|
|
4109
|
+
}, {
|
|
4110
|
+
component: accordion_default,
|
|
4111
|
+
...componentInfo10
|
|
3834
4112
|
}], ...getExtraComponents()];
|
|
3835
4113
|
|
|
3836
4114
|
// src/functions/register-component.ts
|
|
@@ -3909,12 +4187,12 @@ var Inlined_script_default = InlinedScript;
|
|
|
3909
4187
|
|
|
3910
4188
|
// src/components/content/components/enable-editor.tsx
|
|
3911
4189
|
import {
|
|
3912
|
-
Show as
|
|
4190
|
+
Show as Show12,
|
|
3913
4191
|
onMount as onMount3,
|
|
3914
4192
|
on as on2,
|
|
3915
4193
|
createEffect as createEffect2,
|
|
3916
|
-
createMemo as
|
|
3917
|
-
createSignal as
|
|
4194
|
+
createMemo as createMemo15,
|
|
4195
|
+
createSignal as createSignal15
|
|
3918
4196
|
} from "solid-js";
|
|
3919
4197
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
3920
4198
|
|
|
@@ -4414,7 +4692,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4414
4692
|
}
|
|
4415
4693
|
|
|
4416
4694
|
// src/constants/sdk-version.ts
|
|
4417
|
-
var SDK_VERSION = "1.0.
|
|
4695
|
+
var SDK_VERSION = "1.0.28";
|
|
4418
4696
|
|
|
4419
4697
|
// src/functions/register.ts
|
|
4420
4698
|
var registry = {};
|
|
@@ -4692,12 +4970,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
4692
4970
|
|
|
4693
4971
|
// src/components/content/components/enable-editor.tsx
|
|
4694
4972
|
function EnableEditor(props) {
|
|
4695
|
-
const [ContentWrapper, setContentWrapper] =
|
|
4973
|
+
const [ContentWrapper, setContentWrapper] = createSignal15(
|
|
4696
4974
|
props.contentWrapper || "div"
|
|
4697
4975
|
);
|
|
4698
|
-
const [httpReqsData, setHttpReqsData] =
|
|
4699
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
4700
|
-
const [clicked, setClicked] =
|
|
4976
|
+
const [httpReqsData, setHttpReqsData] = createSignal15({});
|
|
4977
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal15({});
|
|
4978
|
+
const [clicked, setClicked] = createSignal15(false);
|
|
4701
4979
|
function mergeNewRootState(newData) {
|
|
4702
4980
|
const combinedState = {
|
|
4703
4981
|
...props.builderContextSignal.rootState,
|
|
@@ -4731,7 +5009,7 @@ function EnableEditor(props) {
|
|
|
4731
5009
|
content: newContentValue
|
|
4732
5010
|
}));
|
|
4733
5011
|
}
|
|
4734
|
-
const showContentProps =
|
|
5012
|
+
const showContentProps = createMemo15(() => {
|
|
4735
5013
|
return props.showContent ? {} : {
|
|
4736
5014
|
hidden: true,
|
|
4737
5015
|
"aria-hidden": true
|
|
@@ -4915,21 +5193,21 @@ function EnableEditor(props) {
|
|
|
4915
5193
|
onMount3(() => {
|
|
4916
5194
|
if (!props.apiKey) {
|
|
4917
5195
|
logger.error(
|
|
4918
|
-
"No API key provided to `
|
|
5196
|
+
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
4919
5197
|
);
|
|
4920
5198
|
}
|
|
4921
5199
|
evaluateJsCode();
|
|
4922
5200
|
runHttpRequests();
|
|
4923
5201
|
emitStateUpdate();
|
|
4924
5202
|
});
|
|
4925
|
-
const onUpdateFn_0_props_content =
|
|
5203
|
+
const onUpdateFn_0_props_content = createMemo15(() => props.content);
|
|
4926
5204
|
function onUpdateFn_0() {
|
|
4927
5205
|
if (props.content) {
|
|
4928
5206
|
mergeNewContent(props.content);
|
|
4929
5207
|
}
|
|
4930
5208
|
}
|
|
4931
5209
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4932
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
5210
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4933
5211
|
function onUpdateFn_1() {
|
|
4934
5212
|
evaluateJsCode();
|
|
4935
5213
|
}
|
|
@@ -4939,7 +5217,7 @@ function EnableEditor(props) {
|
|
|
4939
5217
|
onUpdateFn_1
|
|
4940
5218
|
)
|
|
4941
5219
|
);
|
|
4942
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
5220
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4943
5221
|
function onUpdateFn_2() {
|
|
4944
5222
|
runHttpRequests();
|
|
4945
5223
|
}
|
|
@@ -4951,7 +5229,7 @@ function EnableEditor(props) {
|
|
|
4951
5229
|
onUpdateFn_2
|
|
4952
5230
|
)
|
|
4953
5231
|
);
|
|
4954
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
5232
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
|
|
4955
5233
|
() => props.builderContextSignal.rootState
|
|
4956
5234
|
);
|
|
4957
5235
|
function onUpdateFn_3() {
|
|
@@ -4963,14 +5241,14 @@ function EnableEditor(props) {
|
|
|
4963
5241
|
onUpdateFn_3
|
|
4964
5242
|
)
|
|
4965
5243
|
);
|
|
4966
|
-
const onUpdateFn_4_props_data =
|
|
5244
|
+
const onUpdateFn_4_props_data = createMemo15(() => props.data);
|
|
4967
5245
|
function onUpdateFn_4() {
|
|
4968
5246
|
if (props.data) {
|
|
4969
5247
|
mergeNewRootState(props.data);
|
|
4970
5248
|
}
|
|
4971
5249
|
}
|
|
4972
5250
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4973
|
-
const onUpdateFn_5_props_locale =
|
|
5251
|
+
const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
|
|
4974
5252
|
function onUpdateFn_5() {
|
|
4975
5253
|
if (props.locale) {
|
|
4976
5254
|
mergeNewRootState({
|
|
@@ -4979,7 +5257,7 @@ function EnableEditor(props) {
|
|
|
4979
5257
|
}
|
|
4980
5258
|
}
|
|
4981
5259
|
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4982
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
5260
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
|
|
4983
5261
|
class={getWrapperClassName(
|
|
4984
5262
|
props.content?.testVariationId || props.content?.id
|
|
4985
5263
|
)}
|
|
@@ -4992,14 +5270,14 @@ function EnableEditor(props) {
|
|
|
4992
5270
|
{...showContentProps()}
|
|
4993
5271
|
{...props.contentWrapperProps}
|
|
4994
5272
|
component={ContentWrapper()}
|
|
4995
|
-
>{props.children}</Dynamic5></
|
|
5273
|
+
>{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
|
|
4996
5274
|
}
|
|
4997
5275
|
var Enable_editor_default = EnableEditor;
|
|
4998
5276
|
|
|
4999
5277
|
// src/components/content/components/styles.tsx
|
|
5000
|
-
import { createSignal as
|
|
5278
|
+
import { createSignal as createSignal16 } from "solid-js";
|
|
5001
5279
|
function ContentStyles(props) {
|
|
5002
|
-
const [injectedStyles, setInjectedStyles] =
|
|
5280
|
+
const [injectedStyles, setInjectedStyles] = createSignal16(
|
|
5003
5281
|
`
|
|
5004
5282
|
${getCss({
|
|
5005
5283
|
cssCode: props.cssCode,
|
|
@@ -5056,7 +5334,7 @@ var getContentInitialValue = ({
|
|
|
5056
5334
|
|
|
5057
5335
|
// src/components/content/content.tsx
|
|
5058
5336
|
function ContentComponent(props) {
|
|
5059
|
-
const [scriptStr, setScriptStr] =
|
|
5337
|
+
const [scriptStr, setScriptStr] = createSignal17(
|
|
5060
5338
|
getUpdateVariantVisibilityScript({
|
|
5061
5339
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5062
5340
|
variationId: props.content?.testVariationId,
|
|
@@ -5064,7 +5342,7 @@ function ContentComponent(props) {
|
|
|
5064
5342
|
contentId: props.content?.id
|
|
5065
5343
|
})
|
|
5066
5344
|
);
|
|
5067
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
5345
|
+
const [registeredComponents, setRegisteredComponents] = createSignal17(
|
|
5068
5346
|
[
|
|
5069
5347
|
...getDefaultRegisteredComponents(),
|
|
5070
5348
|
...props.customComponents || []
|
|
@@ -5079,7 +5357,7 @@ function ContentComponent(props) {
|
|
|
5079
5357
|
{}
|
|
5080
5358
|
)
|
|
5081
5359
|
);
|
|
5082
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
5360
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal17({
|
|
5083
5361
|
content: getContentInitialValue({
|
|
5084
5362
|
content: props.content,
|
|
5085
5363
|
data: props.data
|
|
@@ -5137,16 +5415,16 @@ function ContentComponent(props) {
|
|
|
5137
5415
|
setBuilderContextSignal
|
|
5138
5416
|
}}
|
|
5139
5417
|
>
|
|
5140
|
-
<
|
|
5418
|
+
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
5141
5419
|
id="builderio-variant-visibility"
|
|
5142
5420
|
scriptStr={scriptStr()}
|
|
5143
|
-
/></
|
|
5144
|
-
<
|
|
5421
|
+
/></Show13>
|
|
5422
|
+
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
5145
5423
|
isNestedRender={props.isNestedRender}
|
|
5146
5424
|
contentId={builderContextSignal().content?.id}
|
|
5147
5425
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
5148
5426
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
5149
|
-
/></
|
|
5427
|
+
/></Show13>
|
|
5150
5428
|
<Blocks_default
|
|
5151
5429
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
5152
5430
|
context={builderContextSignal()}
|
|
@@ -5159,13 +5437,13 @@ var Content_default = ContentComponent;
|
|
|
5159
5437
|
|
|
5160
5438
|
// src/components/content-variants/content-variants.tsx
|
|
5161
5439
|
function ContentVariants(props) {
|
|
5162
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
5440
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
|
|
5163
5441
|
checkShouldRenderVariants({
|
|
5164
5442
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
5165
5443
|
content: props.content
|
|
5166
5444
|
})
|
|
5167
5445
|
);
|
|
5168
|
-
const updateCookieAndStylesScriptStr =
|
|
5446
|
+
const updateCookieAndStylesScriptStr = createMemo18(() => {
|
|
5169
5447
|
return getUpdateCookieAndStylesScript(
|
|
5170
5448
|
getVariants(props.content).map((value) => ({
|
|
5171
5449
|
id: value.testVariationId,
|
|
@@ -5174,10 +5452,10 @@ function ContentVariants(props) {
|
|
|
5174
5452
|
props.content?.id || ""
|
|
5175
5453
|
);
|
|
5176
5454
|
});
|
|
5177
|
-
const hideVariantsStyleString =
|
|
5455
|
+
const hideVariantsStyleString = createMemo18(() => {
|
|
5178
5456
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
5179
5457
|
});
|
|
5180
|
-
const defaultContent =
|
|
5458
|
+
const defaultContent = createMemo18(() => {
|
|
5181
5459
|
return shouldRenderVariants() ? {
|
|
5182
5460
|
...props.content,
|
|
5183
5461
|
testVariationId: props.content?.id
|
|
@@ -5190,11 +5468,11 @@ function ContentVariants(props) {
|
|
|
5190
5468
|
setShouldRenderVariants(false);
|
|
5191
5469
|
});
|
|
5192
5470
|
return <>
|
|
5193
|
-
<
|
|
5471
|
+
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5194
5472
|
id="builderio-init-variants-fns"
|
|
5195
5473
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5196
|
-
/></
|
|
5197
|
-
<
|
|
5474
|
+
/></Show14>
|
|
5475
|
+
<Show14 when={shouldRenderVariants()}>
|
|
5198
5476
|
<Inlined_styles_default
|
|
5199
5477
|
id="builderio-variants"
|
|
5200
5478
|
styles={hideVariantsStyleString()}
|
|
@@ -5203,7 +5481,7 @@ function ContentVariants(props) {
|
|
|
5203
5481
|
id="builderio-variants-visibility"
|
|
5204
5482
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5205
5483
|
/>
|
|
5206
|
-
<
|
|
5484
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5207
5485
|
const index = _index();
|
|
5208
5486
|
return <Content_default
|
|
5209
5487
|
isNestedRender={props.isNestedRender}
|
|
@@ -5227,8 +5505,8 @@ function ContentVariants(props) {
|
|
|
5227
5505
|
contentWrapperProps={props.contentWrapperProps}
|
|
5228
5506
|
trustedHosts={props.trustedHosts}
|
|
5229
5507
|
/>;
|
|
5230
|
-
}}</
|
|
5231
|
-
</
|
|
5508
|
+
}}</For9>
|
|
5509
|
+
</Show14>
|
|
5232
5510
|
<Content_default
|
|
5233
5511
|
isNestedRender={props.isNestedRender}
|
|
5234
5512
|
{...{}}
|
|
@@ -5281,14 +5559,14 @@ var fetchSymbolContent = async ({
|
|
|
5281
5559
|
|
|
5282
5560
|
// src/blocks/symbol/symbol.tsx
|
|
5283
5561
|
function Symbol(props) {
|
|
5284
|
-
const [contentToUse, setContentToUse] =
|
|
5285
|
-
const blocksWrapper =
|
|
5562
|
+
const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
|
|
5563
|
+
const blocksWrapper = createMemo19(() => {
|
|
5286
5564
|
return "div";
|
|
5287
5565
|
});
|
|
5288
|
-
const contentWrapper =
|
|
5566
|
+
const contentWrapper = createMemo19(() => {
|
|
5289
5567
|
return "div";
|
|
5290
5568
|
});
|
|
5291
|
-
const className =
|
|
5569
|
+
const className = createMemo19(() => {
|
|
5292
5570
|
return [
|
|
5293
5571
|
...[props.attributes[getClassPropName()]],
|
|
5294
5572
|
"builder-symbol",
|
|
@@ -5310,7 +5588,7 @@ function Symbol(props) {
|
|
|
5310
5588
|
}
|
|
5311
5589
|
onMount5(() => {
|
|
5312
5590
|
});
|
|
5313
|
-
const onUpdateFn_0_props_symbol =
|
|
5591
|
+
const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
|
|
5314
5592
|
function onUpdateFn_0() {
|
|
5315
5593
|
setContent();
|
|
5316
5594
|
}
|