@builder.io/sdk-solid 1.0.26 → 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 +392 -66
- package/lib/browser/dev.jsx +406 -116
- package/lib/browser/index.js +392 -66
- package/lib/browser/index.jsx +406 -116
- package/lib/edge/dev.js +392 -66
- package/lib/edge/dev.jsx +406 -116
- package/lib/edge/index.js +392 -66
- package/lib/edge/index.jsx +406 -116
- package/lib/node/dev.js +392 -66
- package/lib/node/dev.jsx +406 -116
- package/lib/node/index.js +392 -66
- package/lib/node/index.jsx +406 -116
- package/package.json +1 -1
package/lib/browser/dev.jsx
CHANGED
|
@@ -470,6 +470,9 @@ function getProcessedBlock({
|
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
+
// src/functions/camel-to-kebab-case.ts
|
|
474
|
+
var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
475
|
+
|
|
473
476
|
// src/components/block/animator.ts
|
|
474
477
|
function throttle(func, wait, options = {}) {
|
|
475
478
|
let context;
|
|
@@ -520,7 +523,6 @@ function assign(target, ..._args) {
|
|
|
520
523
|
}
|
|
521
524
|
return to;
|
|
522
525
|
}
|
|
523
|
-
var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
524
526
|
function bindAnimations(animations) {
|
|
525
527
|
for (const animation of animations) {
|
|
526
528
|
switch (animation.trigger) {
|
|
@@ -573,7 +575,7 @@ function triggerAnimation(animation) {
|
|
|
573
575
|
element.style.transitionDelay = "0";
|
|
574
576
|
assign(element.style, animation.steps[0].styles);
|
|
575
577
|
setTimeout(() => {
|
|
576
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
578
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
577
579
|
if (animation.delay) {
|
|
578
580
|
element.style.transitionDelay = animation.delay + "s";
|
|
579
581
|
}
|
|
@@ -633,7 +635,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
633
635
|
}
|
|
634
636
|
attachDefaultState();
|
|
635
637
|
setTimeout(() => {
|
|
636
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
638
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
637
639
|
if (animation.delay) {
|
|
638
640
|
element.style.transitionDelay = animation.delay + "s";
|
|
639
641
|
}
|
|
@@ -646,9 +648,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
646
648
|
});
|
|
647
649
|
}
|
|
648
650
|
|
|
649
|
-
// src/functions/camel-to-kebab-case.ts
|
|
650
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
651
|
-
|
|
652
651
|
// src/helpers/css.ts
|
|
653
652
|
var convertStyleMapToCSSArray = (style) => {
|
|
654
653
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -778,10 +777,10 @@ var getRepeatItemData = ({
|
|
|
778
777
|
return repeatArray;
|
|
779
778
|
};
|
|
780
779
|
var shouldPassLinkComponent = (block) => {
|
|
781
|
-
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
780
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
782
781
|
};
|
|
783
782
|
var shouldPassRegisteredComponents = (block) => {
|
|
784
|
-
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
783
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
785
784
|
};
|
|
786
785
|
|
|
787
786
|
// src/components/block/components/block-styles.tsx
|
|
@@ -910,7 +909,7 @@ function BlockStyles(props) {
|
|
|
910
909
|
className: `${className}:hover`,
|
|
911
910
|
styles: {
|
|
912
911
|
...hoverStyles,
|
|
913
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
912
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
|
|
914
913
|
hoverAnimation.easing
|
|
915
914
|
)}`,
|
|
916
915
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
@@ -1675,10 +1674,10 @@ function SectionComponent(props) {
|
|
|
1675
1674
|
var section_default = SectionComponent;
|
|
1676
1675
|
|
|
1677
1676
|
// src/blocks/symbol/symbol.tsx
|
|
1678
|
-
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as
|
|
1677
|
+
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
|
|
1679
1678
|
|
|
1680
1679
|
// src/components/content-variants/content-variants.tsx
|
|
1681
|
-
import { Show as
|
|
1680
|
+
import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
|
|
1682
1681
|
|
|
1683
1682
|
// src/helpers/url.ts
|
|
1684
1683
|
var getTopLevelDomain = (host) => {
|
|
@@ -1872,7 +1871,7 @@ var handleABTesting = async ({
|
|
|
1872
1871
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1873
1872
|
|
|
1874
1873
|
// src/components/content/content.tsx
|
|
1875
|
-
import { Show as
|
|
1874
|
+
import { Show as Show13, createSignal as createSignal17 } from "solid-js";
|
|
1876
1875
|
|
|
1877
1876
|
// src/blocks/button/component-info.ts
|
|
1878
1877
|
var componentInfo = {
|
|
@@ -2523,8 +2522,12 @@ function Tabs(props) {
|
|
|
2523
2522
|
function activeTabContent(active) {
|
|
2524
2523
|
return props.tabs && props.tabs[active].content;
|
|
2525
2524
|
}
|
|
2526
|
-
function
|
|
2527
|
-
|
|
2525
|
+
function onClick(index) {
|
|
2526
|
+
if (index === activeTab() && props.collapsible) {
|
|
2527
|
+
setActiveTab(-1);
|
|
2528
|
+
} else {
|
|
2529
|
+
setActiveTab(index);
|
|
2530
|
+
}
|
|
2528
2531
|
}
|
|
2529
2532
|
return <div>
|
|
2530
2533
|
<div
|
|
@@ -2540,14 +2543,10 @@ function Tabs(props) {
|
|
|
2540
2543
|
return <span
|
|
2541
2544
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
2542
2545
|
key={index}
|
|
2543
|
-
style={
|
|
2544
|
-
|
|
2545
|
-
if (index === activeTab() && props.collapsible) {
|
|
2546
|
-
setActiveTab(-1);
|
|
2547
|
-
} else {
|
|
2548
|
-
setActiveTab(index);
|
|
2549
|
-
}
|
|
2546
|
+
style={{
|
|
2547
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
2550
2548
|
}}
|
|
2549
|
+
onClick={(event) => onClick(index)}
|
|
2551
2550
|
><Blocks_default
|
|
2552
2551
|
parent={props.builderBlock.id}
|
|
2553
2552
|
path={`component.options.tabs.${index}.label`}
|
|
@@ -2602,8 +2601,284 @@ function Text(props) {
|
|
|
2602
2601
|
}
|
|
2603
2602
|
var text_default = Text;
|
|
2604
2603
|
|
|
2605
|
-
// src/blocks/
|
|
2604
|
+
// src/blocks/accordion/accordion.tsx
|
|
2605
|
+
import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
|
|
2606
|
+
|
|
2607
|
+
// src/blocks/accordion/helpers.ts
|
|
2608
|
+
var convertOrderNumberToString = (order) => {
|
|
2609
|
+
return order.toString();
|
|
2610
|
+
};
|
|
2611
|
+
|
|
2612
|
+
// src/blocks/accordion/accordion.tsx
|
|
2613
|
+
function Accordion(props) {
|
|
2614
|
+
const [open, setOpen] = createSignal10([]);
|
|
2615
|
+
const onlyOneAtATime = createMemo10(() => {
|
|
2616
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
2617
|
+
});
|
|
2618
|
+
const accordionStyles = createMemo10(() => {
|
|
2619
|
+
const styles = {
|
|
2620
|
+
display: "flex",
|
|
2621
|
+
alignItems: "stretch",
|
|
2622
|
+
flexDirection: "column",
|
|
2623
|
+
...props.grid && {
|
|
2624
|
+
flexDirection: "row",
|
|
2625
|
+
alignItems: "flex-start",
|
|
2626
|
+
flexWrap: "wrap"
|
|
2627
|
+
}
|
|
2628
|
+
};
|
|
2629
|
+
return Object.fromEntries(
|
|
2630
|
+
Object.entries(styles).map(([key, value]) => [
|
|
2631
|
+
camelToKebabCase(key),
|
|
2632
|
+
value
|
|
2633
|
+
])
|
|
2634
|
+
);
|
|
2635
|
+
});
|
|
2636
|
+
const accordionTitleStyles = createMemo10(() => {
|
|
2637
|
+
const shared = {
|
|
2638
|
+
display: "flex",
|
|
2639
|
+
flexDirection: "column"
|
|
2640
|
+
};
|
|
2641
|
+
const styles = Object.fromEntries(
|
|
2642
|
+
Object.entries({
|
|
2643
|
+
...shared,
|
|
2644
|
+
alignItems: "stretch",
|
|
2645
|
+
cursor: "pointer"
|
|
2646
|
+
}).map(([key, value]) => [camelToKebabCase(key), value])
|
|
2647
|
+
);
|
|
2648
|
+
return Object.fromEntries(
|
|
2649
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2650
|
+
);
|
|
2651
|
+
});
|
|
2652
|
+
function getAccordionTitleClassName(index) {
|
|
2653
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
2654
|
+
}
|
|
2655
|
+
function getAccordionDetailClassName(index) {
|
|
2656
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
2657
|
+
}
|
|
2658
|
+
const openGridItemOrder = createMemo10(() => {
|
|
2659
|
+
let itemOrder = null;
|
|
2660
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
2661
|
+
if (getOpenGridItemPosition && document) {
|
|
2662
|
+
const openItemIndex = open()[0];
|
|
2663
|
+
const openItem = document.querySelector(
|
|
2664
|
+
`.builder-accordion-title[data-index="${openItemIndex}"]`
|
|
2665
|
+
);
|
|
2666
|
+
let subjectItem = openItem;
|
|
2667
|
+
itemOrder = openItemIndex;
|
|
2668
|
+
if (subjectItem) {
|
|
2669
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
2670
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
2671
|
+
if (subjectItem) {
|
|
2672
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
2673
|
+
continue;
|
|
2674
|
+
}
|
|
2675
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
2676
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
2677
|
+
const index = parseInt(
|
|
2678
|
+
subjectItem.getAttribute("data-index") || "",
|
|
2679
|
+
10
|
|
2680
|
+
);
|
|
2681
|
+
if (!isNaN(index)) {
|
|
2682
|
+
prevItemRect = subjectItemRect;
|
|
2683
|
+
itemOrder = index;
|
|
2684
|
+
}
|
|
2685
|
+
} else {
|
|
2686
|
+
break;
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
if (typeof itemOrder === "number") {
|
|
2693
|
+
itemOrder = itemOrder + 1;
|
|
2694
|
+
}
|
|
2695
|
+
return itemOrder;
|
|
2696
|
+
});
|
|
2697
|
+
const accordionDetailStyles = createMemo10(() => {
|
|
2698
|
+
const styles = {
|
|
2699
|
+
...{
|
|
2700
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
2701
|
+
},
|
|
2702
|
+
...props.grid && {
|
|
2703
|
+
width: "100%"
|
|
2704
|
+
}
|
|
2705
|
+
};
|
|
2706
|
+
return Object.fromEntries(
|
|
2707
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2708
|
+
);
|
|
2709
|
+
});
|
|
2710
|
+
function onClick(index) {
|
|
2711
|
+
if (open().includes(index)) {
|
|
2712
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
2713
|
+
} else {
|
|
2714
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
|
|
2718
|
+
const index = _index();
|
|
2719
|
+
return <>
|
|
2720
|
+
<div
|
|
2721
|
+
class={getAccordionTitleClassName(index)}
|
|
2722
|
+
style={{
|
|
2723
|
+
...accordionTitleStyles(),
|
|
2724
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
2725
|
+
...{
|
|
2726
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
2727
|
+
}
|
|
2728
|
+
}}
|
|
2729
|
+
data-index={index}
|
|
2730
|
+
onClick={(event) => onClick(index)}
|
|
2731
|
+
><Blocks_default
|
|
2732
|
+
blocks={item.title}
|
|
2733
|
+
path={`items.${index}.title`}
|
|
2734
|
+
parent={props.builderBlock.id}
|
|
2735
|
+
context={props.builderContext}
|
|
2736
|
+
registeredComponents={props.builderComponents}
|
|
2737
|
+
linkComponent={props.builderLinkComponent}
|
|
2738
|
+
/></div>
|
|
2739
|
+
<Show9 when={open().includes(index)}><div
|
|
2740
|
+
class={getAccordionDetailClassName(index)}
|
|
2741
|
+
style={accordionDetailStyles()}
|
|
2742
|
+
><Blocks_default
|
|
2743
|
+
blocks={item.detail}
|
|
2744
|
+
path={`items.${index}.detail`}
|
|
2745
|
+
parent={props.builderBlock.id}
|
|
2746
|
+
context={props.builderContext}
|
|
2747
|
+
registeredComponents={props.builderComponents}
|
|
2748
|
+
linkComponent={props.builderLinkComponent}
|
|
2749
|
+
/></div></Show9>
|
|
2750
|
+
</>;
|
|
2751
|
+
}}</For6></div>;
|
|
2752
|
+
}
|
|
2753
|
+
var accordion_default = Accordion;
|
|
2754
|
+
|
|
2755
|
+
// src/blocks/accordion/component-info.ts
|
|
2756
|
+
var defaultTitle = {
|
|
2757
|
+
"@type": "@builder.io/sdk:Element",
|
|
2758
|
+
layerName: "Accordion item title",
|
|
2759
|
+
responsiveStyles: {
|
|
2760
|
+
large: {
|
|
2761
|
+
marginTop: "10px",
|
|
2762
|
+
position: "relative",
|
|
2763
|
+
display: "flex",
|
|
2764
|
+
alignItems: "stretch",
|
|
2765
|
+
flexDirection: "column",
|
|
2766
|
+
paddingBottom: "10px"
|
|
2767
|
+
}
|
|
2768
|
+
},
|
|
2769
|
+
children: [{
|
|
2770
|
+
"@type": "@builder.io/sdk:Element",
|
|
2771
|
+
responsiveStyles: {
|
|
2772
|
+
large: {
|
|
2773
|
+
textAlign: "left",
|
|
2774
|
+
display: "flex",
|
|
2775
|
+
flexDirection: "column"
|
|
2776
|
+
}
|
|
2777
|
+
},
|
|
2778
|
+
component: {
|
|
2779
|
+
name: "Text",
|
|
2780
|
+
options: {
|
|
2781
|
+
text: "I am an accordion title. Click me!"
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
}]
|
|
2785
|
+
};
|
|
2786
|
+
var defaultDetail = {
|
|
2787
|
+
"@type": "@builder.io/sdk:Element",
|
|
2788
|
+
layerName: "Accordion item detail",
|
|
2789
|
+
responsiveStyles: {
|
|
2790
|
+
large: {
|
|
2791
|
+
position: "relative",
|
|
2792
|
+
display: "flex",
|
|
2793
|
+
alignItems: "stretch",
|
|
2794
|
+
flexDirection: "column",
|
|
2795
|
+
marginTop: "10px",
|
|
2796
|
+
paddingBottom: "10px"
|
|
2797
|
+
}
|
|
2798
|
+
},
|
|
2799
|
+
children: [{
|
|
2800
|
+
"@type": "@builder.io/sdk:Element",
|
|
2801
|
+
responsiveStyles: {
|
|
2802
|
+
large: {
|
|
2803
|
+
paddingTop: "50px",
|
|
2804
|
+
textAlign: "left",
|
|
2805
|
+
display: "flex",
|
|
2806
|
+
flexDirection: "column",
|
|
2807
|
+
paddingBottom: "50px"
|
|
2808
|
+
}
|
|
2809
|
+
},
|
|
2810
|
+
component: {
|
|
2811
|
+
name: "Text",
|
|
2812
|
+
options: {
|
|
2813
|
+
text: "I am an accordion detail, hello!"
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
}]
|
|
2817
|
+
};
|
|
2606
2818
|
var componentInfo10 = {
|
|
2819
|
+
name: "Builder:Accordion",
|
|
2820
|
+
canHaveChildren: true,
|
|
2821
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
2822
|
+
defaultStyles: {
|
|
2823
|
+
display: "flex",
|
|
2824
|
+
flexDirection: "column",
|
|
2825
|
+
alignItems: "stretch"
|
|
2826
|
+
},
|
|
2827
|
+
inputs: [{
|
|
2828
|
+
name: "items",
|
|
2829
|
+
type: "list",
|
|
2830
|
+
broadcast: true,
|
|
2831
|
+
subFields: [{
|
|
2832
|
+
name: "title",
|
|
2833
|
+
type: "uiBlocks",
|
|
2834
|
+
hideFromUI: true,
|
|
2835
|
+
defaultValue: [defaultTitle]
|
|
2836
|
+
}, {
|
|
2837
|
+
name: "detail",
|
|
2838
|
+
type: "uiBlocks",
|
|
2839
|
+
hideFromUI: true,
|
|
2840
|
+
defaultValue: [defaultDetail]
|
|
2841
|
+
}],
|
|
2842
|
+
defaultValue: [{
|
|
2843
|
+
title: [defaultTitle],
|
|
2844
|
+
detail: [defaultDetail]
|
|
2845
|
+
}, {
|
|
2846
|
+
title: [defaultTitle],
|
|
2847
|
+
detail: [defaultDetail]
|
|
2848
|
+
}],
|
|
2849
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
2850
|
+
}, {
|
|
2851
|
+
name: "oneAtATime",
|
|
2852
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
2853
|
+
type: "boolean",
|
|
2854
|
+
defaultValue: false
|
|
2855
|
+
}, {
|
|
2856
|
+
name: "grid",
|
|
2857
|
+
helperText: "Display as a grid",
|
|
2858
|
+
type: "boolean",
|
|
2859
|
+
defaultValue: false
|
|
2860
|
+
}, {
|
|
2861
|
+
name: "gridRowWidth",
|
|
2862
|
+
helperText: "Display as a grid",
|
|
2863
|
+
type: "string",
|
|
2864
|
+
showIf: (options) => options.get("grid"),
|
|
2865
|
+
defaultValue: "25%"
|
|
2866
|
+
}, {
|
|
2867
|
+
name: "useChildrenForItems",
|
|
2868
|
+
type: "boolean",
|
|
2869
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
2870
|
+
advanced: true,
|
|
2871
|
+
defaultValue: false,
|
|
2872
|
+
onChange: (options) => {
|
|
2873
|
+
if (options.get("useChildrenForItems") === true) {
|
|
2874
|
+
options.set("items", []);
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
}]
|
|
2878
|
+
};
|
|
2879
|
+
|
|
2880
|
+
// src/blocks/custom-code/component-info.ts
|
|
2881
|
+
var componentInfo11 = {
|
|
2607
2882
|
name: "Custom Code",
|
|
2608
2883
|
static: true,
|
|
2609
2884
|
requiredPermissions: ["editCode"],
|
|
@@ -2628,10 +2903,10 @@ var componentInfo10 = {
|
|
|
2628
2903
|
};
|
|
2629
2904
|
|
|
2630
2905
|
// src/blocks/custom-code/custom-code.tsx
|
|
2631
|
-
import { onMount as onMount2, createSignal as
|
|
2906
|
+
import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
|
|
2632
2907
|
function CustomCode(props) {
|
|
2633
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2634
|
-
const [scriptsRun, setScriptsRun] =
|
|
2908
|
+
const [scriptsInserted, setScriptsInserted] = createSignal11([]);
|
|
2909
|
+
const [scriptsRun, setScriptsRun] = createSignal11([]);
|
|
2635
2910
|
let elementRef;
|
|
2636
2911
|
onMount2(() => {
|
|
2637
2912
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
@@ -2675,7 +2950,7 @@ function CustomCode(props) {
|
|
|
2675
2950
|
var custom_code_default = CustomCode;
|
|
2676
2951
|
|
|
2677
2952
|
// src/blocks/embed/component-info.ts
|
|
2678
|
-
var
|
|
2953
|
+
var componentInfo12 = {
|
|
2679
2954
|
name: "Embed",
|
|
2680
2955
|
static: true,
|
|
2681
2956
|
inputs: [{
|
|
@@ -2713,7 +2988,7 @@ var componentInfo11 = {
|
|
|
2713
2988
|
};
|
|
2714
2989
|
|
|
2715
2990
|
// src/blocks/embed/embed.tsx
|
|
2716
|
-
import { on, createEffect, createMemo as
|
|
2991
|
+
import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
2717
2992
|
|
|
2718
2993
|
// src/blocks/embed/helpers.ts
|
|
2719
2994
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -2721,9 +2996,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
2721
2996
|
|
|
2722
2997
|
// src/blocks/embed/embed.tsx
|
|
2723
2998
|
function Embed(props) {
|
|
2724
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2725
|
-
const [scriptsRun, setScriptsRun] =
|
|
2726
|
-
const [ranInitFn, setRanInitFn] =
|
|
2999
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3000
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
3001
|
+
const [ranInitFn, setRanInitFn] = createSignal12(false);
|
|
2727
3002
|
function findAndRunScripts() {
|
|
2728
3003
|
if (!elem || !elem.getElementsByTagName)
|
|
2729
3004
|
return;
|
|
@@ -2747,8 +3022,8 @@ function Embed(props) {
|
|
|
2747
3022
|
}
|
|
2748
3023
|
}
|
|
2749
3024
|
let elem;
|
|
2750
|
-
const onUpdateFn_0_elem =
|
|
2751
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
3025
|
+
const onUpdateFn_0_elem = createMemo12(() => elem);
|
|
3026
|
+
const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
|
|
2752
3027
|
function onUpdateFn_0() {
|
|
2753
3028
|
if (elem && !ranInitFn()) {
|
|
2754
3029
|
setRanInitFn(true);
|
|
@@ -2763,7 +3038,7 @@ function Embed(props) {
|
|
|
2763
3038
|
var embed_default = Embed;
|
|
2764
3039
|
|
|
2765
3040
|
// src/blocks/form/form/component-info.ts
|
|
2766
|
-
var
|
|
3041
|
+
var componentInfo13 = {
|
|
2767
3042
|
name: "Form:Form",
|
|
2768
3043
|
// editableTags: ['builder-form-error']
|
|
2769
3044
|
defaults: {
|
|
@@ -2997,7 +3272,7 @@ var componentInfo12 = {
|
|
|
2997
3272
|
};
|
|
2998
3273
|
|
|
2999
3274
|
// src/blocks/form/form/form.tsx
|
|
3000
|
-
import { Show as
|
|
3275
|
+
import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
|
|
3001
3276
|
import { css as css4 } from "solid-styled-components";
|
|
3002
3277
|
|
|
3003
3278
|
// src/functions/get-env.ts
|
|
@@ -3015,9 +3290,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
3015
3290
|
|
|
3016
3291
|
// src/blocks/form/form/form.tsx
|
|
3017
3292
|
function FormComponent(props) {
|
|
3018
|
-
const [formState, setFormState] =
|
|
3019
|
-
const [responseData, setResponseData] =
|
|
3020
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
3293
|
+
const [formState, setFormState] = createSignal13("unsubmitted");
|
|
3294
|
+
const [responseData, setResponseData] = createSignal13(null);
|
|
3295
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal13("");
|
|
3021
3296
|
function mergeNewRootState(newData) {
|
|
3022
3297
|
const combinedState = {
|
|
3023
3298
|
...props.builderContext.rootState,
|
|
@@ -3213,7 +3488,7 @@ function FormComponent(props) {
|
|
|
3213
3488
|
{...{}}
|
|
3214
3489
|
{...props.attributes}
|
|
3215
3490
|
>
|
|
3216
|
-
<
|
|
3491
|
+
<Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
|
|
3217
3492
|
const idx = _index();
|
|
3218
3493
|
return <Block_default
|
|
3219
3494
|
key={`form-block-${idx}`}
|
|
@@ -3222,35 +3497,35 @@ function FormComponent(props) {
|
|
|
3222
3497
|
registeredComponents={props.builderComponents}
|
|
3223
3498
|
linkComponent={props.builderLinkComponent}
|
|
3224
3499
|
/>;
|
|
3225
|
-
}}</
|
|
3226
|
-
<
|
|
3500
|
+
}}</For7></Show10>
|
|
3501
|
+
<Show10 when={submissionState() === "error"}><Blocks_default
|
|
3227
3502
|
path="errorMessage"
|
|
3228
3503
|
blocks={props.errorMessage}
|
|
3229
3504
|
context={props.builderContext}
|
|
3230
|
-
/></
|
|
3231
|
-
<
|
|
3505
|
+
/></Show10>
|
|
3506
|
+
<Show10 when={submissionState() === "sending"}><Blocks_default
|
|
3232
3507
|
path="sendingMessage"
|
|
3233
3508
|
blocks={props.sendingMessage}
|
|
3234
3509
|
context={props.builderContext}
|
|
3235
|
-
/></
|
|
3236
|
-
<
|
|
3510
|
+
/></Show10>
|
|
3511
|
+
<Show10 when={submissionState() === "error" && responseData()}><pre
|
|
3237
3512
|
class={"builder-form-error-text " + css4({
|
|
3238
3513
|
padding: "10px",
|
|
3239
3514
|
color: "red",
|
|
3240
3515
|
textAlign: "center"
|
|
3241
3516
|
})}
|
|
3242
|
-
>{JSON.stringify(responseData(), null, 2)}</pre></
|
|
3243
|
-
<
|
|
3517
|
+
>{JSON.stringify(responseData(), null, 2)}</pre></Show10>
|
|
3518
|
+
<Show10 when={submissionState() === "success"}><Blocks_default
|
|
3244
3519
|
path="successMessage"
|
|
3245
3520
|
blocks={props.successMessage}
|
|
3246
3521
|
context={props.builderContext}
|
|
3247
|
-
/></
|
|
3522
|
+
/></Show10>
|
|
3248
3523
|
</form>;
|
|
3249
3524
|
}
|
|
3250
3525
|
var form_default = FormComponent;
|
|
3251
3526
|
|
|
3252
3527
|
// src/blocks/form/input/component-info.ts
|
|
3253
|
-
var
|
|
3528
|
+
var componentInfo14 = {
|
|
3254
3529
|
name: "Form:Input",
|
|
3255
3530
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3256
3531
|
inputs: [
|
|
@@ -3320,7 +3595,7 @@ function FormInputComponent(props) {
|
|
|
3320
3595
|
var input_default = FormInputComponent;
|
|
3321
3596
|
|
|
3322
3597
|
// src/blocks/form/select/component-info.ts
|
|
3323
|
-
var
|
|
3598
|
+
var componentInfo15 = {
|
|
3324
3599
|
name: "Form:Select",
|
|
3325
3600
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3326
3601
|
defaultStyles: {
|
|
@@ -3365,7 +3640,7 @@ var componentInfo14 = {
|
|
|
3365
3640
|
};
|
|
3366
3641
|
|
|
3367
3642
|
// src/blocks/form/select/select.tsx
|
|
3368
|
-
import { For as
|
|
3643
|
+
import { For as For8 } from "solid-js";
|
|
3369
3644
|
function SelectComponent(props) {
|
|
3370
3645
|
return <select
|
|
3371
3646
|
{...{}}
|
|
@@ -3374,15 +3649,15 @@ function SelectComponent(props) {
|
|
|
3374
3649
|
key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
|
|
3375
3650
|
defaultValue={props.defaultValue}
|
|
3376
3651
|
name={props.name}
|
|
3377
|
-
><
|
|
3652
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
3378
3653
|
const index = _index();
|
|
3379
3654
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
3380
|
-
}}</
|
|
3655
|
+
}}</For8></select>;
|
|
3381
3656
|
}
|
|
3382
3657
|
var select_default = SelectComponent;
|
|
3383
3658
|
|
|
3384
3659
|
// src/blocks/form/submit-button/component-info.ts
|
|
3385
|
-
var
|
|
3660
|
+
var componentInfo16 = {
|
|
3386
3661
|
name: "Form:SubmitButton",
|
|
3387
3662
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3388
3663
|
defaultStyles: {
|
|
@@ -3416,7 +3691,7 @@ function SubmitButton(props) {
|
|
|
3416
3691
|
var submit_button_default = SubmitButton;
|
|
3417
3692
|
|
|
3418
3693
|
// src/blocks/img/component-info.ts
|
|
3419
|
-
var
|
|
3694
|
+
var componentInfo17 = {
|
|
3420
3695
|
// friendlyName?
|
|
3421
3696
|
name: "Raw:Img",
|
|
3422
3697
|
hideFromInsertMenu: true,
|
|
@@ -3449,7 +3724,7 @@ function ImgComponent(props) {
|
|
|
3449
3724
|
var img_default = ImgComponent;
|
|
3450
3725
|
|
|
3451
3726
|
// src/blocks/video/component-info.ts
|
|
3452
|
-
var
|
|
3727
|
+
var componentInfo18 = {
|
|
3453
3728
|
name: "Video",
|
|
3454
3729
|
canHaveChildren: true,
|
|
3455
3730
|
defaultStyles: {
|
|
@@ -3533,9 +3808,9 @@ var componentInfo17 = {
|
|
|
3533
3808
|
};
|
|
3534
3809
|
|
|
3535
3810
|
// src/blocks/video/video.tsx
|
|
3536
|
-
import { Show as
|
|
3811
|
+
import { Show as Show11, createMemo as createMemo14 } from "solid-js";
|
|
3537
3812
|
function Video(props) {
|
|
3538
|
-
const videoProps =
|
|
3813
|
+
const videoProps = createMemo14(() => {
|
|
3539
3814
|
return {
|
|
3540
3815
|
...props.autoPlay === true ? {
|
|
3541
3816
|
autoPlay: true
|
|
@@ -3554,7 +3829,7 @@ function Video(props) {
|
|
|
3554
3829
|
} : {}
|
|
3555
3830
|
};
|
|
3556
3831
|
});
|
|
3557
|
-
const spreadProps =
|
|
3832
|
+
const spreadProps = createMemo14(() => {
|
|
3558
3833
|
return {
|
|
3559
3834
|
...videoProps()
|
|
3560
3835
|
};
|
|
@@ -3584,8 +3859,8 @@ function Video(props) {
|
|
|
3584
3859
|
}}
|
|
3585
3860
|
src={props.video || "no-src"}
|
|
3586
3861
|
poster={props.posterImage}
|
|
3587
|
-
><
|
|
3588
|
-
<
|
|
3862
|
+
><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
|
|
3863
|
+
<Show11
|
|
3589
3864
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
3590
3865
|
><div
|
|
3591
3866
|
style={{
|
|
@@ -3594,15 +3869,15 @@ function Video(props) {
|
|
|
3594
3869
|
"pointer-events": "none",
|
|
3595
3870
|
"font-size": "0px"
|
|
3596
3871
|
}}
|
|
3597
|
-
/></
|
|
3598
|
-
<
|
|
3872
|
+
/></Show11>
|
|
3873
|
+
<Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
3599
3874
|
style={{
|
|
3600
3875
|
display: "flex",
|
|
3601
3876
|
"flex-direction": "column",
|
|
3602
3877
|
"align-items": "stretch"
|
|
3603
3878
|
}}
|
|
3604
|
-
>{props.children}</div></
|
|
3605
|
-
<
|
|
3879
|
+
>{props.children}</div></Show11>
|
|
3880
|
+
<Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
3606
3881
|
style={{
|
|
3607
3882
|
"pointer-events": "none",
|
|
3608
3883
|
display: "flex",
|
|
@@ -3614,7 +3889,7 @@ function Video(props) {
|
|
|
3614
3889
|
width: "100%",
|
|
3615
3890
|
height: "100%"
|
|
3616
3891
|
}}
|
|
3617
|
-
>{props.children}</div></
|
|
3892
|
+
>{props.children}</div></Show11>
|
|
3618
3893
|
</div>;
|
|
3619
3894
|
}
|
|
3620
3895
|
var video_default = Video;
|
|
@@ -3622,28 +3897,28 @@ var video_default = Video;
|
|
|
3622
3897
|
// src/constants/extra-components.ts
|
|
3623
3898
|
var getExtraComponents = () => [{
|
|
3624
3899
|
component: custom_code_default,
|
|
3625
|
-
...
|
|
3900
|
+
...componentInfo11
|
|
3626
3901
|
}, {
|
|
3627
3902
|
component: embed_default,
|
|
3628
|
-
...
|
|
3903
|
+
...componentInfo12
|
|
3629
3904
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3630
3905
|
component: form_default,
|
|
3631
|
-
...
|
|
3906
|
+
...componentInfo13
|
|
3632
3907
|
}, {
|
|
3633
3908
|
component: input_default,
|
|
3634
|
-
...
|
|
3909
|
+
...componentInfo14
|
|
3635
3910
|
}, {
|
|
3636
3911
|
component: submit_button_default,
|
|
3637
|
-
...
|
|
3912
|
+
...componentInfo16
|
|
3638
3913
|
}, {
|
|
3639
3914
|
component: select_default,
|
|
3640
|
-
...
|
|
3915
|
+
...componentInfo15
|
|
3641
3916
|
}], {
|
|
3642
3917
|
component: img_default,
|
|
3643
|
-
...
|
|
3918
|
+
...componentInfo17
|
|
3644
3919
|
}, {
|
|
3645
3920
|
component: video_default,
|
|
3646
|
-
...
|
|
3921
|
+
...componentInfo18
|
|
3647
3922
|
}];
|
|
3648
3923
|
|
|
3649
3924
|
// src/constants/builder-registered-components.ts
|
|
@@ -3674,6 +3949,9 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3674
3949
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3675
3950
|
component: tabs_default,
|
|
3676
3951
|
...componentInfo8
|
|
3952
|
+
}, {
|
|
3953
|
+
component: accordion_default,
|
|
3954
|
+
...componentInfo10
|
|
3677
3955
|
}], ...getExtraComponents()];
|
|
3678
3956
|
|
|
3679
3957
|
// src/functions/register-component.ts
|
|
@@ -3752,12 +4030,12 @@ var Inlined_script_default = InlinedScript;
|
|
|
3752
4030
|
|
|
3753
4031
|
// src/components/content/components/enable-editor.tsx
|
|
3754
4032
|
import {
|
|
3755
|
-
Show as
|
|
4033
|
+
Show as Show12,
|
|
3756
4034
|
onMount as onMount3,
|
|
3757
4035
|
on as on2,
|
|
3758
4036
|
createEffect as createEffect2,
|
|
3759
|
-
createMemo as
|
|
3760
|
-
createSignal as
|
|
4037
|
+
createMemo as createMemo15,
|
|
4038
|
+
createSignal as createSignal15
|
|
3761
4039
|
} from "solid-js";
|
|
3762
4040
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
3763
4041
|
|
|
@@ -3810,6 +4088,18 @@ function flatten(object, path = null, separator = ".") {
|
|
|
3810
4088
|
};
|
|
3811
4089
|
}, {});
|
|
3812
4090
|
}
|
|
4091
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
4092
|
+
for (const key in obj) {
|
|
4093
|
+
const value = obj[key];
|
|
4094
|
+
const newKey = _current ? _current + "." + key : key;
|
|
4095
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$"))) {
|
|
4096
|
+
flattenMongoQuery(value, newKey, _res);
|
|
4097
|
+
} else {
|
|
4098
|
+
_res[newKey] = value;
|
|
4099
|
+
}
|
|
4100
|
+
}
|
|
4101
|
+
return _res;
|
|
4102
|
+
}
|
|
3813
4103
|
|
|
3814
4104
|
// src/types/api-version.ts
|
|
3815
4105
|
var DEFAULT_API_VERSION = "v3";
|
|
@@ -3911,7 +4201,7 @@ var generateContentUrl = (options) => {
|
|
|
3911
4201
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
3912
4202
|
}
|
|
3913
4203
|
if (query) {
|
|
3914
|
-
const flattened2 =
|
|
4204
|
+
const flattened2 = flattenMongoQuery({
|
|
3915
4205
|
query
|
|
3916
4206
|
});
|
|
3917
4207
|
for (const key in flattened2) {
|
|
@@ -4245,7 +4535,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4245
4535
|
}
|
|
4246
4536
|
|
|
4247
4537
|
// src/constants/sdk-version.ts
|
|
4248
|
-
var SDK_VERSION = "1.0.
|
|
4538
|
+
var SDK_VERSION = "1.0.28";
|
|
4249
4539
|
|
|
4250
4540
|
// src/functions/register.ts
|
|
4251
4541
|
var registry = {};
|
|
@@ -4523,12 +4813,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
4523
4813
|
|
|
4524
4814
|
// src/components/content/components/enable-editor.tsx
|
|
4525
4815
|
function EnableEditor(props) {
|
|
4526
|
-
const [ContentWrapper, setContentWrapper] =
|
|
4816
|
+
const [ContentWrapper, setContentWrapper] = createSignal15(
|
|
4527
4817
|
props.contentWrapper || "div"
|
|
4528
4818
|
);
|
|
4529
|
-
const [httpReqsData, setHttpReqsData] =
|
|
4530
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
4531
|
-
const [clicked, setClicked] =
|
|
4819
|
+
const [httpReqsData, setHttpReqsData] = createSignal15({});
|
|
4820
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal15({});
|
|
4821
|
+
const [clicked, setClicked] = createSignal15(false);
|
|
4532
4822
|
function mergeNewRootState(newData) {
|
|
4533
4823
|
const combinedState = {
|
|
4534
4824
|
...props.builderContextSignal.rootState,
|
|
@@ -4562,7 +4852,7 @@ function EnableEditor(props) {
|
|
|
4562
4852
|
content: newContentValue
|
|
4563
4853
|
}));
|
|
4564
4854
|
}
|
|
4565
|
-
const showContentProps =
|
|
4855
|
+
const showContentProps = createMemo15(() => {
|
|
4566
4856
|
return props.showContent ? {} : {
|
|
4567
4857
|
hidden: true,
|
|
4568
4858
|
"aria-hidden": true
|
|
@@ -4746,21 +5036,21 @@ function EnableEditor(props) {
|
|
|
4746
5036
|
onMount3(() => {
|
|
4747
5037
|
if (!props.apiKey) {
|
|
4748
5038
|
logger.error(
|
|
4749
|
-
"No API key provided to `
|
|
5039
|
+
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
4750
5040
|
);
|
|
4751
5041
|
}
|
|
4752
5042
|
evaluateJsCode();
|
|
4753
5043
|
runHttpRequests();
|
|
4754
5044
|
emitStateUpdate();
|
|
4755
5045
|
});
|
|
4756
|
-
const onUpdateFn_0_props_content =
|
|
5046
|
+
const onUpdateFn_0_props_content = createMemo15(() => props.content);
|
|
4757
5047
|
function onUpdateFn_0() {
|
|
4758
5048
|
if (props.content) {
|
|
4759
5049
|
mergeNewContent(props.content);
|
|
4760
5050
|
}
|
|
4761
5051
|
}
|
|
4762
5052
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4763
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
5053
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4764
5054
|
function onUpdateFn_1() {
|
|
4765
5055
|
evaluateJsCode();
|
|
4766
5056
|
}
|
|
@@ -4770,7 +5060,7 @@ function EnableEditor(props) {
|
|
|
4770
5060
|
onUpdateFn_1
|
|
4771
5061
|
)
|
|
4772
5062
|
);
|
|
4773
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
5063
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4774
5064
|
function onUpdateFn_2() {
|
|
4775
5065
|
runHttpRequests();
|
|
4776
5066
|
}
|
|
@@ -4782,7 +5072,7 @@ function EnableEditor(props) {
|
|
|
4782
5072
|
onUpdateFn_2
|
|
4783
5073
|
)
|
|
4784
5074
|
);
|
|
4785
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
5075
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
|
|
4786
5076
|
() => props.builderContextSignal.rootState
|
|
4787
5077
|
);
|
|
4788
5078
|
function onUpdateFn_3() {
|
|
@@ -4794,14 +5084,14 @@ function EnableEditor(props) {
|
|
|
4794
5084
|
onUpdateFn_3
|
|
4795
5085
|
)
|
|
4796
5086
|
);
|
|
4797
|
-
const onUpdateFn_4_props_data =
|
|
5087
|
+
const onUpdateFn_4_props_data = createMemo15(() => props.data);
|
|
4798
5088
|
function onUpdateFn_4() {
|
|
4799
5089
|
if (props.data) {
|
|
4800
5090
|
mergeNewRootState(props.data);
|
|
4801
5091
|
}
|
|
4802
5092
|
}
|
|
4803
5093
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4804
|
-
const onUpdateFn_5_props_locale =
|
|
5094
|
+
const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
|
|
4805
5095
|
function onUpdateFn_5() {
|
|
4806
5096
|
if (props.locale) {
|
|
4807
5097
|
mergeNewRootState({
|
|
@@ -4810,7 +5100,7 @@ function EnableEditor(props) {
|
|
|
4810
5100
|
}
|
|
4811
5101
|
}
|
|
4812
5102
|
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4813
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
5103
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
|
|
4814
5104
|
class={getWrapperClassName(
|
|
4815
5105
|
props.content?.testVariationId || props.content?.id
|
|
4816
5106
|
)}
|
|
@@ -4823,14 +5113,14 @@ function EnableEditor(props) {
|
|
|
4823
5113
|
{...showContentProps()}
|
|
4824
5114
|
{...props.contentWrapperProps}
|
|
4825
5115
|
component={ContentWrapper()}
|
|
4826
|
-
>{props.children}</Dynamic5></
|
|
5116
|
+
>{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
|
|
4827
5117
|
}
|
|
4828
5118
|
var Enable_editor_default = EnableEditor;
|
|
4829
5119
|
|
|
4830
5120
|
// src/components/content/components/styles.tsx
|
|
4831
|
-
import { createSignal as
|
|
5121
|
+
import { createSignal as createSignal16 } from "solid-js";
|
|
4832
5122
|
function ContentStyles(props) {
|
|
4833
|
-
const [injectedStyles, setInjectedStyles] =
|
|
5123
|
+
const [injectedStyles, setInjectedStyles] = createSignal16(
|
|
4834
5124
|
`
|
|
4835
5125
|
${getCss({
|
|
4836
5126
|
cssCode: props.cssCode,
|
|
@@ -4887,7 +5177,7 @@ var getContentInitialValue = ({
|
|
|
4887
5177
|
|
|
4888
5178
|
// src/components/content/content.tsx
|
|
4889
5179
|
function ContentComponent(props) {
|
|
4890
|
-
const [scriptStr, setScriptStr] =
|
|
5180
|
+
const [scriptStr, setScriptStr] = createSignal17(
|
|
4891
5181
|
getUpdateVariantVisibilityScript({
|
|
4892
5182
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
4893
5183
|
variationId: props.content?.testVariationId,
|
|
@@ -4895,7 +5185,7 @@ function ContentComponent(props) {
|
|
|
4895
5185
|
contentId: props.content?.id
|
|
4896
5186
|
})
|
|
4897
5187
|
);
|
|
4898
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
5188
|
+
const [registeredComponents, setRegisteredComponents] = createSignal17(
|
|
4899
5189
|
[
|
|
4900
5190
|
...getDefaultRegisteredComponents(),
|
|
4901
5191
|
...props.customComponents || []
|
|
@@ -4910,7 +5200,7 @@ function ContentComponent(props) {
|
|
|
4910
5200
|
{}
|
|
4911
5201
|
)
|
|
4912
5202
|
);
|
|
4913
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
5203
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal17({
|
|
4914
5204
|
content: getContentInitialValue({
|
|
4915
5205
|
content: props.content,
|
|
4916
5206
|
data: props.data
|
|
@@ -4968,16 +5258,16 @@ function ContentComponent(props) {
|
|
|
4968
5258
|
setBuilderContextSignal
|
|
4969
5259
|
}}
|
|
4970
5260
|
>
|
|
4971
|
-
<
|
|
5261
|
+
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
4972
5262
|
id="builderio-variant-visibility"
|
|
4973
5263
|
scriptStr={scriptStr()}
|
|
4974
|
-
/></
|
|
4975
|
-
<
|
|
5264
|
+
/></Show13>
|
|
5265
|
+
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
4976
5266
|
isNestedRender={props.isNestedRender}
|
|
4977
5267
|
contentId={builderContextSignal().content?.id}
|
|
4978
5268
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
4979
5269
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
4980
|
-
/></
|
|
5270
|
+
/></Show13>
|
|
4981
5271
|
<Blocks_default
|
|
4982
5272
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
4983
5273
|
context={builderContextSignal()}
|
|
@@ -4990,13 +5280,13 @@ var Content_default = ContentComponent;
|
|
|
4990
5280
|
|
|
4991
5281
|
// src/components/content-variants/content-variants.tsx
|
|
4992
5282
|
function ContentVariants(props) {
|
|
4993
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
5283
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
|
|
4994
5284
|
checkShouldRenderVariants({
|
|
4995
5285
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
4996
5286
|
content: props.content
|
|
4997
5287
|
})
|
|
4998
5288
|
);
|
|
4999
|
-
const updateCookieAndStylesScriptStr =
|
|
5289
|
+
const updateCookieAndStylesScriptStr = createMemo18(() => {
|
|
5000
5290
|
return getUpdateCookieAndStylesScript(
|
|
5001
5291
|
getVariants(props.content).map((value) => ({
|
|
5002
5292
|
id: value.testVariationId,
|
|
@@ -5005,10 +5295,10 @@ function ContentVariants(props) {
|
|
|
5005
5295
|
props.content?.id || ""
|
|
5006
5296
|
);
|
|
5007
5297
|
});
|
|
5008
|
-
const hideVariantsStyleString =
|
|
5298
|
+
const hideVariantsStyleString = createMemo18(() => {
|
|
5009
5299
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
5010
5300
|
});
|
|
5011
|
-
const defaultContent =
|
|
5301
|
+
const defaultContent = createMemo18(() => {
|
|
5012
5302
|
return shouldRenderVariants() ? {
|
|
5013
5303
|
...props.content,
|
|
5014
5304
|
testVariationId: props.content?.id
|
|
@@ -5021,11 +5311,11 @@ function ContentVariants(props) {
|
|
|
5021
5311
|
setShouldRenderVariants(false);
|
|
5022
5312
|
});
|
|
5023
5313
|
return <>
|
|
5024
|
-
<
|
|
5314
|
+
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5025
5315
|
id="builderio-init-variants-fns"
|
|
5026
5316
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5027
|
-
/></
|
|
5028
|
-
<
|
|
5317
|
+
/></Show14>
|
|
5318
|
+
<Show14 when={shouldRenderVariants()}>
|
|
5029
5319
|
<Inlined_styles_default
|
|
5030
5320
|
id="builderio-variants"
|
|
5031
5321
|
styles={hideVariantsStyleString()}
|
|
@@ -5034,7 +5324,7 @@ function ContentVariants(props) {
|
|
|
5034
5324
|
id="builderio-variants-visibility"
|
|
5035
5325
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5036
5326
|
/>
|
|
5037
|
-
<
|
|
5327
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5038
5328
|
const index = _index();
|
|
5039
5329
|
return <Content_default
|
|
5040
5330
|
isNestedRender={props.isNestedRender}
|
|
@@ -5058,8 +5348,8 @@ function ContentVariants(props) {
|
|
|
5058
5348
|
contentWrapperProps={props.contentWrapperProps}
|
|
5059
5349
|
trustedHosts={props.trustedHosts}
|
|
5060
5350
|
/>;
|
|
5061
|
-
}}</
|
|
5062
|
-
</
|
|
5351
|
+
}}</For9>
|
|
5352
|
+
</Show14>
|
|
5063
5353
|
<Content_default
|
|
5064
5354
|
isNestedRender={props.isNestedRender}
|
|
5065
5355
|
{...{}}
|
|
@@ -5112,14 +5402,14 @@ var fetchSymbolContent = async ({
|
|
|
5112
5402
|
|
|
5113
5403
|
// src/blocks/symbol/symbol.tsx
|
|
5114
5404
|
function Symbol(props) {
|
|
5115
|
-
const [contentToUse, setContentToUse] =
|
|
5116
|
-
const blocksWrapper =
|
|
5405
|
+
const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
|
|
5406
|
+
const blocksWrapper = createMemo19(() => {
|
|
5117
5407
|
return "div";
|
|
5118
5408
|
});
|
|
5119
|
-
const contentWrapper =
|
|
5409
|
+
const contentWrapper = createMemo19(() => {
|
|
5120
5410
|
return "div";
|
|
5121
5411
|
});
|
|
5122
|
-
const className =
|
|
5412
|
+
const className = createMemo19(() => {
|
|
5123
5413
|
return [
|
|
5124
5414
|
...[props.attributes[getClassPropName()]],
|
|
5125
5415
|
"builder-symbol",
|
|
@@ -5141,7 +5431,7 @@ function Symbol(props) {
|
|
|
5141
5431
|
}
|
|
5142
5432
|
onMount5(() => {
|
|
5143
5433
|
});
|
|
5144
|
-
const onUpdateFn_0_props_symbol =
|
|
5434
|
+
const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
|
|
5145
5435
|
function onUpdateFn_0() {
|
|
5146
5436
|
setContent();
|
|
5147
5437
|
}
|