@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/index.jsx
CHANGED
|
@@ -468,6 +468,9 @@ function getProcessedBlock({
|
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
|
|
471
|
+
// src/functions/camel-to-kebab-case.ts
|
|
472
|
+
var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
473
|
+
|
|
471
474
|
// src/components/block/animator.ts
|
|
472
475
|
function throttle(func, wait, options = {}) {
|
|
473
476
|
let context;
|
|
@@ -518,7 +521,6 @@ function assign(target, ..._args) {
|
|
|
518
521
|
}
|
|
519
522
|
return to;
|
|
520
523
|
}
|
|
521
|
-
var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
522
524
|
function bindAnimations(animations) {
|
|
523
525
|
for (const animation of animations) {
|
|
524
526
|
switch (animation.trigger) {
|
|
@@ -570,7 +572,7 @@ function triggerAnimation(animation) {
|
|
|
570
572
|
element.style.transitionDelay = "0";
|
|
571
573
|
assign(element.style, animation.steps[0].styles);
|
|
572
574
|
setTimeout(() => {
|
|
573
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
575
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
574
576
|
if (animation.delay) {
|
|
575
577
|
element.style.transitionDelay = animation.delay + "s";
|
|
576
578
|
}
|
|
@@ -630,7 +632,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
630
632
|
}
|
|
631
633
|
attachDefaultState();
|
|
632
634
|
setTimeout(() => {
|
|
633
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
635
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
634
636
|
if (animation.delay) {
|
|
635
637
|
element.style.transitionDelay = animation.delay + "s";
|
|
636
638
|
}
|
|
@@ -643,9 +645,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
643
645
|
});
|
|
644
646
|
}
|
|
645
647
|
|
|
646
|
-
// src/functions/camel-to-kebab-case.ts
|
|
647
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
648
|
-
|
|
649
648
|
// src/helpers/css.ts
|
|
650
649
|
var convertStyleMapToCSSArray = (style) => {
|
|
651
650
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -772,10 +771,10 @@ var getRepeatItemData = ({
|
|
|
772
771
|
return repeatArray;
|
|
773
772
|
};
|
|
774
773
|
var shouldPassLinkComponent = (block) => {
|
|
775
|
-
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
774
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
776
775
|
};
|
|
777
776
|
var shouldPassRegisteredComponents = (block) => {
|
|
778
|
-
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
777
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
779
778
|
};
|
|
780
779
|
|
|
781
780
|
// src/components/block/components/block-styles.tsx
|
|
@@ -904,7 +903,7 @@ function BlockStyles(props) {
|
|
|
904
903
|
className: `${className}:hover`,
|
|
905
904
|
styles: {
|
|
906
905
|
...hoverStyles,
|
|
907
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
906
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
|
|
908
907
|
hoverAnimation.easing
|
|
909
908
|
)}`,
|
|
910
909
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
@@ -1668,10 +1667,10 @@ function SectionComponent(props) {
|
|
|
1668
1667
|
var section_default = SectionComponent;
|
|
1669
1668
|
|
|
1670
1669
|
// src/blocks/symbol/symbol.tsx
|
|
1671
|
-
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as
|
|
1670
|
+
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
|
|
1672
1671
|
|
|
1673
1672
|
// src/components/content-variants/content-variants.tsx
|
|
1674
|
-
import { Show as
|
|
1673
|
+
import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
|
|
1675
1674
|
|
|
1676
1675
|
// src/helpers/url.ts
|
|
1677
1676
|
var getTopLevelDomain = (host) => {
|
|
@@ -1865,7 +1864,7 @@ var handleABTesting = async ({
|
|
|
1865
1864
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1866
1865
|
|
|
1867
1866
|
// src/components/content/content.tsx
|
|
1868
|
-
import { Show as
|
|
1867
|
+
import { Show as Show13, createSignal as createSignal17 } from "solid-js";
|
|
1869
1868
|
|
|
1870
1869
|
// src/blocks/button/component-info.ts
|
|
1871
1870
|
var componentInfo = {
|
|
@@ -2515,8 +2514,12 @@ function Tabs(props) {
|
|
|
2515
2514
|
function activeTabContent(active) {
|
|
2516
2515
|
return props.tabs && props.tabs[active].content;
|
|
2517
2516
|
}
|
|
2518
|
-
function
|
|
2519
|
-
|
|
2517
|
+
function onClick(index) {
|
|
2518
|
+
if (index === activeTab() && props.collapsible) {
|
|
2519
|
+
setActiveTab(-1);
|
|
2520
|
+
} else {
|
|
2521
|
+
setActiveTab(index);
|
|
2522
|
+
}
|
|
2520
2523
|
}
|
|
2521
2524
|
return <div>
|
|
2522
2525
|
<div
|
|
@@ -2532,14 +2535,10 @@ function Tabs(props) {
|
|
|
2532
2535
|
return <span
|
|
2533
2536
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
2534
2537
|
key={index}
|
|
2535
|
-
style={
|
|
2536
|
-
|
|
2537
|
-
if (index === activeTab() && props.collapsible) {
|
|
2538
|
-
setActiveTab(-1);
|
|
2539
|
-
} else {
|
|
2540
|
-
setActiveTab(index);
|
|
2541
|
-
}
|
|
2538
|
+
style={{
|
|
2539
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
2542
2540
|
}}
|
|
2541
|
+
onClick={(event) => onClick(index)}
|
|
2543
2542
|
><Blocks_default
|
|
2544
2543
|
parent={props.builderBlock.id}
|
|
2545
2544
|
path={`component.options.tabs.${index}.label`}
|
|
@@ -2594,8 +2593,284 @@ function Text(props) {
|
|
|
2594
2593
|
}
|
|
2595
2594
|
var text_default = Text;
|
|
2596
2595
|
|
|
2597
|
-
// src/blocks/
|
|
2596
|
+
// src/blocks/accordion/accordion.tsx
|
|
2597
|
+
import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
|
|
2598
|
+
|
|
2599
|
+
// src/blocks/accordion/helpers.ts
|
|
2600
|
+
var convertOrderNumberToString = (order) => {
|
|
2601
|
+
return order.toString();
|
|
2602
|
+
};
|
|
2603
|
+
|
|
2604
|
+
// src/blocks/accordion/accordion.tsx
|
|
2605
|
+
function Accordion(props) {
|
|
2606
|
+
const [open, setOpen] = createSignal10([]);
|
|
2607
|
+
const onlyOneAtATime = createMemo10(() => {
|
|
2608
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
2609
|
+
});
|
|
2610
|
+
const accordionStyles = createMemo10(() => {
|
|
2611
|
+
const styles = {
|
|
2612
|
+
display: "flex",
|
|
2613
|
+
alignItems: "stretch",
|
|
2614
|
+
flexDirection: "column",
|
|
2615
|
+
...props.grid && {
|
|
2616
|
+
flexDirection: "row",
|
|
2617
|
+
alignItems: "flex-start",
|
|
2618
|
+
flexWrap: "wrap"
|
|
2619
|
+
}
|
|
2620
|
+
};
|
|
2621
|
+
return Object.fromEntries(
|
|
2622
|
+
Object.entries(styles).map(([key, value]) => [
|
|
2623
|
+
camelToKebabCase(key),
|
|
2624
|
+
value
|
|
2625
|
+
])
|
|
2626
|
+
);
|
|
2627
|
+
});
|
|
2628
|
+
const accordionTitleStyles = createMemo10(() => {
|
|
2629
|
+
const shared = {
|
|
2630
|
+
display: "flex",
|
|
2631
|
+
flexDirection: "column"
|
|
2632
|
+
};
|
|
2633
|
+
const styles = Object.fromEntries(
|
|
2634
|
+
Object.entries({
|
|
2635
|
+
...shared,
|
|
2636
|
+
alignItems: "stretch",
|
|
2637
|
+
cursor: "pointer"
|
|
2638
|
+
}).map(([key, value]) => [camelToKebabCase(key), value])
|
|
2639
|
+
);
|
|
2640
|
+
return Object.fromEntries(
|
|
2641
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2642
|
+
);
|
|
2643
|
+
});
|
|
2644
|
+
function getAccordionTitleClassName(index) {
|
|
2645
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
2646
|
+
}
|
|
2647
|
+
function getAccordionDetailClassName(index) {
|
|
2648
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
2649
|
+
}
|
|
2650
|
+
const openGridItemOrder = createMemo10(() => {
|
|
2651
|
+
let itemOrder = null;
|
|
2652
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
2653
|
+
if (getOpenGridItemPosition && document) {
|
|
2654
|
+
const openItemIndex = open()[0];
|
|
2655
|
+
const openItem = document.querySelector(
|
|
2656
|
+
`.builder-accordion-title[data-index="${openItemIndex}"]`
|
|
2657
|
+
);
|
|
2658
|
+
let subjectItem = openItem;
|
|
2659
|
+
itemOrder = openItemIndex;
|
|
2660
|
+
if (subjectItem) {
|
|
2661
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
2662
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
2663
|
+
if (subjectItem) {
|
|
2664
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
2665
|
+
continue;
|
|
2666
|
+
}
|
|
2667
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
2668
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
2669
|
+
const index = parseInt(
|
|
2670
|
+
subjectItem.getAttribute("data-index") || "",
|
|
2671
|
+
10
|
|
2672
|
+
);
|
|
2673
|
+
if (!isNaN(index)) {
|
|
2674
|
+
prevItemRect = subjectItemRect;
|
|
2675
|
+
itemOrder = index;
|
|
2676
|
+
}
|
|
2677
|
+
} else {
|
|
2678
|
+
break;
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
if (typeof itemOrder === "number") {
|
|
2685
|
+
itemOrder = itemOrder + 1;
|
|
2686
|
+
}
|
|
2687
|
+
return itemOrder;
|
|
2688
|
+
});
|
|
2689
|
+
const accordionDetailStyles = createMemo10(() => {
|
|
2690
|
+
const styles = {
|
|
2691
|
+
...{
|
|
2692
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
2693
|
+
},
|
|
2694
|
+
...props.grid && {
|
|
2695
|
+
width: "100%"
|
|
2696
|
+
}
|
|
2697
|
+
};
|
|
2698
|
+
return Object.fromEntries(
|
|
2699
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2700
|
+
);
|
|
2701
|
+
});
|
|
2702
|
+
function onClick(index) {
|
|
2703
|
+
if (open().includes(index)) {
|
|
2704
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
2705
|
+
} else {
|
|
2706
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
|
|
2710
|
+
const index = _index();
|
|
2711
|
+
return <>
|
|
2712
|
+
<div
|
|
2713
|
+
class={getAccordionTitleClassName(index)}
|
|
2714
|
+
style={{
|
|
2715
|
+
...accordionTitleStyles(),
|
|
2716
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
2717
|
+
...{
|
|
2718
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
2719
|
+
}
|
|
2720
|
+
}}
|
|
2721
|
+
data-index={index}
|
|
2722
|
+
onClick={(event) => onClick(index)}
|
|
2723
|
+
><Blocks_default
|
|
2724
|
+
blocks={item.title}
|
|
2725
|
+
path={`items.${index}.title`}
|
|
2726
|
+
parent={props.builderBlock.id}
|
|
2727
|
+
context={props.builderContext}
|
|
2728
|
+
registeredComponents={props.builderComponents}
|
|
2729
|
+
linkComponent={props.builderLinkComponent}
|
|
2730
|
+
/></div>
|
|
2731
|
+
<Show9 when={open().includes(index)}><div
|
|
2732
|
+
class={getAccordionDetailClassName(index)}
|
|
2733
|
+
style={accordionDetailStyles()}
|
|
2734
|
+
><Blocks_default
|
|
2735
|
+
blocks={item.detail}
|
|
2736
|
+
path={`items.${index}.detail`}
|
|
2737
|
+
parent={props.builderBlock.id}
|
|
2738
|
+
context={props.builderContext}
|
|
2739
|
+
registeredComponents={props.builderComponents}
|
|
2740
|
+
linkComponent={props.builderLinkComponent}
|
|
2741
|
+
/></div></Show9>
|
|
2742
|
+
</>;
|
|
2743
|
+
}}</For6></div>;
|
|
2744
|
+
}
|
|
2745
|
+
var accordion_default = Accordion;
|
|
2746
|
+
|
|
2747
|
+
// src/blocks/accordion/component-info.ts
|
|
2748
|
+
var defaultTitle = {
|
|
2749
|
+
"@type": "@builder.io/sdk:Element",
|
|
2750
|
+
layerName: "Accordion item title",
|
|
2751
|
+
responsiveStyles: {
|
|
2752
|
+
large: {
|
|
2753
|
+
marginTop: "10px",
|
|
2754
|
+
position: "relative",
|
|
2755
|
+
display: "flex",
|
|
2756
|
+
alignItems: "stretch",
|
|
2757
|
+
flexDirection: "column",
|
|
2758
|
+
paddingBottom: "10px"
|
|
2759
|
+
}
|
|
2760
|
+
},
|
|
2761
|
+
children: [{
|
|
2762
|
+
"@type": "@builder.io/sdk:Element",
|
|
2763
|
+
responsiveStyles: {
|
|
2764
|
+
large: {
|
|
2765
|
+
textAlign: "left",
|
|
2766
|
+
display: "flex",
|
|
2767
|
+
flexDirection: "column"
|
|
2768
|
+
}
|
|
2769
|
+
},
|
|
2770
|
+
component: {
|
|
2771
|
+
name: "Text",
|
|
2772
|
+
options: {
|
|
2773
|
+
text: "I am an accordion title. Click me!"
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
}]
|
|
2777
|
+
};
|
|
2778
|
+
var defaultDetail = {
|
|
2779
|
+
"@type": "@builder.io/sdk:Element",
|
|
2780
|
+
layerName: "Accordion item detail",
|
|
2781
|
+
responsiveStyles: {
|
|
2782
|
+
large: {
|
|
2783
|
+
position: "relative",
|
|
2784
|
+
display: "flex",
|
|
2785
|
+
alignItems: "stretch",
|
|
2786
|
+
flexDirection: "column",
|
|
2787
|
+
marginTop: "10px",
|
|
2788
|
+
paddingBottom: "10px"
|
|
2789
|
+
}
|
|
2790
|
+
},
|
|
2791
|
+
children: [{
|
|
2792
|
+
"@type": "@builder.io/sdk:Element",
|
|
2793
|
+
responsiveStyles: {
|
|
2794
|
+
large: {
|
|
2795
|
+
paddingTop: "50px",
|
|
2796
|
+
textAlign: "left",
|
|
2797
|
+
display: "flex",
|
|
2798
|
+
flexDirection: "column",
|
|
2799
|
+
paddingBottom: "50px"
|
|
2800
|
+
}
|
|
2801
|
+
},
|
|
2802
|
+
component: {
|
|
2803
|
+
name: "Text",
|
|
2804
|
+
options: {
|
|
2805
|
+
text: "I am an accordion detail, hello!"
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
}]
|
|
2809
|
+
};
|
|
2598
2810
|
var componentInfo10 = {
|
|
2811
|
+
name: "Builder:Accordion",
|
|
2812
|
+
canHaveChildren: true,
|
|
2813
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
2814
|
+
defaultStyles: {
|
|
2815
|
+
display: "flex",
|
|
2816
|
+
flexDirection: "column",
|
|
2817
|
+
alignItems: "stretch"
|
|
2818
|
+
},
|
|
2819
|
+
inputs: [{
|
|
2820
|
+
name: "items",
|
|
2821
|
+
type: "list",
|
|
2822
|
+
broadcast: true,
|
|
2823
|
+
subFields: [{
|
|
2824
|
+
name: "title",
|
|
2825
|
+
type: "uiBlocks",
|
|
2826
|
+
hideFromUI: true,
|
|
2827
|
+
defaultValue: [defaultTitle]
|
|
2828
|
+
}, {
|
|
2829
|
+
name: "detail",
|
|
2830
|
+
type: "uiBlocks",
|
|
2831
|
+
hideFromUI: true,
|
|
2832
|
+
defaultValue: [defaultDetail]
|
|
2833
|
+
}],
|
|
2834
|
+
defaultValue: [{
|
|
2835
|
+
title: [defaultTitle],
|
|
2836
|
+
detail: [defaultDetail]
|
|
2837
|
+
}, {
|
|
2838
|
+
title: [defaultTitle],
|
|
2839
|
+
detail: [defaultDetail]
|
|
2840
|
+
}],
|
|
2841
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
2842
|
+
}, {
|
|
2843
|
+
name: "oneAtATime",
|
|
2844
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
2845
|
+
type: "boolean",
|
|
2846
|
+
defaultValue: false
|
|
2847
|
+
}, {
|
|
2848
|
+
name: "grid",
|
|
2849
|
+
helperText: "Display as a grid",
|
|
2850
|
+
type: "boolean",
|
|
2851
|
+
defaultValue: false
|
|
2852
|
+
}, {
|
|
2853
|
+
name: "gridRowWidth",
|
|
2854
|
+
helperText: "Display as a grid",
|
|
2855
|
+
type: "string",
|
|
2856
|
+
showIf: (options) => options.get("grid"),
|
|
2857
|
+
defaultValue: "25%"
|
|
2858
|
+
}, {
|
|
2859
|
+
name: "useChildrenForItems",
|
|
2860
|
+
type: "boolean",
|
|
2861
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
2862
|
+
advanced: true,
|
|
2863
|
+
defaultValue: false,
|
|
2864
|
+
onChange: (options) => {
|
|
2865
|
+
if (options.get("useChildrenForItems") === true) {
|
|
2866
|
+
options.set("items", []);
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
}]
|
|
2870
|
+
};
|
|
2871
|
+
|
|
2872
|
+
// src/blocks/custom-code/component-info.ts
|
|
2873
|
+
var componentInfo11 = {
|
|
2599
2874
|
name: "Custom Code",
|
|
2600
2875
|
static: true,
|
|
2601
2876
|
requiredPermissions: ["editCode"],
|
|
@@ -2620,10 +2895,10 @@ var componentInfo10 = {
|
|
|
2620
2895
|
};
|
|
2621
2896
|
|
|
2622
2897
|
// src/blocks/custom-code/custom-code.tsx
|
|
2623
|
-
import { onMount as onMount2, createSignal as
|
|
2898
|
+
import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
|
|
2624
2899
|
function CustomCode(props) {
|
|
2625
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2626
|
-
const [scriptsRun, setScriptsRun] =
|
|
2900
|
+
const [scriptsInserted, setScriptsInserted] = createSignal11([]);
|
|
2901
|
+
const [scriptsRun, setScriptsRun] = createSignal11([]);
|
|
2627
2902
|
let elementRef;
|
|
2628
2903
|
onMount2(() => {
|
|
2629
2904
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
@@ -2666,7 +2941,7 @@ function CustomCode(props) {
|
|
|
2666
2941
|
var custom_code_default = CustomCode;
|
|
2667
2942
|
|
|
2668
2943
|
// src/blocks/embed/component-info.ts
|
|
2669
|
-
var
|
|
2944
|
+
var componentInfo12 = {
|
|
2670
2945
|
name: "Embed",
|
|
2671
2946
|
static: true,
|
|
2672
2947
|
inputs: [{
|
|
@@ -2704,7 +2979,7 @@ var componentInfo11 = {
|
|
|
2704
2979
|
};
|
|
2705
2980
|
|
|
2706
2981
|
// src/blocks/embed/embed.tsx
|
|
2707
|
-
import { on, createEffect, createMemo as
|
|
2982
|
+
import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
2708
2983
|
|
|
2709
2984
|
// src/blocks/embed/helpers.ts
|
|
2710
2985
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -2712,9 +2987,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
2712
2987
|
|
|
2713
2988
|
// src/blocks/embed/embed.tsx
|
|
2714
2989
|
function Embed(props) {
|
|
2715
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2716
|
-
const [scriptsRun, setScriptsRun] =
|
|
2717
|
-
const [ranInitFn, setRanInitFn] =
|
|
2990
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
2991
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
2992
|
+
const [ranInitFn, setRanInitFn] = createSignal12(false);
|
|
2718
2993
|
function findAndRunScripts() {
|
|
2719
2994
|
if (!elem || !elem.getElementsByTagName)
|
|
2720
2995
|
return;
|
|
@@ -2737,8 +3012,8 @@ function Embed(props) {
|
|
|
2737
3012
|
}
|
|
2738
3013
|
}
|
|
2739
3014
|
let elem;
|
|
2740
|
-
const onUpdateFn_0_elem =
|
|
2741
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
3015
|
+
const onUpdateFn_0_elem = createMemo12(() => elem);
|
|
3016
|
+
const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
|
|
2742
3017
|
function onUpdateFn_0() {
|
|
2743
3018
|
if (elem && !ranInitFn()) {
|
|
2744
3019
|
setRanInitFn(true);
|
|
@@ -2753,7 +3028,7 @@ function Embed(props) {
|
|
|
2753
3028
|
var embed_default = Embed;
|
|
2754
3029
|
|
|
2755
3030
|
// src/blocks/form/form/component-info.ts
|
|
2756
|
-
var
|
|
3031
|
+
var componentInfo13 = {
|
|
2757
3032
|
name: "Form:Form",
|
|
2758
3033
|
// editableTags: ['builder-form-error']
|
|
2759
3034
|
defaults: {
|
|
@@ -2987,7 +3262,7 @@ var componentInfo12 = {
|
|
|
2987
3262
|
};
|
|
2988
3263
|
|
|
2989
3264
|
// src/blocks/form/form/form.tsx
|
|
2990
|
-
import { Show as
|
|
3265
|
+
import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
|
|
2991
3266
|
import { css as css4 } from "solid-styled-components";
|
|
2992
3267
|
|
|
2993
3268
|
// src/functions/get-env.ts
|
|
@@ -3005,9 +3280,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
3005
3280
|
|
|
3006
3281
|
// src/blocks/form/form/form.tsx
|
|
3007
3282
|
function FormComponent(props) {
|
|
3008
|
-
const [formState, setFormState] =
|
|
3009
|
-
const [responseData, setResponseData] =
|
|
3010
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
3283
|
+
const [formState, setFormState] = createSignal13("unsubmitted");
|
|
3284
|
+
const [responseData, setResponseData] = createSignal13(null);
|
|
3285
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal13("");
|
|
3011
3286
|
function mergeNewRootState(newData) {
|
|
3012
3287
|
const combinedState = {
|
|
3013
3288
|
...props.builderContext.rootState,
|
|
@@ -3203,7 +3478,7 @@ function FormComponent(props) {
|
|
|
3203
3478
|
{...{}}
|
|
3204
3479
|
{...props.attributes}
|
|
3205
3480
|
>
|
|
3206
|
-
<
|
|
3481
|
+
<Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
|
|
3207
3482
|
const idx = _index();
|
|
3208
3483
|
return <Block_default
|
|
3209
3484
|
key={`form-block-${idx}`}
|
|
@@ -3212,35 +3487,35 @@ function FormComponent(props) {
|
|
|
3212
3487
|
registeredComponents={props.builderComponents}
|
|
3213
3488
|
linkComponent={props.builderLinkComponent}
|
|
3214
3489
|
/>;
|
|
3215
|
-
}}</
|
|
3216
|
-
<
|
|
3490
|
+
}}</For7></Show10>
|
|
3491
|
+
<Show10 when={submissionState() === "error"}><Blocks_default
|
|
3217
3492
|
path="errorMessage"
|
|
3218
3493
|
blocks={props.errorMessage}
|
|
3219
3494
|
context={props.builderContext}
|
|
3220
|
-
/></
|
|
3221
|
-
<
|
|
3495
|
+
/></Show10>
|
|
3496
|
+
<Show10 when={submissionState() === "sending"}><Blocks_default
|
|
3222
3497
|
path="sendingMessage"
|
|
3223
3498
|
blocks={props.sendingMessage}
|
|
3224
3499
|
context={props.builderContext}
|
|
3225
|
-
/></
|
|
3226
|
-
<
|
|
3500
|
+
/></Show10>
|
|
3501
|
+
<Show10 when={submissionState() === "error" && responseData()}><pre
|
|
3227
3502
|
class={"builder-form-error-text " + css4({
|
|
3228
3503
|
padding: "10px",
|
|
3229
3504
|
color: "red",
|
|
3230
3505
|
textAlign: "center"
|
|
3231
3506
|
})}
|
|
3232
|
-
>{JSON.stringify(responseData(), null, 2)}</pre></
|
|
3233
|
-
<
|
|
3507
|
+
>{JSON.stringify(responseData(), null, 2)}</pre></Show10>
|
|
3508
|
+
<Show10 when={submissionState() === "success"}><Blocks_default
|
|
3234
3509
|
path="successMessage"
|
|
3235
3510
|
blocks={props.successMessage}
|
|
3236
3511
|
context={props.builderContext}
|
|
3237
|
-
/></
|
|
3512
|
+
/></Show10>
|
|
3238
3513
|
</form>;
|
|
3239
3514
|
}
|
|
3240
3515
|
var form_default = FormComponent;
|
|
3241
3516
|
|
|
3242
3517
|
// src/blocks/form/input/component-info.ts
|
|
3243
|
-
var
|
|
3518
|
+
var componentInfo14 = {
|
|
3244
3519
|
name: "Form:Input",
|
|
3245
3520
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3246
3521
|
inputs: [
|
|
@@ -3310,7 +3585,7 @@ function FormInputComponent(props) {
|
|
|
3310
3585
|
var input_default = FormInputComponent;
|
|
3311
3586
|
|
|
3312
3587
|
// src/blocks/form/select/component-info.ts
|
|
3313
|
-
var
|
|
3588
|
+
var componentInfo15 = {
|
|
3314
3589
|
name: "Form:Select",
|
|
3315
3590
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3316
3591
|
defaultStyles: {
|
|
@@ -3355,7 +3630,7 @@ var componentInfo14 = {
|
|
|
3355
3630
|
};
|
|
3356
3631
|
|
|
3357
3632
|
// src/blocks/form/select/select.tsx
|
|
3358
|
-
import { For as
|
|
3633
|
+
import { For as For8 } from "solid-js";
|
|
3359
3634
|
function SelectComponent(props) {
|
|
3360
3635
|
return <select
|
|
3361
3636
|
{...{}}
|
|
@@ -3364,15 +3639,15 @@ function SelectComponent(props) {
|
|
|
3364
3639
|
key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
|
|
3365
3640
|
defaultValue={props.defaultValue}
|
|
3366
3641
|
name={props.name}
|
|
3367
|
-
><
|
|
3642
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
3368
3643
|
const index = _index();
|
|
3369
3644
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
3370
|
-
}}</
|
|
3645
|
+
}}</For8></select>;
|
|
3371
3646
|
}
|
|
3372
3647
|
var select_default = SelectComponent;
|
|
3373
3648
|
|
|
3374
3649
|
// src/blocks/form/submit-button/component-info.ts
|
|
3375
|
-
var
|
|
3650
|
+
var componentInfo16 = {
|
|
3376
3651
|
name: "Form:SubmitButton",
|
|
3377
3652
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3378
3653
|
defaultStyles: {
|
|
@@ -3406,7 +3681,7 @@ function SubmitButton(props) {
|
|
|
3406
3681
|
var submit_button_default = SubmitButton;
|
|
3407
3682
|
|
|
3408
3683
|
// src/blocks/img/component-info.ts
|
|
3409
|
-
var
|
|
3684
|
+
var componentInfo17 = {
|
|
3410
3685
|
// friendlyName?
|
|
3411
3686
|
name: "Raw:Img",
|
|
3412
3687
|
hideFromInsertMenu: true,
|
|
@@ -3439,7 +3714,7 @@ function ImgComponent(props) {
|
|
|
3439
3714
|
var img_default = ImgComponent;
|
|
3440
3715
|
|
|
3441
3716
|
// src/blocks/video/component-info.ts
|
|
3442
|
-
var
|
|
3717
|
+
var componentInfo18 = {
|
|
3443
3718
|
name: "Video",
|
|
3444
3719
|
canHaveChildren: true,
|
|
3445
3720
|
defaultStyles: {
|
|
@@ -3523,9 +3798,9 @@ var componentInfo17 = {
|
|
|
3523
3798
|
};
|
|
3524
3799
|
|
|
3525
3800
|
// src/blocks/video/video.tsx
|
|
3526
|
-
import { Show as
|
|
3801
|
+
import { Show as Show11, createMemo as createMemo14 } from "solid-js";
|
|
3527
3802
|
function Video(props) {
|
|
3528
|
-
const videoProps =
|
|
3803
|
+
const videoProps = createMemo14(() => {
|
|
3529
3804
|
return {
|
|
3530
3805
|
...props.autoPlay === true ? {
|
|
3531
3806
|
autoPlay: true
|
|
@@ -3544,7 +3819,7 @@ function Video(props) {
|
|
|
3544
3819
|
} : {}
|
|
3545
3820
|
};
|
|
3546
3821
|
});
|
|
3547
|
-
const spreadProps =
|
|
3822
|
+
const spreadProps = createMemo14(() => {
|
|
3548
3823
|
return {
|
|
3549
3824
|
...videoProps()
|
|
3550
3825
|
};
|
|
@@ -3574,8 +3849,8 @@ function Video(props) {
|
|
|
3574
3849
|
}}
|
|
3575
3850
|
src={props.video || "no-src"}
|
|
3576
3851
|
poster={props.posterImage}
|
|
3577
|
-
><
|
|
3578
|
-
<
|
|
3852
|
+
><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
|
|
3853
|
+
<Show11
|
|
3579
3854
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
3580
3855
|
><div
|
|
3581
3856
|
style={{
|
|
@@ -3584,15 +3859,15 @@ function Video(props) {
|
|
|
3584
3859
|
"pointer-events": "none",
|
|
3585
3860
|
"font-size": "0px"
|
|
3586
3861
|
}}
|
|
3587
|
-
/></
|
|
3588
|
-
<
|
|
3862
|
+
/></Show11>
|
|
3863
|
+
<Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
3589
3864
|
style={{
|
|
3590
3865
|
display: "flex",
|
|
3591
3866
|
"flex-direction": "column",
|
|
3592
3867
|
"align-items": "stretch"
|
|
3593
3868
|
}}
|
|
3594
|
-
>{props.children}</div></
|
|
3595
|
-
<
|
|
3869
|
+
>{props.children}</div></Show11>
|
|
3870
|
+
<Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
3596
3871
|
style={{
|
|
3597
3872
|
"pointer-events": "none",
|
|
3598
3873
|
display: "flex",
|
|
@@ -3604,7 +3879,7 @@ function Video(props) {
|
|
|
3604
3879
|
width: "100%",
|
|
3605
3880
|
height: "100%"
|
|
3606
3881
|
}}
|
|
3607
|
-
>{props.children}</div></
|
|
3882
|
+
>{props.children}</div></Show11>
|
|
3608
3883
|
</div>;
|
|
3609
3884
|
}
|
|
3610
3885
|
var video_default = Video;
|
|
@@ -3612,28 +3887,28 @@ var video_default = Video;
|
|
|
3612
3887
|
// src/constants/extra-components.ts
|
|
3613
3888
|
var getExtraComponents = () => [{
|
|
3614
3889
|
component: custom_code_default,
|
|
3615
|
-
...
|
|
3890
|
+
...componentInfo11
|
|
3616
3891
|
}, {
|
|
3617
3892
|
component: embed_default,
|
|
3618
|
-
...
|
|
3893
|
+
...componentInfo12
|
|
3619
3894
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3620
3895
|
component: form_default,
|
|
3621
|
-
...
|
|
3896
|
+
...componentInfo13
|
|
3622
3897
|
}, {
|
|
3623
3898
|
component: input_default,
|
|
3624
|
-
...
|
|
3899
|
+
...componentInfo14
|
|
3625
3900
|
}, {
|
|
3626
3901
|
component: submit_button_default,
|
|
3627
|
-
...
|
|
3902
|
+
...componentInfo16
|
|
3628
3903
|
}, {
|
|
3629
3904
|
component: select_default,
|
|
3630
|
-
...
|
|
3905
|
+
...componentInfo15
|
|
3631
3906
|
}], {
|
|
3632
3907
|
component: img_default,
|
|
3633
|
-
...
|
|
3908
|
+
...componentInfo17
|
|
3634
3909
|
}, {
|
|
3635
3910
|
component: video_default,
|
|
3636
|
-
...
|
|
3911
|
+
...componentInfo18
|
|
3637
3912
|
}];
|
|
3638
3913
|
|
|
3639
3914
|
// src/constants/builder-registered-components.ts
|
|
@@ -3664,6 +3939,9 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3664
3939
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3665
3940
|
component: tabs_default,
|
|
3666
3941
|
...componentInfo8
|
|
3942
|
+
}, {
|
|
3943
|
+
component: accordion_default,
|
|
3944
|
+
...componentInfo10
|
|
3667
3945
|
}], ...getExtraComponents()];
|
|
3668
3946
|
|
|
3669
3947
|
// src/functions/register-component.ts
|
|
@@ -3742,12 +4020,12 @@ var Inlined_script_default = InlinedScript;
|
|
|
3742
4020
|
|
|
3743
4021
|
// src/components/content/components/enable-editor.tsx
|
|
3744
4022
|
import {
|
|
3745
|
-
Show as
|
|
4023
|
+
Show as Show12,
|
|
3746
4024
|
onMount as onMount3,
|
|
3747
4025
|
on as on2,
|
|
3748
4026
|
createEffect as createEffect2,
|
|
3749
|
-
createMemo as
|
|
3750
|
-
createSignal as
|
|
4027
|
+
createMemo as createMemo15,
|
|
4028
|
+
createSignal as createSignal15
|
|
3751
4029
|
} from "solid-js";
|
|
3752
4030
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
3753
4031
|
|
|
@@ -3798,6 +4076,18 @@ function flatten(object, path = null, separator = ".") {
|
|
|
3798
4076
|
};
|
|
3799
4077
|
}, {});
|
|
3800
4078
|
}
|
|
4079
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
4080
|
+
for (const key in obj) {
|
|
4081
|
+
const value = obj[key];
|
|
4082
|
+
const newKey = _current ? _current + "." + key : key;
|
|
4083
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$"))) {
|
|
4084
|
+
flattenMongoQuery(value, newKey, _res);
|
|
4085
|
+
} else {
|
|
4086
|
+
_res[newKey] = value;
|
|
4087
|
+
}
|
|
4088
|
+
}
|
|
4089
|
+
return _res;
|
|
4090
|
+
}
|
|
3801
4091
|
|
|
3802
4092
|
// src/types/api-version.ts
|
|
3803
4093
|
var DEFAULT_API_VERSION = "v3";
|
|
@@ -3899,7 +4189,7 @@ var generateContentUrl = (options) => {
|
|
|
3899
4189
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
3900
4190
|
}
|
|
3901
4191
|
if (query) {
|
|
3902
|
-
const flattened2 =
|
|
4192
|
+
const flattened2 = flattenMongoQuery({
|
|
3903
4193
|
query
|
|
3904
4194
|
});
|
|
3905
4195
|
for (const key in flattened2) {
|
|
@@ -4230,7 +4520,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4230
4520
|
}
|
|
4231
4521
|
|
|
4232
4522
|
// src/constants/sdk-version.ts
|
|
4233
|
-
var SDK_VERSION = "1.0.
|
|
4523
|
+
var SDK_VERSION = "1.0.28";
|
|
4234
4524
|
|
|
4235
4525
|
// src/functions/register.ts
|
|
4236
4526
|
var registry = {};
|
|
@@ -4507,12 +4797,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
4507
4797
|
|
|
4508
4798
|
// src/components/content/components/enable-editor.tsx
|
|
4509
4799
|
function EnableEditor(props) {
|
|
4510
|
-
const [ContentWrapper, setContentWrapper] =
|
|
4800
|
+
const [ContentWrapper, setContentWrapper] = createSignal15(
|
|
4511
4801
|
props.contentWrapper || "div"
|
|
4512
4802
|
);
|
|
4513
|
-
const [httpReqsData, setHttpReqsData] =
|
|
4514
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
4515
|
-
const [clicked, setClicked] =
|
|
4803
|
+
const [httpReqsData, setHttpReqsData] = createSignal15({});
|
|
4804
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal15({});
|
|
4805
|
+
const [clicked, setClicked] = createSignal15(false);
|
|
4516
4806
|
function mergeNewRootState(newData) {
|
|
4517
4807
|
const combinedState = {
|
|
4518
4808
|
...props.builderContextSignal.rootState,
|
|
@@ -4546,7 +4836,7 @@ function EnableEditor(props) {
|
|
|
4546
4836
|
content: newContentValue
|
|
4547
4837
|
}));
|
|
4548
4838
|
}
|
|
4549
|
-
const showContentProps =
|
|
4839
|
+
const showContentProps = createMemo15(() => {
|
|
4550
4840
|
return props.showContent ? {} : {
|
|
4551
4841
|
hidden: true,
|
|
4552
4842
|
"aria-hidden": true
|
|
@@ -4729,21 +5019,21 @@ function EnableEditor(props) {
|
|
|
4729
5019
|
onMount3(() => {
|
|
4730
5020
|
if (!props.apiKey) {
|
|
4731
5021
|
logger.error(
|
|
4732
|
-
"No API key provided to `
|
|
5022
|
+
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
4733
5023
|
);
|
|
4734
5024
|
}
|
|
4735
5025
|
evaluateJsCode();
|
|
4736
5026
|
runHttpRequests();
|
|
4737
5027
|
emitStateUpdate();
|
|
4738
5028
|
});
|
|
4739
|
-
const onUpdateFn_0_props_content =
|
|
5029
|
+
const onUpdateFn_0_props_content = createMemo15(() => props.content);
|
|
4740
5030
|
function onUpdateFn_0() {
|
|
4741
5031
|
if (props.content) {
|
|
4742
5032
|
mergeNewContent(props.content);
|
|
4743
5033
|
}
|
|
4744
5034
|
}
|
|
4745
5035
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4746
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
5036
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4747
5037
|
function onUpdateFn_1() {
|
|
4748
5038
|
evaluateJsCode();
|
|
4749
5039
|
}
|
|
@@ -4753,7 +5043,7 @@ function EnableEditor(props) {
|
|
|
4753
5043
|
onUpdateFn_1
|
|
4754
5044
|
)
|
|
4755
5045
|
);
|
|
4756
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
5046
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4757
5047
|
function onUpdateFn_2() {
|
|
4758
5048
|
runHttpRequests();
|
|
4759
5049
|
}
|
|
@@ -4765,7 +5055,7 @@ function EnableEditor(props) {
|
|
|
4765
5055
|
onUpdateFn_2
|
|
4766
5056
|
)
|
|
4767
5057
|
);
|
|
4768
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
5058
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
|
|
4769
5059
|
() => props.builderContextSignal.rootState
|
|
4770
5060
|
);
|
|
4771
5061
|
function onUpdateFn_3() {
|
|
@@ -4777,14 +5067,14 @@ function EnableEditor(props) {
|
|
|
4777
5067
|
onUpdateFn_3
|
|
4778
5068
|
)
|
|
4779
5069
|
);
|
|
4780
|
-
const onUpdateFn_4_props_data =
|
|
5070
|
+
const onUpdateFn_4_props_data = createMemo15(() => props.data);
|
|
4781
5071
|
function onUpdateFn_4() {
|
|
4782
5072
|
if (props.data) {
|
|
4783
5073
|
mergeNewRootState(props.data);
|
|
4784
5074
|
}
|
|
4785
5075
|
}
|
|
4786
5076
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4787
|
-
const onUpdateFn_5_props_locale =
|
|
5077
|
+
const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
|
|
4788
5078
|
function onUpdateFn_5() {
|
|
4789
5079
|
if (props.locale) {
|
|
4790
5080
|
mergeNewRootState({
|
|
@@ -4793,7 +5083,7 @@ function EnableEditor(props) {
|
|
|
4793
5083
|
}
|
|
4794
5084
|
}
|
|
4795
5085
|
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4796
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
5086
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
|
|
4797
5087
|
class={getWrapperClassName(
|
|
4798
5088
|
props.content?.testVariationId || props.content?.id
|
|
4799
5089
|
)}
|
|
@@ -4806,14 +5096,14 @@ function EnableEditor(props) {
|
|
|
4806
5096
|
{...showContentProps()}
|
|
4807
5097
|
{...props.contentWrapperProps}
|
|
4808
5098
|
component={ContentWrapper()}
|
|
4809
|
-
>{props.children}</Dynamic5></
|
|
5099
|
+
>{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
|
|
4810
5100
|
}
|
|
4811
5101
|
var Enable_editor_default = EnableEditor;
|
|
4812
5102
|
|
|
4813
5103
|
// src/components/content/components/styles.tsx
|
|
4814
|
-
import { createSignal as
|
|
5104
|
+
import { createSignal as createSignal16 } from "solid-js";
|
|
4815
5105
|
function ContentStyles(props) {
|
|
4816
|
-
const [injectedStyles, setInjectedStyles] =
|
|
5106
|
+
const [injectedStyles, setInjectedStyles] = createSignal16(
|
|
4817
5107
|
`
|
|
4818
5108
|
${getCss({
|
|
4819
5109
|
cssCode: props.cssCode,
|
|
@@ -4870,7 +5160,7 @@ var getContentInitialValue = ({
|
|
|
4870
5160
|
|
|
4871
5161
|
// src/components/content/content.tsx
|
|
4872
5162
|
function ContentComponent(props) {
|
|
4873
|
-
const [scriptStr, setScriptStr] =
|
|
5163
|
+
const [scriptStr, setScriptStr] = createSignal17(
|
|
4874
5164
|
getUpdateVariantVisibilityScript({
|
|
4875
5165
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
4876
5166
|
variationId: props.content?.testVariationId,
|
|
@@ -4878,7 +5168,7 @@ function ContentComponent(props) {
|
|
|
4878
5168
|
contentId: props.content?.id
|
|
4879
5169
|
})
|
|
4880
5170
|
);
|
|
4881
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
5171
|
+
const [registeredComponents, setRegisteredComponents] = createSignal17(
|
|
4882
5172
|
[
|
|
4883
5173
|
...getDefaultRegisteredComponents(),
|
|
4884
5174
|
...props.customComponents || []
|
|
@@ -4893,7 +5183,7 @@ function ContentComponent(props) {
|
|
|
4893
5183
|
{}
|
|
4894
5184
|
)
|
|
4895
5185
|
);
|
|
4896
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
5186
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal17({
|
|
4897
5187
|
content: getContentInitialValue({
|
|
4898
5188
|
content: props.content,
|
|
4899
5189
|
data: props.data
|
|
@@ -4951,16 +5241,16 @@ function ContentComponent(props) {
|
|
|
4951
5241
|
setBuilderContextSignal
|
|
4952
5242
|
}}
|
|
4953
5243
|
>
|
|
4954
|
-
<
|
|
5244
|
+
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
4955
5245
|
id="builderio-variant-visibility"
|
|
4956
5246
|
scriptStr={scriptStr()}
|
|
4957
|
-
/></
|
|
4958
|
-
<
|
|
5247
|
+
/></Show13>
|
|
5248
|
+
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
4959
5249
|
isNestedRender={props.isNestedRender}
|
|
4960
5250
|
contentId={builderContextSignal().content?.id}
|
|
4961
5251
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
4962
5252
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
4963
|
-
/></
|
|
5253
|
+
/></Show13>
|
|
4964
5254
|
<Blocks_default
|
|
4965
5255
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
4966
5256
|
context={builderContextSignal()}
|
|
@@ -4973,13 +5263,13 @@ var Content_default = ContentComponent;
|
|
|
4973
5263
|
|
|
4974
5264
|
// src/components/content-variants/content-variants.tsx
|
|
4975
5265
|
function ContentVariants(props) {
|
|
4976
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
5266
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
|
|
4977
5267
|
checkShouldRenderVariants({
|
|
4978
5268
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
4979
5269
|
content: props.content
|
|
4980
5270
|
})
|
|
4981
5271
|
);
|
|
4982
|
-
const updateCookieAndStylesScriptStr =
|
|
5272
|
+
const updateCookieAndStylesScriptStr = createMemo18(() => {
|
|
4983
5273
|
return getUpdateCookieAndStylesScript(
|
|
4984
5274
|
getVariants(props.content).map((value) => ({
|
|
4985
5275
|
id: value.testVariationId,
|
|
@@ -4988,10 +5278,10 @@ function ContentVariants(props) {
|
|
|
4988
5278
|
props.content?.id || ""
|
|
4989
5279
|
);
|
|
4990
5280
|
});
|
|
4991
|
-
const hideVariantsStyleString =
|
|
5281
|
+
const hideVariantsStyleString = createMemo18(() => {
|
|
4992
5282
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
4993
5283
|
});
|
|
4994
|
-
const defaultContent =
|
|
5284
|
+
const defaultContent = createMemo18(() => {
|
|
4995
5285
|
return shouldRenderVariants() ? {
|
|
4996
5286
|
...props.content,
|
|
4997
5287
|
testVariationId: props.content?.id
|
|
@@ -5004,11 +5294,11 @@ function ContentVariants(props) {
|
|
|
5004
5294
|
setShouldRenderVariants(false);
|
|
5005
5295
|
});
|
|
5006
5296
|
return <>
|
|
5007
|
-
<
|
|
5297
|
+
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5008
5298
|
id="builderio-init-variants-fns"
|
|
5009
5299
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5010
|
-
/></
|
|
5011
|
-
<
|
|
5300
|
+
/></Show14>
|
|
5301
|
+
<Show14 when={shouldRenderVariants()}>
|
|
5012
5302
|
<Inlined_styles_default
|
|
5013
5303
|
id="builderio-variants"
|
|
5014
5304
|
styles={hideVariantsStyleString()}
|
|
@@ -5017,7 +5307,7 @@ function ContentVariants(props) {
|
|
|
5017
5307
|
id="builderio-variants-visibility"
|
|
5018
5308
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5019
5309
|
/>
|
|
5020
|
-
<
|
|
5310
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5021
5311
|
const index = _index();
|
|
5022
5312
|
return <Content_default
|
|
5023
5313
|
isNestedRender={props.isNestedRender}
|
|
@@ -5041,8 +5331,8 @@ function ContentVariants(props) {
|
|
|
5041
5331
|
contentWrapperProps={props.contentWrapperProps}
|
|
5042
5332
|
trustedHosts={props.trustedHosts}
|
|
5043
5333
|
/>;
|
|
5044
|
-
}}</
|
|
5045
|
-
</
|
|
5334
|
+
}}</For9>
|
|
5335
|
+
</Show14>
|
|
5046
5336
|
<Content_default
|
|
5047
5337
|
isNestedRender={props.isNestedRender}
|
|
5048
5338
|
{...{}}
|
|
@@ -5095,14 +5385,14 @@ var fetchSymbolContent = async ({
|
|
|
5095
5385
|
|
|
5096
5386
|
// src/blocks/symbol/symbol.tsx
|
|
5097
5387
|
function Symbol(props) {
|
|
5098
|
-
const [contentToUse, setContentToUse] =
|
|
5099
|
-
const blocksWrapper =
|
|
5388
|
+
const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
|
|
5389
|
+
const blocksWrapper = createMemo19(() => {
|
|
5100
5390
|
return "div";
|
|
5101
5391
|
});
|
|
5102
|
-
const contentWrapper =
|
|
5392
|
+
const contentWrapper = createMemo19(() => {
|
|
5103
5393
|
return "div";
|
|
5104
5394
|
});
|
|
5105
|
-
const className =
|
|
5395
|
+
const className = createMemo19(() => {
|
|
5106
5396
|
return [
|
|
5107
5397
|
...[props.attributes[getClassPropName()]],
|
|
5108
5398
|
"builder-symbol",
|
|
@@ -5124,7 +5414,7 @@ function Symbol(props) {
|
|
|
5124
5414
|
}
|
|
5125
5415
|
onMount5(() => {
|
|
5126
5416
|
});
|
|
5127
|
-
const onUpdateFn_0_props_symbol =
|
|
5417
|
+
const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
|
|
5128
5418
|
function onUpdateFn_0() {
|
|
5129
5419
|
setContent();
|
|
5130
5420
|
}
|