@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/index.jsx
CHANGED
|
@@ -625,6 +625,9 @@ function getProcessedBlock({
|
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
+
// src/functions/camel-to-kebab-case.ts
|
|
629
|
+
var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
630
|
+
|
|
628
631
|
// src/components/block/animator.ts
|
|
629
632
|
function throttle(func, wait, options = {}) {
|
|
630
633
|
let context;
|
|
@@ -675,7 +678,6 @@ function assign(target, ..._args) {
|
|
|
675
678
|
}
|
|
676
679
|
return to;
|
|
677
680
|
}
|
|
678
|
-
var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
679
681
|
function bindAnimations(animations) {
|
|
680
682
|
for (const animation of animations) {
|
|
681
683
|
switch (animation.trigger) {
|
|
@@ -727,7 +729,7 @@ function triggerAnimation(animation) {
|
|
|
727
729
|
element.style.transitionDelay = "0";
|
|
728
730
|
assign(element.style, animation.steps[0].styles);
|
|
729
731
|
setTimeout(() => {
|
|
730
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
732
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
731
733
|
if (animation.delay) {
|
|
732
734
|
element.style.transitionDelay = animation.delay + "s";
|
|
733
735
|
}
|
|
@@ -787,7 +789,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
787
789
|
}
|
|
788
790
|
attachDefaultState();
|
|
789
791
|
setTimeout(() => {
|
|
790
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
792
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
791
793
|
if (animation.delay) {
|
|
792
794
|
element.style.transitionDelay = animation.delay + "s";
|
|
793
795
|
}
|
|
@@ -800,9 +802,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
800
802
|
});
|
|
801
803
|
}
|
|
802
804
|
|
|
803
|
-
// src/functions/camel-to-kebab-case.ts
|
|
804
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
805
|
-
|
|
806
805
|
// src/helpers/css.ts
|
|
807
806
|
var convertStyleMapToCSSArray = (style) => {
|
|
808
807
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -929,10 +928,10 @@ var getRepeatItemData = ({
|
|
|
929
928
|
return repeatArray;
|
|
930
929
|
};
|
|
931
930
|
var shouldPassLinkComponent = (block) => {
|
|
932
|
-
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
931
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
933
932
|
};
|
|
934
933
|
var shouldPassRegisteredComponents = (block) => {
|
|
935
|
-
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
934
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
936
935
|
};
|
|
937
936
|
|
|
938
937
|
// src/components/block/components/block-styles.tsx
|
|
@@ -1061,7 +1060,7 @@ function BlockStyles(props) {
|
|
|
1061
1060
|
className: `${className}:hover`,
|
|
1062
1061
|
styles: {
|
|
1063
1062
|
...hoverStyles,
|
|
1064
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
1063
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
|
|
1065
1064
|
hoverAnimation.easing
|
|
1066
1065
|
)}`,
|
|
1067
1066
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
@@ -1825,10 +1824,10 @@ function SectionComponent(props) {
|
|
|
1825
1824
|
var section_default = SectionComponent;
|
|
1826
1825
|
|
|
1827
1826
|
// src/blocks/symbol/symbol.tsx
|
|
1828
|
-
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as
|
|
1827
|
+
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
|
|
1829
1828
|
|
|
1830
1829
|
// src/components/content-variants/content-variants.tsx
|
|
1831
|
-
import { Show as
|
|
1830
|
+
import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
|
|
1832
1831
|
|
|
1833
1832
|
// src/helpers/url.ts
|
|
1834
1833
|
var getTopLevelDomain = (host) => {
|
|
@@ -2022,7 +2021,7 @@ var handleABTesting = async ({
|
|
|
2022
2021
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2023
2022
|
|
|
2024
2023
|
// src/components/content/content.tsx
|
|
2025
|
-
import { Show as
|
|
2024
|
+
import { Show as Show13, createSignal as createSignal17 } from "solid-js";
|
|
2026
2025
|
|
|
2027
2026
|
// src/blocks/button/component-info.ts
|
|
2028
2027
|
var componentInfo = {
|
|
@@ -2672,8 +2671,12 @@ function Tabs(props) {
|
|
|
2672
2671
|
function activeTabContent(active) {
|
|
2673
2672
|
return props.tabs && props.tabs[active].content;
|
|
2674
2673
|
}
|
|
2675
|
-
function
|
|
2676
|
-
|
|
2674
|
+
function onClick(index) {
|
|
2675
|
+
if (index === activeTab() && props.collapsible) {
|
|
2676
|
+
setActiveTab(-1);
|
|
2677
|
+
} else {
|
|
2678
|
+
setActiveTab(index);
|
|
2679
|
+
}
|
|
2677
2680
|
}
|
|
2678
2681
|
return <div>
|
|
2679
2682
|
<div
|
|
@@ -2689,14 +2692,10 @@ function Tabs(props) {
|
|
|
2689
2692
|
return <span
|
|
2690
2693
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
2691
2694
|
key={index}
|
|
2692
|
-
style={
|
|
2693
|
-
|
|
2694
|
-
if (index === activeTab() && props.collapsible) {
|
|
2695
|
-
setActiveTab(-1);
|
|
2696
|
-
} else {
|
|
2697
|
-
setActiveTab(index);
|
|
2698
|
-
}
|
|
2695
|
+
style={{
|
|
2696
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
2699
2697
|
}}
|
|
2698
|
+
onClick={(event) => onClick(index)}
|
|
2700
2699
|
><Blocks_default
|
|
2701
2700
|
parent={props.builderBlock.id}
|
|
2702
2701
|
path={`component.options.tabs.${index}.label`}
|
|
@@ -2751,8 +2750,284 @@ function Text(props) {
|
|
|
2751
2750
|
}
|
|
2752
2751
|
var text_default = Text;
|
|
2753
2752
|
|
|
2754
|
-
// src/blocks/
|
|
2753
|
+
// src/blocks/accordion/accordion.tsx
|
|
2754
|
+
import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
|
|
2755
|
+
|
|
2756
|
+
// src/blocks/accordion/helpers.ts
|
|
2757
|
+
var convertOrderNumberToString = (order) => {
|
|
2758
|
+
return order.toString();
|
|
2759
|
+
};
|
|
2760
|
+
|
|
2761
|
+
// src/blocks/accordion/accordion.tsx
|
|
2762
|
+
function Accordion(props) {
|
|
2763
|
+
const [open, setOpen] = createSignal10([]);
|
|
2764
|
+
const onlyOneAtATime = createMemo10(() => {
|
|
2765
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
2766
|
+
});
|
|
2767
|
+
const accordionStyles = createMemo10(() => {
|
|
2768
|
+
const styles = {
|
|
2769
|
+
display: "flex",
|
|
2770
|
+
alignItems: "stretch",
|
|
2771
|
+
flexDirection: "column",
|
|
2772
|
+
...props.grid && {
|
|
2773
|
+
flexDirection: "row",
|
|
2774
|
+
alignItems: "flex-start",
|
|
2775
|
+
flexWrap: "wrap"
|
|
2776
|
+
}
|
|
2777
|
+
};
|
|
2778
|
+
return Object.fromEntries(
|
|
2779
|
+
Object.entries(styles).map(([key, value]) => [
|
|
2780
|
+
camelToKebabCase(key),
|
|
2781
|
+
value
|
|
2782
|
+
])
|
|
2783
|
+
);
|
|
2784
|
+
});
|
|
2785
|
+
const accordionTitleStyles = createMemo10(() => {
|
|
2786
|
+
const shared = {
|
|
2787
|
+
display: "flex",
|
|
2788
|
+
flexDirection: "column"
|
|
2789
|
+
};
|
|
2790
|
+
const styles = Object.fromEntries(
|
|
2791
|
+
Object.entries({
|
|
2792
|
+
...shared,
|
|
2793
|
+
alignItems: "stretch",
|
|
2794
|
+
cursor: "pointer"
|
|
2795
|
+
}).map(([key, value]) => [camelToKebabCase(key), value])
|
|
2796
|
+
);
|
|
2797
|
+
return Object.fromEntries(
|
|
2798
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2799
|
+
);
|
|
2800
|
+
});
|
|
2801
|
+
function getAccordionTitleClassName(index) {
|
|
2802
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
2803
|
+
}
|
|
2804
|
+
function getAccordionDetailClassName(index) {
|
|
2805
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
2806
|
+
}
|
|
2807
|
+
const openGridItemOrder = createMemo10(() => {
|
|
2808
|
+
let itemOrder = null;
|
|
2809
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
2810
|
+
if (getOpenGridItemPosition && document) {
|
|
2811
|
+
const openItemIndex = open()[0];
|
|
2812
|
+
const openItem = document.querySelector(
|
|
2813
|
+
`.builder-accordion-title[data-index="${openItemIndex}"]`
|
|
2814
|
+
);
|
|
2815
|
+
let subjectItem = openItem;
|
|
2816
|
+
itemOrder = openItemIndex;
|
|
2817
|
+
if (subjectItem) {
|
|
2818
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
2819
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
2820
|
+
if (subjectItem) {
|
|
2821
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
2822
|
+
continue;
|
|
2823
|
+
}
|
|
2824
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
2825
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
2826
|
+
const index = parseInt(
|
|
2827
|
+
subjectItem.getAttribute("data-index") || "",
|
|
2828
|
+
10
|
|
2829
|
+
);
|
|
2830
|
+
if (!isNaN(index)) {
|
|
2831
|
+
prevItemRect = subjectItemRect;
|
|
2832
|
+
itemOrder = index;
|
|
2833
|
+
}
|
|
2834
|
+
} else {
|
|
2835
|
+
break;
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
if (typeof itemOrder === "number") {
|
|
2842
|
+
itemOrder = itemOrder + 1;
|
|
2843
|
+
}
|
|
2844
|
+
return itemOrder;
|
|
2845
|
+
});
|
|
2846
|
+
const accordionDetailStyles = createMemo10(() => {
|
|
2847
|
+
const styles = {
|
|
2848
|
+
...{
|
|
2849
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
2850
|
+
},
|
|
2851
|
+
...props.grid && {
|
|
2852
|
+
width: "100%"
|
|
2853
|
+
}
|
|
2854
|
+
};
|
|
2855
|
+
return Object.fromEntries(
|
|
2856
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2857
|
+
);
|
|
2858
|
+
});
|
|
2859
|
+
function onClick(index) {
|
|
2860
|
+
if (open().includes(index)) {
|
|
2861
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
2862
|
+
} else {
|
|
2863
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
|
|
2867
|
+
const index = _index();
|
|
2868
|
+
return <>
|
|
2869
|
+
<div
|
|
2870
|
+
class={getAccordionTitleClassName(index)}
|
|
2871
|
+
style={{
|
|
2872
|
+
...accordionTitleStyles(),
|
|
2873
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
2874
|
+
...{
|
|
2875
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
2876
|
+
}
|
|
2877
|
+
}}
|
|
2878
|
+
data-index={index}
|
|
2879
|
+
onClick={(event) => onClick(index)}
|
|
2880
|
+
><Blocks_default
|
|
2881
|
+
blocks={item.title}
|
|
2882
|
+
path={`items.${index}.title`}
|
|
2883
|
+
parent={props.builderBlock.id}
|
|
2884
|
+
context={props.builderContext}
|
|
2885
|
+
registeredComponents={props.builderComponents}
|
|
2886
|
+
linkComponent={props.builderLinkComponent}
|
|
2887
|
+
/></div>
|
|
2888
|
+
<Show9 when={open().includes(index)}><div
|
|
2889
|
+
class={getAccordionDetailClassName(index)}
|
|
2890
|
+
style={accordionDetailStyles()}
|
|
2891
|
+
><Blocks_default
|
|
2892
|
+
blocks={item.detail}
|
|
2893
|
+
path={`items.${index}.detail`}
|
|
2894
|
+
parent={props.builderBlock.id}
|
|
2895
|
+
context={props.builderContext}
|
|
2896
|
+
registeredComponents={props.builderComponents}
|
|
2897
|
+
linkComponent={props.builderLinkComponent}
|
|
2898
|
+
/></div></Show9>
|
|
2899
|
+
</>;
|
|
2900
|
+
}}</For6></div>;
|
|
2901
|
+
}
|
|
2902
|
+
var accordion_default = Accordion;
|
|
2903
|
+
|
|
2904
|
+
// src/blocks/accordion/component-info.ts
|
|
2905
|
+
var defaultTitle = {
|
|
2906
|
+
"@type": "@builder.io/sdk:Element",
|
|
2907
|
+
layerName: "Accordion item title",
|
|
2908
|
+
responsiveStyles: {
|
|
2909
|
+
large: {
|
|
2910
|
+
marginTop: "10px",
|
|
2911
|
+
position: "relative",
|
|
2912
|
+
display: "flex",
|
|
2913
|
+
alignItems: "stretch",
|
|
2914
|
+
flexDirection: "column",
|
|
2915
|
+
paddingBottom: "10px"
|
|
2916
|
+
}
|
|
2917
|
+
},
|
|
2918
|
+
children: [{
|
|
2919
|
+
"@type": "@builder.io/sdk:Element",
|
|
2920
|
+
responsiveStyles: {
|
|
2921
|
+
large: {
|
|
2922
|
+
textAlign: "left",
|
|
2923
|
+
display: "flex",
|
|
2924
|
+
flexDirection: "column"
|
|
2925
|
+
}
|
|
2926
|
+
},
|
|
2927
|
+
component: {
|
|
2928
|
+
name: "Text",
|
|
2929
|
+
options: {
|
|
2930
|
+
text: "I am an accordion title. Click me!"
|
|
2931
|
+
}
|
|
2932
|
+
}
|
|
2933
|
+
}]
|
|
2934
|
+
};
|
|
2935
|
+
var defaultDetail = {
|
|
2936
|
+
"@type": "@builder.io/sdk:Element",
|
|
2937
|
+
layerName: "Accordion item detail",
|
|
2938
|
+
responsiveStyles: {
|
|
2939
|
+
large: {
|
|
2940
|
+
position: "relative",
|
|
2941
|
+
display: "flex",
|
|
2942
|
+
alignItems: "stretch",
|
|
2943
|
+
flexDirection: "column",
|
|
2944
|
+
marginTop: "10px",
|
|
2945
|
+
paddingBottom: "10px"
|
|
2946
|
+
}
|
|
2947
|
+
},
|
|
2948
|
+
children: [{
|
|
2949
|
+
"@type": "@builder.io/sdk:Element",
|
|
2950
|
+
responsiveStyles: {
|
|
2951
|
+
large: {
|
|
2952
|
+
paddingTop: "50px",
|
|
2953
|
+
textAlign: "left",
|
|
2954
|
+
display: "flex",
|
|
2955
|
+
flexDirection: "column",
|
|
2956
|
+
paddingBottom: "50px"
|
|
2957
|
+
}
|
|
2958
|
+
},
|
|
2959
|
+
component: {
|
|
2960
|
+
name: "Text",
|
|
2961
|
+
options: {
|
|
2962
|
+
text: "I am an accordion detail, hello!"
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
}]
|
|
2966
|
+
};
|
|
2755
2967
|
var componentInfo10 = {
|
|
2968
|
+
name: "Builder:Accordion",
|
|
2969
|
+
canHaveChildren: true,
|
|
2970
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
2971
|
+
defaultStyles: {
|
|
2972
|
+
display: "flex",
|
|
2973
|
+
flexDirection: "column",
|
|
2974
|
+
alignItems: "stretch"
|
|
2975
|
+
},
|
|
2976
|
+
inputs: [{
|
|
2977
|
+
name: "items",
|
|
2978
|
+
type: "list",
|
|
2979
|
+
broadcast: true,
|
|
2980
|
+
subFields: [{
|
|
2981
|
+
name: "title",
|
|
2982
|
+
type: "uiBlocks",
|
|
2983
|
+
hideFromUI: true,
|
|
2984
|
+
defaultValue: [defaultTitle]
|
|
2985
|
+
}, {
|
|
2986
|
+
name: "detail",
|
|
2987
|
+
type: "uiBlocks",
|
|
2988
|
+
hideFromUI: true,
|
|
2989
|
+
defaultValue: [defaultDetail]
|
|
2990
|
+
}],
|
|
2991
|
+
defaultValue: [{
|
|
2992
|
+
title: [defaultTitle],
|
|
2993
|
+
detail: [defaultDetail]
|
|
2994
|
+
}, {
|
|
2995
|
+
title: [defaultTitle],
|
|
2996
|
+
detail: [defaultDetail]
|
|
2997
|
+
}],
|
|
2998
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
2999
|
+
}, {
|
|
3000
|
+
name: "oneAtATime",
|
|
3001
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
3002
|
+
type: "boolean",
|
|
3003
|
+
defaultValue: false
|
|
3004
|
+
}, {
|
|
3005
|
+
name: "grid",
|
|
3006
|
+
helperText: "Display as a grid",
|
|
3007
|
+
type: "boolean",
|
|
3008
|
+
defaultValue: false
|
|
3009
|
+
}, {
|
|
3010
|
+
name: "gridRowWidth",
|
|
3011
|
+
helperText: "Display as a grid",
|
|
3012
|
+
type: "string",
|
|
3013
|
+
showIf: (options) => options.get("grid"),
|
|
3014
|
+
defaultValue: "25%"
|
|
3015
|
+
}, {
|
|
3016
|
+
name: "useChildrenForItems",
|
|
3017
|
+
type: "boolean",
|
|
3018
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
3019
|
+
advanced: true,
|
|
3020
|
+
defaultValue: false,
|
|
3021
|
+
onChange: (options) => {
|
|
3022
|
+
if (options.get("useChildrenForItems") === true) {
|
|
3023
|
+
options.set("items", []);
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
}]
|
|
3027
|
+
};
|
|
3028
|
+
|
|
3029
|
+
// src/blocks/custom-code/component-info.ts
|
|
3030
|
+
var componentInfo11 = {
|
|
2756
3031
|
name: "Custom Code",
|
|
2757
3032
|
static: true,
|
|
2758
3033
|
requiredPermissions: ["editCode"],
|
|
@@ -2777,10 +3052,10 @@ var componentInfo10 = {
|
|
|
2777
3052
|
};
|
|
2778
3053
|
|
|
2779
3054
|
// src/blocks/custom-code/custom-code.tsx
|
|
2780
|
-
import { onMount as onMount2, createSignal as
|
|
3055
|
+
import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
|
|
2781
3056
|
function CustomCode(props) {
|
|
2782
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2783
|
-
const [scriptsRun, setScriptsRun] =
|
|
3057
|
+
const [scriptsInserted, setScriptsInserted] = createSignal11([]);
|
|
3058
|
+
const [scriptsRun, setScriptsRun] = createSignal11([]);
|
|
2784
3059
|
let elementRef;
|
|
2785
3060
|
onMount2(() => {
|
|
2786
3061
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
@@ -2823,7 +3098,7 @@ function CustomCode(props) {
|
|
|
2823
3098
|
var custom_code_default = CustomCode;
|
|
2824
3099
|
|
|
2825
3100
|
// src/blocks/embed/component-info.ts
|
|
2826
|
-
var
|
|
3101
|
+
var componentInfo12 = {
|
|
2827
3102
|
name: "Embed",
|
|
2828
3103
|
static: true,
|
|
2829
3104
|
inputs: [{
|
|
@@ -2861,7 +3136,7 @@ var componentInfo11 = {
|
|
|
2861
3136
|
};
|
|
2862
3137
|
|
|
2863
3138
|
// src/blocks/embed/embed.tsx
|
|
2864
|
-
import { on, createEffect, createMemo as
|
|
3139
|
+
import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
2865
3140
|
|
|
2866
3141
|
// src/blocks/embed/helpers.ts
|
|
2867
3142
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -2869,9 +3144,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
2869
3144
|
|
|
2870
3145
|
// src/blocks/embed/embed.tsx
|
|
2871
3146
|
function Embed(props) {
|
|
2872
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2873
|
-
const [scriptsRun, setScriptsRun] =
|
|
2874
|
-
const [ranInitFn, setRanInitFn] =
|
|
3147
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3148
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
3149
|
+
const [ranInitFn, setRanInitFn] = createSignal12(false);
|
|
2875
3150
|
function findAndRunScripts() {
|
|
2876
3151
|
if (!elem || !elem.getElementsByTagName)
|
|
2877
3152
|
return;
|
|
@@ -2894,8 +3169,8 @@ function Embed(props) {
|
|
|
2894
3169
|
}
|
|
2895
3170
|
}
|
|
2896
3171
|
let elem;
|
|
2897
|
-
const onUpdateFn_0_elem =
|
|
2898
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
3172
|
+
const onUpdateFn_0_elem = createMemo12(() => elem);
|
|
3173
|
+
const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
|
|
2899
3174
|
function onUpdateFn_0() {
|
|
2900
3175
|
if (elem && !ranInitFn()) {
|
|
2901
3176
|
setRanInitFn(true);
|
|
@@ -2910,7 +3185,7 @@ function Embed(props) {
|
|
|
2910
3185
|
var embed_default = Embed;
|
|
2911
3186
|
|
|
2912
3187
|
// src/blocks/form/form/component-info.ts
|
|
2913
|
-
var
|
|
3188
|
+
var componentInfo13 = {
|
|
2914
3189
|
name: "Form:Form",
|
|
2915
3190
|
// editableTags: ['builder-form-error']
|
|
2916
3191
|
defaults: {
|
|
@@ -3144,7 +3419,7 @@ var componentInfo12 = {
|
|
|
3144
3419
|
};
|
|
3145
3420
|
|
|
3146
3421
|
// src/blocks/form/form/form.tsx
|
|
3147
|
-
import { Show as
|
|
3422
|
+
import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
|
|
3148
3423
|
import { css as css4 } from "solid-styled-components";
|
|
3149
3424
|
|
|
3150
3425
|
// src/functions/get-env.ts
|
|
@@ -3162,9 +3437,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
3162
3437
|
|
|
3163
3438
|
// src/blocks/form/form/form.tsx
|
|
3164
3439
|
function FormComponent(props) {
|
|
3165
|
-
const [formState, setFormState] =
|
|
3166
|
-
const [responseData, setResponseData] =
|
|
3167
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
3440
|
+
const [formState, setFormState] = createSignal13("unsubmitted");
|
|
3441
|
+
const [responseData, setResponseData] = createSignal13(null);
|
|
3442
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal13("");
|
|
3168
3443
|
function mergeNewRootState(newData) {
|
|
3169
3444
|
const combinedState = {
|
|
3170
3445
|
...props.builderContext.rootState,
|
|
@@ -3360,7 +3635,7 @@ function FormComponent(props) {
|
|
|
3360
3635
|
{...{}}
|
|
3361
3636
|
{...props.attributes}
|
|
3362
3637
|
>
|
|
3363
|
-
<
|
|
3638
|
+
<Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
|
|
3364
3639
|
const idx = _index();
|
|
3365
3640
|
return <Block_default
|
|
3366
3641
|
key={`form-block-${idx}`}
|
|
@@ -3369,35 +3644,35 @@ function FormComponent(props) {
|
|
|
3369
3644
|
registeredComponents={props.builderComponents}
|
|
3370
3645
|
linkComponent={props.builderLinkComponent}
|
|
3371
3646
|
/>;
|
|
3372
|
-
}}</
|
|
3373
|
-
<
|
|
3647
|
+
}}</For7></Show10>
|
|
3648
|
+
<Show10 when={submissionState() === "error"}><Blocks_default
|
|
3374
3649
|
path="errorMessage"
|
|
3375
3650
|
blocks={props.errorMessage}
|
|
3376
3651
|
context={props.builderContext}
|
|
3377
|
-
/></
|
|
3378
|
-
<
|
|
3652
|
+
/></Show10>
|
|
3653
|
+
<Show10 when={submissionState() === "sending"}><Blocks_default
|
|
3379
3654
|
path="sendingMessage"
|
|
3380
3655
|
blocks={props.sendingMessage}
|
|
3381
3656
|
context={props.builderContext}
|
|
3382
|
-
/></
|
|
3383
|
-
<
|
|
3657
|
+
/></Show10>
|
|
3658
|
+
<Show10 when={submissionState() === "error" && responseData()}><pre
|
|
3384
3659
|
class={"builder-form-error-text " + css4({
|
|
3385
3660
|
padding: "10px",
|
|
3386
3661
|
color: "red",
|
|
3387
3662
|
textAlign: "center"
|
|
3388
3663
|
})}
|
|
3389
|
-
>{JSON.stringify(responseData(), null, 2)}</pre></
|
|
3390
|
-
<
|
|
3664
|
+
>{JSON.stringify(responseData(), null, 2)}</pre></Show10>
|
|
3665
|
+
<Show10 when={submissionState() === "success"}><Blocks_default
|
|
3391
3666
|
path="successMessage"
|
|
3392
3667
|
blocks={props.successMessage}
|
|
3393
3668
|
context={props.builderContext}
|
|
3394
|
-
/></
|
|
3669
|
+
/></Show10>
|
|
3395
3670
|
</form>;
|
|
3396
3671
|
}
|
|
3397
3672
|
var form_default = FormComponent;
|
|
3398
3673
|
|
|
3399
3674
|
// src/blocks/form/input/component-info.ts
|
|
3400
|
-
var
|
|
3675
|
+
var componentInfo14 = {
|
|
3401
3676
|
name: "Form:Input",
|
|
3402
3677
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3403
3678
|
inputs: [
|
|
@@ -3467,7 +3742,7 @@ function FormInputComponent(props) {
|
|
|
3467
3742
|
var input_default = FormInputComponent;
|
|
3468
3743
|
|
|
3469
3744
|
// src/blocks/form/select/component-info.ts
|
|
3470
|
-
var
|
|
3745
|
+
var componentInfo15 = {
|
|
3471
3746
|
name: "Form:Select",
|
|
3472
3747
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3473
3748
|
defaultStyles: {
|
|
@@ -3512,7 +3787,7 @@ var componentInfo14 = {
|
|
|
3512
3787
|
};
|
|
3513
3788
|
|
|
3514
3789
|
// src/blocks/form/select/select.tsx
|
|
3515
|
-
import { For as
|
|
3790
|
+
import { For as For8 } from "solid-js";
|
|
3516
3791
|
function SelectComponent(props) {
|
|
3517
3792
|
return <select
|
|
3518
3793
|
{...{}}
|
|
@@ -3521,15 +3796,15 @@ function SelectComponent(props) {
|
|
|
3521
3796
|
key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
|
|
3522
3797
|
defaultValue={props.defaultValue}
|
|
3523
3798
|
name={props.name}
|
|
3524
|
-
><
|
|
3799
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
3525
3800
|
const index = _index();
|
|
3526
3801
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
3527
|
-
}}</
|
|
3802
|
+
}}</For8></select>;
|
|
3528
3803
|
}
|
|
3529
3804
|
var select_default = SelectComponent;
|
|
3530
3805
|
|
|
3531
3806
|
// src/blocks/form/submit-button/component-info.ts
|
|
3532
|
-
var
|
|
3807
|
+
var componentInfo16 = {
|
|
3533
3808
|
name: "Form:SubmitButton",
|
|
3534
3809
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3535
3810
|
defaultStyles: {
|
|
@@ -3563,7 +3838,7 @@ function SubmitButton(props) {
|
|
|
3563
3838
|
var submit_button_default = SubmitButton;
|
|
3564
3839
|
|
|
3565
3840
|
// src/blocks/img/component-info.ts
|
|
3566
|
-
var
|
|
3841
|
+
var componentInfo17 = {
|
|
3567
3842
|
// friendlyName?
|
|
3568
3843
|
name: "Raw:Img",
|
|
3569
3844
|
hideFromInsertMenu: true,
|
|
@@ -3596,7 +3871,7 @@ function ImgComponent(props) {
|
|
|
3596
3871
|
var img_default = ImgComponent;
|
|
3597
3872
|
|
|
3598
3873
|
// src/blocks/video/component-info.ts
|
|
3599
|
-
var
|
|
3874
|
+
var componentInfo18 = {
|
|
3600
3875
|
name: "Video",
|
|
3601
3876
|
canHaveChildren: true,
|
|
3602
3877
|
defaultStyles: {
|
|
@@ -3680,9 +3955,9 @@ var componentInfo17 = {
|
|
|
3680
3955
|
};
|
|
3681
3956
|
|
|
3682
3957
|
// src/blocks/video/video.tsx
|
|
3683
|
-
import { Show as
|
|
3958
|
+
import { Show as Show11, createMemo as createMemo14 } from "solid-js";
|
|
3684
3959
|
function Video(props) {
|
|
3685
|
-
const videoProps =
|
|
3960
|
+
const videoProps = createMemo14(() => {
|
|
3686
3961
|
return {
|
|
3687
3962
|
...props.autoPlay === true ? {
|
|
3688
3963
|
autoPlay: true
|
|
@@ -3701,7 +3976,7 @@ function Video(props) {
|
|
|
3701
3976
|
} : {}
|
|
3702
3977
|
};
|
|
3703
3978
|
});
|
|
3704
|
-
const spreadProps =
|
|
3979
|
+
const spreadProps = createMemo14(() => {
|
|
3705
3980
|
return {
|
|
3706
3981
|
...videoProps()
|
|
3707
3982
|
};
|
|
@@ -3731,8 +4006,8 @@ function Video(props) {
|
|
|
3731
4006
|
}}
|
|
3732
4007
|
src={props.video || "no-src"}
|
|
3733
4008
|
poster={props.posterImage}
|
|
3734
|
-
><
|
|
3735
|
-
<
|
|
4009
|
+
><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
|
|
4010
|
+
<Show11
|
|
3736
4011
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
3737
4012
|
><div
|
|
3738
4013
|
style={{
|
|
@@ -3741,15 +4016,15 @@ function Video(props) {
|
|
|
3741
4016
|
"pointer-events": "none",
|
|
3742
4017
|
"font-size": "0px"
|
|
3743
4018
|
}}
|
|
3744
|
-
/></
|
|
3745
|
-
<
|
|
4019
|
+
/></Show11>
|
|
4020
|
+
<Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
3746
4021
|
style={{
|
|
3747
4022
|
display: "flex",
|
|
3748
4023
|
"flex-direction": "column",
|
|
3749
4024
|
"align-items": "stretch"
|
|
3750
4025
|
}}
|
|
3751
|
-
>{props.children}</div></
|
|
3752
|
-
<
|
|
4026
|
+
>{props.children}</div></Show11>
|
|
4027
|
+
<Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
3753
4028
|
style={{
|
|
3754
4029
|
"pointer-events": "none",
|
|
3755
4030
|
display: "flex",
|
|
@@ -3761,7 +4036,7 @@ function Video(props) {
|
|
|
3761
4036
|
width: "100%",
|
|
3762
4037
|
height: "100%"
|
|
3763
4038
|
}}
|
|
3764
|
-
>{props.children}</div></
|
|
4039
|
+
>{props.children}</div></Show11>
|
|
3765
4040
|
</div>;
|
|
3766
4041
|
}
|
|
3767
4042
|
var video_default = Video;
|
|
@@ -3769,28 +4044,28 @@ var video_default = Video;
|
|
|
3769
4044
|
// src/constants/extra-components.ts
|
|
3770
4045
|
var getExtraComponents = () => [{
|
|
3771
4046
|
component: custom_code_default,
|
|
3772
|
-
...
|
|
4047
|
+
...componentInfo11
|
|
3773
4048
|
}, {
|
|
3774
4049
|
component: embed_default,
|
|
3775
|
-
...
|
|
4050
|
+
...componentInfo12
|
|
3776
4051
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3777
4052
|
component: form_default,
|
|
3778
|
-
...
|
|
4053
|
+
...componentInfo13
|
|
3779
4054
|
}, {
|
|
3780
4055
|
component: input_default,
|
|
3781
|
-
...
|
|
4056
|
+
...componentInfo14
|
|
3782
4057
|
}, {
|
|
3783
4058
|
component: submit_button_default,
|
|
3784
|
-
...
|
|
4059
|
+
...componentInfo16
|
|
3785
4060
|
}, {
|
|
3786
4061
|
component: select_default,
|
|
3787
|
-
...
|
|
4062
|
+
...componentInfo15
|
|
3788
4063
|
}], {
|
|
3789
4064
|
component: img_default,
|
|
3790
|
-
...
|
|
4065
|
+
...componentInfo17
|
|
3791
4066
|
}, {
|
|
3792
4067
|
component: video_default,
|
|
3793
|
-
...
|
|
4068
|
+
...componentInfo18
|
|
3794
4069
|
}];
|
|
3795
4070
|
|
|
3796
4071
|
// src/constants/builder-registered-components.ts
|
|
@@ -3821,6 +4096,9 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3821
4096
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3822
4097
|
component: tabs_default,
|
|
3823
4098
|
...componentInfo8
|
|
4099
|
+
}, {
|
|
4100
|
+
component: accordion_default,
|
|
4101
|
+
...componentInfo10
|
|
3824
4102
|
}], ...getExtraComponents()];
|
|
3825
4103
|
|
|
3826
4104
|
// src/functions/register-component.ts
|
|
@@ -3899,12 +4177,12 @@ var Inlined_script_default = InlinedScript;
|
|
|
3899
4177
|
|
|
3900
4178
|
// src/components/content/components/enable-editor.tsx
|
|
3901
4179
|
import {
|
|
3902
|
-
Show as
|
|
4180
|
+
Show as Show12,
|
|
3903
4181
|
onMount as onMount3,
|
|
3904
4182
|
on as on2,
|
|
3905
4183
|
createEffect as createEffect2,
|
|
3906
|
-
createMemo as
|
|
3907
|
-
createSignal as
|
|
4184
|
+
createMemo as createMemo15,
|
|
4185
|
+
createSignal as createSignal15
|
|
3908
4186
|
} from "solid-js";
|
|
3909
4187
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
3910
4188
|
|
|
@@ -4399,7 +4677,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4399
4677
|
}
|
|
4400
4678
|
|
|
4401
4679
|
// src/constants/sdk-version.ts
|
|
4402
|
-
var SDK_VERSION = "1.0.
|
|
4680
|
+
var SDK_VERSION = "1.0.28";
|
|
4403
4681
|
|
|
4404
4682
|
// src/functions/register.ts
|
|
4405
4683
|
var registry = {};
|
|
@@ -4676,12 +4954,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
4676
4954
|
|
|
4677
4955
|
// src/components/content/components/enable-editor.tsx
|
|
4678
4956
|
function EnableEditor(props) {
|
|
4679
|
-
const [ContentWrapper, setContentWrapper] =
|
|
4957
|
+
const [ContentWrapper, setContentWrapper] = createSignal15(
|
|
4680
4958
|
props.contentWrapper || "div"
|
|
4681
4959
|
);
|
|
4682
|
-
const [httpReqsData, setHttpReqsData] =
|
|
4683
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
4684
|
-
const [clicked, setClicked] =
|
|
4960
|
+
const [httpReqsData, setHttpReqsData] = createSignal15({});
|
|
4961
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal15({});
|
|
4962
|
+
const [clicked, setClicked] = createSignal15(false);
|
|
4685
4963
|
function mergeNewRootState(newData) {
|
|
4686
4964
|
const combinedState = {
|
|
4687
4965
|
...props.builderContextSignal.rootState,
|
|
@@ -4715,7 +4993,7 @@ function EnableEditor(props) {
|
|
|
4715
4993
|
content: newContentValue
|
|
4716
4994
|
}));
|
|
4717
4995
|
}
|
|
4718
|
-
const showContentProps =
|
|
4996
|
+
const showContentProps = createMemo15(() => {
|
|
4719
4997
|
return props.showContent ? {} : {
|
|
4720
4998
|
hidden: true,
|
|
4721
4999
|
"aria-hidden": true
|
|
@@ -4898,21 +5176,21 @@ function EnableEditor(props) {
|
|
|
4898
5176
|
onMount3(() => {
|
|
4899
5177
|
if (!props.apiKey) {
|
|
4900
5178
|
logger.error(
|
|
4901
|
-
"No API key provided to `
|
|
5179
|
+
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
4902
5180
|
);
|
|
4903
5181
|
}
|
|
4904
5182
|
evaluateJsCode();
|
|
4905
5183
|
runHttpRequests();
|
|
4906
5184
|
emitStateUpdate();
|
|
4907
5185
|
});
|
|
4908
|
-
const onUpdateFn_0_props_content =
|
|
5186
|
+
const onUpdateFn_0_props_content = createMemo15(() => props.content);
|
|
4909
5187
|
function onUpdateFn_0() {
|
|
4910
5188
|
if (props.content) {
|
|
4911
5189
|
mergeNewContent(props.content);
|
|
4912
5190
|
}
|
|
4913
5191
|
}
|
|
4914
5192
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4915
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
5193
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4916
5194
|
function onUpdateFn_1() {
|
|
4917
5195
|
evaluateJsCode();
|
|
4918
5196
|
}
|
|
@@ -4922,7 +5200,7 @@ function EnableEditor(props) {
|
|
|
4922
5200
|
onUpdateFn_1
|
|
4923
5201
|
)
|
|
4924
5202
|
);
|
|
4925
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
5203
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4926
5204
|
function onUpdateFn_2() {
|
|
4927
5205
|
runHttpRequests();
|
|
4928
5206
|
}
|
|
@@ -4934,7 +5212,7 @@ function EnableEditor(props) {
|
|
|
4934
5212
|
onUpdateFn_2
|
|
4935
5213
|
)
|
|
4936
5214
|
);
|
|
4937
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
5215
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
|
|
4938
5216
|
() => props.builderContextSignal.rootState
|
|
4939
5217
|
);
|
|
4940
5218
|
function onUpdateFn_3() {
|
|
@@ -4946,14 +5224,14 @@ function EnableEditor(props) {
|
|
|
4946
5224
|
onUpdateFn_3
|
|
4947
5225
|
)
|
|
4948
5226
|
);
|
|
4949
|
-
const onUpdateFn_4_props_data =
|
|
5227
|
+
const onUpdateFn_4_props_data = createMemo15(() => props.data);
|
|
4950
5228
|
function onUpdateFn_4() {
|
|
4951
5229
|
if (props.data) {
|
|
4952
5230
|
mergeNewRootState(props.data);
|
|
4953
5231
|
}
|
|
4954
5232
|
}
|
|
4955
5233
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4956
|
-
const onUpdateFn_5_props_locale =
|
|
5234
|
+
const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
|
|
4957
5235
|
function onUpdateFn_5() {
|
|
4958
5236
|
if (props.locale) {
|
|
4959
5237
|
mergeNewRootState({
|
|
@@ -4962,7 +5240,7 @@ function EnableEditor(props) {
|
|
|
4962
5240
|
}
|
|
4963
5241
|
}
|
|
4964
5242
|
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4965
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
5243
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
|
|
4966
5244
|
class={getWrapperClassName(
|
|
4967
5245
|
props.content?.testVariationId || props.content?.id
|
|
4968
5246
|
)}
|
|
@@ -4975,14 +5253,14 @@ function EnableEditor(props) {
|
|
|
4975
5253
|
{...showContentProps()}
|
|
4976
5254
|
{...props.contentWrapperProps}
|
|
4977
5255
|
component={ContentWrapper()}
|
|
4978
|
-
>{props.children}</Dynamic5></
|
|
5256
|
+
>{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
|
|
4979
5257
|
}
|
|
4980
5258
|
var Enable_editor_default = EnableEditor;
|
|
4981
5259
|
|
|
4982
5260
|
// src/components/content/components/styles.tsx
|
|
4983
|
-
import { createSignal as
|
|
5261
|
+
import { createSignal as createSignal16 } from "solid-js";
|
|
4984
5262
|
function ContentStyles(props) {
|
|
4985
|
-
const [injectedStyles, setInjectedStyles] =
|
|
5263
|
+
const [injectedStyles, setInjectedStyles] = createSignal16(
|
|
4986
5264
|
`
|
|
4987
5265
|
${getCss({
|
|
4988
5266
|
cssCode: props.cssCode,
|
|
@@ -5039,7 +5317,7 @@ var getContentInitialValue = ({
|
|
|
5039
5317
|
|
|
5040
5318
|
// src/components/content/content.tsx
|
|
5041
5319
|
function ContentComponent(props) {
|
|
5042
|
-
const [scriptStr, setScriptStr] =
|
|
5320
|
+
const [scriptStr, setScriptStr] = createSignal17(
|
|
5043
5321
|
getUpdateVariantVisibilityScript({
|
|
5044
5322
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5045
5323
|
variationId: props.content?.testVariationId,
|
|
@@ -5047,7 +5325,7 @@ function ContentComponent(props) {
|
|
|
5047
5325
|
contentId: props.content?.id
|
|
5048
5326
|
})
|
|
5049
5327
|
);
|
|
5050
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
5328
|
+
const [registeredComponents, setRegisteredComponents] = createSignal17(
|
|
5051
5329
|
[
|
|
5052
5330
|
...getDefaultRegisteredComponents(),
|
|
5053
5331
|
...props.customComponents || []
|
|
@@ -5062,7 +5340,7 @@ function ContentComponent(props) {
|
|
|
5062
5340
|
{}
|
|
5063
5341
|
)
|
|
5064
5342
|
);
|
|
5065
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
5343
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal17({
|
|
5066
5344
|
content: getContentInitialValue({
|
|
5067
5345
|
content: props.content,
|
|
5068
5346
|
data: props.data
|
|
@@ -5120,16 +5398,16 @@ function ContentComponent(props) {
|
|
|
5120
5398
|
setBuilderContextSignal
|
|
5121
5399
|
}}
|
|
5122
5400
|
>
|
|
5123
|
-
<
|
|
5401
|
+
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
5124
5402
|
id="builderio-variant-visibility"
|
|
5125
5403
|
scriptStr={scriptStr()}
|
|
5126
|
-
/></
|
|
5127
|
-
<
|
|
5404
|
+
/></Show13>
|
|
5405
|
+
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
5128
5406
|
isNestedRender={props.isNestedRender}
|
|
5129
5407
|
contentId={builderContextSignal().content?.id}
|
|
5130
5408
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
5131
5409
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
5132
|
-
/></
|
|
5410
|
+
/></Show13>
|
|
5133
5411
|
<Blocks_default
|
|
5134
5412
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
5135
5413
|
context={builderContextSignal()}
|
|
@@ -5142,13 +5420,13 @@ var Content_default = ContentComponent;
|
|
|
5142
5420
|
|
|
5143
5421
|
// src/components/content-variants/content-variants.tsx
|
|
5144
5422
|
function ContentVariants(props) {
|
|
5145
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
5423
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
|
|
5146
5424
|
checkShouldRenderVariants({
|
|
5147
5425
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
5148
5426
|
content: props.content
|
|
5149
5427
|
})
|
|
5150
5428
|
);
|
|
5151
|
-
const updateCookieAndStylesScriptStr =
|
|
5429
|
+
const updateCookieAndStylesScriptStr = createMemo18(() => {
|
|
5152
5430
|
return getUpdateCookieAndStylesScript(
|
|
5153
5431
|
getVariants(props.content).map((value) => ({
|
|
5154
5432
|
id: value.testVariationId,
|
|
@@ -5157,10 +5435,10 @@ function ContentVariants(props) {
|
|
|
5157
5435
|
props.content?.id || ""
|
|
5158
5436
|
);
|
|
5159
5437
|
});
|
|
5160
|
-
const hideVariantsStyleString =
|
|
5438
|
+
const hideVariantsStyleString = createMemo18(() => {
|
|
5161
5439
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
5162
5440
|
});
|
|
5163
|
-
const defaultContent =
|
|
5441
|
+
const defaultContent = createMemo18(() => {
|
|
5164
5442
|
return shouldRenderVariants() ? {
|
|
5165
5443
|
...props.content,
|
|
5166
5444
|
testVariationId: props.content?.id
|
|
@@ -5173,11 +5451,11 @@ function ContentVariants(props) {
|
|
|
5173
5451
|
setShouldRenderVariants(false);
|
|
5174
5452
|
});
|
|
5175
5453
|
return <>
|
|
5176
|
-
<
|
|
5454
|
+
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5177
5455
|
id="builderio-init-variants-fns"
|
|
5178
5456
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5179
|
-
/></
|
|
5180
|
-
<
|
|
5457
|
+
/></Show14>
|
|
5458
|
+
<Show14 when={shouldRenderVariants()}>
|
|
5181
5459
|
<Inlined_styles_default
|
|
5182
5460
|
id="builderio-variants"
|
|
5183
5461
|
styles={hideVariantsStyleString()}
|
|
@@ -5186,7 +5464,7 @@ function ContentVariants(props) {
|
|
|
5186
5464
|
id="builderio-variants-visibility"
|
|
5187
5465
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5188
5466
|
/>
|
|
5189
|
-
<
|
|
5467
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5190
5468
|
const index = _index();
|
|
5191
5469
|
return <Content_default
|
|
5192
5470
|
isNestedRender={props.isNestedRender}
|
|
@@ -5210,8 +5488,8 @@ function ContentVariants(props) {
|
|
|
5210
5488
|
contentWrapperProps={props.contentWrapperProps}
|
|
5211
5489
|
trustedHosts={props.trustedHosts}
|
|
5212
5490
|
/>;
|
|
5213
|
-
}}</
|
|
5214
|
-
</
|
|
5491
|
+
}}</For9>
|
|
5492
|
+
</Show14>
|
|
5215
5493
|
<Content_default
|
|
5216
5494
|
isNestedRender={props.isNestedRender}
|
|
5217
5495
|
{...{}}
|
|
@@ -5264,14 +5542,14 @@ var fetchSymbolContent = async ({
|
|
|
5264
5542
|
|
|
5265
5543
|
// src/blocks/symbol/symbol.tsx
|
|
5266
5544
|
function Symbol(props) {
|
|
5267
|
-
const [contentToUse, setContentToUse] =
|
|
5268
|
-
const blocksWrapper =
|
|
5545
|
+
const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
|
|
5546
|
+
const blocksWrapper = createMemo19(() => {
|
|
5269
5547
|
return "div";
|
|
5270
5548
|
});
|
|
5271
|
-
const contentWrapper =
|
|
5549
|
+
const contentWrapper = createMemo19(() => {
|
|
5272
5550
|
return "div";
|
|
5273
5551
|
});
|
|
5274
|
-
const className =
|
|
5552
|
+
const className = createMemo19(() => {
|
|
5275
5553
|
return [
|
|
5276
5554
|
...[props.attributes[getClassPropName()]],
|
|
5277
5555
|
"builder-symbol",
|
|
@@ -5293,7 +5571,7 @@ function Symbol(props) {
|
|
|
5293
5571
|
}
|
|
5294
5572
|
onMount5(() => {
|
|
5295
5573
|
});
|
|
5296
|
-
const onUpdateFn_0_props_symbol =
|
|
5574
|
+
const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
|
|
5297
5575
|
function onUpdateFn_0() {
|
|
5298
5576
|
setContent();
|
|
5299
5577
|
}
|