@builder.io/sdk-solid 1.0.27 → 1.0.29
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 +409 -95
- package/lib/browser/dev.jsx +421 -144
- package/lib/browser/index.js +409 -95
- package/lib/browser/index.jsx +421 -144
- package/lib/edge/dev.js +409 -95
- package/lib/edge/dev.jsx +421 -144
- package/lib/edge/index.js +409 -95
- package/lib/edge/index.jsx +421 -144
- package/lib/node/dev.js +409 -95
- package/lib/node/dev.jsx +421 -144
- package/lib/node/index.js +409 -95
- package/lib/node/index.jsx +421 -144
- package/package.json +3 -3
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,10 +1864,286 @@ 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
|
-
// src/blocks/
|
|
1869
|
+
// src/blocks/accordion/component-info.ts
|
|
1870
|
+
var defaultTitle = {
|
|
1871
|
+
"@type": "@builder.io/sdk:Element",
|
|
1872
|
+
layerName: "Accordion item title",
|
|
1873
|
+
responsiveStyles: {
|
|
1874
|
+
large: {
|
|
1875
|
+
marginTop: "10px",
|
|
1876
|
+
position: "relative",
|
|
1877
|
+
display: "flex",
|
|
1878
|
+
alignItems: "stretch",
|
|
1879
|
+
flexDirection: "column",
|
|
1880
|
+
paddingBottom: "10px"
|
|
1881
|
+
}
|
|
1882
|
+
},
|
|
1883
|
+
children: [{
|
|
1884
|
+
"@type": "@builder.io/sdk:Element",
|
|
1885
|
+
responsiveStyles: {
|
|
1886
|
+
large: {
|
|
1887
|
+
textAlign: "left",
|
|
1888
|
+
display: "flex",
|
|
1889
|
+
flexDirection: "column"
|
|
1890
|
+
}
|
|
1891
|
+
},
|
|
1892
|
+
component: {
|
|
1893
|
+
name: "Text",
|
|
1894
|
+
options: {
|
|
1895
|
+
text: "I am an accordion title. Click me!"
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
}]
|
|
1899
|
+
};
|
|
1900
|
+
var defaultDetail = {
|
|
1901
|
+
"@type": "@builder.io/sdk:Element",
|
|
1902
|
+
layerName: "Accordion item detail",
|
|
1903
|
+
responsiveStyles: {
|
|
1904
|
+
large: {
|
|
1905
|
+
position: "relative",
|
|
1906
|
+
display: "flex",
|
|
1907
|
+
alignItems: "stretch",
|
|
1908
|
+
flexDirection: "column",
|
|
1909
|
+
marginTop: "10px",
|
|
1910
|
+
paddingBottom: "10px"
|
|
1911
|
+
}
|
|
1912
|
+
},
|
|
1913
|
+
children: [{
|
|
1914
|
+
"@type": "@builder.io/sdk:Element",
|
|
1915
|
+
responsiveStyles: {
|
|
1916
|
+
large: {
|
|
1917
|
+
paddingTop: "50px",
|
|
1918
|
+
textAlign: "left",
|
|
1919
|
+
display: "flex",
|
|
1920
|
+
flexDirection: "column",
|
|
1921
|
+
paddingBottom: "50px"
|
|
1922
|
+
}
|
|
1923
|
+
},
|
|
1924
|
+
component: {
|
|
1925
|
+
name: "Text",
|
|
1926
|
+
options: {
|
|
1927
|
+
text: "I am an accordion detail, hello!"
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
}]
|
|
1931
|
+
};
|
|
1871
1932
|
var componentInfo = {
|
|
1933
|
+
name: "Builder:Accordion",
|
|
1934
|
+
canHaveChildren: true,
|
|
1935
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
1936
|
+
defaultStyles: {
|
|
1937
|
+
display: "flex",
|
|
1938
|
+
flexDirection: "column",
|
|
1939
|
+
alignItems: "stretch"
|
|
1940
|
+
},
|
|
1941
|
+
inputs: [{
|
|
1942
|
+
name: "items",
|
|
1943
|
+
type: "list",
|
|
1944
|
+
broadcast: true,
|
|
1945
|
+
subFields: [{
|
|
1946
|
+
name: "title",
|
|
1947
|
+
type: "uiBlocks",
|
|
1948
|
+
hideFromUI: true,
|
|
1949
|
+
defaultValue: [defaultTitle]
|
|
1950
|
+
}, {
|
|
1951
|
+
name: "detail",
|
|
1952
|
+
type: "uiBlocks",
|
|
1953
|
+
hideFromUI: true,
|
|
1954
|
+
defaultValue: [defaultDetail]
|
|
1955
|
+
}],
|
|
1956
|
+
defaultValue: [{
|
|
1957
|
+
title: [defaultTitle],
|
|
1958
|
+
detail: [defaultDetail]
|
|
1959
|
+
}, {
|
|
1960
|
+
title: [defaultTitle],
|
|
1961
|
+
detail: [defaultDetail]
|
|
1962
|
+
}],
|
|
1963
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
1964
|
+
}, {
|
|
1965
|
+
name: "oneAtATime",
|
|
1966
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
1967
|
+
type: "boolean",
|
|
1968
|
+
defaultValue: false
|
|
1969
|
+
}, {
|
|
1970
|
+
name: "grid",
|
|
1971
|
+
helperText: "Display as a grid",
|
|
1972
|
+
type: "boolean",
|
|
1973
|
+
defaultValue: false
|
|
1974
|
+
}, {
|
|
1975
|
+
name: "gridRowWidth",
|
|
1976
|
+
helperText: "Display as a grid",
|
|
1977
|
+
type: "string",
|
|
1978
|
+
showIf: (options) => options.get("grid"),
|
|
1979
|
+
defaultValue: "25%"
|
|
1980
|
+
}, {
|
|
1981
|
+
name: "useChildrenForItems",
|
|
1982
|
+
type: "boolean",
|
|
1983
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
1984
|
+
advanced: true,
|
|
1985
|
+
defaultValue: false,
|
|
1986
|
+
onChange: (options) => {
|
|
1987
|
+
if (options.get("useChildrenForItems") === true) {
|
|
1988
|
+
options.set("items", []);
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
}]
|
|
1992
|
+
};
|
|
1993
|
+
|
|
1994
|
+
// src/blocks/accordion/accordion.tsx
|
|
1995
|
+
import { Show as Show8, For as For5, createSignal as createSignal9, createMemo as createMemo9 } from "solid-js";
|
|
1996
|
+
|
|
1997
|
+
// src/blocks/accordion/helpers.ts
|
|
1998
|
+
var convertOrderNumberToString = (order) => {
|
|
1999
|
+
return order.toString();
|
|
2000
|
+
};
|
|
2001
|
+
|
|
2002
|
+
// src/blocks/accordion/accordion.tsx
|
|
2003
|
+
function Accordion(props) {
|
|
2004
|
+
const [open, setOpen] = createSignal9([]);
|
|
2005
|
+
const onlyOneAtATime = createMemo9(() => {
|
|
2006
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
2007
|
+
});
|
|
2008
|
+
const accordionStyles = createMemo9(() => {
|
|
2009
|
+
const styles = {
|
|
2010
|
+
display: "flex",
|
|
2011
|
+
alignItems: "stretch",
|
|
2012
|
+
flexDirection: "column",
|
|
2013
|
+
...props.grid && {
|
|
2014
|
+
flexDirection: "row",
|
|
2015
|
+
alignItems: "flex-start",
|
|
2016
|
+
flexWrap: "wrap"
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
return Object.fromEntries(
|
|
2020
|
+
Object.entries(styles).map(([key, value]) => [
|
|
2021
|
+
camelToKebabCase(key),
|
|
2022
|
+
value
|
|
2023
|
+
])
|
|
2024
|
+
);
|
|
2025
|
+
});
|
|
2026
|
+
const accordionTitleStyles = createMemo9(() => {
|
|
2027
|
+
const shared = {
|
|
2028
|
+
display: "flex",
|
|
2029
|
+
flexDirection: "column"
|
|
2030
|
+
};
|
|
2031
|
+
const styles = Object.fromEntries(
|
|
2032
|
+
Object.entries({
|
|
2033
|
+
...shared,
|
|
2034
|
+
alignItems: "stretch",
|
|
2035
|
+
cursor: "pointer"
|
|
2036
|
+
}).map(([key, value]) => [camelToKebabCase(key), value])
|
|
2037
|
+
);
|
|
2038
|
+
return Object.fromEntries(
|
|
2039
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2040
|
+
);
|
|
2041
|
+
});
|
|
2042
|
+
function getAccordionTitleClassName(index) {
|
|
2043
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
2044
|
+
}
|
|
2045
|
+
function getAccordionDetailClassName(index) {
|
|
2046
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
2047
|
+
}
|
|
2048
|
+
const openGridItemOrder = createMemo9(() => {
|
|
2049
|
+
let itemOrder = null;
|
|
2050
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
2051
|
+
if (getOpenGridItemPosition && document) {
|
|
2052
|
+
const openItemIndex = open()[0];
|
|
2053
|
+
const openItem = document.querySelector(
|
|
2054
|
+
`.builder-accordion-title[data-index="${openItemIndex}"]`
|
|
2055
|
+
);
|
|
2056
|
+
let subjectItem = openItem;
|
|
2057
|
+
itemOrder = openItemIndex;
|
|
2058
|
+
if (subjectItem) {
|
|
2059
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
2060
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
2061
|
+
if (subjectItem) {
|
|
2062
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
2063
|
+
continue;
|
|
2064
|
+
}
|
|
2065
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
2066
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
2067
|
+
const index = parseInt(
|
|
2068
|
+
subjectItem.getAttribute("data-index") || "",
|
|
2069
|
+
10
|
|
2070
|
+
);
|
|
2071
|
+
if (!isNaN(index)) {
|
|
2072
|
+
prevItemRect = subjectItemRect;
|
|
2073
|
+
itemOrder = index;
|
|
2074
|
+
}
|
|
2075
|
+
} else {
|
|
2076
|
+
break;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
if (typeof itemOrder === "number") {
|
|
2083
|
+
itemOrder = itemOrder + 1;
|
|
2084
|
+
}
|
|
2085
|
+
return itemOrder;
|
|
2086
|
+
});
|
|
2087
|
+
const accordionDetailStyles = createMemo9(() => {
|
|
2088
|
+
const styles = {
|
|
2089
|
+
...{
|
|
2090
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
2091
|
+
},
|
|
2092
|
+
...props.grid && {
|
|
2093
|
+
width: "100%"
|
|
2094
|
+
}
|
|
2095
|
+
};
|
|
2096
|
+
return Object.fromEntries(
|
|
2097
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2098
|
+
);
|
|
2099
|
+
});
|
|
2100
|
+
function onClick(index) {
|
|
2101
|
+
if (open().includes(index)) {
|
|
2102
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
2103
|
+
} else {
|
|
2104
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
return <div class="builder-accordion" style={accordionStyles()}><For5 each={props.items}>{(item, _index) => {
|
|
2108
|
+
const index = _index();
|
|
2109
|
+
return <>
|
|
2110
|
+
<div
|
|
2111
|
+
class={getAccordionTitleClassName(index)}
|
|
2112
|
+
style={{
|
|
2113
|
+
...accordionTitleStyles(),
|
|
2114
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
2115
|
+
...{
|
|
2116
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
2117
|
+
}
|
|
2118
|
+
}}
|
|
2119
|
+
data-index={index}
|
|
2120
|
+
onClick={(event) => onClick(index)}
|
|
2121
|
+
><Blocks_default
|
|
2122
|
+
blocks={item.title}
|
|
2123
|
+
path={`items.${index}.title`}
|
|
2124
|
+
parent={props.builderBlock.id}
|
|
2125
|
+
context={props.builderContext}
|
|
2126
|
+
registeredComponents={props.builderComponents}
|
|
2127
|
+
linkComponent={props.builderLinkComponent}
|
|
2128
|
+
/></div>
|
|
2129
|
+
<Show8 when={open().includes(index)}><div
|
|
2130
|
+
class={getAccordionDetailClassName(index)}
|
|
2131
|
+
style={accordionDetailStyles()}
|
|
2132
|
+
><Blocks_default
|
|
2133
|
+
blocks={item.detail}
|
|
2134
|
+
path={`items.${index}.detail`}
|
|
2135
|
+
parent={props.builderBlock.id}
|
|
2136
|
+
context={props.builderContext}
|
|
2137
|
+
registeredComponents={props.builderComponents}
|
|
2138
|
+
linkComponent={props.builderLinkComponent}
|
|
2139
|
+
/></div></Show8>
|
|
2140
|
+
</>;
|
|
2141
|
+
}}</For5></div>;
|
|
2142
|
+
}
|
|
2143
|
+
var accordion_default = Accordion;
|
|
2144
|
+
|
|
2145
|
+
// src/blocks/button/component-info.ts
|
|
2146
|
+
var componentInfo2 = {
|
|
1872
2147
|
name: "Core:Button",
|
|
1873
2148
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
1874
2149
|
defaultStyles: {
|
|
@@ -1904,7 +2179,7 @@ var componentInfo = {
|
|
|
1904
2179
|
};
|
|
1905
2180
|
|
|
1906
2181
|
// src/blocks/columns/component-info.ts
|
|
1907
|
-
var
|
|
2182
|
+
var componentInfo3 = {
|
|
1908
2183
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
1909
2184
|
name: "Columns",
|
|
1910
2185
|
isRSC: true,
|
|
@@ -2124,7 +2399,7 @@ var componentInfo2 = {
|
|
|
2124
2399
|
};
|
|
2125
2400
|
|
|
2126
2401
|
// src/blocks/fragment/component-info.ts
|
|
2127
|
-
var
|
|
2402
|
+
var componentInfo4 = {
|
|
2128
2403
|
name: "Fragment",
|
|
2129
2404
|
static: true,
|
|
2130
2405
|
hidden: true,
|
|
@@ -2133,7 +2408,7 @@ var componentInfo3 = {
|
|
|
2133
2408
|
};
|
|
2134
2409
|
|
|
2135
2410
|
// src/blocks/image/component-info.ts
|
|
2136
|
-
var
|
|
2411
|
+
var componentInfo5 = {
|
|
2137
2412
|
name: "Image",
|
|
2138
2413
|
static: true,
|
|
2139
2414
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -2255,7 +2530,7 @@ var componentInfo4 = {
|
|
|
2255
2530
|
};
|
|
2256
2531
|
|
|
2257
2532
|
// src/blocks/section/component-info.ts
|
|
2258
|
-
var
|
|
2533
|
+
var componentInfo6 = {
|
|
2259
2534
|
name: "Core:Section",
|
|
2260
2535
|
static: true,
|
|
2261
2536
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2297,7 +2572,7 @@ var componentInfo5 = {
|
|
|
2297
2572
|
};
|
|
2298
2573
|
|
|
2299
2574
|
// src/blocks/slot/component-info.ts
|
|
2300
|
-
var
|
|
2575
|
+
var componentInfo7 = {
|
|
2301
2576
|
name: "Slot",
|
|
2302
2577
|
isRSC: true,
|
|
2303
2578
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -2331,7 +2606,7 @@ function Slot(props) {
|
|
|
2331
2606
|
var slot_default = Slot;
|
|
2332
2607
|
|
|
2333
2608
|
// src/blocks/symbol/component-info.ts
|
|
2334
|
-
var
|
|
2609
|
+
var componentInfo8 = {
|
|
2335
2610
|
name: "Symbol",
|
|
2336
2611
|
noWrap: true,
|
|
2337
2612
|
static: true,
|
|
@@ -2407,7 +2682,7 @@ var defaultElement = {
|
|
|
2407
2682
|
}
|
|
2408
2683
|
}
|
|
2409
2684
|
};
|
|
2410
|
-
var
|
|
2685
|
+
var componentInfo9 = {
|
|
2411
2686
|
name: "Builder: Tabs",
|
|
2412
2687
|
inputs: [{
|
|
2413
2688
|
name: "tabs",
|
|
@@ -2507,16 +2782,20 @@ var componentInfo8 = {
|
|
|
2507
2782
|
};
|
|
2508
2783
|
|
|
2509
2784
|
// src/blocks/tabs/tabs.tsx
|
|
2510
|
-
import { Show as
|
|
2785
|
+
import { Show as Show9, For as For6, createSignal as createSignal10 } from "solid-js";
|
|
2511
2786
|
function Tabs(props) {
|
|
2512
|
-
const [activeTab, setActiveTab] =
|
|
2787
|
+
const [activeTab, setActiveTab] = createSignal10(
|
|
2513
2788
|
props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
|
|
2514
2789
|
);
|
|
2515
2790
|
function activeTabContent(active) {
|
|
2516
2791
|
return props.tabs && props.tabs[active].content;
|
|
2517
2792
|
}
|
|
2518
|
-
function
|
|
2519
|
-
|
|
2793
|
+
function onClick(index) {
|
|
2794
|
+
if (index === activeTab() && props.collapsible) {
|
|
2795
|
+
setActiveTab(-1);
|
|
2796
|
+
} else {
|
|
2797
|
+
setActiveTab(index);
|
|
2798
|
+
}
|
|
2520
2799
|
}
|
|
2521
2800
|
return <div>
|
|
2522
2801
|
<div
|
|
@@ -2527,19 +2806,15 @@ function Tabs(props) {
|
|
|
2527
2806
|
"justify-content": props.tabHeaderLayout || "flex-start",
|
|
2528
2807
|
overflow: "auto"
|
|
2529
2808
|
}}
|
|
2530
|
-
><
|
|
2809
|
+
><For6 each={props.tabs}>{(tab, _index) => {
|
|
2531
2810
|
const index = _index();
|
|
2532
2811
|
return <span
|
|
2533
2812
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
2534
2813
|
key={index}
|
|
2535
|
-
style={
|
|
2536
|
-
|
|
2537
|
-
if (index === activeTab() && props.collapsible) {
|
|
2538
|
-
setActiveTab(-1);
|
|
2539
|
-
} else {
|
|
2540
|
-
setActiveTab(index);
|
|
2541
|
-
}
|
|
2814
|
+
style={{
|
|
2815
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
2542
2816
|
}}
|
|
2817
|
+
onClick={(event) => onClick(index)}
|
|
2543
2818
|
><Blocks_default
|
|
2544
2819
|
parent={props.builderBlock.id}
|
|
2545
2820
|
path={`component.options.tabs.${index}.label`}
|
|
@@ -2548,21 +2823,21 @@ function Tabs(props) {
|
|
|
2548
2823
|
registeredComponents={props.builderComponents}
|
|
2549
2824
|
linkComponent={props.builderLinkComponent}
|
|
2550
2825
|
/></span>;
|
|
2551
|
-
}}</
|
|
2552
|
-
<
|
|
2826
|
+
}}</For6></div>
|
|
2827
|
+
<Show9 when={activeTabContent(activeTab())}><div><Blocks_default
|
|
2553
2828
|
parent={props.builderBlock.id}
|
|
2554
2829
|
path={`component.options.tabs.${activeTab()}.content`}
|
|
2555
2830
|
blocks={activeTabContent(activeTab())}
|
|
2556
2831
|
context={props.builderContext}
|
|
2557
2832
|
registeredComponents={props.builderComponents}
|
|
2558
2833
|
linkComponent={props.builderLinkComponent}
|
|
2559
|
-
/></div></
|
|
2834
|
+
/></div></Show9>
|
|
2560
2835
|
</div>;
|
|
2561
2836
|
}
|
|
2562
2837
|
var tabs_default = Tabs;
|
|
2563
2838
|
|
|
2564
2839
|
// src/blocks/text/component-info.ts
|
|
2565
|
-
var
|
|
2840
|
+
var componentInfo10 = {
|
|
2566
2841
|
name: "Text",
|
|
2567
2842
|
static: true,
|
|
2568
2843
|
isRSC: true,
|
|
@@ -2595,7 +2870,7 @@ function Text(props) {
|
|
|
2595
2870
|
var text_default = Text;
|
|
2596
2871
|
|
|
2597
2872
|
// src/blocks/custom-code/component-info.ts
|
|
2598
|
-
var
|
|
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,
|
|
@@ -3032,13 +3307,11 @@ function FormComponent(props) {
|
|
|
3032
3307
|
return;
|
|
3033
3308
|
}
|
|
3034
3309
|
event.preventDefault();
|
|
3035
|
-
const el = event.currentTarget;
|
|
3310
|
+
const el = event.currentTarget || event.target;
|
|
3036
3311
|
const headers = props.customHeaders || {};
|
|
3037
3312
|
let body;
|
|
3038
3313
|
const formData = new FormData(el);
|
|
3039
|
-
const formPairs = Array.from(
|
|
3040
|
-
event.currentTarget.querySelectorAll("input,select,textarea")
|
|
3041
|
-
).filter((el2) => !!el2.name).map((el2) => {
|
|
3314
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
3042
3315
|
let value;
|
|
3043
3316
|
const key = el2.name;
|
|
3044
3317
|
if (el2 instanceof HTMLInputElement) {
|
|
@@ -3201,9 +3474,10 @@ function FormComponent(props) {
|
|
|
3201
3474
|
name={props.name}
|
|
3202
3475
|
onSubmit={(event) => onSubmit(event)}
|
|
3203
3476
|
{...{}}
|
|
3477
|
+
{...{}}
|
|
3204
3478
|
{...props.attributes}
|
|
3205
3479
|
>
|
|
3206
|
-
<
|
|
3480
|
+
<Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
|
|
3207
3481
|
const idx = _index();
|
|
3208
3482
|
return <Block_default
|
|
3209
3483
|
key={`form-block-${idx}`}
|
|
@@ -3212,35 +3486,35 @@ function FormComponent(props) {
|
|
|
3212
3486
|
registeredComponents={props.builderComponents}
|
|
3213
3487
|
linkComponent={props.builderLinkComponent}
|
|
3214
3488
|
/>;
|
|
3215
|
-
}}</
|
|
3216
|
-
<
|
|
3489
|
+
}}</For7></Show10>
|
|
3490
|
+
<Show10 when={submissionState() === "error"}><Blocks_default
|
|
3217
3491
|
path="errorMessage"
|
|
3218
3492
|
blocks={props.errorMessage}
|
|
3219
3493
|
context={props.builderContext}
|
|
3220
|
-
/></
|
|
3221
|
-
<
|
|
3494
|
+
/></Show10>
|
|
3495
|
+
<Show10 when={submissionState() === "sending"}><Blocks_default
|
|
3222
3496
|
path="sendingMessage"
|
|
3223
3497
|
blocks={props.sendingMessage}
|
|
3224
3498
|
context={props.builderContext}
|
|
3225
|
-
/></
|
|
3226
|
-
<
|
|
3499
|
+
/></Show10>
|
|
3500
|
+
<Show10 when={submissionState() === "error" && responseData()}><pre
|
|
3227
3501
|
class={"builder-form-error-text " + css4({
|
|
3228
3502
|
padding: "10px",
|
|
3229
3503
|
color: "red",
|
|
3230
3504
|
textAlign: "center"
|
|
3231
3505
|
})}
|
|
3232
|
-
>{JSON.stringify(responseData(), null, 2)}</pre></
|
|
3233
|
-
<
|
|
3506
|
+
>{JSON.stringify(responseData(), null, 2)}</pre></Show10>
|
|
3507
|
+
<Show10 when={submissionState() === "success"}><Blocks_default
|
|
3234
3508
|
path="successMessage"
|
|
3235
3509
|
blocks={props.successMessage}
|
|
3236
3510
|
context={props.builderContext}
|
|
3237
|
-
/></
|
|
3511
|
+
/></Show10>
|
|
3238
3512
|
</form>;
|
|
3239
3513
|
}
|
|
3240
3514
|
var form_default = FormComponent;
|
|
3241
3515
|
|
|
3242
3516
|
// src/blocks/form/input/component-info.ts
|
|
3243
|
-
var
|
|
3517
|
+
var componentInfo14 = {
|
|
3244
3518
|
name: "Form:Input",
|
|
3245
3519
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3246
3520
|
inputs: [
|
|
@@ -3310,7 +3584,7 @@ function FormInputComponent(props) {
|
|
|
3310
3584
|
var input_default = FormInputComponent;
|
|
3311
3585
|
|
|
3312
3586
|
// src/blocks/form/select/component-info.ts
|
|
3313
|
-
var
|
|
3587
|
+
var componentInfo15 = {
|
|
3314
3588
|
name: "Form:Select",
|
|
3315
3589
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3316
3590
|
defaultStyles: {
|
|
@@ -3355,7 +3629,7 @@ var componentInfo14 = {
|
|
|
3355
3629
|
};
|
|
3356
3630
|
|
|
3357
3631
|
// src/blocks/form/select/select.tsx
|
|
3358
|
-
import { For as
|
|
3632
|
+
import { For as For8 } from "solid-js";
|
|
3359
3633
|
function SelectComponent(props) {
|
|
3360
3634
|
return <select
|
|
3361
3635
|
{...{}}
|
|
@@ -3364,15 +3638,15 @@ function SelectComponent(props) {
|
|
|
3364
3638
|
key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
|
|
3365
3639
|
defaultValue={props.defaultValue}
|
|
3366
3640
|
name={props.name}
|
|
3367
|
-
><
|
|
3641
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
3368
3642
|
const index = _index();
|
|
3369
3643
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
3370
|
-
}}</
|
|
3644
|
+
}}</For8></select>;
|
|
3371
3645
|
}
|
|
3372
3646
|
var select_default = SelectComponent;
|
|
3373
3647
|
|
|
3374
3648
|
// src/blocks/form/submit-button/component-info.ts
|
|
3375
|
-
var
|
|
3649
|
+
var componentInfo16 = {
|
|
3376
3650
|
name: "Form:SubmitButton",
|
|
3377
3651
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3378
3652
|
defaultStyles: {
|
|
@@ -3406,7 +3680,7 @@ function SubmitButton(props) {
|
|
|
3406
3680
|
var submit_button_default = SubmitButton;
|
|
3407
3681
|
|
|
3408
3682
|
// src/blocks/img/component-info.ts
|
|
3409
|
-
var
|
|
3683
|
+
var componentInfo17 = {
|
|
3410
3684
|
// friendlyName?
|
|
3411
3685
|
name: "Raw:Img",
|
|
3412
3686
|
hideFromInsertMenu: true,
|
|
@@ -3439,7 +3713,7 @@ function ImgComponent(props) {
|
|
|
3439
3713
|
var img_default = ImgComponent;
|
|
3440
3714
|
|
|
3441
3715
|
// src/blocks/video/component-info.ts
|
|
3442
|
-
var
|
|
3716
|
+
var componentInfo18 = {
|
|
3443
3717
|
name: "Video",
|
|
3444
3718
|
canHaveChildren: true,
|
|
3445
3719
|
defaultStyles: {
|
|
@@ -3523,9 +3797,9 @@ var componentInfo17 = {
|
|
|
3523
3797
|
};
|
|
3524
3798
|
|
|
3525
3799
|
// src/blocks/video/video.tsx
|
|
3526
|
-
import { Show as
|
|
3800
|
+
import { Show as Show11, createMemo as createMemo14 } from "solid-js";
|
|
3527
3801
|
function Video(props) {
|
|
3528
|
-
const videoProps =
|
|
3802
|
+
const videoProps = createMemo14(() => {
|
|
3529
3803
|
return {
|
|
3530
3804
|
...props.autoPlay === true ? {
|
|
3531
3805
|
autoPlay: true
|
|
@@ -3544,7 +3818,7 @@ function Video(props) {
|
|
|
3544
3818
|
} : {}
|
|
3545
3819
|
};
|
|
3546
3820
|
});
|
|
3547
|
-
const spreadProps =
|
|
3821
|
+
const spreadProps = createMemo14(() => {
|
|
3548
3822
|
return {
|
|
3549
3823
|
...videoProps()
|
|
3550
3824
|
};
|
|
@@ -3574,8 +3848,8 @@ function Video(props) {
|
|
|
3574
3848
|
}}
|
|
3575
3849
|
src={props.video || "no-src"}
|
|
3576
3850
|
poster={props.posterImage}
|
|
3577
|
-
><
|
|
3578
|
-
<
|
|
3851
|
+
><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
|
|
3852
|
+
<Show11
|
|
3579
3853
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
3580
3854
|
><div
|
|
3581
3855
|
style={{
|
|
@@ -3584,15 +3858,15 @@ function Video(props) {
|
|
|
3584
3858
|
"pointer-events": "none",
|
|
3585
3859
|
"font-size": "0px"
|
|
3586
3860
|
}}
|
|
3587
|
-
/></
|
|
3588
|
-
<
|
|
3861
|
+
/></Show11>
|
|
3862
|
+
<Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
3589
3863
|
style={{
|
|
3590
3864
|
display: "flex",
|
|
3591
3865
|
"flex-direction": "column",
|
|
3592
3866
|
"align-items": "stretch"
|
|
3593
3867
|
}}
|
|
3594
|
-
>{props.children}</div></
|
|
3595
|
-
<
|
|
3868
|
+
>{props.children}</div></Show11>
|
|
3869
|
+
<Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
3596
3870
|
style={{
|
|
3597
3871
|
"pointer-events": "none",
|
|
3598
3872
|
display: "flex",
|
|
@@ -3604,7 +3878,7 @@ function Video(props) {
|
|
|
3604
3878
|
width: "100%",
|
|
3605
3879
|
height: "100%"
|
|
3606
3880
|
}}
|
|
3607
|
-
>{props.children}</div></
|
|
3881
|
+
>{props.children}</div></Show11>
|
|
3608
3882
|
</div>;
|
|
3609
3883
|
}
|
|
3610
3884
|
var video_default = Video;
|
|
@@ -3612,58 +3886,61 @@ var video_default = Video;
|
|
|
3612
3886
|
// src/constants/extra-components.ts
|
|
3613
3887
|
var getExtraComponents = () => [{
|
|
3614
3888
|
component: custom_code_default,
|
|
3615
|
-
...
|
|
3889
|
+
...componentInfo11
|
|
3616
3890
|
}, {
|
|
3617
3891
|
component: embed_default,
|
|
3618
|
-
...
|
|
3892
|
+
...componentInfo12
|
|
3619
3893
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3620
3894
|
component: form_default,
|
|
3621
|
-
...
|
|
3895
|
+
...componentInfo13
|
|
3622
3896
|
}, {
|
|
3623
3897
|
component: input_default,
|
|
3624
|
-
...
|
|
3898
|
+
...componentInfo14
|
|
3625
3899
|
}, {
|
|
3626
3900
|
component: submit_button_default,
|
|
3627
|
-
...
|
|
3901
|
+
...componentInfo16
|
|
3628
3902
|
}, {
|
|
3629
3903
|
component: select_default,
|
|
3630
|
-
...
|
|
3904
|
+
...componentInfo15
|
|
3631
3905
|
}], {
|
|
3632
3906
|
component: img_default,
|
|
3633
|
-
...
|
|
3907
|
+
...componentInfo17
|
|
3634
3908
|
}, {
|
|
3635
3909
|
component: video_default,
|
|
3636
|
-
...
|
|
3910
|
+
...componentInfo18
|
|
3637
3911
|
}];
|
|
3638
3912
|
|
|
3639
3913
|
// src/constants/builder-registered-components.ts
|
|
3640
3914
|
var getDefaultRegisteredComponents = () => [{
|
|
3641
3915
|
component: button_default,
|
|
3642
|
-
...
|
|
3916
|
+
...componentInfo2
|
|
3643
3917
|
}, {
|
|
3644
3918
|
component: columns_default,
|
|
3645
|
-
...
|
|
3919
|
+
...componentInfo3
|
|
3646
3920
|
}, {
|
|
3647
3921
|
component: fragment_default,
|
|
3648
|
-
...
|
|
3922
|
+
...componentInfo4
|
|
3649
3923
|
}, {
|
|
3650
3924
|
component: image_default,
|
|
3651
|
-
...
|
|
3925
|
+
...componentInfo5
|
|
3652
3926
|
}, {
|
|
3653
3927
|
component: section_default,
|
|
3654
|
-
...
|
|
3928
|
+
...componentInfo6
|
|
3655
3929
|
}, {
|
|
3656
3930
|
component: slot_default,
|
|
3657
|
-
...
|
|
3931
|
+
...componentInfo7
|
|
3658
3932
|
}, {
|
|
3659
3933
|
component: symbol_default,
|
|
3660
|
-
...
|
|
3934
|
+
...componentInfo8
|
|
3661
3935
|
}, {
|
|
3662
3936
|
component: text_default,
|
|
3663
|
-
...
|
|
3937
|
+
...componentInfo10
|
|
3664
3938
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3665
3939
|
component: tabs_default,
|
|
3666
|
-
...
|
|
3940
|
+
...componentInfo9
|
|
3941
|
+
}, {
|
|
3942
|
+
component: accordion_default,
|
|
3943
|
+
...componentInfo
|
|
3667
3944
|
}], ...getExtraComponents()];
|
|
3668
3945
|
|
|
3669
3946
|
// src/functions/register-component.ts
|
|
@@ -3742,12 +4019,12 @@ var Inlined_script_default = InlinedScript;
|
|
|
3742
4019
|
|
|
3743
4020
|
// src/components/content/components/enable-editor.tsx
|
|
3744
4021
|
import {
|
|
3745
|
-
Show as
|
|
4022
|
+
Show as Show12,
|
|
3746
4023
|
onMount as onMount3,
|
|
3747
4024
|
on as on2,
|
|
3748
4025
|
createEffect as createEffect2,
|
|
3749
|
-
createMemo as
|
|
3750
|
-
createSignal as
|
|
4026
|
+
createMemo as createMemo15,
|
|
4027
|
+
createSignal as createSignal15
|
|
3751
4028
|
} from "solid-js";
|
|
3752
4029
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
3753
4030
|
|
|
@@ -4242,7 +4519,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4242
4519
|
}
|
|
4243
4520
|
|
|
4244
4521
|
// src/constants/sdk-version.ts
|
|
4245
|
-
var SDK_VERSION = "1.0.
|
|
4522
|
+
var SDK_VERSION = "1.0.29";
|
|
4246
4523
|
|
|
4247
4524
|
// src/functions/register.ts
|
|
4248
4525
|
var registry = {};
|
|
@@ -4519,12 +4796,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
4519
4796
|
|
|
4520
4797
|
// src/components/content/components/enable-editor.tsx
|
|
4521
4798
|
function EnableEditor(props) {
|
|
4522
|
-
const [ContentWrapper, setContentWrapper] =
|
|
4799
|
+
const [ContentWrapper, setContentWrapper] = createSignal15(
|
|
4523
4800
|
props.contentWrapper || "div"
|
|
4524
4801
|
);
|
|
4525
|
-
const [httpReqsData, setHttpReqsData] =
|
|
4526
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
4527
|
-
const [clicked, setClicked] =
|
|
4802
|
+
const [httpReqsData, setHttpReqsData] = createSignal15({});
|
|
4803
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal15({});
|
|
4804
|
+
const [clicked, setClicked] = createSignal15(false);
|
|
4528
4805
|
function mergeNewRootState(newData) {
|
|
4529
4806
|
const combinedState = {
|
|
4530
4807
|
...props.builderContextSignal.rootState,
|
|
@@ -4558,7 +4835,7 @@ function EnableEditor(props) {
|
|
|
4558
4835
|
content: newContentValue
|
|
4559
4836
|
}));
|
|
4560
4837
|
}
|
|
4561
|
-
const showContentProps =
|
|
4838
|
+
const showContentProps = createMemo15(() => {
|
|
4562
4839
|
return props.showContent ? {} : {
|
|
4563
4840
|
hidden: true,
|
|
4564
4841
|
"aria-hidden": true
|
|
@@ -4721,7 +4998,7 @@ function EnableEditor(props) {
|
|
|
4721
4998
|
const searchParams = new URL(location.href).searchParams;
|
|
4722
4999
|
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
4723
5000
|
const searchParamPreviewId = searchParams.get(
|
|
4724
|
-
`builder.
|
|
5001
|
+
`builder.overrides.${searchParamPreviewModel}`
|
|
4725
5002
|
);
|
|
4726
5003
|
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
4727
5004
|
if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id)) {
|
|
@@ -4741,21 +5018,21 @@ function EnableEditor(props) {
|
|
|
4741
5018
|
onMount3(() => {
|
|
4742
5019
|
if (!props.apiKey) {
|
|
4743
5020
|
logger.error(
|
|
4744
|
-
"No API key provided to `
|
|
5021
|
+
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
4745
5022
|
);
|
|
4746
5023
|
}
|
|
4747
5024
|
evaluateJsCode();
|
|
4748
5025
|
runHttpRequests();
|
|
4749
5026
|
emitStateUpdate();
|
|
4750
5027
|
});
|
|
4751
|
-
const onUpdateFn_0_props_content =
|
|
5028
|
+
const onUpdateFn_0_props_content = createMemo15(() => props.content);
|
|
4752
5029
|
function onUpdateFn_0() {
|
|
4753
5030
|
if (props.content) {
|
|
4754
5031
|
mergeNewContent(props.content);
|
|
4755
5032
|
}
|
|
4756
5033
|
}
|
|
4757
5034
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4758
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
5035
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4759
5036
|
function onUpdateFn_1() {
|
|
4760
5037
|
evaluateJsCode();
|
|
4761
5038
|
}
|
|
@@ -4765,7 +5042,7 @@ function EnableEditor(props) {
|
|
|
4765
5042
|
onUpdateFn_1
|
|
4766
5043
|
)
|
|
4767
5044
|
);
|
|
4768
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
5045
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4769
5046
|
function onUpdateFn_2() {
|
|
4770
5047
|
runHttpRequests();
|
|
4771
5048
|
}
|
|
@@ -4777,7 +5054,7 @@ function EnableEditor(props) {
|
|
|
4777
5054
|
onUpdateFn_2
|
|
4778
5055
|
)
|
|
4779
5056
|
);
|
|
4780
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
5057
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
|
|
4781
5058
|
() => props.builderContextSignal.rootState
|
|
4782
5059
|
);
|
|
4783
5060
|
function onUpdateFn_3() {
|
|
@@ -4789,14 +5066,14 @@ function EnableEditor(props) {
|
|
|
4789
5066
|
onUpdateFn_3
|
|
4790
5067
|
)
|
|
4791
5068
|
);
|
|
4792
|
-
const onUpdateFn_4_props_data =
|
|
5069
|
+
const onUpdateFn_4_props_data = createMemo15(() => props.data);
|
|
4793
5070
|
function onUpdateFn_4() {
|
|
4794
5071
|
if (props.data) {
|
|
4795
5072
|
mergeNewRootState(props.data);
|
|
4796
5073
|
}
|
|
4797
5074
|
}
|
|
4798
5075
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4799
|
-
const onUpdateFn_5_props_locale =
|
|
5076
|
+
const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
|
|
4800
5077
|
function onUpdateFn_5() {
|
|
4801
5078
|
if (props.locale) {
|
|
4802
5079
|
mergeNewRootState({
|
|
@@ -4805,7 +5082,7 @@ function EnableEditor(props) {
|
|
|
4805
5082
|
}
|
|
4806
5083
|
}
|
|
4807
5084
|
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4808
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
5085
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
|
|
4809
5086
|
class={getWrapperClassName(
|
|
4810
5087
|
props.content?.testVariationId || props.content?.id
|
|
4811
5088
|
)}
|
|
@@ -4818,14 +5095,14 @@ function EnableEditor(props) {
|
|
|
4818
5095
|
{...showContentProps()}
|
|
4819
5096
|
{...props.contentWrapperProps}
|
|
4820
5097
|
component={ContentWrapper()}
|
|
4821
|
-
>{props.children}</Dynamic5></
|
|
5098
|
+
>{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
|
|
4822
5099
|
}
|
|
4823
5100
|
var Enable_editor_default = EnableEditor;
|
|
4824
5101
|
|
|
4825
5102
|
// src/components/content/components/styles.tsx
|
|
4826
|
-
import { createSignal as
|
|
5103
|
+
import { createSignal as createSignal16 } from "solid-js";
|
|
4827
5104
|
function ContentStyles(props) {
|
|
4828
|
-
const [injectedStyles, setInjectedStyles] =
|
|
5105
|
+
const [injectedStyles, setInjectedStyles] = createSignal16(
|
|
4829
5106
|
`
|
|
4830
5107
|
${getCss({
|
|
4831
5108
|
cssCode: props.cssCode,
|
|
@@ -4882,7 +5159,7 @@ var getContentInitialValue = ({
|
|
|
4882
5159
|
|
|
4883
5160
|
// src/components/content/content.tsx
|
|
4884
5161
|
function ContentComponent(props) {
|
|
4885
|
-
const [scriptStr, setScriptStr] =
|
|
5162
|
+
const [scriptStr, setScriptStr] = createSignal17(
|
|
4886
5163
|
getUpdateVariantVisibilityScript({
|
|
4887
5164
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
4888
5165
|
variationId: props.content?.testVariationId,
|
|
@@ -4890,7 +5167,7 @@ function ContentComponent(props) {
|
|
|
4890
5167
|
contentId: props.content?.id
|
|
4891
5168
|
})
|
|
4892
5169
|
);
|
|
4893
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
5170
|
+
const [registeredComponents, setRegisteredComponents] = createSignal17(
|
|
4894
5171
|
[
|
|
4895
5172
|
...getDefaultRegisteredComponents(),
|
|
4896
5173
|
...props.customComponents || []
|
|
@@ -4905,7 +5182,7 @@ function ContentComponent(props) {
|
|
|
4905
5182
|
{}
|
|
4906
5183
|
)
|
|
4907
5184
|
);
|
|
4908
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
5185
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal17({
|
|
4909
5186
|
content: getContentInitialValue({
|
|
4910
5187
|
content: props.content,
|
|
4911
5188
|
data: props.data
|
|
@@ -4963,16 +5240,16 @@ function ContentComponent(props) {
|
|
|
4963
5240
|
setBuilderContextSignal
|
|
4964
5241
|
}}
|
|
4965
5242
|
>
|
|
4966
|
-
<
|
|
5243
|
+
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
4967
5244
|
id="builderio-variant-visibility"
|
|
4968
5245
|
scriptStr={scriptStr()}
|
|
4969
|
-
/></
|
|
4970
|
-
<
|
|
5246
|
+
/></Show13>
|
|
5247
|
+
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
4971
5248
|
isNestedRender={props.isNestedRender}
|
|
4972
5249
|
contentId={builderContextSignal().content?.id}
|
|
4973
5250
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
4974
5251
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
4975
|
-
/></
|
|
5252
|
+
/></Show13>
|
|
4976
5253
|
<Blocks_default
|
|
4977
5254
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
4978
5255
|
context={builderContextSignal()}
|
|
@@ -4985,13 +5262,13 @@ var Content_default = ContentComponent;
|
|
|
4985
5262
|
|
|
4986
5263
|
// src/components/content-variants/content-variants.tsx
|
|
4987
5264
|
function ContentVariants(props) {
|
|
4988
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
5265
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
|
|
4989
5266
|
checkShouldRenderVariants({
|
|
4990
5267
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
4991
5268
|
content: props.content
|
|
4992
5269
|
})
|
|
4993
5270
|
);
|
|
4994
|
-
const updateCookieAndStylesScriptStr =
|
|
5271
|
+
const updateCookieAndStylesScriptStr = createMemo18(() => {
|
|
4995
5272
|
return getUpdateCookieAndStylesScript(
|
|
4996
5273
|
getVariants(props.content).map((value) => ({
|
|
4997
5274
|
id: value.testVariationId,
|
|
@@ -5000,10 +5277,10 @@ function ContentVariants(props) {
|
|
|
5000
5277
|
props.content?.id || ""
|
|
5001
5278
|
);
|
|
5002
5279
|
});
|
|
5003
|
-
const hideVariantsStyleString =
|
|
5280
|
+
const hideVariantsStyleString = createMemo18(() => {
|
|
5004
5281
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
5005
5282
|
});
|
|
5006
|
-
const defaultContent =
|
|
5283
|
+
const defaultContent = createMemo18(() => {
|
|
5007
5284
|
return shouldRenderVariants() ? {
|
|
5008
5285
|
...props.content,
|
|
5009
5286
|
testVariationId: props.content?.id
|
|
@@ -5016,11 +5293,11 @@ function ContentVariants(props) {
|
|
|
5016
5293
|
setShouldRenderVariants(false);
|
|
5017
5294
|
});
|
|
5018
5295
|
return <>
|
|
5019
|
-
<
|
|
5296
|
+
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5020
5297
|
id="builderio-init-variants-fns"
|
|
5021
5298
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5022
|
-
/></
|
|
5023
|
-
<
|
|
5299
|
+
/></Show14>
|
|
5300
|
+
<Show14 when={shouldRenderVariants()}>
|
|
5024
5301
|
<Inlined_styles_default
|
|
5025
5302
|
id="builderio-variants"
|
|
5026
5303
|
styles={hideVariantsStyleString()}
|
|
@@ -5029,7 +5306,7 @@ function ContentVariants(props) {
|
|
|
5029
5306
|
id="builderio-variants-visibility"
|
|
5030
5307
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5031
5308
|
/>
|
|
5032
|
-
<
|
|
5309
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5033
5310
|
const index = _index();
|
|
5034
5311
|
return <Content_default
|
|
5035
5312
|
isNestedRender={props.isNestedRender}
|
|
@@ -5053,8 +5330,8 @@ function ContentVariants(props) {
|
|
|
5053
5330
|
contentWrapperProps={props.contentWrapperProps}
|
|
5054
5331
|
trustedHosts={props.trustedHosts}
|
|
5055
5332
|
/>;
|
|
5056
|
-
}}</
|
|
5057
|
-
</
|
|
5333
|
+
}}</For9>
|
|
5334
|
+
</Show14>
|
|
5058
5335
|
<Content_default
|
|
5059
5336
|
isNestedRender={props.isNestedRender}
|
|
5060
5337
|
{...{}}
|
|
@@ -5107,14 +5384,14 @@ var fetchSymbolContent = async ({
|
|
|
5107
5384
|
|
|
5108
5385
|
// src/blocks/symbol/symbol.tsx
|
|
5109
5386
|
function Symbol(props) {
|
|
5110
|
-
const [contentToUse, setContentToUse] =
|
|
5111
|
-
const blocksWrapper =
|
|
5387
|
+
const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
|
|
5388
|
+
const blocksWrapper = createMemo19(() => {
|
|
5112
5389
|
return "div";
|
|
5113
5390
|
});
|
|
5114
|
-
const contentWrapper =
|
|
5391
|
+
const contentWrapper = createMemo19(() => {
|
|
5115
5392
|
return "div";
|
|
5116
5393
|
});
|
|
5117
|
-
const className =
|
|
5394
|
+
const className = createMemo19(() => {
|
|
5118
5395
|
return [
|
|
5119
5396
|
...[props.attributes[getClassPropName()]],
|
|
5120
5397
|
"builder-symbol",
|
|
@@ -5136,7 +5413,7 @@ function Symbol(props) {
|
|
|
5136
5413
|
}
|
|
5137
5414
|
onMount5(() => {
|
|
5138
5415
|
});
|
|
5139
|
-
const onUpdateFn_0_props_symbol =
|
|
5416
|
+
const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
|
|
5140
5417
|
function onUpdateFn_0() {
|
|
5141
5418
|
setContent();
|
|
5142
5419
|
}
|