@builder.io/sdk-solid 1.0.28 → 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.
@@ -1873,1010 +1873,1010 @@ var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : tru
1873
1873
  // src/components/content/content.tsx
1874
1874
  import { Show as Show13, createSignal as createSignal17 } from "solid-js";
1875
1875
 
1876
- // src/blocks/button/component-info.ts
1877
- var componentInfo = {
1878
- name: "Core:Button",
1879
- image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1880
- defaultStyles: {
1881
- // TODO: make min width more intuitive and set one
1882
- appearance: "none",
1883
- paddingTop: "15px",
1884
- paddingBottom: "15px",
1885
- paddingLeft: "25px",
1886
- paddingRight: "25px",
1887
- backgroundColor: "#000000",
1888
- color: "white",
1889
- borderRadius: "4px",
1890
- textAlign: "center",
1891
- cursor: "pointer"
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
+ }
1892
1889
  },
1893
- inputs: [{
1894
- name: "text",
1895
- type: "text",
1896
- defaultValue: "Click me!",
1897
- bubble: true
1898
- }, {
1899
- name: "link",
1900
- type: "url",
1901
- bubble: true
1902
- }, {
1903
- name: "openLinkInNewTab",
1904
- type: "boolean",
1905
- defaultValue: false,
1906
- friendlyName: "Open link in new tab"
1907
- }],
1908
- static: true,
1909
- noWrap: true
1910
- };
1911
-
1912
- // src/blocks/columns/component-info.ts
1913
- var componentInfo2 = {
1914
- // TODO: ways to statically preprocess JSON for references, functions, etc
1915
- name: "Columns",
1916
- isRSC: true,
1917
- inputs: [{
1918
- name: "columns",
1919
- type: "array",
1920
- broadcast: true,
1921
- subFields: [{
1922
- name: "blocks",
1923
- type: "array",
1924
- hideFromUI: true,
1925
- defaultValue: [{
1926
- "@type": "@builder.io/sdk:Element",
1927
- responsiveStyles: {
1928
- large: {
1929
- display: "flex",
1930
- flexDirection: "column",
1931
- alignItems: "stretch",
1932
- flexShrink: "0",
1933
- position: "relative",
1934
- marginTop: "30px",
1935
- textAlign: "center",
1936
- lineHeight: "normal",
1937
- height: "auto",
1938
- minHeight: "20px",
1939
- minWidth: "20px",
1940
- overflow: "hidden"
1941
- }
1942
- },
1943
- component: {
1944
- name: "Image",
1945
- options: {
1946
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1947
- backgroundPosition: "center",
1948
- backgroundSize: "cover",
1949
- aspectRatio: 0.7004048582995948
1950
- }
1951
- }
1952
- }, {
1953
- "@type": "@builder.io/sdk:Element",
1954
- responsiveStyles: {
1955
- large: {
1956
- display: "flex",
1957
- flexDirection: "column",
1958
- alignItems: "stretch",
1959
- flexShrink: "0",
1960
- position: "relative",
1961
- marginTop: "30px",
1962
- textAlign: "center",
1963
- lineHeight: "normal",
1964
- height: "auto"
1965
- }
1966
- },
1967
- component: {
1968
- name: "Text",
1969
- options: {
1970
- text: "<p>Enter some text...</p>"
1971
- }
1972
- }
1973
- }]
1974
- }, {
1975
- name: "width",
1976
- type: "number",
1977
- hideFromUI: true,
1978
- helperText: "Width %, e.g. set to 50 to fill half of the space"
1979
- }, {
1980
- name: "link",
1981
- type: "url",
1982
- helperText: "Optionally set a url that clicking this column will link to"
1983
- }],
1984
- defaultValue: [{
1985
- blocks: [{
1986
- "@type": "@builder.io/sdk:Element",
1987
- responsiveStyles: {
1988
- large: {
1989
- display: "flex",
1990
- flexDirection: "column",
1991
- alignItems: "stretch",
1992
- flexShrink: "0",
1993
- position: "relative",
1994
- marginTop: "30px",
1995
- textAlign: "center",
1996
- lineHeight: "normal",
1997
- height: "auto",
1998
- minHeight: "20px",
1999
- minWidth: "20px",
2000
- overflow: "hidden"
2001
- }
2002
- },
2003
- component: {
2004
- name: "Image",
2005
- options: {
2006
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
2007
- backgroundPosition: "center",
2008
- backgroundSize: "cover",
2009
- aspectRatio: 0.7004048582995948
2010
- }
2011
- }
2012
- }, {
2013
- "@type": "@builder.io/sdk:Element",
2014
- responsiveStyles: {
2015
- large: {
2016
- display: "flex",
2017
- flexDirection: "column",
2018
- alignItems: "stretch",
2019
- flexShrink: "0",
2020
- position: "relative",
2021
- marginTop: "30px",
2022
- textAlign: "center",
2023
- lineHeight: "normal",
2024
- height: "auto"
2025
- }
2026
- },
2027
- component: {
2028
- name: "Text",
2029
- options: {
2030
- text: "<p>Enter some text...</p>"
2031
- }
2032
- }
2033
- }]
2034
- }, {
2035
- blocks: [{
2036
- "@type": "@builder.io/sdk:Element",
2037
- responsiveStyles: {
2038
- large: {
2039
- display: "flex",
2040
- flexDirection: "column",
2041
- alignItems: "stretch",
2042
- flexShrink: "0",
2043
- position: "relative",
2044
- marginTop: "30px",
2045
- textAlign: "center",
2046
- lineHeight: "normal",
2047
- height: "auto",
2048
- minHeight: "20px",
2049
- minWidth: "20px",
2050
- overflow: "hidden"
2051
- }
2052
- },
2053
- component: {
2054
- name: "Image",
2055
- options: {
2056
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
2057
- backgroundPosition: "center",
2058
- backgroundSize: "cover",
2059
- aspectRatio: 0.7004048582995948
2060
- }
2061
- }
2062
- }, {
2063
- "@type": "@builder.io/sdk:Element",
2064
- responsiveStyles: {
2065
- large: {
2066
- display: "flex",
2067
- flexDirection: "column",
2068
- alignItems: "stretch",
2069
- flexShrink: "0",
2070
- position: "relative",
2071
- marginTop: "30px",
2072
- textAlign: "center",
2073
- lineHeight: "normal",
2074
- height: "auto"
2075
- }
2076
- },
2077
- component: {
2078
- name: "Text",
2079
- options: {
2080
- text: "<p>Enter some text...</p>"
2081
- }
2082
- }
2083
- }]
2084
- }],
2085
- onChange: (options) => {
2086
- function clearWidths() {
2087
- columns.forEach((col) => {
2088
- col.delete("width");
2089
- });
1890
+ children: [{
1891
+ "@type": "@builder.io/sdk:Element",
1892
+ responsiveStyles: {
1893
+ large: {
1894
+ textAlign: "left",
1895
+ display: "flex",
1896
+ flexDirection: "column"
2090
1897
  }
2091
- const columns = options.get("columns");
2092
- if (Array.isArray(columns)) {
2093
- const containsColumnWithWidth = !!columns.find((col) => col.get("width"));
2094
- if (containsColumnWithWidth) {
2095
- const containsColumnWithoutWidth = !!columns.find((col) => !col.get("width"));
2096
- if (containsColumnWithoutWidth) {
2097
- clearWidths();
2098
- } else {
2099
- const sumWidths = columns.reduce((memo, col) => {
2100
- return memo + col.get("width");
2101
- }, 0);
2102
- const widthsDontAddUp = sumWidths !== 100;
2103
- if (widthsDontAddUp) {
2104
- clearWidths();
2105
- }
2106
- }
2107
- }
1898
+ },
1899
+ component: {
1900
+ name: "Text",
1901
+ options: {
1902
+ text: "I am an accordion title. Click me!"
2108
1903
  }
2109
1904
  }
2110
- }, {
2111
- name: "space",
2112
- type: "number",
2113
- defaultValue: 20,
2114
- helperText: "Size of gap between columns",
2115
- advanced: true
2116
- }, {
2117
- name: "stackColumnsAt",
2118
- type: "string",
2119
- defaultValue: "tablet",
2120
- helperText: "Convert horizontal columns to vertical at what device size",
2121
- enum: ["tablet", "mobile", "never"],
2122
- advanced: true
2123
- }, {
2124
- name: "reverseColumnsWhenStacked",
2125
- type: "boolean",
2126
- defaultValue: false,
2127
- helperText: "When stacking columns for mobile devices, reverse the ordering",
2128
- advanced: true
2129
1905
  }]
2130
1906
  };
2131
-
2132
- // src/blocks/fragment/component-info.ts
2133
- var componentInfo3 = {
2134
- name: "Fragment",
2135
- static: true,
2136
- hidden: true,
2137
- canHaveChildren: true,
2138
- noWrap: true
2139
- };
2140
-
2141
- // src/blocks/image/component-info.ts
2142
- var componentInfo4 = {
2143
- name: "Image",
2144
- static: true,
2145
- 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",
2146
- defaultStyles: {
2147
- position: "relative",
2148
- minHeight: "20px",
2149
- minWidth: "20px",
2150
- overflow: "hidden"
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
+ }
2151
1919
  },
2152
- canHaveChildren: true,
2153
- inputs: [{
2154
- name: "image",
2155
- type: "file",
2156
- bubble: true,
2157
- allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
2158
- required: true,
2159
- defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
2160
- onChange: (options) => {
2161
- const DEFAULT_ASPECT_RATIO = 0.7041;
2162
- options.delete("srcset");
2163
- options.delete("noWebp");
2164
- function loadImage(url, timeout = 6e4) {
2165
- return new Promise((resolve, reject) => {
2166
- const img = document.createElement("img");
2167
- let loaded = false;
2168
- img.onload = () => {
2169
- loaded = true;
2170
- resolve(img);
2171
- };
2172
- img.addEventListener("error", (event) => {
2173
- console.warn("Image load failed", event.error);
2174
- reject(event.error);
2175
- });
2176
- img.src = url;
2177
- setTimeout(() => {
2178
- if (!loaded) {
2179
- reject(new Error("Image load timed out"));
2180
- }
2181
- }, timeout);
2182
- });
2183
- }
2184
- function round2(num) {
2185
- return Math.round(num * 1e3) / 1e3;
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"
2186
1929
  }
2187
- const value = options.get("image");
2188
- const aspectRatio = options.get("aspectRatio");
2189
- fetch(value).then((res) => res.blob()).then((blob) => {
2190
- if (blob.type.includes("svg")) {
2191
- options.set("noWebp", true);
2192
- }
2193
- });
2194
- if (value && (!aspectRatio || aspectRatio === DEFAULT_ASPECT_RATIO)) {
2195
- return loadImage(value).then((img) => {
2196
- const possiblyUpdatedAspectRatio = options.get("aspectRatio");
2197
- if (options.get("image") === value && (!possiblyUpdatedAspectRatio || possiblyUpdatedAspectRatio === DEFAULT_ASPECT_RATIO)) {
2198
- if (img.width && img.height) {
2199
- options.set("aspectRatio", round2(img.height / img.width));
2200
- options.set("height", img.height);
2201
- options.set("width", img.width);
2202
- }
2203
- }
2204
- });
1930
+ },
1931
+ component: {
1932
+ name: "Text",
1933
+ options: {
1934
+ text: "I am an accordion detail, hello!"
2205
1935
  }
2206
1936
  }
2207
- }, {
2208
- name: "backgroundSize",
2209
- type: "text",
2210
- defaultValue: "cover",
2211
- enum: [{
2212
- label: "contain",
2213
- value: "contain",
2214
- helperText: "The image should never get cropped"
2215
- }, {
2216
- label: "cover",
2217
- value: "cover",
2218
- helperText: "The image should fill it's box, cropping when needed"
2219
- }]
2220
- }, {
2221
- name: "backgroundPosition",
2222
- type: "text",
2223
- defaultValue: "center",
2224
- enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
2225
- }, {
2226
- name: "altText",
2227
- type: "string",
2228
- helperText: "Text to display when the user has images off"
2229
- }, {
2230
- name: "height",
2231
- type: "number",
2232
- hideFromUI: true
2233
- }, {
2234
- name: "width",
2235
- type: "number",
2236
- hideFromUI: true
2237
- }, {
2238
- name: "sizes",
2239
- type: "string",
2240
- hideFromUI: true
2241
- }, {
2242
- name: "srcset",
2243
- type: "string",
2244
- hideFromUI: true
2245
- }, {
2246
- name: "lazy",
2247
- type: "boolean",
2248
- defaultValue: true,
2249
- hideFromUI: true
2250
- }, {
2251
- name: "fitContent",
2252
- type: "boolean",
2253
- helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
2254
- defaultValue: true
2255
- }, {
2256
- name: "aspectRatio",
2257
- type: "number",
2258
- helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
2259
- advanced: true,
2260
- defaultValue: 0.7041
2261
1937
  }]
2262
1938
  };
2263
-
2264
- // src/blocks/section/component-info.ts
2265
- var componentInfo5 = {
2266
- name: "Core:Section",
2267
- static: true,
2268
- image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
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
+ },
2269
1948
  inputs: [{
2270
- name: "maxWidth",
2271
- type: "number",
2272
- defaultValue: 1200
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")
2273
1971
  }, {
2274
- name: "lazyLoad",
1972
+ name: "oneAtATime",
1973
+ helperText: "Only allow opening one at a time (collapse all others when new item openned)",
2275
1974
  type: "boolean",
2276
- defaultValue: false,
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",
2277
1991
  advanced: true,
2278
- description: "Only render this section when in view"
2279
- }],
2280
- defaultStyles: {
2281
- paddingLeft: "20px",
2282
- paddingRight: "20px",
2283
- paddingTop: "50px",
2284
- paddingBottom: "50px",
2285
- marginTop: "0px",
2286
- width: "100vw",
2287
- marginLeft: "calc(50% - 50vw)"
2288
- },
2289
- canHaveChildren: true,
2290
- defaultChildren: [{
2291
- "@type": "@builder.io/sdk:Element",
2292
- responsiveStyles: {
2293
- large: {
2294
- textAlign: "center"
2295
- }
2296
- },
2297
- component: {
2298
- name: "Text",
2299
- options: {
2300
- text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
1992
+ defaultValue: false,
1993
+ onChange: (options) => {
1994
+ if (options.get("useChildrenForItems") === true) {
1995
+ options.set("items", []);
2301
1996
  }
2302
1997
  }
2303
1998
  }]
2304
1999
  };
2305
2000
 
2306
- // src/blocks/slot/component-info.ts
2307
- var componentInfo6 = {
2308
- name: "Slot",
2309
- isRSC: true,
2310
- description: "Allow child blocks to be inserted into this content when used as a Symbol",
2311
- docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
2312
- image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
2313
- // Maybe wrap this for canHaveChildren so bind children to this hm
2314
- inputs: [{
2315
- name: "name",
2316
- type: "string",
2317
- required: true,
2318
- defaultValue: "children"
2319
- }]
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();
2320
2007
  };
2321
2008
 
2322
- // src/blocks/slot/slot.tsx
2323
- function Slot(props) {
2324
- return <div
2325
- style={{
2326
- "pointer-events": "auto"
2327
- }}
2328
- {...!props.builderContext.context?.symbolId && {
2329
- "builder-slot": props.name
2330
- }}
2331
- ><Blocks_default
2332
- parent={props.builderContext.context?.symbolId}
2333
- path={`symbol.data.${props.name}`}
2334
- context={props.builderContext}
2335
- blocks={props.builderContext.rootState?.[props.name]}
2336
- /></div>;
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>;
2337
2149
  }
2338
- var slot_default = Slot;
2150
+ var accordion_default = Accordion;
2339
2151
 
2340
- // src/blocks/symbol/component-info.ts
2341
- var componentInfo7 = {
2342
- name: "Symbol",
2343
- noWrap: true,
2344
- static: true,
2345
- isRSC: true,
2152
+ // src/blocks/button/component-info.ts
2153
+ var componentInfo2 = {
2154
+ name: "Core:Button",
2155
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
2156
+ defaultStyles: {
2157
+ // TODO: make min width more intuitive and set one
2158
+ appearance: "none",
2159
+ paddingTop: "15px",
2160
+ paddingBottom: "15px",
2161
+ paddingLeft: "25px",
2162
+ paddingRight: "25px",
2163
+ backgroundColor: "#000000",
2164
+ color: "white",
2165
+ borderRadius: "4px",
2166
+ textAlign: "center",
2167
+ cursor: "pointer"
2168
+ },
2346
2169
  inputs: [{
2347
- name: "symbol",
2348
- type: "uiSymbol"
2349
- }, {
2350
- name: "dataOnly",
2351
- helperText: "Make this a data symbol that doesn't display any UI",
2352
- type: "boolean",
2353
- defaultValue: false,
2354
- advanced: true,
2355
- hideFromUI: true
2356
- }, {
2357
- name: "inheritState",
2358
- helperText: "Inherit the parent component state and data",
2359
- type: "boolean",
2360
- defaultValue: false,
2361
- advanced: true
2170
+ name: "text",
2171
+ type: "text",
2172
+ defaultValue: "Click me!",
2173
+ bubble: true
2362
2174
  }, {
2363
- name: "renderToLiquid",
2364
- helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
2175
+ name: "link",
2176
+ type: "url",
2177
+ bubble: true
2178
+ }, {
2179
+ name: "openLinkInNewTab",
2365
2180
  type: "boolean",
2366
2181
  defaultValue: false,
2367
- advanced: true,
2368
- hideFromUI: true
2369
- }, {
2370
- name: "useChildren",
2371
- hideFromUI: true,
2372
- type: "boolean"
2373
- }]
2182
+ friendlyName: "Open link in new tab"
2183
+ }],
2184
+ static: true,
2185
+ noWrap: true
2374
2186
  };
2375
2187
 
2376
- // src/blocks/tabs/component-info.ts
2377
- var defaultTab = {
2378
- "@type": "@builder.io/sdk:Element",
2379
- responsiveStyles: {
2380
- large: {
2381
- paddingLeft: "20px",
2382
- paddingRight: "20px",
2383
- paddingTop: "10px",
2384
- paddingBottom: "10px",
2385
- minWidth: "100px",
2386
- textAlign: "center",
2387
- display: "flex",
2388
- flexDirection: "column",
2389
- cursor: "pointer",
2390
- userSelect: "none"
2391
- }
2392
- },
2393
- component: {
2394
- name: "Text",
2395
- options: {
2396
- text: "New tab"
2397
- }
2398
- }
2399
- };
2400
- var defaultElement = {
2401
- "@type": "@builder.io/sdk:Element",
2402
- responsiveStyles: {
2403
- large: {
2404
- height: "200px",
2405
- display: "flex",
2406
- marginTop: "20px",
2407
- flexDirection: "column"
2408
- }
2409
- },
2410
- component: {
2411
- name: "Text",
2412
- options: {
2413
- text: "New tab content "
2414
- }
2415
- }
2416
- };
2417
- var componentInfo8 = {
2418
- name: "Builder: Tabs",
2188
+ // src/blocks/columns/component-info.ts
2189
+ var componentInfo3 = {
2190
+ // TODO: ways to statically preprocess JSON for references, functions, etc
2191
+ name: "Columns",
2192
+ isRSC: true,
2419
2193
  inputs: [{
2420
- name: "tabs",
2421
- type: "list",
2194
+ name: "columns",
2195
+ type: "array",
2422
2196
  broadcast: true,
2423
2197
  subFields: [{
2424
- name: "label",
2425
- type: "uiBlocks",
2198
+ name: "blocks",
2199
+ type: "array",
2426
2200
  hideFromUI: true,
2427
- defaultValue: [defaultTab]
2201
+ defaultValue: [{
2202
+ "@type": "@builder.io/sdk:Element",
2203
+ responsiveStyles: {
2204
+ large: {
2205
+ display: "flex",
2206
+ flexDirection: "column",
2207
+ alignItems: "stretch",
2208
+ flexShrink: "0",
2209
+ position: "relative",
2210
+ marginTop: "30px",
2211
+ textAlign: "center",
2212
+ lineHeight: "normal",
2213
+ height: "auto",
2214
+ minHeight: "20px",
2215
+ minWidth: "20px",
2216
+ overflow: "hidden"
2217
+ }
2218
+ },
2219
+ component: {
2220
+ name: "Image",
2221
+ options: {
2222
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
2223
+ backgroundPosition: "center",
2224
+ backgroundSize: "cover",
2225
+ aspectRatio: 0.7004048582995948
2226
+ }
2227
+ }
2228
+ }, {
2229
+ "@type": "@builder.io/sdk:Element",
2230
+ responsiveStyles: {
2231
+ large: {
2232
+ display: "flex",
2233
+ flexDirection: "column",
2234
+ alignItems: "stretch",
2235
+ flexShrink: "0",
2236
+ position: "relative",
2237
+ marginTop: "30px",
2238
+ textAlign: "center",
2239
+ lineHeight: "normal",
2240
+ height: "auto"
2241
+ }
2242
+ },
2243
+ component: {
2244
+ name: "Text",
2245
+ options: {
2246
+ text: "<p>Enter some text...</p>"
2247
+ }
2248
+ }
2249
+ }]
2428
2250
  }, {
2429
- name: "content",
2430
- type: "uiBlocks",
2251
+ name: "width",
2252
+ type: "number",
2431
2253
  hideFromUI: true,
2432
- defaultValue: [defaultElement]
2254
+ helperText: "Width %, e.g. set to 50 to fill half of the space"
2255
+ }, {
2256
+ name: "link",
2257
+ type: "url",
2258
+ helperText: "Optionally set a url that clicking this column will link to"
2433
2259
  }],
2434
2260
  defaultValue: [{
2435
- label: [{
2436
- ...defaultTab,
2261
+ blocks: [{
2262
+ "@type": "@builder.io/sdk:Element",
2263
+ responsiveStyles: {
2264
+ large: {
2265
+ display: "flex",
2266
+ flexDirection: "column",
2267
+ alignItems: "stretch",
2268
+ flexShrink: "0",
2269
+ position: "relative",
2270
+ marginTop: "30px",
2271
+ textAlign: "center",
2272
+ lineHeight: "normal",
2273
+ height: "auto",
2274
+ minHeight: "20px",
2275
+ minWidth: "20px",
2276
+ overflow: "hidden"
2277
+ }
2278
+ },
2437
2279
  component: {
2438
- name: "Text",
2280
+ name: "Image",
2439
2281
  options: {
2440
- text: "Tab 1"
2282
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
2283
+ backgroundPosition: "center",
2284
+ backgroundSize: "cover",
2285
+ aspectRatio: 0.7004048582995948
2441
2286
  }
2442
2287
  }
2443
- }],
2444
- content: [{
2445
- ...defaultElement,
2288
+ }, {
2289
+ "@type": "@builder.io/sdk:Element",
2290
+ responsiveStyles: {
2291
+ large: {
2292
+ display: "flex",
2293
+ flexDirection: "column",
2294
+ alignItems: "stretch",
2295
+ flexShrink: "0",
2296
+ position: "relative",
2297
+ marginTop: "30px",
2298
+ textAlign: "center",
2299
+ lineHeight: "normal",
2300
+ height: "auto"
2301
+ }
2302
+ },
2446
2303
  component: {
2447
2304
  name: "Text",
2448
2305
  options: {
2449
- text: "Tab 1 content"
2306
+ text: "<p>Enter some text...</p>"
2450
2307
  }
2451
2308
  }
2452
2309
  }]
2453
2310
  }, {
2454
- label: [{
2455
- ...defaultTab,
2311
+ blocks: [{
2312
+ "@type": "@builder.io/sdk:Element",
2313
+ responsiveStyles: {
2314
+ large: {
2315
+ display: "flex",
2316
+ flexDirection: "column",
2317
+ alignItems: "stretch",
2318
+ flexShrink: "0",
2319
+ position: "relative",
2320
+ marginTop: "30px",
2321
+ textAlign: "center",
2322
+ lineHeight: "normal",
2323
+ height: "auto",
2324
+ minHeight: "20px",
2325
+ minWidth: "20px",
2326
+ overflow: "hidden"
2327
+ }
2328
+ },
2456
2329
  component: {
2457
- name: "Text",
2330
+ name: "Image",
2458
2331
  options: {
2459
- text: "Tab 2"
2332
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
2333
+ backgroundPosition: "center",
2334
+ backgroundSize: "cover",
2335
+ aspectRatio: 0.7004048582995948
2460
2336
  }
2461
2337
  }
2462
- }],
2463
- content: [{
2464
- ...defaultElement,
2338
+ }, {
2339
+ "@type": "@builder.io/sdk:Element",
2340
+ responsiveStyles: {
2341
+ large: {
2342
+ display: "flex",
2343
+ flexDirection: "column",
2344
+ alignItems: "stretch",
2345
+ flexShrink: "0",
2346
+ position: "relative",
2347
+ marginTop: "30px",
2348
+ textAlign: "center",
2349
+ lineHeight: "normal",
2350
+ height: "auto"
2351
+ }
2352
+ },
2465
2353
  component: {
2466
2354
  name: "Text",
2467
2355
  options: {
2468
- text: "Tab 2 content"
2356
+ text: "<p>Enter some text...</p>"
2469
2357
  }
2470
2358
  }
2471
2359
  }]
2472
- }]
2473
- }, {
2474
- name: "activeTabStyle",
2475
- type: "uiStyle",
2476
- helperText: "CSS styles for the active tab",
2477
- defaultValue: {
2478
- backgroundColor: "rgba(0, 0, 0, 0.1)"
2360
+ }],
2361
+ onChange: (options) => {
2362
+ function clearWidths() {
2363
+ columns.forEach((col) => {
2364
+ col.delete("width");
2365
+ });
2366
+ }
2367
+ const columns = options.get("columns");
2368
+ if (Array.isArray(columns)) {
2369
+ const containsColumnWithWidth = !!columns.find((col) => col.get("width"));
2370
+ if (containsColumnWithWidth) {
2371
+ const containsColumnWithoutWidth = !!columns.find((col) => !col.get("width"));
2372
+ if (containsColumnWithoutWidth) {
2373
+ clearWidths();
2374
+ } else {
2375
+ const sumWidths = columns.reduce((memo, col) => {
2376
+ return memo + col.get("width");
2377
+ }, 0);
2378
+ const widthsDontAddUp = sumWidths !== 100;
2379
+ if (widthsDontAddUp) {
2380
+ clearWidths();
2381
+ }
2382
+ }
2383
+ }
2384
+ }
2479
2385
  }
2480
2386
  }, {
2481
- name: "defaultActiveTab",
2387
+ name: "space",
2482
2388
  type: "number",
2483
- helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
2484
- defaultValue: 1,
2389
+ defaultValue: 20,
2390
+ helperText: "Size of gap between columns",
2485
2391
  advanced: true
2486
2392
  }, {
2487
- name: "collapsible",
2393
+ name: "stackColumnsAt",
2394
+ type: "string",
2395
+ defaultValue: "tablet",
2396
+ helperText: "Convert horizontal columns to vertical at what device size",
2397
+ enum: ["tablet", "mobile", "never"],
2398
+ advanced: true
2399
+ }, {
2400
+ name: "reverseColumnsWhenStacked",
2488
2401
  type: "boolean",
2489
- helperText: "If on, clicking an open tab closes it so no tabs are active",
2490
2402
  defaultValue: false,
2403
+ helperText: "When stacking columns for mobile devices, reverse the ordering",
2491
2404
  advanced: true
2405
+ }]
2406
+ };
2407
+
2408
+ // src/blocks/fragment/component-info.ts
2409
+ var componentInfo4 = {
2410
+ name: "Fragment",
2411
+ static: true,
2412
+ hidden: true,
2413
+ canHaveChildren: true,
2414
+ noWrap: true
2415
+ };
2416
+
2417
+ // src/blocks/image/component-info.ts
2418
+ var componentInfo5 = {
2419
+ name: "Image",
2420
+ static: true,
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",
2422
+ defaultStyles: {
2423
+ position: "relative",
2424
+ minHeight: "20px",
2425
+ minWidth: "20px",
2426
+ overflow: "hidden"
2427
+ },
2428
+ canHaveChildren: true,
2429
+ inputs: [{
2430
+ name: "image",
2431
+ type: "file",
2432
+ bubble: true,
2433
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
2434
+ required: true,
2435
+ defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
2436
+ onChange: (options) => {
2437
+ const DEFAULT_ASPECT_RATIO = 0.7041;
2438
+ options.delete("srcset");
2439
+ options.delete("noWebp");
2440
+ function loadImage(url, timeout = 6e4) {
2441
+ return new Promise((resolve, reject) => {
2442
+ const img = document.createElement("img");
2443
+ let loaded = false;
2444
+ img.onload = () => {
2445
+ loaded = true;
2446
+ resolve(img);
2447
+ };
2448
+ img.addEventListener("error", (event) => {
2449
+ console.warn("Image load failed", event.error);
2450
+ reject(event.error);
2451
+ });
2452
+ img.src = url;
2453
+ setTimeout(() => {
2454
+ if (!loaded) {
2455
+ reject(new Error("Image load timed out"));
2456
+ }
2457
+ }, timeout);
2458
+ });
2459
+ }
2460
+ function round2(num) {
2461
+ return Math.round(num * 1e3) / 1e3;
2462
+ }
2463
+ const value = options.get("image");
2464
+ const aspectRatio = options.get("aspectRatio");
2465
+ fetch(value).then((res) => res.blob()).then((blob) => {
2466
+ if (blob.type.includes("svg")) {
2467
+ options.set("noWebp", true);
2468
+ }
2469
+ });
2470
+ if (value && (!aspectRatio || aspectRatio === DEFAULT_ASPECT_RATIO)) {
2471
+ return loadImage(value).then((img) => {
2472
+ const possiblyUpdatedAspectRatio = options.get("aspectRatio");
2473
+ if (options.get("image") === value && (!possiblyUpdatedAspectRatio || possiblyUpdatedAspectRatio === DEFAULT_ASPECT_RATIO)) {
2474
+ if (img.width && img.height) {
2475
+ options.set("aspectRatio", round2(img.height / img.width));
2476
+ options.set("height", img.height);
2477
+ options.set("width", img.width);
2478
+ }
2479
+ }
2480
+ });
2481
+ }
2482
+ }
2492
2483
  }, {
2493
- name: "tabHeaderLayout",
2494
- type: "enum",
2495
- helperText: "Change the layout of the tab headers (uses justify-content)",
2496
- defaultValue: "flex-start",
2484
+ name: "backgroundSize",
2485
+ type: "text",
2486
+ defaultValue: "cover",
2497
2487
  enum: [{
2498
- label: "Center",
2499
- value: "center"
2500
- }, {
2501
- label: "Space between",
2502
- value: "space-between"
2503
- }, {
2504
- label: "Space around",
2505
- value: "space-around"
2506
- }, {
2507
- label: "Left",
2508
- value: "flex-start"
2488
+ label: "contain",
2489
+ value: "contain",
2490
+ helperText: "The image should never get cropped"
2509
2491
  }, {
2510
- label: "Right",
2511
- value: "flex-end"
2492
+ label: "cover",
2493
+ value: "cover",
2494
+ helperText: "The image should fill it's box, cropping when needed"
2512
2495
  }]
2496
+ }, {
2497
+ name: "backgroundPosition",
2498
+ type: "text",
2499
+ defaultValue: "center",
2500
+ enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
2501
+ }, {
2502
+ name: "altText",
2503
+ type: "string",
2504
+ helperText: "Text to display when the user has images off"
2505
+ }, {
2506
+ name: "height",
2507
+ type: "number",
2508
+ hideFromUI: true
2509
+ }, {
2510
+ name: "width",
2511
+ type: "number",
2512
+ hideFromUI: true
2513
+ }, {
2514
+ name: "sizes",
2515
+ type: "string",
2516
+ hideFromUI: true
2517
+ }, {
2518
+ name: "srcset",
2519
+ type: "string",
2520
+ hideFromUI: true
2521
+ }, {
2522
+ name: "lazy",
2523
+ type: "boolean",
2524
+ defaultValue: true,
2525
+ hideFromUI: true
2526
+ }, {
2527
+ name: "fitContent",
2528
+ type: "boolean",
2529
+ helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
2530
+ defaultValue: true
2531
+ }, {
2532
+ name: "aspectRatio",
2533
+ type: "number",
2534
+ helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
2535
+ advanced: true,
2536
+ defaultValue: 0.7041
2513
2537
  }]
2514
2538
  };
2515
2539
 
2516
- // src/blocks/tabs/tabs.tsx
2517
- import { Show as Show8, For as For5, createSignal as createSignal9 } from "solid-js";
2518
- function Tabs(props) {
2519
- const [activeTab, setActiveTab] = createSignal9(
2520
- props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
2521
- );
2522
- function activeTabContent(active) {
2523
- return props.tabs && props.tabs[active].content;
2524
- }
2525
- function onClick(index) {
2526
- if (index === activeTab() && props.collapsible) {
2527
- setActiveTab(-1);
2528
- } else {
2529
- setActiveTab(index);
2530
- }
2531
- }
2532
- return <div>
2533
- <div
2534
- class="builder-tabs-wrap"
2535
- style={{
2536
- display: "flex",
2537
- "flex-direction": "row",
2538
- "justify-content": props.tabHeaderLayout || "flex-start",
2539
- overflow: "auto"
2540
- }}
2541
- ><For5 each={props.tabs}>{(tab, _index) => {
2542
- const index = _index();
2543
- return <span
2544
- class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2545
- key={index}
2546
- style={{
2547
- ...activeTab() === index ? props.activeTabStyle : {}
2548
- }}
2549
- onClick={(event) => onClick(index)}
2550
- ><Blocks_default
2551
- parent={props.builderBlock.id}
2552
- path={`component.options.tabs.${index}.label`}
2553
- blocks={tab.label}
2554
- context={props.builderContext}
2555
- registeredComponents={props.builderComponents}
2556
- linkComponent={props.builderLinkComponent}
2557
- /></span>;
2558
- }}</For5></div>
2559
- <Show8 when={activeTabContent(activeTab())}><div><Blocks_default
2560
- parent={props.builderBlock.id}
2561
- path={`component.options.tabs.${activeTab()}.content`}
2562
- blocks={activeTabContent(activeTab())}
2563
- context={props.builderContext}
2564
- registeredComponents={props.builderComponents}
2565
- linkComponent={props.builderLinkComponent}
2566
- /></div></Show8>
2567
- </div>;
2568
- }
2569
- var tabs_default = Tabs;
2570
-
2571
- // src/blocks/text/component-info.ts
2572
- var componentInfo9 = {
2573
- name: "Text",
2540
+ // src/blocks/section/component-info.ts
2541
+ var componentInfo6 = {
2542
+ name: "Core:Section",
2574
2543
  static: true,
2544
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
2545
+ inputs: [{
2546
+ name: "maxWidth",
2547
+ type: "number",
2548
+ defaultValue: 1200
2549
+ }, {
2550
+ name: "lazyLoad",
2551
+ type: "boolean",
2552
+ defaultValue: false,
2553
+ advanced: true,
2554
+ description: "Only render this section when in view"
2555
+ }],
2556
+ defaultStyles: {
2557
+ paddingLeft: "20px",
2558
+ paddingRight: "20px",
2559
+ paddingTop: "50px",
2560
+ paddingBottom: "50px",
2561
+ marginTop: "0px",
2562
+ width: "100vw",
2563
+ marginLeft: "calc(50% - 50vw)"
2564
+ },
2565
+ canHaveChildren: true,
2566
+ defaultChildren: [{
2567
+ "@type": "@builder.io/sdk:Element",
2568
+ responsiveStyles: {
2569
+ large: {
2570
+ textAlign: "center"
2571
+ }
2572
+ },
2573
+ component: {
2574
+ name: "Text",
2575
+ options: {
2576
+ text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
2577
+ }
2578
+ }
2579
+ }]
2580
+ };
2581
+
2582
+ // src/blocks/slot/component-info.ts
2583
+ var componentInfo7 = {
2584
+ name: "Slot",
2575
2585
  isRSC: true,
2576
- image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
2586
+ description: "Allow child blocks to be inserted into this content when used as a Symbol",
2587
+ docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
2588
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
2589
+ // Maybe wrap this for canHaveChildren so bind children to this hm
2577
2590
  inputs: [{
2578
- name: "text",
2579
- type: "html",
2591
+ name: "name",
2592
+ type: "string",
2580
2593
  required: true,
2581
- autoFocus: true,
2582
- bubble: true,
2583
- defaultValue: "Enter some text..."
2584
- }],
2585
- defaultStyles: {
2586
- lineHeight: "normal",
2587
- height: "auto",
2588
- textAlign: "center"
2589
- }
2594
+ defaultValue: "children"
2595
+ }]
2590
2596
  };
2591
2597
 
2592
- // src/blocks/text/text.tsx
2593
- function Text(props) {
2598
+ // src/blocks/slot/slot.tsx
2599
+ function Slot(props) {
2594
2600
  return <div
2595
- class="builder-text"
2596
- innerHTML={props.text?.toString() || ""}
2597
2601
  style={{
2598
- outline: "none"
2602
+ "pointer-events": "auto"
2599
2603
  }}
2600
- />;
2604
+ {...!props.builderContext.context?.symbolId && {
2605
+ "builder-slot": props.name
2606
+ }}
2607
+ ><Blocks_default
2608
+ parent={props.builderContext.context?.symbolId}
2609
+ path={`symbol.data.${props.name}`}
2610
+ context={props.builderContext}
2611
+ blocks={props.builderContext.rootState?.[props.name]}
2612
+ /></div>;
2601
2613
  }
2602
- var text_default = Text;
2603
-
2604
- // src/blocks/accordion/accordion.tsx
2605
- import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
2614
+ var slot_default = Slot;
2606
2615
 
2607
- // src/blocks/accordion/helpers.ts
2608
- var convertOrderNumberToString = (order) => {
2609
- return order.toString();
2616
+ // src/blocks/symbol/component-info.ts
2617
+ var componentInfo8 = {
2618
+ name: "Symbol",
2619
+ noWrap: true,
2620
+ static: true,
2621
+ isRSC: true,
2622
+ inputs: [{
2623
+ name: "symbol",
2624
+ type: "uiSymbol"
2625
+ }, {
2626
+ name: "dataOnly",
2627
+ helperText: "Make this a data symbol that doesn't display any UI",
2628
+ type: "boolean",
2629
+ defaultValue: false,
2630
+ advanced: true,
2631
+ hideFromUI: true
2632
+ }, {
2633
+ name: "inheritState",
2634
+ helperText: "Inherit the parent component state and data",
2635
+ type: "boolean",
2636
+ defaultValue: false,
2637
+ advanced: true
2638
+ }, {
2639
+ name: "renderToLiquid",
2640
+ helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
2641
+ type: "boolean",
2642
+ defaultValue: false,
2643
+ advanced: true,
2644
+ hideFromUI: true
2645
+ }, {
2646
+ name: "useChildren",
2647
+ hideFromUI: true,
2648
+ type: "boolean"
2649
+ }]
2610
2650
  };
2611
2651
 
2612
- // src/blocks/accordion/accordion.tsx
2613
- function Accordion(props) {
2614
- const [open, setOpen] = createSignal10([]);
2615
- const onlyOneAtATime = createMemo10(() => {
2616
- return Boolean(props.grid || props.oneAtATime);
2617
- });
2618
- const accordionStyles = createMemo10(() => {
2619
- const styles = {
2620
- display: "flex",
2621
- alignItems: "stretch",
2622
- flexDirection: "column",
2623
- ...props.grid && {
2624
- flexDirection: "row",
2625
- alignItems: "flex-start",
2626
- flexWrap: "wrap"
2627
- }
2628
- };
2629
- return Object.fromEntries(
2630
- Object.entries(styles).map(([key, value]) => [
2631
- camelToKebabCase(key),
2632
- value
2633
- ])
2634
- );
2635
- });
2636
- const accordionTitleStyles = createMemo10(() => {
2637
- const shared = {
2638
- display: "flex",
2639
- flexDirection: "column"
2640
- };
2641
- const styles = Object.fromEntries(
2642
- Object.entries({
2643
- ...shared,
2644
- alignItems: "stretch",
2645
- cursor: "pointer"
2646
- }).map(([key, value]) => [camelToKebabCase(key), value])
2647
- );
2648
- return Object.fromEntries(
2649
- Object.entries(styles).filter(([_, value]) => value !== void 0)
2650
- );
2651
- });
2652
- function getAccordionTitleClassName(index) {
2653
- return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
2654
- }
2655
- function getAccordionDetailClassName(index) {
2656
- return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
2657
- }
2658
- const openGridItemOrder = createMemo10(() => {
2659
- let itemOrder = null;
2660
- const getOpenGridItemPosition = props.grid && open().length;
2661
- if (getOpenGridItemPosition && document) {
2662
- const openItemIndex = open()[0];
2663
- const openItem = document.querySelector(
2664
- `.builder-accordion-title[data-index="${openItemIndex}"]`
2665
- );
2666
- let subjectItem = openItem;
2667
- itemOrder = openItemIndex;
2668
- if (subjectItem) {
2669
- let prevItemRect = subjectItem.getBoundingClientRect();
2670
- while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
2671
- if (subjectItem) {
2672
- if (subjectItem.classList.contains("builder-accordion-detail")) {
2673
- continue;
2674
- }
2675
- const subjectItemRect = subjectItem.getBoundingClientRect();
2676
- if (subjectItemRect.left > prevItemRect.left) {
2677
- const index = parseInt(
2678
- subjectItem.getAttribute("data-index") || "",
2679
- 10
2680
- );
2681
- if (!isNaN(index)) {
2682
- prevItemRect = subjectItemRect;
2683
- itemOrder = index;
2684
- }
2685
- } else {
2686
- break;
2687
- }
2688
- }
2689
- }
2690
- }
2691
- }
2692
- if (typeof itemOrder === "number") {
2693
- itemOrder = itemOrder + 1;
2694
- }
2695
- return itemOrder;
2696
- });
2697
- const accordionDetailStyles = createMemo10(() => {
2698
- const styles = {
2699
- ...{
2700
- order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
2701
- },
2702
- ...props.grid && {
2703
- width: "100%"
2704
- }
2705
- };
2706
- return Object.fromEntries(
2707
- Object.entries(styles).filter(([_, value]) => value !== void 0)
2708
- );
2709
- });
2710
- function onClick(index) {
2711
- if (open().includes(index)) {
2712
- setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
2713
- } else {
2714
- setOpen(onlyOneAtATime() ? [index] : open().concat(index));
2715
- }
2716
- }
2717
- return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
2718
- const index = _index();
2719
- return <>
2720
- <div
2721
- class={getAccordionTitleClassName(index)}
2722
- style={{
2723
- ...accordionTitleStyles(),
2724
- width: props.grid ? props.gridRowWidth : void 0,
2725
- ...{
2726
- order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2727
- }
2728
- }}
2729
- data-index={index}
2730
- onClick={(event) => onClick(index)}
2731
- ><Blocks_default
2732
- blocks={item.title}
2733
- path={`items.${index}.title`}
2734
- parent={props.builderBlock.id}
2735
- context={props.builderContext}
2736
- registeredComponents={props.builderComponents}
2737
- linkComponent={props.builderLinkComponent}
2738
- /></div>
2739
- <Show9 when={open().includes(index)}><div
2740
- class={getAccordionDetailClassName(index)}
2741
- style={accordionDetailStyles()}
2742
- ><Blocks_default
2743
- blocks={item.detail}
2744
- path={`items.${index}.detail`}
2745
- parent={props.builderBlock.id}
2746
- context={props.builderContext}
2747
- registeredComponents={props.builderComponents}
2748
- linkComponent={props.builderLinkComponent}
2749
- /></div></Show9>
2750
- </>;
2751
- }}</For6></div>;
2752
- }
2753
- var accordion_default = Accordion;
2754
-
2755
- // src/blocks/accordion/component-info.ts
2756
- var defaultTitle = {
2652
+ // src/blocks/tabs/component-info.ts
2653
+ var defaultTab = {
2757
2654
  "@type": "@builder.io/sdk:Element",
2758
- layerName: "Accordion item title",
2759
2655
  responsiveStyles: {
2760
2656
  large: {
2761
- marginTop: "10px",
2762
- position: "relative",
2657
+ paddingLeft: "20px",
2658
+ paddingRight: "20px",
2659
+ paddingTop: "10px",
2660
+ paddingBottom: "10px",
2661
+ minWidth: "100px",
2662
+ textAlign: "center",
2763
2663
  display: "flex",
2764
- alignItems: "stretch",
2765
2664
  flexDirection: "column",
2766
- paddingBottom: "10px"
2665
+ cursor: "pointer",
2666
+ userSelect: "none"
2767
2667
  }
2768
2668
  },
2769
- children: [{
2770
- "@type": "@builder.io/sdk:Element",
2771
- responsiveStyles: {
2772
- large: {
2773
- textAlign: "left",
2774
- display: "flex",
2775
- flexDirection: "column"
2776
- }
2777
- },
2778
- component: {
2779
- name: "Text",
2780
- options: {
2781
- text: "I am an accordion title. Click me!"
2782
- }
2669
+ component: {
2670
+ name: "Text",
2671
+ options: {
2672
+ text: "New tab"
2783
2673
  }
2784
- }]
2674
+ }
2785
2675
  };
2786
- var defaultDetail = {
2676
+ var defaultElement = {
2787
2677
  "@type": "@builder.io/sdk:Element",
2788
- layerName: "Accordion item detail",
2789
2678
  responsiveStyles: {
2790
2679
  large: {
2791
- position: "relative",
2680
+ height: "200px",
2792
2681
  display: "flex",
2793
- alignItems: "stretch",
2794
- flexDirection: "column",
2795
- marginTop: "10px",
2796
- paddingBottom: "10px"
2682
+ marginTop: "20px",
2683
+ flexDirection: "column"
2797
2684
  }
2798
2685
  },
2799
- children: [{
2800
- "@type": "@builder.io/sdk:Element",
2801
- responsiveStyles: {
2802
- large: {
2803
- paddingTop: "50px",
2804
- textAlign: "left",
2805
- display: "flex",
2806
- flexDirection: "column",
2807
- paddingBottom: "50px"
2808
- }
2809
- },
2810
- component: {
2811
- name: "Text",
2812
- options: {
2813
- text: "I am an accordion detail, hello!"
2814
- }
2686
+ component: {
2687
+ name: "Text",
2688
+ options: {
2689
+ text: "New tab content "
2815
2690
  }
2816
- }]
2691
+ }
2817
2692
  };
2818
- var componentInfo10 = {
2819
- name: "Builder:Accordion",
2820
- canHaveChildren: true,
2821
- image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
2822
- defaultStyles: {
2823
- display: "flex",
2824
- flexDirection: "column",
2825
- alignItems: "stretch"
2826
- },
2693
+ var componentInfo9 = {
2694
+ name: "Builder: Tabs",
2827
2695
  inputs: [{
2828
- name: "items",
2696
+ name: "tabs",
2829
2697
  type: "list",
2830
2698
  broadcast: true,
2831
2699
  subFields: [{
2832
- name: "title",
2700
+ name: "label",
2833
2701
  type: "uiBlocks",
2834
2702
  hideFromUI: true,
2835
- defaultValue: [defaultTitle]
2703
+ defaultValue: [defaultTab]
2836
2704
  }, {
2837
- name: "detail",
2705
+ name: "content",
2838
2706
  type: "uiBlocks",
2839
2707
  hideFromUI: true,
2840
- defaultValue: [defaultDetail]
2708
+ defaultValue: [defaultElement]
2841
2709
  }],
2842
2710
  defaultValue: [{
2843
- title: [defaultTitle],
2844
- detail: [defaultDetail]
2711
+ label: [{
2712
+ ...defaultTab,
2713
+ component: {
2714
+ name: "Text",
2715
+ options: {
2716
+ text: "Tab 1"
2717
+ }
2718
+ }
2719
+ }],
2720
+ content: [{
2721
+ ...defaultElement,
2722
+ component: {
2723
+ name: "Text",
2724
+ options: {
2725
+ text: "Tab 1 content"
2726
+ }
2727
+ }
2728
+ }]
2845
2729
  }, {
2846
- title: [defaultTitle],
2847
- detail: [defaultDetail]
2848
- }],
2849
- showIf: (options) => !options.get("useChildrenForItems")
2850
- }, {
2851
- name: "oneAtATime",
2852
- helperText: "Only allow opening one at a time (collapse all others when new item openned)",
2853
- type: "boolean",
2854
- defaultValue: false
2730
+ label: [{
2731
+ ...defaultTab,
2732
+ component: {
2733
+ name: "Text",
2734
+ options: {
2735
+ text: "Tab 2"
2736
+ }
2737
+ }
2738
+ }],
2739
+ content: [{
2740
+ ...defaultElement,
2741
+ component: {
2742
+ name: "Text",
2743
+ options: {
2744
+ text: "Tab 2 content"
2745
+ }
2746
+ }
2747
+ }]
2748
+ }]
2855
2749
  }, {
2856
- name: "grid",
2857
- helperText: "Display as a grid",
2858
- type: "boolean",
2859
- defaultValue: false
2750
+ name: "activeTabStyle",
2751
+ type: "uiStyle",
2752
+ helperText: "CSS styles for the active tab",
2753
+ defaultValue: {
2754
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
2755
+ }
2860
2756
  }, {
2861
- name: "gridRowWidth",
2862
- helperText: "Display as a grid",
2863
- type: "string",
2864
- showIf: (options) => options.get("grid"),
2865
- defaultValue: "25%"
2757
+ name: "defaultActiveTab",
2758
+ type: "number",
2759
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
2760
+ defaultValue: 1,
2761
+ advanced: true
2866
2762
  }, {
2867
- name: "useChildrenForItems",
2763
+ name: "collapsible",
2868
2764
  type: "boolean",
2869
- helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
2870
- advanced: true,
2765
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
2871
2766
  defaultValue: false,
2872
- onChange: (options) => {
2873
- if (options.get("useChildrenForItems") === true) {
2874
- options.set("items", []);
2875
- }
2876
- }
2767
+ advanced: true
2768
+ }, {
2769
+ name: "tabHeaderLayout",
2770
+ type: "enum",
2771
+ helperText: "Change the layout of the tab headers (uses justify-content)",
2772
+ defaultValue: "flex-start",
2773
+ enum: [{
2774
+ label: "Center",
2775
+ value: "center"
2776
+ }, {
2777
+ label: "Space between",
2778
+ value: "space-between"
2779
+ }, {
2780
+ label: "Space around",
2781
+ value: "space-around"
2782
+ }, {
2783
+ label: "Left",
2784
+ value: "flex-start"
2785
+ }, {
2786
+ label: "Right",
2787
+ value: "flex-end"
2788
+ }]
2877
2789
  }]
2878
2790
  };
2879
2791
 
2792
+ // src/blocks/tabs/tabs.tsx
2793
+ import { Show as Show9, For as For6, createSignal as createSignal10 } from "solid-js";
2794
+ function Tabs(props) {
2795
+ const [activeTab, setActiveTab] = createSignal10(
2796
+ props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
2797
+ );
2798
+ function activeTabContent(active) {
2799
+ return props.tabs && props.tabs[active].content;
2800
+ }
2801
+ function onClick(index) {
2802
+ if (index === activeTab() && props.collapsible) {
2803
+ setActiveTab(-1);
2804
+ } else {
2805
+ setActiveTab(index);
2806
+ }
2807
+ }
2808
+ return <div>
2809
+ <div
2810
+ class="builder-tabs-wrap"
2811
+ style={{
2812
+ display: "flex",
2813
+ "flex-direction": "row",
2814
+ "justify-content": props.tabHeaderLayout || "flex-start",
2815
+ overflow: "auto"
2816
+ }}
2817
+ ><For6 each={props.tabs}>{(tab, _index) => {
2818
+ const index = _index();
2819
+ return <span
2820
+ class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2821
+ key={index}
2822
+ style={{
2823
+ ...activeTab() === index ? props.activeTabStyle : {}
2824
+ }}
2825
+ onClick={(event) => onClick(index)}
2826
+ ><Blocks_default
2827
+ parent={props.builderBlock.id}
2828
+ path={`component.options.tabs.${index}.label`}
2829
+ blocks={tab.label}
2830
+ context={props.builderContext}
2831
+ registeredComponents={props.builderComponents}
2832
+ linkComponent={props.builderLinkComponent}
2833
+ /></span>;
2834
+ }}</For6></div>
2835
+ <Show9 when={activeTabContent(activeTab())}><div><Blocks_default
2836
+ parent={props.builderBlock.id}
2837
+ path={`component.options.tabs.${activeTab()}.content`}
2838
+ blocks={activeTabContent(activeTab())}
2839
+ context={props.builderContext}
2840
+ registeredComponents={props.builderComponents}
2841
+ linkComponent={props.builderLinkComponent}
2842
+ /></div></Show9>
2843
+ </div>;
2844
+ }
2845
+ var tabs_default = Tabs;
2846
+
2847
+ // src/blocks/text/component-info.ts
2848
+ var componentInfo10 = {
2849
+ name: "Text",
2850
+ static: true,
2851
+ isRSC: true,
2852
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
2853
+ inputs: [{
2854
+ name: "text",
2855
+ type: "html",
2856
+ required: true,
2857
+ autoFocus: true,
2858
+ bubble: true,
2859
+ defaultValue: "Enter some text..."
2860
+ }],
2861
+ defaultStyles: {
2862
+ lineHeight: "normal",
2863
+ height: "auto",
2864
+ textAlign: "center"
2865
+ }
2866
+ };
2867
+
2868
+ // src/blocks/text/text.tsx
2869
+ function Text(props) {
2870
+ return <div
2871
+ class="builder-text"
2872
+ innerHTML={props.text?.toString() || ""}
2873
+ style={{
2874
+ outline: "none"
2875
+ }}
2876
+ />;
2877
+ }
2878
+ var text_default = Text;
2879
+
2880
2880
  // src/blocks/custom-code/component-info.ts
2881
2881
  var componentInfo11 = {
2882
2882
  name: "Custom Code",
@@ -3317,13 +3317,11 @@ function FormComponent(props) {
3317
3317
  return;
3318
3318
  }
3319
3319
  event.preventDefault();
3320
- const el = event.currentTarget;
3320
+ const el = event.currentTarget || event.target;
3321
3321
  const headers = props.customHeaders || {};
3322
3322
  let body;
3323
3323
  const formData = new FormData(el);
3324
- const formPairs = Array.from(
3325
- event.currentTarget.querySelectorAll("input,select,textarea")
3326
- ).filter((el2) => !!el2.name).map((el2) => {
3324
+ const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
3327
3325
  let value;
3328
3326
  const key = el2.name;
3329
3327
  if (el2 instanceof HTMLInputElement) {
@@ -3486,6 +3484,7 @@ function FormComponent(props) {
3486
3484
  name={props.name}
3487
3485
  onSubmit={(event) => onSubmit(event)}
3488
3486
  {...{}}
3487
+ {...{}}
3489
3488
  {...props.attributes}
3490
3489
  >
3491
3490
  <Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
@@ -3924,34 +3923,34 @@ var getExtraComponents = () => [{
3924
3923
  // src/constants/builder-registered-components.ts
3925
3924
  var getDefaultRegisteredComponents = () => [{
3926
3925
  component: button_default,
3927
- ...componentInfo
3926
+ ...componentInfo2
3928
3927
  }, {
3929
3928
  component: columns_default,
3930
- ...componentInfo2
3929
+ ...componentInfo3
3931
3930
  }, {
3932
3931
  component: fragment_default,
3933
- ...componentInfo3
3932
+ ...componentInfo4
3934
3933
  }, {
3935
3934
  component: image_default,
3936
- ...componentInfo4
3935
+ ...componentInfo5
3937
3936
  }, {
3938
3937
  component: section_default,
3939
- ...componentInfo5
3938
+ ...componentInfo6
3940
3939
  }, {
3941
3940
  component: slot_default,
3942
- ...componentInfo6
3941
+ ...componentInfo7
3943
3942
  }, {
3944
3943
  component: symbol_default,
3945
- ...componentInfo7
3944
+ ...componentInfo8
3946
3945
  }, {
3947
3946
  component: text_default,
3948
- ...componentInfo9
3947
+ ...componentInfo10
3949
3948
  }, ...TARGET === "rsc" ? [] : [{
3950
3949
  component: tabs_default,
3951
- ...componentInfo8
3950
+ ...componentInfo9
3952
3951
  }, {
3953
3952
  component: accordion_default,
3954
- ...componentInfo10
3953
+ ...componentInfo
3955
3954
  }], ...getExtraComponents()];
3956
3955
 
3957
3956
  // src/functions/register-component.ts
@@ -4535,7 +4534,7 @@ function isFromTrustedHost(trustedHosts, e) {
4535
4534
  }
4536
4535
 
4537
4536
  // src/constants/sdk-version.ts
4538
- var SDK_VERSION = "1.0.28";
4537
+ var SDK_VERSION = "1.0.29";
4539
4538
 
4540
4539
  // src/functions/register.ts
4541
4540
  var registry = {};
@@ -5016,7 +5015,7 @@ function EnableEditor(props) {
5016
5015
  const searchParams = new URL(location.href).searchParams;
5017
5016
  const searchParamPreviewModel = searchParams.get("builder.preview");
5018
5017
  const searchParamPreviewId = searchParams.get(
5019
- `builder.preview.${searchParamPreviewModel}`
5018
+ `builder.overrides.${searchParamPreviewModel}`
5020
5019
  );
5021
5020
  const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
5022
5021
  if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id)) {