@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/dev.jsx
CHANGED
|
@@ -470,6 +470,9 @@ function getProcessedBlock({
|
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
+
// src/functions/camel-to-kebab-case.ts
|
|
474
|
+
var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
475
|
+
|
|
473
476
|
// src/components/block/animator.ts
|
|
474
477
|
function throttle(func, wait, options = {}) {
|
|
475
478
|
let context;
|
|
@@ -520,7 +523,6 @@ function assign(target, ..._args) {
|
|
|
520
523
|
}
|
|
521
524
|
return to;
|
|
522
525
|
}
|
|
523
|
-
var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
524
526
|
function bindAnimations(animations) {
|
|
525
527
|
for (const animation of animations) {
|
|
526
528
|
switch (animation.trigger) {
|
|
@@ -573,7 +575,7 @@ function triggerAnimation(animation) {
|
|
|
573
575
|
element.style.transitionDelay = "0";
|
|
574
576
|
assign(element.style, animation.steps[0].styles);
|
|
575
577
|
setTimeout(() => {
|
|
576
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
578
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
577
579
|
if (animation.delay) {
|
|
578
580
|
element.style.transitionDelay = animation.delay + "s";
|
|
579
581
|
}
|
|
@@ -633,7 +635,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
633
635
|
}
|
|
634
636
|
attachDefaultState();
|
|
635
637
|
setTimeout(() => {
|
|
636
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
638
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
637
639
|
if (animation.delay) {
|
|
638
640
|
element.style.transitionDelay = animation.delay + "s";
|
|
639
641
|
}
|
|
@@ -646,9 +648,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
646
648
|
});
|
|
647
649
|
}
|
|
648
650
|
|
|
649
|
-
// src/functions/camel-to-kebab-case.ts
|
|
650
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
651
|
-
|
|
652
651
|
// src/helpers/css.ts
|
|
653
652
|
var convertStyleMapToCSSArray = (style) => {
|
|
654
653
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -778,10 +777,10 @@ var getRepeatItemData = ({
|
|
|
778
777
|
return repeatArray;
|
|
779
778
|
};
|
|
780
779
|
var shouldPassLinkComponent = (block) => {
|
|
781
|
-
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
780
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
782
781
|
};
|
|
783
782
|
var shouldPassRegisteredComponents = (block) => {
|
|
784
|
-
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
783
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
785
784
|
};
|
|
786
785
|
|
|
787
786
|
// src/components/block/components/block-styles.tsx
|
|
@@ -910,7 +909,7 @@ function BlockStyles(props) {
|
|
|
910
909
|
className: `${className}:hover`,
|
|
911
910
|
styles: {
|
|
912
911
|
...hoverStyles,
|
|
913
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
912
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
|
|
914
913
|
hoverAnimation.easing
|
|
915
914
|
)}`,
|
|
916
915
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
@@ -1675,10 +1674,10 @@ function SectionComponent(props) {
|
|
|
1675
1674
|
var section_default = SectionComponent;
|
|
1676
1675
|
|
|
1677
1676
|
// src/blocks/symbol/symbol.tsx
|
|
1678
|
-
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as
|
|
1677
|
+
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
|
|
1679
1678
|
|
|
1680
1679
|
// src/components/content-variants/content-variants.tsx
|
|
1681
|
-
import { Show as
|
|
1680
|
+
import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
|
|
1682
1681
|
|
|
1683
1682
|
// src/helpers/url.ts
|
|
1684
1683
|
var getTopLevelDomain = (host) => {
|
|
@@ -1872,10 +1871,286 @@ var handleABTesting = async ({
|
|
|
1872
1871
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1873
1872
|
|
|
1874
1873
|
// src/components/content/content.tsx
|
|
1875
|
-
import { Show as
|
|
1874
|
+
import { Show as Show13, createSignal as createSignal17 } from "solid-js";
|
|
1876
1875
|
|
|
1877
|
-
// src/blocks/
|
|
1876
|
+
// src/blocks/accordion/component-info.ts
|
|
1877
|
+
var defaultTitle = {
|
|
1878
|
+
"@type": "@builder.io/sdk:Element",
|
|
1879
|
+
layerName: "Accordion item title",
|
|
1880
|
+
responsiveStyles: {
|
|
1881
|
+
large: {
|
|
1882
|
+
marginTop: "10px",
|
|
1883
|
+
position: "relative",
|
|
1884
|
+
display: "flex",
|
|
1885
|
+
alignItems: "stretch",
|
|
1886
|
+
flexDirection: "column",
|
|
1887
|
+
paddingBottom: "10px"
|
|
1888
|
+
}
|
|
1889
|
+
},
|
|
1890
|
+
children: [{
|
|
1891
|
+
"@type": "@builder.io/sdk:Element",
|
|
1892
|
+
responsiveStyles: {
|
|
1893
|
+
large: {
|
|
1894
|
+
textAlign: "left",
|
|
1895
|
+
display: "flex",
|
|
1896
|
+
flexDirection: "column"
|
|
1897
|
+
}
|
|
1898
|
+
},
|
|
1899
|
+
component: {
|
|
1900
|
+
name: "Text",
|
|
1901
|
+
options: {
|
|
1902
|
+
text: "I am an accordion title. Click me!"
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
}]
|
|
1906
|
+
};
|
|
1907
|
+
var defaultDetail = {
|
|
1908
|
+
"@type": "@builder.io/sdk:Element",
|
|
1909
|
+
layerName: "Accordion item detail",
|
|
1910
|
+
responsiveStyles: {
|
|
1911
|
+
large: {
|
|
1912
|
+
position: "relative",
|
|
1913
|
+
display: "flex",
|
|
1914
|
+
alignItems: "stretch",
|
|
1915
|
+
flexDirection: "column",
|
|
1916
|
+
marginTop: "10px",
|
|
1917
|
+
paddingBottom: "10px"
|
|
1918
|
+
}
|
|
1919
|
+
},
|
|
1920
|
+
children: [{
|
|
1921
|
+
"@type": "@builder.io/sdk:Element",
|
|
1922
|
+
responsiveStyles: {
|
|
1923
|
+
large: {
|
|
1924
|
+
paddingTop: "50px",
|
|
1925
|
+
textAlign: "left",
|
|
1926
|
+
display: "flex",
|
|
1927
|
+
flexDirection: "column",
|
|
1928
|
+
paddingBottom: "50px"
|
|
1929
|
+
}
|
|
1930
|
+
},
|
|
1931
|
+
component: {
|
|
1932
|
+
name: "Text",
|
|
1933
|
+
options: {
|
|
1934
|
+
text: "I am an accordion detail, hello!"
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
}]
|
|
1938
|
+
};
|
|
1878
1939
|
var componentInfo = {
|
|
1940
|
+
name: "Builder:Accordion",
|
|
1941
|
+
canHaveChildren: true,
|
|
1942
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
1943
|
+
defaultStyles: {
|
|
1944
|
+
display: "flex",
|
|
1945
|
+
flexDirection: "column",
|
|
1946
|
+
alignItems: "stretch"
|
|
1947
|
+
},
|
|
1948
|
+
inputs: [{
|
|
1949
|
+
name: "items",
|
|
1950
|
+
type: "list",
|
|
1951
|
+
broadcast: true,
|
|
1952
|
+
subFields: [{
|
|
1953
|
+
name: "title",
|
|
1954
|
+
type: "uiBlocks",
|
|
1955
|
+
hideFromUI: true,
|
|
1956
|
+
defaultValue: [defaultTitle]
|
|
1957
|
+
}, {
|
|
1958
|
+
name: "detail",
|
|
1959
|
+
type: "uiBlocks",
|
|
1960
|
+
hideFromUI: true,
|
|
1961
|
+
defaultValue: [defaultDetail]
|
|
1962
|
+
}],
|
|
1963
|
+
defaultValue: [{
|
|
1964
|
+
title: [defaultTitle],
|
|
1965
|
+
detail: [defaultDetail]
|
|
1966
|
+
}, {
|
|
1967
|
+
title: [defaultTitle],
|
|
1968
|
+
detail: [defaultDetail]
|
|
1969
|
+
}],
|
|
1970
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
1971
|
+
}, {
|
|
1972
|
+
name: "oneAtATime",
|
|
1973
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
1974
|
+
type: "boolean",
|
|
1975
|
+
defaultValue: false
|
|
1976
|
+
}, {
|
|
1977
|
+
name: "grid",
|
|
1978
|
+
helperText: "Display as a grid",
|
|
1979
|
+
type: "boolean",
|
|
1980
|
+
defaultValue: false
|
|
1981
|
+
}, {
|
|
1982
|
+
name: "gridRowWidth",
|
|
1983
|
+
helperText: "Display as a grid",
|
|
1984
|
+
type: "string",
|
|
1985
|
+
showIf: (options) => options.get("grid"),
|
|
1986
|
+
defaultValue: "25%"
|
|
1987
|
+
}, {
|
|
1988
|
+
name: "useChildrenForItems",
|
|
1989
|
+
type: "boolean",
|
|
1990
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
1991
|
+
advanced: true,
|
|
1992
|
+
defaultValue: false,
|
|
1993
|
+
onChange: (options) => {
|
|
1994
|
+
if (options.get("useChildrenForItems") === true) {
|
|
1995
|
+
options.set("items", []);
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
}]
|
|
1999
|
+
};
|
|
2000
|
+
|
|
2001
|
+
// src/blocks/accordion/accordion.tsx
|
|
2002
|
+
import { Show as Show8, For as For5, createSignal as createSignal9, createMemo as createMemo9 } from "solid-js";
|
|
2003
|
+
|
|
2004
|
+
// src/blocks/accordion/helpers.ts
|
|
2005
|
+
var convertOrderNumberToString = (order) => {
|
|
2006
|
+
return order.toString();
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
// src/blocks/accordion/accordion.tsx
|
|
2010
|
+
function Accordion(props) {
|
|
2011
|
+
const [open, setOpen] = createSignal9([]);
|
|
2012
|
+
const onlyOneAtATime = createMemo9(() => {
|
|
2013
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
2014
|
+
});
|
|
2015
|
+
const accordionStyles = createMemo9(() => {
|
|
2016
|
+
const styles = {
|
|
2017
|
+
display: "flex",
|
|
2018
|
+
alignItems: "stretch",
|
|
2019
|
+
flexDirection: "column",
|
|
2020
|
+
...props.grid && {
|
|
2021
|
+
flexDirection: "row",
|
|
2022
|
+
alignItems: "flex-start",
|
|
2023
|
+
flexWrap: "wrap"
|
|
2024
|
+
}
|
|
2025
|
+
};
|
|
2026
|
+
return Object.fromEntries(
|
|
2027
|
+
Object.entries(styles).map(([key, value]) => [
|
|
2028
|
+
camelToKebabCase(key),
|
|
2029
|
+
value
|
|
2030
|
+
])
|
|
2031
|
+
);
|
|
2032
|
+
});
|
|
2033
|
+
const accordionTitleStyles = createMemo9(() => {
|
|
2034
|
+
const shared = {
|
|
2035
|
+
display: "flex",
|
|
2036
|
+
flexDirection: "column"
|
|
2037
|
+
};
|
|
2038
|
+
const styles = Object.fromEntries(
|
|
2039
|
+
Object.entries({
|
|
2040
|
+
...shared,
|
|
2041
|
+
alignItems: "stretch",
|
|
2042
|
+
cursor: "pointer"
|
|
2043
|
+
}).map(([key, value]) => [camelToKebabCase(key), value])
|
|
2044
|
+
);
|
|
2045
|
+
return Object.fromEntries(
|
|
2046
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2047
|
+
);
|
|
2048
|
+
});
|
|
2049
|
+
function getAccordionTitleClassName(index) {
|
|
2050
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
2051
|
+
}
|
|
2052
|
+
function getAccordionDetailClassName(index) {
|
|
2053
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
2054
|
+
}
|
|
2055
|
+
const openGridItemOrder = createMemo9(() => {
|
|
2056
|
+
let itemOrder = null;
|
|
2057
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
2058
|
+
if (getOpenGridItemPosition && document) {
|
|
2059
|
+
const openItemIndex = open()[0];
|
|
2060
|
+
const openItem = document.querySelector(
|
|
2061
|
+
`.builder-accordion-title[data-index="${openItemIndex}"]`
|
|
2062
|
+
);
|
|
2063
|
+
let subjectItem = openItem;
|
|
2064
|
+
itemOrder = openItemIndex;
|
|
2065
|
+
if (subjectItem) {
|
|
2066
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
2067
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
2068
|
+
if (subjectItem) {
|
|
2069
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
2070
|
+
continue;
|
|
2071
|
+
}
|
|
2072
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
2073
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
2074
|
+
const index = parseInt(
|
|
2075
|
+
subjectItem.getAttribute("data-index") || "",
|
|
2076
|
+
10
|
|
2077
|
+
);
|
|
2078
|
+
if (!isNaN(index)) {
|
|
2079
|
+
prevItemRect = subjectItemRect;
|
|
2080
|
+
itemOrder = index;
|
|
2081
|
+
}
|
|
2082
|
+
} else {
|
|
2083
|
+
break;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
if (typeof itemOrder === "number") {
|
|
2090
|
+
itemOrder = itemOrder + 1;
|
|
2091
|
+
}
|
|
2092
|
+
return itemOrder;
|
|
2093
|
+
});
|
|
2094
|
+
const accordionDetailStyles = createMemo9(() => {
|
|
2095
|
+
const styles = {
|
|
2096
|
+
...{
|
|
2097
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
2098
|
+
},
|
|
2099
|
+
...props.grid && {
|
|
2100
|
+
width: "100%"
|
|
2101
|
+
}
|
|
2102
|
+
};
|
|
2103
|
+
return Object.fromEntries(
|
|
2104
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
2105
|
+
);
|
|
2106
|
+
});
|
|
2107
|
+
function onClick(index) {
|
|
2108
|
+
if (open().includes(index)) {
|
|
2109
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
2110
|
+
} else {
|
|
2111
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
return <div class="builder-accordion" style={accordionStyles()}><For5 each={props.items}>{(item, _index) => {
|
|
2115
|
+
const index = _index();
|
|
2116
|
+
return <>
|
|
2117
|
+
<div
|
|
2118
|
+
class={getAccordionTitleClassName(index)}
|
|
2119
|
+
style={{
|
|
2120
|
+
...accordionTitleStyles(),
|
|
2121
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
2122
|
+
...{
|
|
2123
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
2124
|
+
}
|
|
2125
|
+
}}
|
|
2126
|
+
data-index={index}
|
|
2127
|
+
onClick={(event) => onClick(index)}
|
|
2128
|
+
><Blocks_default
|
|
2129
|
+
blocks={item.title}
|
|
2130
|
+
path={`items.${index}.title`}
|
|
2131
|
+
parent={props.builderBlock.id}
|
|
2132
|
+
context={props.builderContext}
|
|
2133
|
+
registeredComponents={props.builderComponents}
|
|
2134
|
+
linkComponent={props.builderLinkComponent}
|
|
2135
|
+
/></div>
|
|
2136
|
+
<Show8 when={open().includes(index)}><div
|
|
2137
|
+
class={getAccordionDetailClassName(index)}
|
|
2138
|
+
style={accordionDetailStyles()}
|
|
2139
|
+
><Blocks_default
|
|
2140
|
+
blocks={item.detail}
|
|
2141
|
+
path={`items.${index}.detail`}
|
|
2142
|
+
parent={props.builderBlock.id}
|
|
2143
|
+
context={props.builderContext}
|
|
2144
|
+
registeredComponents={props.builderComponents}
|
|
2145
|
+
linkComponent={props.builderLinkComponent}
|
|
2146
|
+
/></div></Show8>
|
|
2147
|
+
</>;
|
|
2148
|
+
}}</For5></div>;
|
|
2149
|
+
}
|
|
2150
|
+
var accordion_default = Accordion;
|
|
2151
|
+
|
|
2152
|
+
// src/blocks/button/component-info.ts
|
|
2153
|
+
var componentInfo2 = {
|
|
1879
2154
|
name: "Core:Button",
|
|
1880
2155
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
1881
2156
|
defaultStyles: {
|
|
@@ -1911,7 +2186,7 @@ var componentInfo = {
|
|
|
1911
2186
|
};
|
|
1912
2187
|
|
|
1913
2188
|
// src/blocks/columns/component-info.ts
|
|
1914
|
-
var
|
|
2189
|
+
var componentInfo3 = {
|
|
1915
2190
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
1916
2191
|
name: "Columns",
|
|
1917
2192
|
isRSC: true,
|
|
@@ -2131,7 +2406,7 @@ var componentInfo2 = {
|
|
|
2131
2406
|
};
|
|
2132
2407
|
|
|
2133
2408
|
// src/blocks/fragment/component-info.ts
|
|
2134
|
-
var
|
|
2409
|
+
var componentInfo4 = {
|
|
2135
2410
|
name: "Fragment",
|
|
2136
2411
|
static: true,
|
|
2137
2412
|
hidden: true,
|
|
@@ -2140,7 +2415,7 @@ var componentInfo3 = {
|
|
|
2140
2415
|
};
|
|
2141
2416
|
|
|
2142
2417
|
// src/blocks/image/component-info.ts
|
|
2143
|
-
var
|
|
2418
|
+
var componentInfo5 = {
|
|
2144
2419
|
name: "Image",
|
|
2145
2420
|
static: true,
|
|
2146
2421
|
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",
|
|
@@ -2263,7 +2538,7 @@ var componentInfo4 = {
|
|
|
2263
2538
|
};
|
|
2264
2539
|
|
|
2265
2540
|
// src/blocks/section/component-info.ts
|
|
2266
|
-
var
|
|
2541
|
+
var componentInfo6 = {
|
|
2267
2542
|
name: "Core:Section",
|
|
2268
2543
|
static: true,
|
|
2269
2544
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2305,7 +2580,7 @@ var componentInfo5 = {
|
|
|
2305
2580
|
};
|
|
2306
2581
|
|
|
2307
2582
|
// src/blocks/slot/component-info.ts
|
|
2308
|
-
var
|
|
2583
|
+
var componentInfo7 = {
|
|
2309
2584
|
name: "Slot",
|
|
2310
2585
|
isRSC: true,
|
|
2311
2586
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -2339,7 +2614,7 @@ function Slot(props) {
|
|
|
2339
2614
|
var slot_default = Slot;
|
|
2340
2615
|
|
|
2341
2616
|
// src/blocks/symbol/component-info.ts
|
|
2342
|
-
var
|
|
2617
|
+
var componentInfo8 = {
|
|
2343
2618
|
name: "Symbol",
|
|
2344
2619
|
noWrap: true,
|
|
2345
2620
|
static: true,
|
|
@@ -2415,7 +2690,7 @@ var defaultElement = {
|
|
|
2415
2690
|
}
|
|
2416
2691
|
}
|
|
2417
2692
|
};
|
|
2418
|
-
var
|
|
2693
|
+
var componentInfo9 = {
|
|
2419
2694
|
name: "Builder: Tabs",
|
|
2420
2695
|
inputs: [{
|
|
2421
2696
|
name: "tabs",
|
|
@@ -2515,16 +2790,20 @@ var componentInfo8 = {
|
|
|
2515
2790
|
};
|
|
2516
2791
|
|
|
2517
2792
|
// src/blocks/tabs/tabs.tsx
|
|
2518
|
-
import { Show as
|
|
2793
|
+
import { Show as Show9, For as For6, createSignal as createSignal10 } from "solid-js";
|
|
2519
2794
|
function Tabs(props) {
|
|
2520
|
-
const [activeTab, setActiveTab] =
|
|
2795
|
+
const [activeTab, setActiveTab] = createSignal10(
|
|
2521
2796
|
props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
|
|
2522
2797
|
);
|
|
2523
2798
|
function activeTabContent(active) {
|
|
2524
2799
|
return props.tabs && props.tabs[active].content;
|
|
2525
2800
|
}
|
|
2526
|
-
function
|
|
2527
|
-
|
|
2801
|
+
function onClick(index) {
|
|
2802
|
+
if (index === activeTab() && props.collapsible) {
|
|
2803
|
+
setActiveTab(-1);
|
|
2804
|
+
} else {
|
|
2805
|
+
setActiveTab(index);
|
|
2806
|
+
}
|
|
2528
2807
|
}
|
|
2529
2808
|
return <div>
|
|
2530
2809
|
<div
|
|
@@ -2535,19 +2814,15 @@ function Tabs(props) {
|
|
|
2535
2814
|
"justify-content": props.tabHeaderLayout || "flex-start",
|
|
2536
2815
|
overflow: "auto"
|
|
2537
2816
|
}}
|
|
2538
|
-
><
|
|
2817
|
+
><For6 each={props.tabs}>{(tab, _index) => {
|
|
2539
2818
|
const index = _index();
|
|
2540
2819
|
return <span
|
|
2541
2820
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
2542
2821
|
key={index}
|
|
2543
|
-
style={
|
|
2544
|
-
|
|
2545
|
-
if (index === activeTab() && props.collapsible) {
|
|
2546
|
-
setActiveTab(-1);
|
|
2547
|
-
} else {
|
|
2548
|
-
setActiveTab(index);
|
|
2549
|
-
}
|
|
2822
|
+
style={{
|
|
2823
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
2550
2824
|
}}
|
|
2825
|
+
onClick={(event) => onClick(index)}
|
|
2551
2826
|
><Blocks_default
|
|
2552
2827
|
parent={props.builderBlock.id}
|
|
2553
2828
|
path={`component.options.tabs.${index}.label`}
|
|
@@ -2556,21 +2831,21 @@ function Tabs(props) {
|
|
|
2556
2831
|
registeredComponents={props.builderComponents}
|
|
2557
2832
|
linkComponent={props.builderLinkComponent}
|
|
2558
2833
|
/></span>;
|
|
2559
|
-
}}</
|
|
2560
|
-
<
|
|
2834
|
+
}}</For6></div>
|
|
2835
|
+
<Show9 when={activeTabContent(activeTab())}><div><Blocks_default
|
|
2561
2836
|
parent={props.builderBlock.id}
|
|
2562
2837
|
path={`component.options.tabs.${activeTab()}.content`}
|
|
2563
2838
|
blocks={activeTabContent(activeTab())}
|
|
2564
2839
|
context={props.builderContext}
|
|
2565
2840
|
registeredComponents={props.builderComponents}
|
|
2566
2841
|
linkComponent={props.builderLinkComponent}
|
|
2567
|
-
/></div></
|
|
2842
|
+
/></div></Show9>
|
|
2568
2843
|
</div>;
|
|
2569
2844
|
}
|
|
2570
2845
|
var tabs_default = Tabs;
|
|
2571
2846
|
|
|
2572
2847
|
// src/blocks/text/component-info.ts
|
|
2573
|
-
var
|
|
2848
|
+
var componentInfo10 = {
|
|
2574
2849
|
name: "Text",
|
|
2575
2850
|
static: true,
|
|
2576
2851
|
isRSC: true,
|
|
@@ -2603,7 +2878,7 @@ function Text(props) {
|
|
|
2603
2878
|
var text_default = Text;
|
|
2604
2879
|
|
|
2605
2880
|
// src/blocks/custom-code/component-info.ts
|
|
2606
|
-
var
|
|
2881
|
+
var componentInfo11 = {
|
|
2607
2882
|
name: "Custom Code",
|
|
2608
2883
|
static: true,
|
|
2609
2884
|
requiredPermissions: ["editCode"],
|
|
@@ -2628,10 +2903,10 @@ var componentInfo10 = {
|
|
|
2628
2903
|
};
|
|
2629
2904
|
|
|
2630
2905
|
// src/blocks/custom-code/custom-code.tsx
|
|
2631
|
-
import { onMount as onMount2, createSignal as
|
|
2906
|
+
import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
|
|
2632
2907
|
function CustomCode(props) {
|
|
2633
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2634
|
-
const [scriptsRun, setScriptsRun] =
|
|
2908
|
+
const [scriptsInserted, setScriptsInserted] = createSignal11([]);
|
|
2909
|
+
const [scriptsRun, setScriptsRun] = createSignal11([]);
|
|
2635
2910
|
let elementRef;
|
|
2636
2911
|
onMount2(() => {
|
|
2637
2912
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
@@ -2675,7 +2950,7 @@ function CustomCode(props) {
|
|
|
2675
2950
|
var custom_code_default = CustomCode;
|
|
2676
2951
|
|
|
2677
2952
|
// src/blocks/embed/component-info.ts
|
|
2678
|
-
var
|
|
2953
|
+
var componentInfo12 = {
|
|
2679
2954
|
name: "Embed",
|
|
2680
2955
|
static: true,
|
|
2681
2956
|
inputs: [{
|
|
@@ -2713,7 +2988,7 @@ var componentInfo11 = {
|
|
|
2713
2988
|
};
|
|
2714
2989
|
|
|
2715
2990
|
// src/blocks/embed/embed.tsx
|
|
2716
|
-
import { on, createEffect, createMemo as
|
|
2991
|
+
import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
2717
2992
|
|
|
2718
2993
|
// src/blocks/embed/helpers.ts
|
|
2719
2994
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -2721,9 +2996,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
2721
2996
|
|
|
2722
2997
|
// src/blocks/embed/embed.tsx
|
|
2723
2998
|
function Embed(props) {
|
|
2724
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2725
|
-
const [scriptsRun, setScriptsRun] =
|
|
2726
|
-
const [ranInitFn, setRanInitFn] =
|
|
2999
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3000
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
3001
|
+
const [ranInitFn, setRanInitFn] = createSignal12(false);
|
|
2727
3002
|
function findAndRunScripts() {
|
|
2728
3003
|
if (!elem || !elem.getElementsByTagName)
|
|
2729
3004
|
return;
|
|
@@ -2747,8 +3022,8 @@ function Embed(props) {
|
|
|
2747
3022
|
}
|
|
2748
3023
|
}
|
|
2749
3024
|
let elem;
|
|
2750
|
-
const onUpdateFn_0_elem =
|
|
2751
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
3025
|
+
const onUpdateFn_0_elem = createMemo12(() => elem);
|
|
3026
|
+
const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
|
|
2752
3027
|
function onUpdateFn_0() {
|
|
2753
3028
|
if (elem && !ranInitFn()) {
|
|
2754
3029
|
setRanInitFn(true);
|
|
@@ -2763,7 +3038,7 @@ function Embed(props) {
|
|
|
2763
3038
|
var embed_default = Embed;
|
|
2764
3039
|
|
|
2765
3040
|
// src/blocks/form/form/component-info.ts
|
|
2766
|
-
var
|
|
3041
|
+
var componentInfo13 = {
|
|
2767
3042
|
name: "Form:Form",
|
|
2768
3043
|
// editableTags: ['builder-form-error']
|
|
2769
3044
|
defaults: {
|
|
@@ -2997,7 +3272,7 @@ var componentInfo12 = {
|
|
|
2997
3272
|
};
|
|
2998
3273
|
|
|
2999
3274
|
// src/blocks/form/form/form.tsx
|
|
3000
|
-
import { Show as
|
|
3275
|
+
import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
|
|
3001
3276
|
import { css as css4 } from "solid-styled-components";
|
|
3002
3277
|
|
|
3003
3278
|
// src/functions/get-env.ts
|
|
@@ -3015,9 +3290,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
3015
3290
|
|
|
3016
3291
|
// src/blocks/form/form/form.tsx
|
|
3017
3292
|
function FormComponent(props) {
|
|
3018
|
-
const [formState, setFormState] =
|
|
3019
|
-
const [responseData, setResponseData] =
|
|
3020
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
3293
|
+
const [formState, setFormState] = createSignal13("unsubmitted");
|
|
3294
|
+
const [responseData, setResponseData] = createSignal13(null);
|
|
3295
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal13("");
|
|
3021
3296
|
function mergeNewRootState(newData) {
|
|
3022
3297
|
const combinedState = {
|
|
3023
3298
|
...props.builderContext.rootState,
|
|
@@ -3042,13 +3317,11 @@ function FormComponent(props) {
|
|
|
3042
3317
|
return;
|
|
3043
3318
|
}
|
|
3044
3319
|
event.preventDefault();
|
|
3045
|
-
const el = event.currentTarget;
|
|
3320
|
+
const el = event.currentTarget || event.target;
|
|
3046
3321
|
const headers = props.customHeaders || {};
|
|
3047
3322
|
let body;
|
|
3048
3323
|
const formData = new FormData(el);
|
|
3049
|
-
const formPairs = Array.from(
|
|
3050
|
-
event.currentTarget.querySelectorAll("input,select,textarea")
|
|
3051
|
-
).filter((el2) => !!el2.name).map((el2) => {
|
|
3324
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
3052
3325
|
let value;
|
|
3053
3326
|
const key = el2.name;
|
|
3054
3327
|
if (el2 instanceof HTMLInputElement) {
|
|
@@ -3211,9 +3484,10 @@ function FormComponent(props) {
|
|
|
3211
3484
|
name={props.name}
|
|
3212
3485
|
onSubmit={(event) => onSubmit(event)}
|
|
3213
3486
|
{...{}}
|
|
3487
|
+
{...{}}
|
|
3214
3488
|
{...props.attributes}
|
|
3215
3489
|
>
|
|
3216
|
-
<
|
|
3490
|
+
<Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
|
|
3217
3491
|
const idx = _index();
|
|
3218
3492
|
return <Block_default
|
|
3219
3493
|
key={`form-block-${idx}`}
|
|
@@ -3222,35 +3496,35 @@ function FormComponent(props) {
|
|
|
3222
3496
|
registeredComponents={props.builderComponents}
|
|
3223
3497
|
linkComponent={props.builderLinkComponent}
|
|
3224
3498
|
/>;
|
|
3225
|
-
}}</
|
|
3226
|
-
<
|
|
3499
|
+
}}</For7></Show10>
|
|
3500
|
+
<Show10 when={submissionState() === "error"}><Blocks_default
|
|
3227
3501
|
path="errorMessage"
|
|
3228
3502
|
blocks={props.errorMessage}
|
|
3229
3503
|
context={props.builderContext}
|
|
3230
|
-
/></
|
|
3231
|
-
<
|
|
3504
|
+
/></Show10>
|
|
3505
|
+
<Show10 when={submissionState() === "sending"}><Blocks_default
|
|
3232
3506
|
path="sendingMessage"
|
|
3233
3507
|
blocks={props.sendingMessage}
|
|
3234
3508
|
context={props.builderContext}
|
|
3235
|
-
/></
|
|
3236
|
-
<
|
|
3509
|
+
/></Show10>
|
|
3510
|
+
<Show10 when={submissionState() === "error" && responseData()}><pre
|
|
3237
3511
|
class={"builder-form-error-text " + css4({
|
|
3238
3512
|
padding: "10px",
|
|
3239
3513
|
color: "red",
|
|
3240
3514
|
textAlign: "center"
|
|
3241
3515
|
})}
|
|
3242
|
-
>{JSON.stringify(responseData(), null, 2)}</pre></
|
|
3243
|
-
<
|
|
3516
|
+
>{JSON.stringify(responseData(), null, 2)}</pre></Show10>
|
|
3517
|
+
<Show10 when={submissionState() === "success"}><Blocks_default
|
|
3244
3518
|
path="successMessage"
|
|
3245
3519
|
blocks={props.successMessage}
|
|
3246
3520
|
context={props.builderContext}
|
|
3247
|
-
/></
|
|
3521
|
+
/></Show10>
|
|
3248
3522
|
</form>;
|
|
3249
3523
|
}
|
|
3250
3524
|
var form_default = FormComponent;
|
|
3251
3525
|
|
|
3252
3526
|
// src/blocks/form/input/component-info.ts
|
|
3253
|
-
var
|
|
3527
|
+
var componentInfo14 = {
|
|
3254
3528
|
name: "Form:Input",
|
|
3255
3529
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3256
3530
|
inputs: [
|
|
@@ -3320,7 +3594,7 @@ function FormInputComponent(props) {
|
|
|
3320
3594
|
var input_default = FormInputComponent;
|
|
3321
3595
|
|
|
3322
3596
|
// src/blocks/form/select/component-info.ts
|
|
3323
|
-
var
|
|
3597
|
+
var componentInfo15 = {
|
|
3324
3598
|
name: "Form:Select",
|
|
3325
3599
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3326
3600
|
defaultStyles: {
|
|
@@ -3365,7 +3639,7 @@ var componentInfo14 = {
|
|
|
3365
3639
|
};
|
|
3366
3640
|
|
|
3367
3641
|
// src/blocks/form/select/select.tsx
|
|
3368
|
-
import { For as
|
|
3642
|
+
import { For as For8 } from "solid-js";
|
|
3369
3643
|
function SelectComponent(props) {
|
|
3370
3644
|
return <select
|
|
3371
3645
|
{...{}}
|
|
@@ -3374,15 +3648,15 @@ function SelectComponent(props) {
|
|
|
3374
3648
|
key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
|
|
3375
3649
|
defaultValue={props.defaultValue}
|
|
3376
3650
|
name={props.name}
|
|
3377
|
-
><
|
|
3651
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
3378
3652
|
const index = _index();
|
|
3379
3653
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
3380
|
-
}}</
|
|
3654
|
+
}}</For8></select>;
|
|
3381
3655
|
}
|
|
3382
3656
|
var select_default = SelectComponent;
|
|
3383
3657
|
|
|
3384
3658
|
// src/blocks/form/submit-button/component-info.ts
|
|
3385
|
-
var
|
|
3659
|
+
var componentInfo16 = {
|
|
3386
3660
|
name: "Form:SubmitButton",
|
|
3387
3661
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3388
3662
|
defaultStyles: {
|
|
@@ -3416,7 +3690,7 @@ function SubmitButton(props) {
|
|
|
3416
3690
|
var submit_button_default = SubmitButton;
|
|
3417
3691
|
|
|
3418
3692
|
// src/blocks/img/component-info.ts
|
|
3419
|
-
var
|
|
3693
|
+
var componentInfo17 = {
|
|
3420
3694
|
// friendlyName?
|
|
3421
3695
|
name: "Raw:Img",
|
|
3422
3696
|
hideFromInsertMenu: true,
|
|
@@ -3449,7 +3723,7 @@ function ImgComponent(props) {
|
|
|
3449
3723
|
var img_default = ImgComponent;
|
|
3450
3724
|
|
|
3451
3725
|
// src/blocks/video/component-info.ts
|
|
3452
|
-
var
|
|
3726
|
+
var componentInfo18 = {
|
|
3453
3727
|
name: "Video",
|
|
3454
3728
|
canHaveChildren: true,
|
|
3455
3729
|
defaultStyles: {
|
|
@@ -3533,9 +3807,9 @@ var componentInfo17 = {
|
|
|
3533
3807
|
};
|
|
3534
3808
|
|
|
3535
3809
|
// src/blocks/video/video.tsx
|
|
3536
|
-
import { Show as
|
|
3810
|
+
import { Show as Show11, createMemo as createMemo14 } from "solid-js";
|
|
3537
3811
|
function Video(props) {
|
|
3538
|
-
const videoProps =
|
|
3812
|
+
const videoProps = createMemo14(() => {
|
|
3539
3813
|
return {
|
|
3540
3814
|
...props.autoPlay === true ? {
|
|
3541
3815
|
autoPlay: true
|
|
@@ -3554,7 +3828,7 @@ function Video(props) {
|
|
|
3554
3828
|
} : {}
|
|
3555
3829
|
};
|
|
3556
3830
|
});
|
|
3557
|
-
const spreadProps =
|
|
3831
|
+
const spreadProps = createMemo14(() => {
|
|
3558
3832
|
return {
|
|
3559
3833
|
...videoProps()
|
|
3560
3834
|
};
|
|
@@ -3584,8 +3858,8 @@ function Video(props) {
|
|
|
3584
3858
|
}}
|
|
3585
3859
|
src={props.video || "no-src"}
|
|
3586
3860
|
poster={props.posterImage}
|
|
3587
|
-
><
|
|
3588
|
-
<
|
|
3861
|
+
><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
|
|
3862
|
+
<Show11
|
|
3589
3863
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
3590
3864
|
><div
|
|
3591
3865
|
style={{
|
|
@@ -3594,15 +3868,15 @@ function Video(props) {
|
|
|
3594
3868
|
"pointer-events": "none",
|
|
3595
3869
|
"font-size": "0px"
|
|
3596
3870
|
}}
|
|
3597
|
-
/></
|
|
3598
|
-
<
|
|
3871
|
+
/></Show11>
|
|
3872
|
+
<Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
3599
3873
|
style={{
|
|
3600
3874
|
display: "flex",
|
|
3601
3875
|
"flex-direction": "column",
|
|
3602
3876
|
"align-items": "stretch"
|
|
3603
3877
|
}}
|
|
3604
|
-
>{props.children}</div></
|
|
3605
|
-
<
|
|
3878
|
+
>{props.children}</div></Show11>
|
|
3879
|
+
<Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
3606
3880
|
style={{
|
|
3607
3881
|
"pointer-events": "none",
|
|
3608
3882
|
display: "flex",
|
|
@@ -3614,7 +3888,7 @@ function Video(props) {
|
|
|
3614
3888
|
width: "100%",
|
|
3615
3889
|
height: "100%"
|
|
3616
3890
|
}}
|
|
3617
|
-
>{props.children}</div></
|
|
3891
|
+
>{props.children}</div></Show11>
|
|
3618
3892
|
</div>;
|
|
3619
3893
|
}
|
|
3620
3894
|
var video_default = Video;
|
|
@@ -3622,58 +3896,61 @@ var video_default = Video;
|
|
|
3622
3896
|
// src/constants/extra-components.ts
|
|
3623
3897
|
var getExtraComponents = () => [{
|
|
3624
3898
|
component: custom_code_default,
|
|
3625
|
-
...
|
|
3899
|
+
...componentInfo11
|
|
3626
3900
|
}, {
|
|
3627
3901
|
component: embed_default,
|
|
3628
|
-
...
|
|
3902
|
+
...componentInfo12
|
|
3629
3903
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3630
3904
|
component: form_default,
|
|
3631
|
-
...
|
|
3905
|
+
...componentInfo13
|
|
3632
3906
|
}, {
|
|
3633
3907
|
component: input_default,
|
|
3634
|
-
...
|
|
3908
|
+
...componentInfo14
|
|
3635
3909
|
}, {
|
|
3636
3910
|
component: submit_button_default,
|
|
3637
|
-
...
|
|
3911
|
+
...componentInfo16
|
|
3638
3912
|
}, {
|
|
3639
3913
|
component: select_default,
|
|
3640
|
-
...
|
|
3914
|
+
...componentInfo15
|
|
3641
3915
|
}], {
|
|
3642
3916
|
component: img_default,
|
|
3643
|
-
...
|
|
3917
|
+
...componentInfo17
|
|
3644
3918
|
}, {
|
|
3645
3919
|
component: video_default,
|
|
3646
|
-
...
|
|
3920
|
+
...componentInfo18
|
|
3647
3921
|
}];
|
|
3648
3922
|
|
|
3649
3923
|
// src/constants/builder-registered-components.ts
|
|
3650
3924
|
var getDefaultRegisteredComponents = () => [{
|
|
3651
3925
|
component: button_default,
|
|
3652
|
-
...
|
|
3926
|
+
...componentInfo2
|
|
3653
3927
|
}, {
|
|
3654
3928
|
component: columns_default,
|
|
3655
|
-
...
|
|
3929
|
+
...componentInfo3
|
|
3656
3930
|
}, {
|
|
3657
3931
|
component: fragment_default,
|
|
3658
|
-
...
|
|
3932
|
+
...componentInfo4
|
|
3659
3933
|
}, {
|
|
3660
3934
|
component: image_default,
|
|
3661
|
-
...
|
|
3935
|
+
...componentInfo5
|
|
3662
3936
|
}, {
|
|
3663
3937
|
component: section_default,
|
|
3664
|
-
...
|
|
3938
|
+
...componentInfo6
|
|
3665
3939
|
}, {
|
|
3666
3940
|
component: slot_default,
|
|
3667
|
-
...
|
|
3941
|
+
...componentInfo7
|
|
3668
3942
|
}, {
|
|
3669
3943
|
component: symbol_default,
|
|
3670
|
-
...
|
|
3944
|
+
...componentInfo8
|
|
3671
3945
|
}, {
|
|
3672
3946
|
component: text_default,
|
|
3673
|
-
...
|
|
3947
|
+
...componentInfo10
|
|
3674
3948
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3675
3949
|
component: tabs_default,
|
|
3676
|
-
...
|
|
3950
|
+
...componentInfo9
|
|
3951
|
+
}, {
|
|
3952
|
+
component: accordion_default,
|
|
3953
|
+
...componentInfo
|
|
3677
3954
|
}], ...getExtraComponents()];
|
|
3678
3955
|
|
|
3679
3956
|
// src/functions/register-component.ts
|
|
@@ -3752,12 +4029,12 @@ var Inlined_script_default = InlinedScript;
|
|
|
3752
4029
|
|
|
3753
4030
|
// src/components/content/components/enable-editor.tsx
|
|
3754
4031
|
import {
|
|
3755
|
-
Show as
|
|
4032
|
+
Show as Show12,
|
|
3756
4033
|
onMount as onMount3,
|
|
3757
4034
|
on as on2,
|
|
3758
4035
|
createEffect as createEffect2,
|
|
3759
|
-
createMemo as
|
|
3760
|
-
createSignal as
|
|
4036
|
+
createMemo as createMemo15,
|
|
4037
|
+
createSignal as createSignal15
|
|
3761
4038
|
} from "solid-js";
|
|
3762
4039
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
3763
4040
|
|
|
@@ -4257,7 +4534,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4257
4534
|
}
|
|
4258
4535
|
|
|
4259
4536
|
// src/constants/sdk-version.ts
|
|
4260
|
-
var SDK_VERSION = "1.0.
|
|
4537
|
+
var SDK_VERSION = "1.0.29";
|
|
4261
4538
|
|
|
4262
4539
|
// src/functions/register.ts
|
|
4263
4540
|
var registry = {};
|
|
@@ -4535,12 +4812,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
4535
4812
|
|
|
4536
4813
|
// src/components/content/components/enable-editor.tsx
|
|
4537
4814
|
function EnableEditor(props) {
|
|
4538
|
-
const [ContentWrapper, setContentWrapper] =
|
|
4815
|
+
const [ContentWrapper, setContentWrapper] = createSignal15(
|
|
4539
4816
|
props.contentWrapper || "div"
|
|
4540
4817
|
);
|
|
4541
|
-
const [httpReqsData, setHttpReqsData] =
|
|
4542
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
4543
|
-
const [clicked, setClicked] =
|
|
4818
|
+
const [httpReqsData, setHttpReqsData] = createSignal15({});
|
|
4819
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal15({});
|
|
4820
|
+
const [clicked, setClicked] = createSignal15(false);
|
|
4544
4821
|
function mergeNewRootState(newData) {
|
|
4545
4822
|
const combinedState = {
|
|
4546
4823
|
...props.builderContextSignal.rootState,
|
|
@@ -4574,7 +4851,7 @@ function EnableEditor(props) {
|
|
|
4574
4851
|
content: newContentValue
|
|
4575
4852
|
}));
|
|
4576
4853
|
}
|
|
4577
|
-
const showContentProps =
|
|
4854
|
+
const showContentProps = createMemo15(() => {
|
|
4578
4855
|
return props.showContent ? {} : {
|
|
4579
4856
|
hidden: true,
|
|
4580
4857
|
"aria-hidden": true
|
|
@@ -4738,7 +5015,7 @@ function EnableEditor(props) {
|
|
|
4738
5015
|
const searchParams = new URL(location.href).searchParams;
|
|
4739
5016
|
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
4740
5017
|
const searchParamPreviewId = searchParams.get(
|
|
4741
|
-
`builder.
|
|
5018
|
+
`builder.overrides.${searchParamPreviewModel}`
|
|
4742
5019
|
);
|
|
4743
5020
|
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
4744
5021
|
if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id)) {
|
|
@@ -4758,21 +5035,21 @@ function EnableEditor(props) {
|
|
|
4758
5035
|
onMount3(() => {
|
|
4759
5036
|
if (!props.apiKey) {
|
|
4760
5037
|
logger.error(
|
|
4761
|
-
"No API key provided to `
|
|
5038
|
+
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
4762
5039
|
);
|
|
4763
5040
|
}
|
|
4764
5041
|
evaluateJsCode();
|
|
4765
5042
|
runHttpRequests();
|
|
4766
5043
|
emitStateUpdate();
|
|
4767
5044
|
});
|
|
4768
|
-
const onUpdateFn_0_props_content =
|
|
5045
|
+
const onUpdateFn_0_props_content = createMemo15(() => props.content);
|
|
4769
5046
|
function onUpdateFn_0() {
|
|
4770
5047
|
if (props.content) {
|
|
4771
5048
|
mergeNewContent(props.content);
|
|
4772
5049
|
}
|
|
4773
5050
|
}
|
|
4774
5051
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
4775
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
5052
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
|
|
4776
5053
|
function onUpdateFn_1() {
|
|
4777
5054
|
evaluateJsCode();
|
|
4778
5055
|
}
|
|
@@ -4782,7 +5059,7 @@ function EnableEditor(props) {
|
|
|
4782
5059
|
onUpdateFn_1
|
|
4783
5060
|
)
|
|
4784
5061
|
);
|
|
4785
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
5062
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
4786
5063
|
function onUpdateFn_2() {
|
|
4787
5064
|
runHttpRequests();
|
|
4788
5065
|
}
|
|
@@ -4794,7 +5071,7 @@ function EnableEditor(props) {
|
|
|
4794
5071
|
onUpdateFn_2
|
|
4795
5072
|
)
|
|
4796
5073
|
);
|
|
4797
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
5074
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
|
|
4798
5075
|
() => props.builderContextSignal.rootState
|
|
4799
5076
|
);
|
|
4800
5077
|
function onUpdateFn_3() {
|
|
@@ -4806,14 +5083,14 @@ function EnableEditor(props) {
|
|
|
4806
5083
|
onUpdateFn_3
|
|
4807
5084
|
)
|
|
4808
5085
|
);
|
|
4809
|
-
const onUpdateFn_4_props_data =
|
|
5086
|
+
const onUpdateFn_4_props_data = createMemo15(() => props.data);
|
|
4810
5087
|
function onUpdateFn_4() {
|
|
4811
5088
|
if (props.data) {
|
|
4812
5089
|
mergeNewRootState(props.data);
|
|
4813
5090
|
}
|
|
4814
5091
|
}
|
|
4815
5092
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
4816
|
-
const onUpdateFn_5_props_locale =
|
|
5093
|
+
const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
|
|
4817
5094
|
function onUpdateFn_5() {
|
|
4818
5095
|
if (props.locale) {
|
|
4819
5096
|
mergeNewRootState({
|
|
@@ -4822,7 +5099,7 @@ function EnableEditor(props) {
|
|
|
4822
5099
|
}
|
|
4823
5100
|
}
|
|
4824
5101
|
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
4825
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
5102
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
|
|
4826
5103
|
class={getWrapperClassName(
|
|
4827
5104
|
props.content?.testVariationId || props.content?.id
|
|
4828
5105
|
)}
|
|
@@ -4835,14 +5112,14 @@ function EnableEditor(props) {
|
|
|
4835
5112
|
{...showContentProps()}
|
|
4836
5113
|
{...props.contentWrapperProps}
|
|
4837
5114
|
component={ContentWrapper()}
|
|
4838
|
-
>{props.children}</Dynamic5></
|
|
5115
|
+
>{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
|
|
4839
5116
|
}
|
|
4840
5117
|
var Enable_editor_default = EnableEditor;
|
|
4841
5118
|
|
|
4842
5119
|
// src/components/content/components/styles.tsx
|
|
4843
|
-
import { createSignal as
|
|
5120
|
+
import { createSignal as createSignal16 } from "solid-js";
|
|
4844
5121
|
function ContentStyles(props) {
|
|
4845
|
-
const [injectedStyles, setInjectedStyles] =
|
|
5122
|
+
const [injectedStyles, setInjectedStyles] = createSignal16(
|
|
4846
5123
|
`
|
|
4847
5124
|
${getCss({
|
|
4848
5125
|
cssCode: props.cssCode,
|
|
@@ -4899,7 +5176,7 @@ var getContentInitialValue = ({
|
|
|
4899
5176
|
|
|
4900
5177
|
// src/components/content/content.tsx
|
|
4901
5178
|
function ContentComponent(props) {
|
|
4902
|
-
const [scriptStr, setScriptStr] =
|
|
5179
|
+
const [scriptStr, setScriptStr] = createSignal17(
|
|
4903
5180
|
getUpdateVariantVisibilityScript({
|
|
4904
5181
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
4905
5182
|
variationId: props.content?.testVariationId,
|
|
@@ -4907,7 +5184,7 @@ function ContentComponent(props) {
|
|
|
4907
5184
|
contentId: props.content?.id
|
|
4908
5185
|
})
|
|
4909
5186
|
);
|
|
4910
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
5187
|
+
const [registeredComponents, setRegisteredComponents] = createSignal17(
|
|
4911
5188
|
[
|
|
4912
5189
|
...getDefaultRegisteredComponents(),
|
|
4913
5190
|
...props.customComponents || []
|
|
@@ -4922,7 +5199,7 @@ function ContentComponent(props) {
|
|
|
4922
5199
|
{}
|
|
4923
5200
|
)
|
|
4924
5201
|
);
|
|
4925
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
5202
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal17({
|
|
4926
5203
|
content: getContentInitialValue({
|
|
4927
5204
|
content: props.content,
|
|
4928
5205
|
data: props.data
|
|
@@ -4980,16 +5257,16 @@ function ContentComponent(props) {
|
|
|
4980
5257
|
setBuilderContextSignal
|
|
4981
5258
|
}}
|
|
4982
5259
|
>
|
|
4983
|
-
<
|
|
5260
|
+
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
4984
5261
|
id="builderio-variant-visibility"
|
|
4985
5262
|
scriptStr={scriptStr()}
|
|
4986
|
-
/></
|
|
4987
|
-
<
|
|
5263
|
+
/></Show13>
|
|
5264
|
+
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
4988
5265
|
isNestedRender={props.isNestedRender}
|
|
4989
5266
|
contentId={builderContextSignal().content?.id}
|
|
4990
5267
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
4991
5268
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
4992
|
-
/></
|
|
5269
|
+
/></Show13>
|
|
4993
5270
|
<Blocks_default
|
|
4994
5271
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
4995
5272
|
context={builderContextSignal()}
|
|
@@ -5002,13 +5279,13 @@ var Content_default = ContentComponent;
|
|
|
5002
5279
|
|
|
5003
5280
|
// src/components/content-variants/content-variants.tsx
|
|
5004
5281
|
function ContentVariants(props) {
|
|
5005
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
5282
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
|
|
5006
5283
|
checkShouldRenderVariants({
|
|
5007
5284
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
5008
5285
|
content: props.content
|
|
5009
5286
|
})
|
|
5010
5287
|
);
|
|
5011
|
-
const updateCookieAndStylesScriptStr =
|
|
5288
|
+
const updateCookieAndStylesScriptStr = createMemo18(() => {
|
|
5012
5289
|
return getUpdateCookieAndStylesScript(
|
|
5013
5290
|
getVariants(props.content).map((value) => ({
|
|
5014
5291
|
id: value.testVariationId,
|
|
@@ -5017,10 +5294,10 @@ function ContentVariants(props) {
|
|
|
5017
5294
|
props.content?.id || ""
|
|
5018
5295
|
);
|
|
5019
5296
|
});
|
|
5020
|
-
const hideVariantsStyleString =
|
|
5297
|
+
const hideVariantsStyleString = createMemo18(() => {
|
|
5021
5298
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
5022
5299
|
});
|
|
5023
|
-
const defaultContent =
|
|
5300
|
+
const defaultContent = createMemo18(() => {
|
|
5024
5301
|
return shouldRenderVariants() ? {
|
|
5025
5302
|
...props.content,
|
|
5026
5303
|
testVariationId: props.content?.id
|
|
@@ -5033,11 +5310,11 @@ function ContentVariants(props) {
|
|
|
5033
5310
|
setShouldRenderVariants(false);
|
|
5034
5311
|
});
|
|
5035
5312
|
return <>
|
|
5036
|
-
<
|
|
5313
|
+
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5037
5314
|
id="builderio-init-variants-fns"
|
|
5038
5315
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5039
|
-
/></
|
|
5040
|
-
<
|
|
5316
|
+
/></Show14>
|
|
5317
|
+
<Show14 when={shouldRenderVariants()}>
|
|
5041
5318
|
<Inlined_styles_default
|
|
5042
5319
|
id="builderio-variants"
|
|
5043
5320
|
styles={hideVariantsStyleString()}
|
|
@@ -5046,7 +5323,7 @@ function ContentVariants(props) {
|
|
|
5046
5323
|
id="builderio-variants-visibility"
|
|
5047
5324
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5048
5325
|
/>
|
|
5049
|
-
<
|
|
5326
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5050
5327
|
const index = _index();
|
|
5051
5328
|
return <Content_default
|
|
5052
5329
|
isNestedRender={props.isNestedRender}
|
|
@@ -5070,8 +5347,8 @@ function ContentVariants(props) {
|
|
|
5070
5347
|
contentWrapperProps={props.contentWrapperProps}
|
|
5071
5348
|
trustedHosts={props.trustedHosts}
|
|
5072
5349
|
/>;
|
|
5073
|
-
}}</
|
|
5074
|
-
</
|
|
5350
|
+
}}</For9>
|
|
5351
|
+
</Show14>
|
|
5075
5352
|
<Content_default
|
|
5076
5353
|
isNestedRender={props.isNestedRender}
|
|
5077
5354
|
{...{}}
|
|
@@ -5124,14 +5401,14 @@ var fetchSymbolContent = async ({
|
|
|
5124
5401
|
|
|
5125
5402
|
// src/blocks/symbol/symbol.tsx
|
|
5126
5403
|
function Symbol(props) {
|
|
5127
|
-
const [contentToUse, setContentToUse] =
|
|
5128
|
-
const blocksWrapper =
|
|
5404
|
+
const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
|
|
5405
|
+
const blocksWrapper = createMemo19(() => {
|
|
5129
5406
|
return "div";
|
|
5130
5407
|
});
|
|
5131
|
-
const contentWrapper =
|
|
5408
|
+
const contentWrapper = createMemo19(() => {
|
|
5132
5409
|
return "div";
|
|
5133
5410
|
});
|
|
5134
|
-
const className =
|
|
5411
|
+
const className = createMemo19(() => {
|
|
5135
5412
|
return [
|
|
5136
5413
|
...[props.attributes[getClassPropName()]],
|
|
5137
5414
|
"builder-symbol",
|
|
@@ -5153,7 +5430,7 @@ function Symbol(props) {
|
|
|
5153
5430
|
}
|
|
5154
5431
|
onMount5(() => {
|
|
5155
5432
|
});
|
|
5156
|
-
const onUpdateFn_0_props_symbol =
|
|
5433
|
+
const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
|
|
5157
5434
|
function onUpdateFn_0() {
|
|
5158
5435
|
setContent();
|
|
5159
5436
|
}
|