@builder.io/sdk-solid 1.0.23 → 1.0.24

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.
@@ -46,14 +46,15 @@ var getClassPropName = () => {
46
46
  case "vue":
47
47
  case "solid":
48
48
  case "qwik":
49
+ case "angular":
49
50
  return "class";
50
51
  }
51
52
  };
52
53
 
53
54
  // src/blocks/button/button.tsx
54
55
  function Button(props) {
55
- return <Dynamic_renderer_default
56
- attributes={{
56
+ function attrs() {
57
+ return {
57
58
  ...props.attributes,
58
59
  [getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
59
60
  ...props.link ? {
@@ -63,7 +64,10 @@ function Button(props) {
63
64
  } : {
64
65
  role: "button"
65
66
  }
66
- }}
67
+ };
68
+ }
69
+ return <Dynamic_renderer_default
70
+ attributes={attrs()}
67
71
  TagName={props.link ? props.builderLinkComponent || "a" : "button"}
68
72
  actionAttributes={{}}
69
73
  >{props.text}</Dynamic_renderer_default>;
@@ -71,7 +75,7 @@ function Button(props) {
71
75
  var button_default = Button;
72
76
 
73
77
  // src/blocks/columns/columns.tsx
74
- import { Show as Show6, For as For4, createSignal as createSignal6, createMemo as createMemo6 } from "solid-js";
78
+ import { Show as Show6, For as For4, createSignal as createSignal7 } from "solid-js";
75
79
  import { css as css2 } from "solid-styled-components";
76
80
 
77
81
  // src/components/blocks/blocks.tsx
@@ -99,7 +103,7 @@ import { createContext as createContext2 } from "solid-js";
99
103
  var components_context_default = createContext2({ registeredComponents: {} });
100
104
 
101
105
  // src/components/block/block.tsx
102
- import { Show as Show4, For as For2, onMount, createMemo as createMemo4 } from "solid-js";
106
+ import { Show as Show4, For as For2, onMount, createMemo as createMemo5 } from "solid-js";
103
107
 
104
108
  // src/functions/get-block-component-options.ts
105
109
  function getBlockComponentOptions(block) {
@@ -694,6 +698,7 @@ function mapStyleObjToStrIfNeeded(style) {
694
698
  case "svelte":
695
699
  case "vue":
696
700
  case "solid":
701
+ case "angular":
697
702
  return convertStyleMapToCSSArray(style).join(" ");
698
703
  case "qwik":
699
704
  case "reactNative":
@@ -766,6 +771,12 @@ var getRepeatItemData = ({
766
771
  }));
767
772
  return repeatArray;
768
773
  };
774
+ var shouldPassLinkComponent = (blockName) => {
775
+ return blockName && ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
776
+ };
777
+ var shouldPassRegisteredComponents = (blockName) => {
778
+ return blockName && ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
779
+ };
769
780
 
770
781
  // src/components/block/components/block-styles.tsx
771
782
  import { Show as Show2, createMemo } from "solid-js";
@@ -1009,15 +1020,15 @@ function BlockWrapper(props) {
1009
1020
  var Block_wrapper_default = BlockWrapper;
1010
1021
 
1011
1022
  // src/components/block/components/component-ref/component-ref.tsx
1012
- import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
1023
+ import { Show as Show3, For, createSignal as createSignal3 } from "solid-js";
1013
1024
  import { Dynamic as Dynamic3 } from "solid-js/web";
1014
1025
 
1015
1026
  // src/components/block/components/interactive-element.tsx
1027
+ import { createMemo as createMemo2 } from "solid-js";
1016
1028
  import { Dynamic as Dynamic2 } from "solid-js/web";
1017
1029
  function InteractiveElement(props) {
1018
- return <Dynamic2
1019
- {...props.wrapperProps}
1020
- attributes={props.includeBlockProps ? {
1030
+ const attributes = createMemo2(() => {
1031
+ return props.includeBlockProps ? {
1021
1032
  ...getBlockProperties({
1022
1033
  block: props.block,
1023
1034
  context: props.context
@@ -1029,7 +1040,11 @@ function InteractiveElement(props) {
1029
1040
  localState: props.context.localState,
1030
1041
  context: props.context.context
1031
1042
  })
1032
- } : {}}
1043
+ } : {};
1044
+ });
1045
+ return <Dynamic2
1046
+ {...props.wrapperProps}
1047
+ attributes={attributes()}
1033
1048
  component={props.Wrapper}
1034
1049
  >{props.children}</Dynamic2>;
1035
1050
  }
@@ -1070,7 +1085,7 @@ var getWrapperProps = ({
1070
1085
 
1071
1086
  // src/components/block/components/component-ref/component-ref.tsx
1072
1087
  function ComponentRef(props) {
1073
- const [Wrapper, setWrapper] = createSignal2(
1088
+ const [Wrapper, setWrapper] = createSignal3(
1074
1089
  props.isInteractive ? interactive_element_default : props.componentRef
1075
1090
  );
1076
1091
  return <Show3 when={props.componentRef}><Dynamic3
@@ -1099,9 +1114,9 @@ function ComponentRef(props) {
1099
1114
  var Component_ref_default = ComponentRef;
1100
1115
 
1101
1116
  // src/components/block/components/repeated-block.tsx
1102
- import { createSignal as createSignal3 } from "solid-js";
1117
+ import { createSignal as createSignal4 } from "solid-js";
1103
1118
  function RepeatedBlock(props) {
1104
- const [store, setStore] = createSignal3(props.repeatContext);
1119
+ const [store, setStore] = createSignal4(props.repeatContext);
1105
1120
  return <builder_context_default.Provider value={store()}><Block_default
1106
1121
  block={props.block}
1107
1122
  context={store()}
@@ -1113,20 +1128,20 @@ var Repeated_block_default = RepeatedBlock;
1113
1128
 
1114
1129
  // src/components/block/block.tsx
1115
1130
  function Block(props) {
1116
- const blockComponent = createMemo4(() => {
1131
+ const blockComponent = createMemo5(() => {
1117
1132
  return getComponent({
1118
1133
  block: props.block,
1119
1134
  context: props.context,
1120
1135
  registeredComponents: props.registeredComponents
1121
1136
  });
1122
1137
  });
1123
- const repeatItem = createMemo4(() => {
1138
+ const repeatItem = createMemo5(() => {
1124
1139
  return getRepeatItemData({
1125
1140
  block: props.block,
1126
1141
  context: props.context
1127
1142
  });
1128
1143
  });
1129
- const processedBlock = createMemo4(() => {
1144
+ const processedBlock = createMemo5(() => {
1130
1145
  return props.block.repeat?.collection ? props.block : getProcessedBlock({
1131
1146
  block: props.block,
1132
1147
  localState: props.context.localState,
@@ -1136,14 +1151,14 @@ function Block(props) {
1136
1151
  shouldEvaluateBindings: true
1137
1152
  });
1138
1153
  });
1139
- const Tag = createMemo4(() => {
1154
+ const Tag = createMemo5(() => {
1140
1155
  const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
1141
1156
  if (shouldUseLink) {
1142
1157
  return props.linkComponent || "a";
1143
1158
  }
1144
1159
  return props.block.tagName || "div";
1145
1160
  });
1146
- const canShowBlock = createMemo4(() => {
1161
+ const canShowBlock = createMemo5(() => {
1147
1162
  if (props.block.repeat?.collection) {
1148
1163
  if (repeatItem()?.length)
1149
1164
  return true;
@@ -1153,21 +1168,21 @@ function Block(props) {
1153
1168
  const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
1154
1169
  return shouldShow && !shouldHide;
1155
1170
  });
1156
- const childrenWithoutParentComponent = createMemo4(() => {
1171
+ const childrenWithoutParentComponent = createMemo5(() => {
1157
1172
  const shouldRenderChildrenOutsideRef = !blockComponent()?.component && !repeatItem();
1158
1173
  return shouldRenderChildrenOutsideRef ? processedBlock().children ?? [] : [];
1159
1174
  });
1160
- const componentRefProps = createMemo4(() => {
1175
+ const componentRefProps = createMemo5(() => {
1161
1176
  return {
1162
1177
  blockChildren: processedBlock().children ?? [],
1163
1178
  componentRef: blockComponent()?.component,
1164
1179
  componentOptions: {
1165
1180
  ...getBlockComponentOptions(processedBlock()),
1166
1181
  builderContext: props.context,
1167
- ...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1182
+ ...shouldPassLinkComponent(blockComponent()?.name) ? {
1168
1183
  builderLinkComponent: props.linkComponent
1169
1184
  } : {},
1170
- ...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1185
+ ...shouldPassRegisteredComponents(blockComponent()?.name) ? {
1171
1186
  builderComponents: props.registeredComponents
1172
1187
  } : {}
1173
1188
  },
@@ -1251,11 +1266,11 @@ function Block(props) {
1251
1266
  var Block_default = Block;
1252
1267
 
1253
1268
  // src/components/blocks/blocks-wrapper.tsx
1254
- import { createMemo as createMemo5 } from "solid-js";
1269
+ import { createMemo as createMemo6 } from "solid-js";
1255
1270
  import { Dynamic as Dynamic4 } from "solid-js/web";
1256
1271
  import { css } from "solid-styled-components";
1257
1272
  function BlocksWrapper(props) {
1258
- const className = createMemo5(() => {
1273
+ const className = createMemo6(() => {
1259
1274
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
1260
1275
  });
1261
1276
  function onClick() {
@@ -1329,16 +1344,24 @@ function Blocks(props) {
1329
1344
  }
1330
1345
  var Blocks_default = Blocks;
1331
1346
 
1347
+ // src/blocks/columns/helpers.ts
1348
+ var getColumnsClass = (id) => {
1349
+ return `builder-columns ${id}-breakpoints`;
1350
+ };
1351
+
1332
1352
  // src/blocks/columns/columns.tsx
1333
1353
  function Columns(props) {
1334
- const [gutterSize, setGutterSize] = createSignal6(
1354
+ const [gutterSize, setGutterSize] = createSignal7(
1335
1355
  typeof props.space === "number" ? props.space || 0 : 20
1336
1356
  );
1337
- const [cols, setCols] = createSignal6(props.columns || []);
1338
- const [stackAt, setStackAt] = createSignal6(props.stackColumnsAt || "tablet");
1339
- const [flexDir, setFlexDir] = createSignal6(
1357
+ const [cols, setCols] = createSignal7(props.columns || []);
1358
+ const [stackAt, setStackAt] = createSignal7(props.stackColumnsAt || "tablet");
1359
+ const [flexDir, setFlexDir] = createSignal7(
1340
1360
  props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column"
1341
1361
  );
1362
+ function getTagName(column) {
1363
+ return column.link ? props.builderLinkComponent || "a" : "div";
1364
+ }
1342
1365
  function getWidth(index) {
1343
1366
  return cols()[index]?.width || 100 / cols().length;
1344
1367
  }
@@ -1358,7 +1381,7 @@ function Columns(props) {
1358
1381
  }) {
1359
1382
  return stackAt() === "never" ? desktopStyle : stackedStyle;
1360
1383
  }
1361
- const columnsCssVars = createMemo6(() => {
1384
+ function columnsCssVars() {
1362
1385
  return {
1363
1386
  "--flex-dir": flexDir(),
1364
1387
  "--flex-dir-tablet": getTabletStyle({
@@ -1366,7 +1389,7 @@ function Columns(props) {
1366
1389
  desktopStyle: "row"
1367
1390
  })
1368
1391
  };
1369
- });
1392
+ }
1370
1393
  function columnCssVars(index) {
1371
1394
  const gutter = index === 0 ? 0 : gutterSize();
1372
1395
  const width = getColumnCssWidth(index);
@@ -1407,7 +1430,7 @@ function Columns(props) {
1407
1430
  );
1408
1431
  return breakpointSizes[size].max;
1409
1432
  }
1410
- const columnsStyles = createMemo6(() => {
1433
+ function columnsStyles() {
1411
1434
  return `
1412
1435
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
1413
1436
  .${props.builderBlock.id}-breakpoints {
@@ -1433,9 +1456,19 @@ function Columns(props) {
1433
1456
  }
1434
1457
  },
1435
1458
  `;
1436
- });
1459
+ }
1460
+ function getAttributes(column, index) {
1461
+ return {
1462
+ ...{},
1463
+ ...column.link ? {
1464
+ href: column.link
1465
+ } : {},
1466
+ [getClassPropName()]: "builder-column",
1467
+ style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1468
+ };
1469
+ }
1437
1470
  return <div
1438
- class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
1471
+ class={getColumnsClass(props.builderBlock?.id) + " " + css2({
1439
1472
  display: "flex",
1440
1473
  lineHeight: "normal"
1441
1474
  })}
@@ -1450,16 +1483,9 @@ function Columns(props) {
1450
1483
  const index = _index();
1451
1484
  return <Dynamic_renderer_default
1452
1485
  key={index}
1453
- TagName={column.link ? props.builderLinkComponent || "a" : "div"}
1486
+ TagName={getTagName(column)}
1454
1487
  actionAttributes={{}}
1455
- attributes={{
1456
- ...{},
1457
- ...column.link ? {
1458
- href: column.link
1459
- } : {},
1460
- [getClassPropName()]: "builder-column",
1461
- style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1462
- }}
1488
+ attributes={getAttributes(column, index)}
1463
1489
  ><Blocks_default
1464
1490
  path={`component.options.columns.${index}.blocks`}
1465
1491
  parent={props.builderBlock.id}
@@ -1483,7 +1509,7 @@ function FragmentComponent(props) {
1483
1509
  var fragment_default = FragmentComponent;
1484
1510
 
1485
1511
  // src/blocks/image/image.tsx
1486
- import { Show as Show7, createMemo as createMemo7 } from "solid-js";
1512
+ import { Show as Show7, createMemo as createMemo8 } from "solid-js";
1487
1513
  import { css as css3 } from "solid-styled-components";
1488
1514
 
1489
1515
  // src/blocks/image/image.helpers.ts
@@ -1535,7 +1561,7 @@ function getSrcSet(url) {
1535
1561
 
1536
1562
  // src/blocks/image/image.tsx
1537
1563
  function Image(props) {
1538
- const srcSetToUse = createMemo7(() => {
1564
+ const srcSetToUse = createMemo8(() => {
1539
1565
  const imageToUse = props.image || props.src;
1540
1566
  const url = imageToUse;
1541
1567
  if (!url || // We can auto add srcset for cdn.builder.io and shopify
@@ -1552,14 +1578,14 @@ function Image(props) {
1552
1578
  }
1553
1579
  return getSrcSet(url);
1554
1580
  });
1555
- const webpSrcSet = createMemo7(() => {
1581
+ const webpSrcSet = createMemo8(() => {
1556
1582
  if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
1557
1583
  return srcSetToUse().replace(/\?/g, "?format=webp&");
1558
1584
  } else {
1559
1585
  return "";
1560
1586
  }
1561
1587
  });
1562
- const aspectRatioCss = createMemo7(() => {
1588
+ const aspectRatioCss = createMemo8(() => {
1563
1589
  const aspectRatioStyles = {
1564
1590
  position: "absolute",
1565
1591
  height: "100%",
@@ -1604,7 +1630,7 @@ function Image(props) {
1604
1630
  }}
1605
1631
  /></Show7>
1606
1632
  <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
1607
- <Show7 when={!props.fitContent && props.children}><div
1633
+ <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div
1608
1634
  class={css3({
1609
1635
  display: "flex",
1610
1636
  flexDirection: "column",
@@ -1642,10 +1668,10 @@ function SectionComponent(props) {
1642
1668
  var section_default = SectionComponent;
1643
1669
 
1644
1670
  // src/blocks/symbol/symbol.tsx
1645
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo16, createSignal as createSignal16 } from "solid-js";
1671
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
1646
1672
 
1647
1673
  // src/components/content-variants/content-variants.tsx
1648
- import { Show as Show12, For as For7, onMount as onMount4, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
1674
+ import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
1649
1675
 
1650
1676
  // src/helpers/url.ts
1651
1677
  var getTopLevelDomain = (host) => {
@@ -1839,7 +1865,7 @@ var handleABTesting = async ({
1839
1865
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1840
1866
 
1841
1867
  // src/components/content/content.tsx
1842
- import { Show as Show11, createSignal as createSignal14 } from "solid-js";
1868
+ import { Show as Show12, createSignal as createSignal16 } from "solid-js";
1843
1869
 
1844
1870
  // src/blocks/button/component-info.ts
1845
1871
  var componentInfo = {
@@ -2340,8 +2366,203 @@ var componentInfo7 = {
2340
2366
  }]
2341
2367
  };
2342
2368
 
2343
- // src/blocks/text/component-info.ts
2369
+ // src/blocks/tabs/component-info.ts
2370
+ var defaultTab = {
2371
+ "@type": "@builder.io/sdk:Element",
2372
+ responsiveStyles: {
2373
+ large: {
2374
+ paddingLeft: "20px",
2375
+ paddingRight: "20px",
2376
+ paddingTop: "10px",
2377
+ paddingBottom: "10px",
2378
+ minWidth: "100px",
2379
+ textAlign: "center",
2380
+ display: "flex",
2381
+ flexDirection: "column",
2382
+ cursor: "pointer",
2383
+ userSelect: "none"
2384
+ }
2385
+ },
2386
+ component: {
2387
+ name: "Text",
2388
+ options: {
2389
+ text: "New tab"
2390
+ }
2391
+ }
2392
+ };
2393
+ var defaultElement = {
2394
+ "@type": "@builder.io/sdk:Element",
2395
+ responsiveStyles: {
2396
+ large: {
2397
+ height: "200px",
2398
+ display: "flex",
2399
+ marginTop: "20px",
2400
+ flexDirection: "column"
2401
+ }
2402
+ },
2403
+ component: {
2404
+ name: "Text",
2405
+ options: {
2406
+ text: "New tab content "
2407
+ }
2408
+ }
2409
+ };
2344
2410
  var componentInfo8 = {
2411
+ name: "Builder: Tabs",
2412
+ inputs: [{
2413
+ name: "tabs",
2414
+ type: "list",
2415
+ broadcast: true,
2416
+ subFields: [{
2417
+ name: "label",
2418
+ type: "uiBlocks",
2419
+ hideFromUI: true,
2420
+ defaultValue: [defaultTab]
2421
+ }, {
2422
+ name: "content",
2423
+ type: "uiBlocks",
2424
+ hideFromUI: true,
2425
+ defaultValue: [defaultElement]
2426
+ }],
2427
+ defaultValue: [{
2428
+ label: [{
2429
+ ...defaultTab,
2430
+ component: {
2431
+ name: "Text",
2432
+ options: {
2433
+ text: "Tab 1"
2434
+ }
2435
+ }
2436
+ }],
2437
+ content: [{
2438
+ ...defaultElement,
2439
+ component: {
2440
+ name: "Text",
2441
+ options: {
2442
+ text: "Tab 1 content"
2443
+ }
2444
+ }
2445
+ }]
2446
+ }, {
2447
+ label: [{
2448
+ ...defaultTab,
2449
+ component: {
2450
+ name: "Text",
2451
+ options: {
2452
+ text: "Tab 2"
2453
+ }
2454
+ }
2455
+ }],
2456
+ content: [{
2457
+ ...defaultElement,
2458
+ component: {
2459
+ name: "Text",
2460
+ options: {
2461
+ text: "Tab 2 content"
2462
+ }
2463
+ }
2464
+ }]
2465
+ }]
2466
+ }, {
2467
+ name: "activeTabStyle",
2468
+ type: "uiStyle",
2469
+ helperText: "CSS styles for the active tab",
2470
+ defaultValue: {
2471
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
2472
+ }
2473
+ }, {
2474
+ name: "defaultActiveTab",
2475
+ type: "number",
2476
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
2477
+ defaultValue: 1,
2478
+ advanced: true
2479
+ }, {
2480
+ name: "collapsible",
2481
+ type: "boolean",
2482
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
2483
+ defaultValue: false,
2484
+ advanced: true
2485
+ }, {
2486
+ name: "tabHeaderLayout",
2487
+ type: "enum",
2488
+ helperText: "Change the layout of the tab headers (uses justify-content)",
2489
+ defaultValue: "flex-start",
2490
+ enum: [{
2491
+ label: "Center",
2492
+ value: "center"
2493
+ }, {
2494
+ label: "Space between",
2495
+ value: "space-between"
2496
+ }, {
2497
+ label: "Space around",
2498
+ value: "space-around"
2499
+ }, {
2500
+ label: "Left",
2501
+ value: "flex-start"
2502
+ }, {
2503
+ label: "Right",
2504
+ value: "flex-end"
2505
+ }]
2506
+ }]
2507
+ };
2508
+
2509
+ // src/blocks/tabs/tabs.tsx
2510
+ import { Show as Show8, For as For5, createSignal as createSignal9 } from "solid-js";
2511
+ function Tabs(props) {
2512
+ const [activeTab, setActiveTab] = createSignal9(
2513
+ props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
2514
+ );
2515
+ function activeTabContent(active) {
2516
+ return props.tabs && props.tabs[active].content;
2517
+ }
2518
+ function getActiveTabStyle(index) {
2519
+ return activeTab() === index ? props.activeTabStyle : {};
2520
+ }
2521
+ return <div>
2522
+ <div
2523
+ class="builder-tabs-wrap"
2524
+ style={{
2525
+ display: "flex",
2526
+ "flex-direction": "row",
2527
+ "justify-content": props.tabHeaderLayout || "flex-start",
2528
+ overflow: "auto"
2529
+ }}
2530
+ ><For5 each={props.tabs}>{(tab, _index) => {
2531
+ const index = _index();
2532
+ return <span
2533
+ class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2534
+ key={index}
2535
+ style={getActiveTabStyle(index)}
2536
+ onClick={(event) => {
2537
+ if (index === activeTab() && props.collapsible) {
2538
+ setActiveTab(-1);
2539
+ } else {
2540
+ setActiveTab(index);
2541
+ }
2542
+ }}
2543
+ ><Blocks_default
2544
+ parent={props.builderBlock.id}
2545
+ path={`component.options.tabs.${index}.label`}
2546
+ blocks={tab.label}
2547
+ context={props.builderContext}
2548
+ registeredComponents={props.builderComponents}
2549
+ linkComponent={props.builderLinkComponent}
2550
+ /></span>;
2551
+ }}</For5></div>
2552
+ <Show8 when={activeTabContent(activeTab())}><div><Blocks_default
2553
+ parent={props.builderBlock.id}
2554
+ path={`component.options.tabs.${activeTab()}.content`}
2555
+ blocks={activeTabContent(activeTab())}
2556
+ context={props.builderContext}
2557
+ registeredComponents={props.builderComponents}
2558
+ linkComponent={props.builderLinkComponent}
2559
+ /></div></Show8>
2560
+ </div>;
2561
+ }
2562
+ var tabs_default = Tabs;
2563
+
2564
+ // src/blocks/text/component-info.ts
2565
+ var componentInfo9 = {
2345
2566
  name: "Text",
2346
2567
  static: true,
2347
2568
  isRSC: true,
@@ -2374,7 +2595,7 @@ function Text(props) {
2374
2595
  var text_default = Text;
2375
2596
 
2376
2597
  // src/blocks/custom-code/component-info.ts
2377
- var componentInfo9 = {
2598
+ var componentInfo10 = {
2378
2599
  name: "Custom Code",
2379
2600
  static: true,
2380
2601
  requiredPermissions: ["editCode"],
@@ -2399,10 +2620,10 @@ var componentInfo9 = {
2399
2620
  };
2400
2621
 
2401
2622
  // src/blocks/custom-code/custom-code.tsx
2402
- import { onMount as onMount2, createSignal as createSignal8 } from "solid-js";
2623
+ import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
2403
2624
  function CustomCode(props) {
2404
- const [scriptsInserted, setScriptsInserted] = createSignal8([]);
2405
- const [scriptsRun, setScriptsRun] = createSignal8([]);
2625
+ const [scriptsInserted, setScriptsInserted] = createSignal10([]);
2626
+ const [scriptsRun, setScriptsRun] = createSignal10([]);
2406
2627
  let elementRef;
2407
2628
  onMount2(() => {
2408
2629
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -2445,7 +2666,7 @@ function CustomCode(props) {
2445
2666
  var custom_code_default = CustomCode;
2446
2667
 
2447
2668
  // src/blocks/embed/component-info.ts
2448
- var componentInfo10 = {
2669
+ var componentInfo11 = {
2449
2670
  name: "Embed",
2450
2671
  static: true,
2451
2672
  inputs: [{
@@ -2483,7 +2704,7 @@ var componentInfo10 = {
2483
2704
  };
2484
2705
 
2485
2706
  // src/blocks/embed/embed.tsx
2486
- import { on, createEffect, createMemo as createMemo9, createSignal as createSignal9 } from "solid-js";
2707
+ import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
2487
2708
 
2488
2709
  // src/blocks/embed/helpers.ts
2489
2710
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -2491,9 +2712,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2491
2712
 
2492
2713
  // src/blocks/embed/embed.tsx
2493
2714
  function Embed(props) {
2494
- const [scriptsInserted, setScriptsInserted] = createSignal9([]);
2495
- const [scriptsRun, setScriptsRun] = createSignal9([]);
2496
- const [ranInitFn, setRanInitFn] = createSignal9(false);
2715
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2716
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
2717
+ const [ranInitFn, setRanInitFn] = createSignal11(false);
2497
2718
  function findAndRunScripts() {
2498
2719
  if (!elem || !elem.getElementsByTagName)
2499
2720
  return;
@@ -2516,8 +2737,8 @@ function Embed(props) {
2516
2737
  }
2517
2738
  }
2518
2739
  let elem;
2519
- const onUpdateFn_0_elem = createMemo9(() => elem);
2520
- const onUpdateFn_0_ranInitFn__ = createMemo9(() => ranInitFn());
2740
+ const onUpdateFn_0_elem = createMemo11(() => elem);
2741
+ const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
2521
2742
  function onUpdateFn_0() {
2522
2743
  if (elem && !ranInitFn()) {
2523
2744
  setRanInitFn(true);
@@ -2532,7 +2753,7 @@ function Embed(props) {
2532
2753
  var embed_default = Embed;
2533
2754
 
2534
2755
  // src/blocks/form/form/component-info.ts
2535
- var componentInfo11 = {
2756
+ var componentInfo12 = {
2536
2757
  name: "Form:Form",
2537
2758
  // editableTags: ['builder-form-error']
2538
2759
  defaults: {
@@ -2766,7 +2987,7 @@ var componentInfo11 = {
2766
2987
  };
2767
2988
 
2768
2989
  // src/blocks/form/form/form.tsx
2769
- import { Show as Show8, For as For5, createSignal as createSignal10 } from "solid-js";
2990
+ import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
2770
2991
  import { css as css4 } from "solid-styled-components";
2771
2992
 
2772
2993
  // src/functions/get-env.ts
@@ -2784,9 +3005,9 @@ var get = (obj, path, defaultValue) => {
2784
3005
 
2785
3006
  // src/blocks/form/form/form.tsx
2786
3007
  function FormComponent(props) {
2787
- const [formState, setFormState] = createSignal10("unsubmitted");
2788
- const [responseData, setResponseData] = createSignal10(null);
2789
- const [formErrorMessage, setFormErrorMessage] = createSignal10("");
3008
+ const [formState, setFormState] = createSignal12("unsubmitted");
3009
+ const [responseData, setResponseData] = createSignal12(null);
3010
+ const [formErrorMessage, setFormErrorMessage] = createSignal12("");
2790
3011
  function mergeNewRootState(newData) {
2791
3012
  const combinedState = {
2792
3013
  ...props.builderContext.rootState,
@@ -2982,7 +3203,7 @@ function FormComponent(props) {
2982
3203
  {...{}}
2983
3204
  {...props.attributes}
2984
3205
  >
2985
- <Show8 when={props.builderBlock && props.builderBlock.children}><For5 each={props.builderBlock?.children}>{(block, _index) => {
3206
+ <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
2986
3207
  const idx = _index();
2987
3208
  return <Block_default
2988
3209
  key={`form-block-${idx}`}
@@ -2991,35 +3212,35 @@ function FormComponent(props) {
2991
3212
  registeredComponents={props.builderComponents}
2992
3213
  linkComponent={props.builderLinkComponent}
2993
3214
  />;
2994
- }}</For5></Show8>
2995
- <Show8 when={submissionState() === "error"}><Blocks_default
3215
+ }}</For6></Show9>
3216
+ <Show9 when={submissionState() === "error"}><Blocks_default
2996
3217
  path="errorMessage"
2997
3218
  blocks={props.errorMessage}
2998
3219
  context={props.builderContext}
2999
- /></Show8>
3000
- <Show8 when={submissionState() === "sending"}><Blocks_default
3220
+ /></Show9>
3221
+ <Show9 when={submissionState() === "sending"}><Blocks_default
3001
3222
  path="sendingMessage"
3002
3223
  blocks={props.sendingMessage}
3003
3224
  context={props.builderContext}
3004
- /></Show8>
3005
- <Show8 when={submissionState() === "error" && responseData()}><pre
3225
+ /></Show9>
3226
+ <Show9 when={submissionState() === "error" && responseData()}><pre
3006
3227
  class={"builder-form-error-text " + css4({
3007
3228
  padding: "10px",
3008
3229
  color: "red",
3009
3230
  textAlign: "center"
3010
3231
  })}
3011
- >{JSON.stringify(responseData(), null, 2)}</pre></Show8>
3012
- <Show8 when={submissionState() === "success"}><Blocks_default
3232
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
3233
+ <Show9 when={submissionState() === "success"}><Blocks_default
3013
3234
  path="successMessage"
3014
3235
  blocks={props.successMessage}
3015
3236
  context={props.builderContext}
3016
- /></Show8>
3237
+ /></Show9>
3017
3238
  </form>;
3018
3239
  }
3019
3240
  var form_default = FormComponent;
3020
3241
 
3021
3242
  // src/blocks/form/input/component-info.ts
3022
- var componentInfo12 = {
3243
+ var componentInfo13 = {
3023
3244
  name: "Form:Input",
3024
3245
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3025
3246
  inputs: [
@@ -3089,7 +3310,7 @@ function FormInputComponent(props) {
3089
3310
  var input_default = FormInputComponent;
3090
3311
 
3091
3312
  // src/blocks/form/select/component-info.ts
3092
- var componentInfo13 = {
3313
+ var componentInfo14 = {
3093
3314
  name: "Form:Select",
3094
3315
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3095
3316
  defaultStyles: {
@@ -3134,7 +3355,7 @@ var componentInfo13 = {
3134
3355
  };
3135
3356
 
3136
3357
  // src/blocks/form/select/select.tsx
3137
- import { For as For6 } from "solid-js";
3358
+ import { For as For7 } from "solid-js";
3138
3359
  function SelectComponent(props) {
3139
3360
  return <select
3140
3361
  {...{}}
@@ -3143,15 +3364,15 @@ function SelectComponent(props) {
3143
3364
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
3144
3365
  defaultValue={props.defaultValue}
3145
3366
  name={props.name}
3146
- ><For6 each={props.options}>{(option, _index) => {
3367
+ ><For7 each={props.options}>{(option, _index) => {
3147
3368
  const index = _index();
3148
3369
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
3149
- }}</For6></select>;
3370
+ }}</For7></select>;
3150
3371
  }
3151
3372
  var select_default = SelectComponent;
3152
3373
 
3153
3374
  // src/blocks/form/submit-button/component-info.ts
3154
- var componentInfo14 = {
3375
+ var componentInfo15 = {
3155
3376
  name: "Form:SubmitButton",
3156
3377
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3157
3378
  defaultStyles: {
@@ -3185,7 +3406,7 @@ function SubmitButton(props) {
3185
3406
  var submit_button_default = SubmitButton;
3186
3407
 
3187
3408
  // src/blocks/img/component-info.ts
3188
- var componentInfo15 = {
3409
+ var componentInfo16 = {
3189
3410
  // friendlyName?
3190
3411
  name: "Raw:Img",
3191
3412
  hideFromInsertMenu: true,
@@ -3218,7 +3439,7 @@ function ImgComponent(props) {
3218
3439
  var img_default = ImgComponent;
3219
3440
 
3220
3441
  // src/blocks/video/component-info.ts
3221
- var componentInfo16 = {
3442
+ var componentInfo17 = {
3222
3443
  name: "Video",
3223
3444
  canHaveChildren: true,
3224
3445
  defaultStyles: {
@@ -3302,9 +3523,9 @@ var componentInfo16 = {
3302
3523
  };
3303
3524
 
3304
3525
  // src/blocks/video/video.tsx
3305
- import { Show as Show9, createMemo as createMemo11 } from "solid-js";
3526
+ import { Show as Show10, createMemo as createMemo13 } from "solid-js";
3306
3527
  function Video(props) {
3307
- const videoProps = createMemo11(() => {
3528
+ const videoProps = createMemo13(() => {
3308
3529
  return {
3309
3530
  ...props.autoPlay === true ? {
3310
3531
  autoPlay: true
@@ -3323,7 +3544,7 @@ function Video(props) {
3323
3544
  } : {}
3324
3545
  };
3325
3546
  });
3326
- const spreadProps = createMemo11(() => {
3547
+ const spreadProps = createMemo13(() => {
3327
3548
  return {
3328
3549
  ...videoProps()
3329
3550
  };
@@ -3353,8 +3574,8 @@ function Video(props) {
3353
3574
  }}
3354
3575
  src={props.video || "no-src"}
3355
3576
  poster={props.posterImage}
3356
- ><Show9 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show9></video>
3357
- <Show9
3577
+ ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
3578
+ <Show10
3358
3579
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
3359
3580
  ><div
3360
3581
  style={{
@@ -3363,15 +3584,15 @@ function Video(props) {
3363
3584
  "pointer-events": "none",
3364
3585
  "font-size": "0px"
3365
3586
  }}
3366
- /></Show9>
3367
- <Show9 when={props.builderBlock?.children?.length && props.fitContent}><div
3587
+ /></Show10>
3588
+ <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
3368
3589
  style={{
3369
3590
  display: "flex",
3370
3591
  "flex-direction": "column",
3371
3592
  "align-items": "stretch"
3372
3593
  }}
3373
- >{props.children}</div></Show9>
3374
- <Show9 when={props.builderBlock?.children?.length && !props.fitContent}><div
3594
+ >{props.children}</div></Show10>
3595
+ <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
3375
3596
  style={{
3376
3597
  "pointer-events": "none",
3377
3598
  display: "flex",
@@ -3383,7 +3604,7 @@ function Video(props) {
3383
3604
  width: "100%",
3384
3605
  height: "100%"
3385
3606
  }}
3386
- >{props.children}</div></Show9>
3607
+ >{props.children}</div></Show10>
3387
3608
  </div>;
3388
3609
  }
3389
3610
  var video_default = Video;
@@ -3391,28 +3612,28 @@ var video_default = Video;
3391
3612
  // src/constants/extra-components.ts
3392
3613
  var getExtraComponents = () => [{
3393
3614
  component: custom_code_default,
3394
- ...componentInfo9
3615
+ ...componentInfo10
3395
3616
  }, {
3396
3617
  component: embed_default,
3397
- ...componentInfo10
3618
+ ...componentInfo11
3398
3619
  }, ...TARGET === "rsc" ? [] : [{
3399
3620
  component: form_default,
3400
- ...componentInfo11
3621
+ ...componentInfo12
3401
3622
  }, {
3402
3623
  component: input_default,
3403
- ...componentInfo12
3624
+ ...componentInfo13
3404
3625
  }, {
3405
3626
  component: submit_button_default,
3406
- ...componentInfo14
3627
+ ...componentInfo15
3407
3628
  }, {
3408
3629
  component: select_default,
3409
- ...componentInfo13
3630
+ ...componentInfo14
3410
3631
  }], {
3411
3632
  component: img_default,
3412
- ...componentInfo15
3633
+ ...componentInfo16
3413
3634
  }, {
3414
3635
  component: video_default,
3415
- ...componentInfo16
3636
+ ...componentInfo17
3416
3637
  }];
3417
3638
 
3418
3639
  // src/constants/builder-registered-components.ts
@@ -3439,8 +3660,11 @@ var getDefaultRegisteredComponents = () => [{
3439
3660
  ...componentInfo7
3440
3661
  }, {
3441
3662
  component: text_default,
3663
+ ...componentInfo9
3664
+ }, ...TARGET === "rsc" ? [] : [{
3665
+ component: tabs_default,
3442
3666
  ...componentInfo8
3443
- }, ...getExtraComponents()];
3667
+ }], ...getExtraComponents()];
3444
3668
 
3445
3669
  // src/functions/register-component.ts
3446
3670
  var createRegisterComponentMessage = (info) => ({
@@ -3518,12 +3742,12 @@ var Inlined_script_default = InlinedScript;
3518
3742
 
3519
3743
  // src/components/content/components/enable-editor.tsx
3520
3744
  import {
3521
- Show as Show10,
3745
+ Show as Show11,
3522
3746
  onMount as onMount3,
3523
3747
  on as on2,
3524
3748
  createEffect as createEffect2,
3525
- createMemo as createMemo12,
3526
- createSignal as createSignal12
3749
+ createMemo as createMemo14,
3750
+ createSignal as createSignal14
3527
3751
  } from "solid-js";
3528
3752
  import { Dynamic as Dynamic5 } from "solid-js/web";
3529
3753
 
@@ -4006,7 +4230,7 @@ function isFromTrustedHost(trustedHosts, e) {
4006
4230
  }
4007
4231
 
4008
4232
  // src/constants/sdk-version.ts
4009
- var SDK_VERSION = "1.0.23";
4233
+ var SDK_VERSION = "1.0.24";
4010
4234
 
4011
4235
  // src/functions/register.ts
4012
4236
  var registry = {};
@@ -4202,14 +4426,93 @@ var subscribeToEditor = (model, callback, options) => {
4202
4426
  };
4203
4427
  };
4204
4428
 
4429
+ // src/components/content/components/styles.helpers.ts
4430
+ var getCssFromFont = (font) => {
4431
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4432
+ const name = family.split(",")[0];
4433
+ const url = font.fileUrl ?? font?.files?.regular;
4434
+ let str = "";
4435
+ if (url && family && name) {
4436
+ str += `
4437
+ @font-face {
4438
+ font-family: "${family}";
4439
+ src: local("${name}"), url('${url}') format('woff2');
4440
+ font-display: fallback;
4441
+ font-weight: 400;
4442
+ }
4443
+ `.trim();
4444
+ }
4445
+ if (font.files) {
4446
+ for (const weight in font.files) {
4447
+ const isNumber = String(Number(weight)) === weight;
4448
+ if (!isNumber) {
4449
+ continue;
4450
+ }
4451
+ const weightUrl = font.files[weight];
4452
+ if (weightUrl && weightUrl !== url) {
4453
+ str += `
4454
+ @font-face {
4455
+ font-family: "${family}";
4456
+ src: url('${weightUrl}') format('woff2');
4457
+ font-display: fallback;
4458
+ font-weight: ${weight};
4459
+ }
4460
+ `.trim();
4461
+ }
4462
+ }
4463
+ }
4464
+ return str;
4465
+ };
4466
+ var getFontCss = ({
4467
+ customFonts
4468
+ }) => {
4469
+ return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4470
+ };
4471
+ var getCss = ({
4472
+ cssCode,
4473
+ contentId
4474
+ }) => {
4475
+ if (!cssCode) {
4476
+ return "";
4477
+ }
4478
+ if (!contentId) {
4479
+ return cssCode;
4480
+ }
4481
+ return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4482
+ };
4483
+ var DEFAULT_STYLES = `
4484
+ .builder-button {
4485
+ all: unset;
4486
+ }
4487
+
4488
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4489
+ margin: 0;
4490
+ }
4491
+ .builder-text > p, .builder-text > .builder-paragraph {
4492
+ color: inherit;
4493
+ line-height: inherit;
4494
+ letter-spacing: inherit;
4495
+ font-weight: inherit;
4496
+ font-size: inherit;
4497
+ text-align: inherit;
4498
+ font-family: inherit;
4499
+ }
4500
+ `;
4501
+ var getDefaultStyles = (isNested) => {
4502
+ return !isNested ? DEFAULT_STYLES : "";
4503
+ };
4504
+ var getWrapperClassName = (variationId) => {
4505
+ return `variant-${variationId}`;
4506
+ };
4507
+
4205
4508
  // src/components/content/components/enable-editor.tsx
4206
4509
  function EnableEditor(props) {
4207
- const [ContentWrapper, setContentWrapper] = createSignal12(
4510
+ const [ContentWrapper, setContentWrapper] = createSignal14(
4208
4511
  props.contentWrapper || "div"
4209
4512
  );
4210
- const [httpReqsData, setHttpReqsData] = createSignal12({});
4211
- const [httpReqsPending, setHttpReqsPending] = createSignal12({});
4212
- const [clicked, setClicked] = createSignal12(false);
4513
+ const [httpReqsData, setHttpReqsData] = createSignal14({});
4514
+ const [httpReqsPending, setHttpReqsPending] = createSignal14({});
4515
+ const [clicked, setClicked] = createSignal14(false);
4213
4516
  function mergeNewRootState(newData) {
4214
4517
  const combinedState = {
4215
4518
  ...props.builderContextSignal.rootState,
@@ -4243,6 +4546,12 @@ function EnableEditor(props) {
4243
4546
  content: newContentValue
4244
4547
  }));
4245
4548
  }
4549
+ const showContentProps = createMemo14(() => {
4550
+ return props.showContent ? {} : {
4551
+ hidden: true,
4552
+ "aria-hidden": true
4553
+ };
4554
+ });
4246
4555
  function processMessage(event) {
4247
4556
  return createEditorListener({
4248
4557
  model: props.model,
@@ -4427,14 +4736,14 @@ function EnableEditor(props) {
4427
4736
  runHttpRequests();
4428
4737
  emitStateUpdate();
4429
4738
  });
4430
- const onUpdateFn_0_props_content = createMemo12(() => props.content);
4739
+ const onUpdateFn_0_props_content = createMemo14(() => props.content);
4431
4740
  function onUpdateFn_0() {
4432
4741
  if (props.content) {
4433
4742
  mergeNewContent(props.content);
4434
4743
  }
4435
4744
  }
4436
4745
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4437
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4746
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
4438
4747
  function onUpdateFn_1() {
4439
4748
  evaluateJsCode();
4440
4749
  }
@@ -4444,7 +4753,7 @@ function EnableEditor(props) {
4444
4753
  onUpdateFn_1
4445
4754
  )
4446
4755
  );
4447
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4756
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
4448
4757
  function onUpdateFn_2() {
4449
4758
  runHttpRequests();
4450
4759
  }
@@ -4456,7 +4765,7 @@ function EnableEditor(props) {
4456
4765
  onUpdateFn_2
4457
4766
  )
4458
4767
  );
4459
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
4768
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
4460
4769
  () => props.builderContextSignal.rootState
4461
4770
  );
4462
4771
  function onUpdateFn_3() {
@@ -4468,14 +4777,14 @@ function EnableEditor(props) {
4468
4777
  onUpdateFn_3
4469
4778
  )
4470
4779
  );
4471
- const onUpdateFn_4_props_data = createMemo12(() => props.data);
4780
+ const onUpdateFn_4_props_data = createMemo14(() => props.data);
4472
4781
  function onUpdateFn_4() {
4473
4782
  if (props.data) {
4474
4783
  mergeNewRootState(props.data);
4475
4784
  }
4476
4785
  }
4477
4786
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4478
- const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
4787
+ const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
4479
4788
  function onUpdateFn_5() {
4480
4789
  if (props.locale) {
4481
4790
  mergeNewRootState({
@@ -4484,106 +4793,27 @@ function EnableEditor(props) {
4484
4793
  }
4485
4794
  }
4486
4795
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4487
- return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
4488
- class={`variant-${props.content?.testVariationId || props.content?.id}`}
4796
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
4797
+ class={getWrapperClassName(
4798
+ props.content?.testVariationId || props.content?.id
4799
+ )}
4489
4800
  {...{}}
4490
4801
  ref={elementRef}
4491
4802
  onClick={(event) => onClick(event)}
4492
4803
  builder-content-id={props.builderContextSignal.content?.id}
4493
4804
  builder-model={props.model}
4494
4805
  {...{}}
4495
- {...props.showContent ? {} : {
4496
- hidden: true,
4497
- "aria-hidden": true
4498
- }}
4806
+ {...showContentProps()}
4499
4807
  {...props.contentWrapperProps}
4500
4808
  component={ContentWrapper()}
4501
- >{props.children}</Dynamic5></Show10></builder_context_default.Provider>;
4809
+ >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
4502
4810
  }
4503
4811
  var Enable_editor_default = EnableEditor;
4504
4812
 
4505
4813
  // src/components/content/components/styles.tsx
4506
- import { createSignal as createSignal13 } from "solid-js";
4507
-
4508
- // src/components/content/components/styles.helpers.ts
4509
- var getCssFromFont = (font) => {
4510
- const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4511
- const name = family.split(",")[0];
4512
- const url = font.fileUrl ?? font?.files?.regular;
4513
- let str = "";
4514
- if (url && family && name) {
4515
- str += `
4516
- @font-face {
4517
- font-family: "${family}";
4518
- src: local("${name}"), url('${url}') format('woff2');
4519
- font-display: fallback;
4520
- font-weight: 400;
4521
- }
4522
- `.trim();
4523
- }
4524
- if (font.files) {
4525
- for (const weight in font.files) {
4526
- const isNumber = String(Number(weight)) === weight;
4527
- if (!isNumber) {
4528
- continue;
4529
- }
4530
- const weightUrl = font.files[weight];
4531
- if (weightUrl && weightUrl !== url) {
4532
- str += `
4533
- @font-face {
4534
- font-family: "${family}";
4535
- src: url('${weightUrl}') format('woff2');
4536
- font-display: fallback;
4537
- font-weight: ${weight};
4538
- }
4539
- `.trim();
4540
- }
4541
- }
4542
- }
4543
- return str;
4544
- };
4545
- var getFontCss = ({
4546
- customFonts
4547
- }) => {
4548
- return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4549
- };
4550
- var getCss = ({
4551
- cssCode,
4552
- contentId
4553
- }) => {
4554
- if (!cssCode) {
4555
- return "";
4556
- }
4557
- if (!contentId) {
4558
- return cssCode;
4559
- }
4560
- return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4561
- };
4562
- var DEFAULT_STYLES = `
4563
- .builder-button {
4564
- all: unset;
4565
- }
4566
-
4567
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4568
- margin: 0;
4569
- }
4570
- .builder-text > p, .builder-text > .builder-paragraph {
4571
- color: inherit;
4572
- line-height: inherit;
4573
- letter-spacing: inherit;
4574
- font-weight: inherit;
4575
- font-size: inherit;
4576
- text-align: inherit;
4577
- font-family: inherit;
4578
- }
4579
- `;
4580
- var getDefaultStyles = (isNested) => {
4581
- return !isNested ? DEFAULT_STYLES : "";
4582
- };
4583
-
4584
- // src/components/content/components/styles.tsx
4814
+ import { createSignal as createSignal15 } from "solid-js";
4585
4815
  function ContentStyles(props) {
4586
- const [injectedStyles, setInjectedStyles] = createSignal13(
4816
+ const [injectedStyles, setInjectedStyles] = createSignal15(
4587
4817
  `
4588
4818
  ${getCss({
4589
4819
  cssCode: props.cssCode,
@@ -4640,7 +4870,7 @@ var getContentInitialValue = ({
4640
4870
 
4641
4871
  // src/components/content/content.tsx
4642
4872
  function ContentComponent(props) {
4643
- const [scriptStr, setScriptStr] = createSignal14(
4873
+ const [scriptStr, setScriptStr] = createSignal16(
4644
4874
  getUpdateVariantVisibilityScript({
4645
4875
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
4646
4876
  variationId: props.content?.testVariationId,
@@ -4648,7 +4878,7 @@ function ContentComponent(props) {
4648
4878
  contentId: props.content?.id
4649
4879
  })
4650
4880
  );
4651
- const [registeredComponents, setRegisteredComponents] = createSignal14(
4881
+ const [registeredComponents, setRegisteredComponents] = createSignal16(
4652
4882
  [
4653
4883
  ...getDefaultRegisteredComponents(),
4654
4884
  ...props.customComponents || []
@@ -4663,7 +4893,7 @@ function ContentComponent(props) {
4663
4893
  {}
4664
4894
  )
4665
4895
  );
4666
- const [builderContextSignal, setBuilderContextSignal] = createSignal14({
4896
+ const [builderContextSignal, setBuilderContextSignal] = createSignal16({
4667
4897
  content: getContentInitialValue({
4668
4898
  content: props.content,
4669
4899
  data: props.data
@@ -4721,16 +4951,16 @@ function ContentComponent(props) {
4721
4951
  setBuilderContextSignal
4722
4952
  }}
4723
4953
  >
4724
- <Show11 when={props.isSsrAbTest}><Inlined_script_default
4954
+ <Show12 when={props.isSsrAbTest}><Inlined_script_default
4725
4955
  id="builderio-variant-visibility"
4726
4956
  scriptStr={scriptStr()}
4727
- /></Show11>
4728
- <Show11 when={TARGET !== "reactNative"}><Styles_default
4957
+ /></Show12>
4958
+ <Show12 when={TARGET !== "reactNative"}><Styles_default
4729
4959
  isNestedRender={props.isNestedRender}
4730
4960
  contentId={builderContextSignal().content?.id}
4731
4961
  cssCode={builderContextSignal().content?.data?.cssCode}
4732
4962
  customFonts={builderContextSignal().content?.data?.customFonts}
4733
- /></Show11>
4963
+ /></Show12>
4734
4964
  <Blocks_default
4735
4965
  blocks={builderContextSignal().content?.data?.blocks}
4736
4966
  context={builderContextSignal()}
@@ -4743,13 +4973,13 @@ var Content_default = ContentComponent;
4743
4973
 
4744
4974
  // src/components/content-variants/content-variants.tsx
4745
4975
  function ContentVariants(props) {
4746
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal15(
4976
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
4747
4977
  checkShouldRenderVariants({
4748
4978
  canTrack: getDefaultCanTrack(props.canTrack),
4749
4979
  content: props.content
4750
4980
  })
4751
4981
  );
4752
- const updateCookieAndStylesScriptStr = createMemo15(() => {
4982
+ const updateCookieAndStylesScriptStr = createMemo17(() => {
4753
4983
  return getUpdateCookieAndStylesScript(
4754
4984
  getVariants(props.content).map((value) => ({
4755
4985
  id: value.testVariationId,
@@ -4758,10 +4988,10 @@ function ContentVariants(props) {
4758
4988
  props.content?.id || ""
4759
4989
  );
4760
4990
  });
4761
- const hideVariantsStyleString = createMemo15(() => {
4991
+ const hideVariantsStyleString = createMemo17(() => {
4762
4992
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
4763
4993
  });
4764
- const defaultContent = createMemo15(() => {
4994
+ const defaultContent = createMemo17(() => {
4765
4995
  return shouldRenderVariants() ? {
4766
4996
  ...props.content,
4767
4997
  testVariationId: props.content?.id
@@ -4774,11 +5004,11 @@ function ContentVariants(props) {
4774
5004
  setShouldRenderVariants(false);
4775
5005
  });
4776
5006
  return <>
4777
- <Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5007
+ <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
4778
5008
  id="builderio-init-variants-fns"
4779
5009
  scriptStr={getInitVariantsFnsScriptString()}
4780
- /></Show12>
4781
- <Show12 when={shouldRenderVariants()}>
5010
+ /></Show13>
5011
+ <Show13 when={shouldRenderVariants()}>
4782
5012
  <Inlined_styles_default
4783
5013
  id="builderio-variants"
4784
5014
  styles={hideVariantsStyleString()}
@@ -4787,7 +5017,7 @@ function ContentVariants(props) {
4787
5017
  id="builderio-variants-visibility"
4788
5018
  scriptStr={updateCookieAndStylesScriptStr()}
4789
5019
  />
4790
- <For7 each={getVariants(props.content)}>{(variant, _index) => {
5020
+ <For8 each={getVariants(props.content)}>{(variant, _index) => {
4791
5021
  const index = _index();
4792
5022
  return <Content_default
4793
5023
  isNestedRender={props.isNestedRender}
@@ -4811,8 +5041,8 @@ function ContentVariants(props) {
4811
5041
  contentWrapperProps={props.contentWrapperProps}
4812
5042
  trustedHosts={props.trustedHosts}
4813
5043
  />;
4814
- }}</For7>
4815
- </Show12>
5044
+ }}</For8>
5045
+ </Show13>
4816
5046
  <Content_default
4817
5047
  isNestedRender={props.isNestedRender}
4818
5048
  {...{}}
@@ -4865,8 +5095,14 @@ var fetchSymbolContent = async ({
4865
5095
 
4866
5096
  // src/blocks/symbol/symbol.tsx
4867
5097
  function Symbol(props) {
4868
- const [contentToUse, setContentToUse] = createSignal16(props.symbol?.content);
4869
- const className = createMemo16(() => {
5098
+ const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
5099
+ const blocksWrapper = createMemo18(() => {
5100
+ return "div";
5101
+ });
5102
+ const contentWrapper = createMemo18(() => {
5103
+ return "div";
5104
+ });
5105
+ const className = createMemo18(() => {
4870
5106
  return [
4871
5107
  ...[props.attributes[getClassPropName()]],
4872
5108
  "builder-symbol",
@@ -4888,7 +5124,7 @@ function Symbol(props) {
4888
5124
  }
4889
5125
  onMount5(() => {
4890
5126
  });
4891
- const onUpdateFn_0_props_symbol = createMemo16(() => props.symbol);
5127
+ const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
4892
5128
  function onUpdateFn_0() {
4893
5129
  setContent();
4894
5130
  }
@@ -4910,8 +5146,8 @@ function Symbol(props) {
4910
5146
  model={props.symbol?.model}
4911
5147
  content={contentToUse()}
4912
5148
  linkComponent={props.builderLinkComponent}
4913
- blocksWrapper="div"
4914
- contentWrapper="div"
5149
+ blocksWrapper={blocksWrapper()}
5150
+ contentWrapper={contentWrapper()}
4915
5151
  /></div>;
4916
5152
  }
4917
5153
  var symbol_default = Symbol;