@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.
package/lib/node/dev.jsx CHANGED
@@ -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) {
@@ -844,6 +848,7 @@ function mapStyleObjToStrIfNeeded(style) {
844
848
  case "svelte":
845
849
  case "vue":
846
850
  case "solid":
851
+ case "angular":
847
852
  return convertStyleMapToCSSArray(style).join(" ");
848
853
  case "qwik":
849
854
  case "reactNative":
@@ -919,6 +924,12 @@ var getRepeatItemData = ({
919
924
  }));
920
925
  return repeatArray;
921
926
  };
927
+ var shouldPassLinkComponent = (blockName) => {
928
+ return blockName && ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
929
+ };
930
+ var shouldPassRegisteredComponents = (blockName) => {
931
+ return blockName && ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
932
+ };
922
933
 
923
934
  // src/components/block/components/block-styles.tsx
924
935
  import { Show as Show2, createMemo } from "solid-js";
@@ -1162,15 +1173,15 @@ function BlockWrapper(props) {
1162
1173
  var Block_wrapper_default = BlockWrapper;
1163
1174
 
1164
1175
  // src/components/block/components/component-ref/component-ref.tsx
1165
- import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
1176
+ import { Show as Show3, For, createSignal as createSignal3 } from "solid-js";
1166
1177
  import { Dynamic as Dynamic3 } from "solid-js/web";
1167
1178
 
1168
1179
  // src/components/block/components/interactive-element.tsx
1180
+ import { createMemo as createMemo2 } from "solid-js";
1169
1181
  import { Dynamic as Dynamic2 } from "solid-js/web";
1170
1182
  function InteractiveElement(props) {
1171
- return <Dynamic2
1172
- {...props.wrapperProps}
1173
- attributes={props.includeBlockProps ? {
1183
+ const attributes = createMemo2(() => {
1184
+ return props.includeBlockProps ? {
1174
1185
  ...getBlockProperties({
1175
1186
  block: props.block,
1176
1187
  context: props.context
@@ -1182,7 +1193,11 @@ function InteractiveElement(props) {
1182
1193
  localState: props.context.localState,
1183
1194
  context: props.context.context
1184
1195
  })
1185
- } : {}}
1196
+ } : {};
1197
+ });
1198
+ return <Dynamic2
1199
+ {...props.wrapperProps}
1200
+ attributes={attributes()}
1186
1201
  component={props.Wrapper}
1187
1202
  >{props.children}</Dynamic2>;
1188
1203
  }
@@ -1223,7 +1238,7 @@ var getWrapperProps = ({
1223
1238
 
1224
1239
  // src/components/block/components/component-ref/component-ref.tsx
1225
1240
  function ComponentRef(props) {
1226
- const [Wrapper, setWrapper] = createSignal2(
1241
+ const [Wrapper, setWrapper] = createSignal3(
1227
1242
  props.isInteractive ? interactive_element_default : props.componentRef
1228
1243
  );
1229
1244
  return <Show3 when={props.componentRef}><Dynamic3
@@ -1252,9 +1267,9 @@ function ComponentRef(props) {
1252
1267
  var Component_ref_default = ComponentRef;
1253
1268
 
1254
1269
  // src/components/block/components/repeated-block.tsx
1255
- import { createSignal as createSignal3 } from "solid-js";
1270
+ import { createSignal as createSignal4 } from "solid-js";
1256
1271
  function RepeatedBlock(props) {
1257
- const [store, setStore] = createSignal3(props.repeatContext);
1272
+ const [store, setStore] = createSignal4(props.repeatContext);
1258
1273
  return <builder_context_default.Provider value={store()}><Block_default
1259
1274
  block={props.block}
1260
1275
  context={store()}
@@ -1266,20 +1281,20 @@ var Repeated_block_default = RepeatedBlock;
1266
1281
 
1267
1282
  // src/components/block/block.tsx
1268
1283
  function Block(props) {
1269
- const blockComponent = createMemo4(() => {
1284
+ const blockComponent = createMemo5(() => {
1270
1285
  return getComponent({
1271
1286
  block: props.block,
1272
1287
  context: props.context,
1273
1288
  registeredComponents: props.registeredComponents
1274
1289
  });
1275
1290
  });
1276
- const repeatItem = createMemo4(() => {
1291
+ const repeatItem = createMemo5(() => {
1277
1292
  return getRepeatItemData({
1278
1293
  block: props.block,
1279
1294
  context: props.context
1280
1295
  });
1281
1296
  });
1282
- const processedBlock = createMemo4(() => {
1297
+ const processedBlock = createMemo5(() => {
1283
1298
  return props.block.repeat?.collection ? props.block : getProcessedBlock({
1284
1299
  block: props.block,
1285
1300
  localState: props.context.localState,
@@ -1289,14 +1304,14 @@ function Block(props) {
1289
1304
  shouldEvaluateBindings: true
1290
1305
  });
1291
1306
  });
1292
- const Tag = createMemo4(() => {
1307
+ const Tag = createMemo5(() => {
1293
1308
  const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
1294
1309
  if (shouldUseLink) {
1295
1310
  return props.linkComponent || "a";
1296
1311
  }
1297
1312
  return props.block.tagName || "div";
1298
1313
  });
1299
- const canShowBlock = createMemo4(() => {
1314
+ const canShowBlock = createMemo5(() => {
1300
1315
  if (props.block.repeat?.collection) {
1301
1316
  if (repeatItem()?.length)
1302
1317
  return true;
@@ -1306,21 +1321,21 @@ function Block(props) {
1306
1321
  const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
1307
1322
  return shouldShow && !shouldHide;
1308
1323
  });
1309
- const childrenWithoutParentComponent = createMemo4(() => {
1324
+ const childrenWithoutParentComponent = createMemo5(() => {
1310
1325
  const shouldRenderChildrenOutsideRef = !blockComponent()?.component && !repeatItem();
1311
1326
  return shouldRenderChildrenOutsideRef ? processedBlock().children ?? [] : [];
1312
1327
  });
1313
- const componentRefProps = createMemo4(() => {
1328
+ const componentRefProps = createMemo5(() => {
1314
1329
  return {
1315
1330
  blockChildren: processedBlock().children ?? [],
1316
1331
  componentRef: blockComponent()?.component,
1317
1332
  componentOptions: {
1318
1333
  ...getBlockComponentOptions(processedBlock()),
1319
1334
  builderContext: props.context,
1320
- ...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1335
+ ...shouldPassLinkComponent(blockComponent()?.name) ? {
1321
1336
  builderLinkComponent: props.linkComponent
1322
1337
  } : {},
1323
- ...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1338
+ ...shouldPassRegisteredComponents(blockComponent()?.name) ? {
1324
1339
  builderComponents: props.registeredComponents
1325
1340
  } : {}
1326
1341
  },
@@ -1404,11 +1419,11 @@ function Block(props) {
1404
1419
  var Block_default = Block;
1405
1420
 
1406
1421
  // src/components/blocks/blocks-wrapper.tsx
1407
- import { createMemo as createMemo5 } from "solid-js";
1422
+ import { createMemo as createMemo6 } from "solid-js";
1408
1423
  import { Dynamic as Dynamic4 } from "solid-js/web";
1409
1424
  import { css } from "solid-styled-components";
1410
1425
  function BlocksWrapper(props) {
1411
- const className = createMemo5(() => {
1426
+ const className = createMemo6(() => {
1412
1427
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
1413
1428
  });
1414
1429
  function onClick() {
@@ -1482,16 +1497,24 @@ function Blocks(props) {
1482
1497
  }
1483
1498
  var Blocks_default = Blocks;
1484
1499
 
1500
+ // src/blocks/columns/helpers.ts
1501
+ var getColumnsClass = (id) => {
1502
+ return `builder-columns ${id}-breakpoints`;
1503
+ };
1504
+
1485
1505
  // src/blocks/columns/columns.tsx
1486
1506
  function Columns(props) {
1487
- const [gutterSize, setGutterSize] = createSignal6(
1507
+ const [gutterSize, setGutterSize] = createSignal7(
1488
1508
  typeof props.space === "number" ? props.space || 0 : 20
1489
1509
  );
1490
- const [cols, setCols] = createSignal6(props.columns || []);
1491
- const [stackAt, setStackAt] = createSignal6(props.stackColumnsAt || "tablet");
1492
- const [flexDir, setFlexDir] = createSignal6(
1510
+ const [cols, setCols] = createSignal7(props.columns || []);
1511
+ const [stackAt, setStackAt] = createSignal7(props.stackColumnsAt || "tablet");
1512
+ const [flexDir, setFlexDir] = createSignal7(
1493
1513
  props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column"
1494
1514
  );
1515
+ function getTagName(column) {
1516
+ return column.link ? props.builderLinkComponent || "a" : "div";
1517
+ }
1495
1518
  function getWidth(index) {
1496
1519
  return cols()[index]?.width || 100 / cols().length;
1497
1520
  }
@@ -1511,7 +1534,7 @@ function Columns(props) {
1511
1534
  }) {
1512
1535
  return stackAt() === "never" ? desktopStyle : stackedStyle;
1513
1536
  }
1514
- const columnsCssVars = createMemo6(() => {
1537
+ function columnsCssVars() {
1515
1538
  return {
1516
1539
  "--flex-dir": flexDir(),
1517
1540
  "--flex-dir-tablet": getTabletStyle({
@@ -1519,7 +1542,7 @@ function Columns(props) {
1519
1542
  desktopStyle: "row"
1520
1543
  })
1521
1544
  };
1522
- });
1545
+ }
1523
1546
  function columnCssVars(index) {
1524
1547
  const gutter = index === 0 ? 0 : gutterSize();
1525
1548
  const width = getColumnCssWidth(index);
@@ -1560,7 +1583,7 @@ function Columns(props) {
1560
1583
  );
1561
1584
  return breakpointSizes[size].max;
1562
1585
  }
1563
- const columnsStyles = createMemo6(() => {
1586
+ function columnsStyles() {
1564
1587
  return `
1565
1588
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
1566
1589
  .${props.builderBlock.id}-breakpoints {
@@ -1586,9 +1609,19 @@ function Columns(props) {
1586
1609
  }
1587
1610
  },
1588
1611
  `;
1589
- });
1612
+ }
1613
+ function getAttributes(column, index) {
1614
+ return {
1615
+ ...{},
1616
+ ...column.link ? {
1617
+ href: column.link
1618
+ } : {},
1619
+ [getClassPropName()]: "builder-column",
1620
+ style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1621
+ };
1622
+ }
1590
1623
  return <div
1591
- class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
1624
+ class={getColumnsClass(props.builderBlock?.id) + " " + css2({
1592
1625
  display: "flex",
1593
1626
  lineHeight: "normal"
1594
1627
  })}
@@ -1603,16 +1636,9 @@ function Columns(props) {
1603
1636
  const index = _index();
1604
1637
  return <Dynamic_renderer_default
1605
1638
  key={index}
1606
- TagName={column.link ? props.builderLinkComponent || "a" : "div"}
1639
+ TagName={getTagName(column)}
1607
1640
  actionAttributes={{}}
1608
- attributes={{
1609
- ...{},
1610
- ...column.link ? {
1611
- href: column.link
1612
- } : {},
1613
- [getClassPropName()]: "builder-column",
1614
- style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1615
- }}
1641
+ attributes={getAttributes(column, index)}
1616
1642
  ><Blocks_default
1617
1643
  path={`component.options.columns.${index}.blocks`}
1618
1644
  parent={props.builderBlock.id}
@@ -1636,7 +1662,7 @@ function FragmentComponent(props) {
1636
1662
  var fragment_default = FragmentComponent;
1637
1663
 
1638
1664
  // src/blocks/image/image.tsx
1639
- import { Show as Show7, createMemo as createMemo7 } from "solid-js";
1665
+ import { Show as Show7, createMemo as createMemo8 } from "solid-js";
1640
1666
  import { css as css3 } from "solid-styled-components";
1641
1667
 
1642
1668
  // src/blocks/image/image.helpers.ts
@@ -1688,7 +1714,7 @@ function getSrcSet(url) {
1688
1714
 
1689
1715
  // src/blocks/image/image.tsx
1690
1716
  function Image(props) {
1691
- const srcSetToUse = createMemo7(() => {
1717
+ const srcSetToUse = createMemo8(() => {
1692
1718
  const imageToUse = props.image || props.src;
1693
1719
  const url = imageToUse;
1694
1720
  if (!url || // We can auto add srcset for cdn.builder.io and shopify
@@ -1706,14 +1732,14 @@ function Image(props) {
1706
1732
  }
1707
1733
  return getSrcSet(url);
1708
1734
  });
1709
- const webpSrcSet = createMemo7(() => {
1735
+ const webpSrcSet = createMemo8(() => {
1710
1736
  if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
1711
1737
  return srcSetToUse().replace(/\?/g, "?format=webp&");
1712
1738
  } else {
1713
1739
  return "";
1714
1740
  }
1715
1741
  });
1716
- const aspectRatioCss = createMemo7(() => {
1742
+ const aspectRatioCss = createMemo8(() => {
1717
1743
  const aspectRatioStyles = {
1718
1744
  position: "absolute",
1719
1745
  height: "100%",
@@ -1758,7 +1784,7 @@ function Image(props) {
1758
1784
  }}
1759
1785
  /></Show7>
1760
1786
  <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
1761
- <Show7 when={!props.fitContent && props.children}><div
1787
+ <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div
1762
1788
  class={css3({
1763
1789
  display: "flex",
1764
1790
  flexDirection: "column",
@@ -1796,10 +1822,10 @@ function SectionComponent(props) {
1796
1822
  var section_default = SectionComponent;
1797
1823
 
1798
1824
  // src/blocks/symbol/symbol.tsx
1799
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo16, createSignal as createSignal16 } from "solid-js";
1825
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
1800
1826
 
1801
1827
  // src/components/content-variants/content-variants.tsx
1802
- import { Show as Show12, For as For7, onMount as onMount4, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
1828
+ import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
1803
1829
 
1804
1830
  // src/helpers/url.ts
1805
1831
  var getTopLevelDomain = (host) => {
@@ -1993,7 +2019,7 @@ var handleABTesting = async ({
1993
2019
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1994
2020
 
1995
2021
  // src/components/content/content.tsx
1996
- import { Show as Show11, createSignal as createSignal14 } from "solid-js";
2022
+ import { Show as Show12, createSignal as createSignal16 } from "solid-js";
1997
2023
 
1998
2024
  // src/blocks/button/component-info.ts
1999
2025
  var componentInfo = {
@@ -2495,8 +2521,203 @@ var componentInfo7 = {
2495
2521
  }]
2496
2522
  };
2497
2523
 
2498
- // src/blocks/text/component-info.ts
2524
+ // src/blocks/tabs/component-info.ts
2525
+ var defaultTab = {
2526
+ "@type": "@builder.io/sdk:Element",
2527
+ responsiveStyles: {
2528
+ large: {
2529
+ paddingLeft: "20px",
2530
+ paddingRight: "20px",
2531
+ paddingTop: "10px",
2532
+ paddingBottom: "10px",
2533
+ minWidth: "100px",
2534
+ textAlign: "center",
2535
+ display: "flex",
2536
+ flexDirection: "column",
2537
+ cursor: "pointer",
2538
+ userSelect: "none"
2539
+ }
2540
+ },
2541
+ component: {
2542
+ name: "Text",
2543
+ options: {
2544
+ text: "New tab"
2545
+ }
2546
+ }
2547
+ };
2548
+ var defaultElement = {
2549
+ "@type": "@builder.io/sdk:Element",
2550
+ responsiveStyles: {
2551
+ large: {
2552
+ height: "200px",
2553
+ display: "flex",
2554
+ marginTop: "20px",
2555
+ flexDirection: "column"
2556
+ }
2557
+ },
2558
+ component: {
2559
+ name: "Text",
2560
+ options: {
2561
+ text: "New tab content "
2562
+ }
2563
+ }
2564
+ };
2499
2565
  var componentInfo8 = {
2566
+ name: "Builder: Tabs",
2567
+ inputs: [{
2568
+ name: "tabs",
2569
+ type: "list",
2570
+ broadcast: true,
2571
+ subFields: [{
2572
+ name: "label",
2573
+ type: "uiBlocks",
2574
+ hideFromUI: true,
2575
+ defaultValue: [defaultTab]
2576
+ }, {
2577
+ name: "content",
2578
+ type: "uiBlocks",
2579
+ hideFromUI: true,
2580
+ defaultValue: [defaultElement]
2581
+ }],
2582
+ defaultValue: [{
2583
+ label: [{
2584
+ ...defaultTab,
2585
+ component: {
2586
+ name: "Text",
2587
+ options: {
2588
+ text: "Tab 1"
2589
+ }
2590
+ }
2591
+ }],
2592
+ content: [{
2593
+ ...defaultElement,
2594
+ component: {
2595
+ name: "Text",
2596
+ options: {
2597
+ text: "Tab 1 content"
2598
+ }
2599
+ }
2600
+ }]
2601
+ }, {
2602
+ label: [{
2603
+ ...defaultTab,
2604
+ component: {
2605
+ name: "Text",
2606
+ options: {
2607
+ text: "Tab 2"
2608
+ }
2609
+ }
2610
+ }],
2611
+ content: [{
2612
+ ...defaultElement,
2613
+ component: {
2614
+ name: "Text",
2615
+ options: {
2616
+ text: "Tab 2 content"
2617
+ }
2618
+ }
2619
+ }]
2620
+ }]
2621
+ }, {
2622
+ name: "activeTabStyle",
2623
+ type: "uiStyle",
2624
+ helperText: "CSS styles for the active tab",
2625
+ defaultValue: {
2626
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
2627
+ }
2628
+ }, {
2629
+ name: "defaultActiveTab",
2630
+ type: "number",
2631
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
2632
+ defaultValue: 1,
2633
+ advanced: true
2634
+ }, {
2635
+ name: "collapsible",
2636
+ type: "boolean",
2637
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
2638
+ defaultValue: false,
2639
+ advanced: true
2640
+ }, {
2641
+ name: "tabHeaderLayout",
2642
+ type: "enum",
2643
+ helperText: "Change the layout of the tab headers (uses justify-content)",
2644
+ defaultValue: "flex-start",
2645
+ enum: [{
2646
+ label: "Center",
2647
+ value: "center"
2648
+ }, {
2649
+ label: "Space between",
2650
+ value: "space-between"
2651
+ }, {
2652
+ label: "Space around",
2653
+ value: "space-around"
2654
+ }, {
2655
+ label: "Left",
2656
+ value: "flex-start"
2657
+ }, {
2658
+ label: "Right",
2659
+ value: "flex-end"
2660
+ }]
2661
+ }]
2662
+ };
2663
+
2664
+ // src/blocks/tabs/tabs.tsx
2665
+ import { Show as Show8, For as For5, createSignal as createSignal9 } from "solid-js";
2666
+ function Tabs(props) {
2667
+ const [activeTab, setActiveTab] = createSignal9(
2668
+ props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
2669
+ );
2670
+ function activeTabContent(active) {
2671
+ return props.tabs && props.tabs[active].content;
2672
+ }
2673
+ function getActiveTabStyle(index) {
2674
+ return activeTab() === index ? props.activeTabStyle : {};
2675
+ }
2676
+ return <div>
2677
+ <div
2678
+ class="builder-tabs-wrap"
2679
+ style={{
2680
+ display: "flex",
2681
+ "flex-direction": "row",
2682
+ "justify-content": props.tabHeaderLayout || "flex-start",
2683
+ overflow: "auto"
2684
+ }}
2685
+ ><For5 each={props.tabs}>{(tab, _index) => {
2686
+ const index = _index();
2687
+ return <span
2688
+ class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2689
+ key={index}
2690
+ style={getActiveTabStyle(index)}
2691
+ onClick={(event) => {
2692
+ if (index === activeTab() && props.collapsible) {
2693
+ setActiveTab(-1);
2694
+ } else {
2695
+ setActiveTab(index);
2696
+ }
2697
+ }}
2698
+ ><Blocks_default
2699
+ parent={props.builderBlock.id}
2700
+ path={`component.options.tabs.${index}.label`}
2701
+ blocks={tab.label}
2702
+ context={props.builderContext}
2703
+ registeredComponents={props.builderComponents}
2704
+ linkComponent={props.builderLinkComponent}
2705
+ /></span>;
2706
+ }}</For5></div>
2707
+ <Show8 when={activeTabContent(activeTab())}><div><Blocks_default
2708
+ parent={props.builderBlock.id}
2709
+ path={`component.options.tabs.${activeTab()}.content`}
2710
+ blocks={activeTabContent(activeTab())}
2711
+ context={props.builderContext}
2712
+ registeredComponents={props.builderComponents}
2713
+ linkComponent={props.builderLinkComponent}
2714
+ /></div></Show8>
2715
+ </div>;
2716
+ }
2717
+ var tabs_default = Tabs;
2718
+
2719
+ // src/blocks/text/component-info.ts
2720
+ var componentInfo9 = {
2500
2721
  name: "Text",
2501
2722
  static: true,
2502
2723
  isRSC: true,
@@ -2529,7 +2750,7 @@ function Text(props) {
2529
2750
  var text_default = Text;
2530
2751
 
2531
2752
  // src/blocks/custom-code/component-info.ts
2532
- var componentInfo9 = {
2753
+ var componentInfo10 = {
2533
2754
  name: "Custom Code",
2534
2755
  static: true,
2535
2756
  requiredPermissions: ["editCode"],
@@ -2554,10 +2775,10 @@ var componentInfo9 = {
2554
2775
  };
2555
2776
 
2556
2777
  // src/blocks/custom-code/custom-code.tsx
2557
- import { onMount as onMount2, createSignal as createSignal8 } from "solid-js";
2778
+ import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
2558
2779
  function CustomCode(props) {
2559
- const [scriptsInserted, setScriptsInserted] = createSignal8([]);
2560
- const [scriptsRun, setScriptsRun] = createSignal8([]);
2780
+ const [scriptsInserted, setScriptsInserted] = createSignal10([]);
2781
+ const [scriptsRun, setScriptsRun] = createSignal10([]);
2561
2782
  let elementRef;
2562
2783
  onMount2(() => {
2563
2784
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -2601,7 +2822,7 @@ function CustomCode(props) {
2601
2822
  var custom_code_default = CustomCode;
2602
2823
 
2603
2824
  // src/blocks/embed/component-info.ts
2604
- var componentInfo10 = {
2825
+ var componentInfo11 = {
2605
2826
  name: "Embed",
2606
2827
  static: true,
2607
2828
  inputs: [{
@@ -2639,7 +2860,7 @@ var componentInfo10 = {
2639
2860
  };
2640
2861
 
2641
2862
  // src/blocks/embed/embed.tsx
2642
- import { on, createEffect, createMemo as createMemo9, createSignal as createSignal9 } from "solid-js";
2863
+ import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
2643
2864
 
2644
2865
  // src/blocks/embed/helpers.ts
2645
2866
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -2647,9 +2868,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2647
2868
 
2648
2869
  // src/blocks/embed/embed.tsx
2649
2870
  function Embed(props) {
2650
- const [scriptsInserted, setScriptsInserted] = createSignal9([]);
2651
- const [scriptsRun, setScriptsRun] = createSignal9([]);
2652
- const [ranInitFn, setRanInitFn] = createSignal9(false);
2871
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2872
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
2873
+ const [ranInitFn, setRanInitFn] = createSignal11(false);
2653
2874
  function findAndRunScripts() {
2654
2875
  if (!elem || !elem.getElementsByTagName)
2655
2876
  return;
@@ -2673,8 +2894,8 @@ function Embed(props) {
2673
2894
  }
2674
2895
  }
2675
2896
  let elem;
2676
- const onUpdateFn_0_elem = createMemo9(() => elem);
2677
- const onUpdateFn_0_ranInitFn__ = createMemo9(() => ranInitFn());
2897
+ const onUpdateFn_0_elem = createMemo11(() => elem);
2898
+ const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
2678
2899
  function onUpdateFn_0() {
2679
2900
  if (elem && !ranInitFn()) {
2680
2901
  setRanInitFn(true);
@@ -2689,7 +2910,7 @@ function Embed(props) {
2689
2910
  var embed_default = Embed;
2690
2911
 
2691
2912
  // src/blocks/form/form/component-info.ts
2692
- var componentInfo11 = {
2913
+ var componentInfo12 = {
2693
2914
  name: "Form:Form",
2694
2915
  // editableTags: ['builder-form-error']
2695
2916
  defaults: {
@@ -2923,7 +3144,7 @@ var componentInfo11 = {
2923
3144
  };
2924
3145
 
2925
3146
  // src/blocks/form/form/form.tsx
2926
- import { Show as Show8, For as For5, createSignal as createSignal10 } from "solid-js";
3147
+ import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
2927
3148
  import { css as css4 } from "solid-styled-components";
2928
3149
 
2929
3150
  // src/functions/get-env.ts
@@ -2941,9 +3162,9 @@ var get = (obj, path, defaultValue) => {
2941
3162
 
2942
3163
  // src/blocks/form/form/form.tsx
2943
3164
  function FormComponent(props) {
2944
- const [formState, setFormState] = createSignal10("unsubmitted");
2945
- const [responseData, setResponseData] = createSignal10(null);
2946
- const [formErrorMessage, setFormErrorMessage] = createSignal10("");
3165
+ const [formState, setFormState] = createSignal12("unsubmitted");
3166
+ const [responseData, setResponseData] = createSignal12(null);
3167
+ const [formErrorMessage, setFormErrorMessage] = createSignal12("");
2947
3168
  function mergeNewRootState(newData) {
2948
3169
  const combinedState = {
2949
3170
  ...props.builderContext.rootState,
@@ -3139,7 +3360,7 @@ function FormComponent(props) {
3139
3360
  {...{}}
3140
3361
  {...props.attributes}
3141
3362
  >
3142
- <Show8 when={props.builderBlock && props.builderBlock.children}><For5 each={props.builderBlock?.children}>{(block, _index) => {
3363
+ <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
3143
3364
  const idx = _index();
3144
3365
  return <Block_default
3145
3366
  key={`form-block-${idx}`}
@@ -3148,35 +3369,35 @@ function FormComponent(props) {
3148
3369
  registeredComponents={props.builderComponents}
3149
3370
  linkComponent={props.builderLinkComponent}
3150
3371
  />;
3151
- }}</For5></Show8>
3152
- <Show8 when={submissionState() === "error"}><Blocks_default
3372
+ }}</For6></Show9>
3373
+ <Show9 when={submissionState() === "error"}><Blocks_default
3153
3374
  path="errorMessage"
3154
3375
  blocks={props.errorMessage}
3155
3376
  context={props.builderContext}
3156
- /></Show8>
3157
- <Show8 when={submissionState() === "sending"}><Blocks_default
3377
+ /></Show9>
3378
+ <Show9 when={submissionState() === "sending"}><Blocks_default
3158
3379
  path="sendingMessage"
3159
3380
  blocks={props.sendingMessage}
3160
3381
  context={props.builderContext}
3161
- /></Show8>
3162
- <Show8 when={submissionState() === "error" && responseData()}><pre
3382
+ /></Show9>
3383
+ <Show9 when={submissionState() === "error" && responseData()}><pre
3163
3384
  class={"builder-form-error-text " + css4({
3164
3385
  padding: "10px",
3165
3386
  color: "red",
3166
3387
  textAlign: "center"
3167
3388
  })}
3168
- >{JSON.stringify(responseData(), null, 2)}</pre></Show8>
3169
- <Show8 when={submissionState() === "success"}><Blocks_default
3389
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
3390
+ <Show9 when={submissionState() === "success"}><Blocks_default
3170
3391
  path="successMessage"
3171
3392
  blocks={props.successMessage}
3172
3393
  context={props.builderContext}
3173
- /></Show8>
3394
+ /></Show9>
3174
3395
  </form>;
3175
3396
  }
3176
3397
  var form_default = FormComponent;
3177
3398
 
3178
3399
  // src/blocks/form/input/component-info.ts
3179
- var componentInfo12 = {
3400
+ var componentInfo13 = {
3180
3401
  name: "Form:Input",
3181
3402
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3182
3403
  inputs: [
@@ -3246,7 +3467,7 @@ function FormInputComponent(props) {
3246
3467
  var input_default = FormInputComponent;
3247
3468
 
3248
3469
  // src/blocks/form/select/component-info.ts
3249
- var componentInfo13 = {
3470
+ var componentInfo14 = {
3250
3471
  name: "Form:Select",
3251
3472
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3252
3473
  defaultStyles: {
@@ -3291,7 +3512,7 @@ var componentInfo13 = {
3291
3512
  };
3292
3513
 
3293
3514
  // src/blocks/form/select/select.tsx
3294
- import { For as For6 } from "solid-js";
3515
+ import { For as For7 } from "solid-js";
3295
3516
  function SelectComponent(props) {
3296
3517
  return <select
3297
3518
  {...{}}
@@ -3300,15 +3521,15 @@ function SelectComponent(props) {
3300
3521
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
3301
3522
  defaultValue={props.defaultValue}
3302
3523
  name={props.name}
3303
- ><For6 each={props.options}>{(option, _index) => {
3524
+ ><For7 each={props.options}>{(option, _index) => {
3304
3525
  const index = _index();
3305
3526
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
3306
- }}</For6></select>;
3527
+ }}</For7></select>;
3307
3528
  }
3308
3529
  var select_default = SelectComponent;
3309
3530
 
3310
3531
  // src/blocks/form/submit-button/component-info.ts
3311
- var componentInfo14 = {
3532
+ var componentInfo15 = {
3312
3533
  name: "Form:SubmitButton",
3313
3534
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3314
3535
  defaultStyles: {
@@ -3342,7 +3563,7 @@ function SubmitButton(props) {
3342
3563
  var submit_button_default = SubmitButton;
3343
3564
 
3344
3565
  // src/blocks/img/component-info.ts
3345
- var componentInfo15 = {
3566
+ var componentInfo16 = {
3346
3567
  // friendlyName?
3347
3568
  name: "Raw:Img",
3348
3569
  hideFromInsertMenu: true,
@@ -3375,7 +3596,7 @@ function ImgComponent(props) {
3375
3596
  var img_default = ImgComponent;
3376
3597
 
3377
3598
  // src/blocks/video/component-info.ts
3378
- var componentInfo16 = {
3599
+ var componentInfo17 = {
3379
3600
  name: "Video",
3380
3601
  canHaveChildren: true,
3381
3602
  defaultStyles: {
@@ -3459,9 +3680,9 @@ var componentInfo16 = {
3459
3680
  };
3460
3681
 
3461
3682
  // src/blocks/video/video.tsx
3462
- import { Show as Show9, createMemo as createMemo11 } from "solid-js";
3683
+ import { Show as Show10, createMemo as createMemo13 } from "solid-js";
3463
3684
  function Video(props) {
3464
- const videoProps = createMemo11(() => {
3685
+ const videoProps = createMemo13(() => {
3465
3686
  return {
3466
3687
  ...props.autoPlay === true ? {
3467
3688
  autoPlay: true
@@ -3480,7 +3701,7 @@ function Video(props) {
3480
3701
  } : {}
3481
3702
  };
3482
3703
  });
3483
- const spreadProps = createMemo11(() => {
3704
+ const spreadProps = createMemo13(() => {
3484
3705
  return {
3485
3706
  ...videoProps()
3486
3707
  };
@@ -3510,8 +3731,8 @@ function Video(props) {
3510
3731
  }}
3511
3732
  src={props.video || "no-src"}
3512
3733
  poster={props.posterImage}
3513
- ><Show9 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show9></video>
3514
- <Show9
3734
+ ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
3735
+ <Show10
3515
3736
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
3516
3737
  ><div
3517
3738
  style={{
@@ -3520,15 +3741,15 @@ function Video(props) {
3520
3741
  "pointer-events": "none",
3521
3742
  "font-size": "0px"
3522
3743
  }}
3523
- /></Show9>
3524
- <Show9 when={props.builderBlock?.children?.length && props.fitContent}><div
3744
+ /></Show10>
3745
+ <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
3525
3746
  style={{
3526
3747
  display: "flex",
3527
3748
  "flex-direction": "column",
3528
3749
  "align-items": "stretch"
3529
3750
  }}
3530
- >{props.children}</div></Show9>
3531
- <Show9 when={props.builderBlock?.children?.length && !props.fitContent}><div
3751
+ >{props.children}</div></Show10>
3752
+ <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
3532
3753
  style={{
3533
3754
  "pointer-events": "none",
3534
3755
  display: "flex",
@@ -3540,7 +3761,7 @@ function Video(props) {
3540
3761
  width: "100%",
3541
3762
  height: "100%"
3542
3763
  }}
3543
- >{props.children}</div></Show9>
3764
+ >{props.children}</div></Show10>
3544
3765
  </div>;
3545
3766
  }
3546
3767
  var video_default = Video;
@@ -3548,28 +3769,28 @@ var video_default = Video;
3548
3769
  // src/constants/extra-components.ts
3549
3770
  var getExtraComponents = () => [{
3550
3771
  component: custom_code_default,
3551
- ...componentInfo9
3772
+ ...componentInfo10
3552
3773
  }, {
3553
3774
  component: embed_default,
3554
- ...componentInfo10
3775
+ ...componentInfo11
3555
3776
  }, ...TARGET === "rsc" ? [] : [{
3556
3777
  component: form_default,
3557
- ...componentInfo11
3778
+ ...componentInfo12
3558
3779
  }, {
3559
3780
  component: input_default,
3560
- ...componentInfo12
3781
+ ...componentInfo13
3561
3782
  }, {
3562
3783
  component: submit_button_default,
3563
- ...componentInfo14
3784
+ ...componentInfo15
3564
3785
  }, {
3565
3786
  component: select_default,
3566
- ...componentInfo13
3787
+ ...componentInfo14
3567
3788
  }], {
3568
3789
  component: img_default,
3569
- ...componentInfo15
3790
+ ...componentInfo16
3570
3791
  }, {
3571
3792
  component: video_default,
3572
- ...componentInfo16
3793
+ ...componentInfo17
3573
3794
  }];
3574
3795
 
3575
3796
  // src/constants/builder-registered-components.ts
@@ -3596,8 +3817,11 @@ var getDefaultRegisteredComponents = () => [{
3596
3817
  ...componentInfo7
3597
3818
  }, {
3598
3819
  component: text_default,
3820
+ ...componentInfo9
3821
+ }, ...TARGET === "rsc" ? [] : [{
3822
+ component: tabs_default,
3599
3823
  ...componentInfo8
3600
- }, ...getExtraComponents()];
3824
+ }], ...getExtraComponents()];
3601
3825
 
3602
3826
  // src/functions/register-component.ts
3603
3827
  var createRegisterComponentMessage = (info) => ({
@@ -3675,12 +3899,12 @@ var Inlined_script_default = InlinedScript;
3675
3899
 
3676
3900
  // src/components/content/components/enable-editor.tsx
3677
3901
  import {
3678
- Show as Show10,
3902
+ Show as Show11,
3679
3903
  onMount as onMount3,
3680
3904
  on as on2,
3681
3905
  createEffect as createEffect2,
3682
- createMemo as createMemo12,
3683
- createSignal as createSignal12
3906
+ createMemo as createMemo14,
3907
+ createSignal as createSignal14
3684
3908
  } from "solid-js";
3685
3909
  import { Dynamic as Dynamic5 } from "solid-js/web";
3686
3910
 
@@ -4168,7 +4392,7 @@ function isFromTrustedHost(trustedHosts, e) {
4168
4392
  }
4169
4393
 
4170
4394
  // src/constants/sdk-version.ts
4171
- var SDK_VERSION = "1.0.23";
4395
+ var SDK_VERSION = "1.0.24";
4172
4396
 
4173
4397
  // src/functions/register.ts
4174
4398
  var registry = {};
@@ -4365,14 +4589,93 @@ var subscribeToEditor = (model, callback, options) => {
4365
4589
  };
4366
4590
  };
4367
4591
 
4592
+ // src/components/content/components/styles.helpers.ts
4593
+ var getCssFromFont = (font) => {
4594
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4595
+ const name = family.split(",")[0];
4596
+ const url = font.fileUrl ?? font?.files?.regular;
4597
+ let str = "";
4598
+ if (url && family && name) {
4599
+ str += `
4600
+ @font-face {
4601
+ font-family: "${family}";
4602
+ src: local("${name}"), url('${url}') format('woff2');
4603
+ font-display: fallback;
4604
+ font-weight: 400;
4605
+ }
4606
+ `.trim();
4607
+ }
4608
+ if (font.files) {
4609
+ for (const weight in font.files) {
4610
+ const isNumber = String(Number(weight)) === weight;
4611
+ if (!isNumber) {
4612
+ continue;
4613
+ }
4614
+ const weightUrl = font.files[weight];
4615
+ if (weightUrl && weightUrl !== url) {
4616
+ str += `
4617
+ @font-face {
4618
+ font-family: "${family}";
4619
+ src: url('${weightUrl}') format('woff2');
4620
+ font-display: fallback;
4621
+ font-weight: ${weight};
4622
+ }
4623
+ `.trim();
4624
+ }
4625
+ }
4626
+ }
4627
+ return str;
4628
+ };
4629
+ var getFontCss = ({
4630
+ customFonts
4631
+ }) => {
4632
+ return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4633
+ };
4634
+ var getCss = ({
4635
+ cssCode,
4636
+ contentId
4637
+ }) => {
4638
+ if (!cssCode) {
4639
+ return "";
4640
+ }
4641
+ if (!contentId) {
4642
+ return cssCode;
4643
+ }
4644
+ return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4645
+ };
4646
+ var DEFAULT_STYLES = `
4647
+ .builder-button {
4648
+ all: unset;
4649
+ }
4650
+
4651
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4652
+ margin: 0;
4653
+ }
4654
+ .builder-text > p, .builder-text > .builder-paragraph {
4655
+ color: inherit;
4656
+ line-height: inherit;
4657
+ letter-spacing: inherit;
4658
+ font-weight: inherit;
4659
+ font-size: inherit;
4660
+ text-align: inherit;
4661
+ font-family: inherit;
4662
+ }
4663
+ `;
4664
+ var getDefaultStyles = (isNested) => {
4665
+ return !isNested ? DEFAULT_STYLES : "";
4666
+ };
4667
+ var getWrapperClassName = (variationId) => {
4668
+ return `variant-${variationId}`;
4669
+ };
4670
+
4368
4671
  // src/components/content/components/enable-editor.tsx
4369
4672
  function EnableEditor(props) {
4370
- const [ContentWrapper, setContentWrapper] = createSignal12(
4673
+ const [ContentWrapper, setContentWrapper] = createSignal14(
4371
4674
  props.contentWrapper || "div"
4372
4675
  );
4373
- const [httpReqsData, setHttpReqsData] = createSignal12({});
4374
- const [httpReqsPending, setHttpReqsPending] = createSignal12({});
4375
- const [clicked, setClicked] = createSignal12(false);
4676
+ const [httpReqsData, setHttpReqsData] = createSignal14({});
4677
+ const [httpReqsPending, setHttpReqsPending] = createSignal14({});
4678
+ const [clicked, setClicked] = createSignal14(false);
4376
4679
  function mergeNewRootState(newData) {
4377
4680
  const combinedState = {
4378
4681
  ...props.builderContextSignal.rootState,
@@ -4406,6 +4709,12 @@ function EnableEditor(props) {
4406
4709
  content: newContentValue
4407
4710
  }));
4408
4711
  }
4712
+ const showContentProps = createMemo14(() => {
4713
+ return props.showContent ? {} : {
4714
+ hidden: true,
4715
+ "aria-hidden": true
4716
+ };
4717
+ });
4409
4718
  function processMessage(event) {
4410
4719
  return createEditorListener({
4411
4720
  model: props.model,
@@ -4591,14 +4900,14 @@ function EnableEditor(props) {
4591
4900
  runHttpRequests();
4592
4901
  emitStateUpdate();
4593
4902
  });
4594
- const onUpdateFn_0_props_content = createMemo12(() => props.content);
4903
+ const onUpdateFn_0_props_content = createMemo14(() => props.content);
4595
4904
  function onUpdateFn_0() {
4596
4905
  if (props.content) {
4597
4906
  mergeNewContent(props.content);
4598
4907
  }
4599
4908
  }
4600
4909
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4601
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4910
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
4602
4911
  function onUpdateFn_1() {
4603
4912
  evaluateJsCode();
4604
4913
  }
@@ -4608,7 +4917,7 @@ function EnableEditor(props) {
4608
4917
  onUpdateFn_1
4609
4918
  )
4610
4919
  );
4611
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4920
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
4612
4921
  function onUpdateFn_2() {
4613
4922
  runHttpRequests();
4614
4923
  }
@@ -4620,7 +4929,7 @@ function EnableEditor(props) {
4620
4929
  onUpdateFn_2
4621
4930
  )
4622
4931
  );
4623
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
4932
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
4624
4933
  () => props.builderContextSignal.rootState
4625
4934
  );
4626
4935
  function onUpdateFn_3() {
@@ -4632,14 +4941,14 @@ function EnableEditor(props) {
4632
4941
  onUpdateFn_3
4633
4942
  )
4634
4943
  );
4635
- const onUpdateFn_4_props_data = createMemo12(() => props.data);
4944
+ const onUpdateFn_4_props_data = createMemo14(() => props.data);
4636
4945
  function onUpdateFn_4() {
4637
4946
  if (props.data) {
4638
4947
  mergeNewRootState(props.data);
4639
4948
  }
4640
4949
  }
4641
4950
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4642
- const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
4951
+ const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
4643
4952
  function onUpdateFn_5() {
4644
4953
  if (props.locale) {
4645
4954
  mergeNewRootState({
@@ -4648,106 +4957,27 @@ function EnableEditor(props) {
4648
4957
  }
4649
4958
  }
4650
4959
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4651
- return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
4652
- class={`variant-${props.content?.testVariationId || props.content?.id}`}
4960
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
4961
+ class={getWrapperClassName(
4962
+ props.content?.testVariationId || props.content?.id
4963
+ )}
4653
4964
  {...{}}
4654
4965
  ref={elementRef}
4655
4966
  onClick={(event) => onClick(event)}
4656
4967
  builder-content-id={props.builderContextSignal.content?.id}
4657
4968
  builder-model={props.model}
4658
4969
  {...{}}
4659
- {...props.showContent ? {} : {
4660
- hidden: true,
4661
- "aria-hidden": true
4662
- }}
4970
+ {...showContentProps()}
4663
4971
  {...props.contentWrapperProps}
4664
4972
  component={ContentWrapper()}
4665
- >{props.children}</Dynamic5></Show10></builder_context_default.Provider>;
4973
+ >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
4666
4974
  }
4667
4975
  var Enable_editor_default = EnableEditor;
4668
4976
 
4669
4977
  // src/components/content/components/styles.tsx
4670
- import { createSignal as createSignal13 } from "solid-js";
4671
-
4672
- // src/components/content/components/styles.helpers.ts
4673
- var getCssFromFont = (font) => {
4674
- const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4675
- const name = family.split(",")[0];
4676
- const url = font.fileUrl ?? font?.files?.regular;
4677
- let str = "";
4678
- if (url && family && name) {
4679
- str += `
4680
- @font-face {
4681
- font-family: "${family}";
4682
- src: local("${name}"), url('${url}') format('woff2');
4683
- font-display: fallback;
4684
- font-weight: 400;
4685
- }
4686
- `.trim();
4687
- }
4688
- if (font.files) {
4689
- for (const weight in font.files) {
4690
- const isNumber = String(Number(weight)) === weight;
4691
- if (!isNumber) {
4692
- continue;
4693
- }
4694
- const weightUrl = font.files[weight];
4695
- if (weightUrl && weightUrl !== url) {
4696
- str += `
4697
- @font-face {
4698
- font-family: "${family}";
4699
- src: url('${weightUrl}') format('woff2');
4700
- font-display: fallback;
4701
- font-weight: ${weight};
4702
- }
4703
- `.trim();
4704
- }
4705
- }
4706
- }
4707
- return str;
4708
- };
4709
- var getFontCss = ({
4710
- customFonts
4711
- }) => {
4712
- return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4713
- };
4714
- var getCss = ({
4715
- cssCode,
4716
- contentId
4717
- }) => {
4718
- if (!cssCode) {
4719
- return "";
4720
- }
4721
- if (!contentId) {
4722
- return cssCode;
4723
- }
4724
- return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4725
- };
4726
- var DEFAULT_STYLES = `
4727
- .builder-button {
4728
- all: unset;
4729
- }
4730
-
4731
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4732
- margin: 0;
4733
- }
4734
- .builder-text > p, .builder-text > .builder-paragraph {
4735
- color: inherit;
4736
- line-height: inherit;
4737
- letter-spacing: inherit;
4738
- font-weight: inherit;
4739
- font-size: inherit;
4740
- text-align: inherit;
4741
- font-family: inherit;
4742
- }
4743
- `;
4744
- var getDefaultStyles = (isNested) => {
4745
- return !isNested ? DEFAULT_STYLES : "";
4746
- };
4747
-
4748
- // src/components/content/components/styles.tsx
4978
+ import { createSignal as createSignal15 } from "solid-js";
4749
4979
  function ContentStyles(props) {
4750
- const [injectedStyles, setInjectedStyles] = createSignal13(
4980
+ const [injectedStyles, setInjectedStyles] = createSignal15(
4751
4981
  `
4752
4982
  ${getCss({
4753
4983
  cssCode: props.cssCode,
@@ -4804,7 +5034,7 @@ var getContentInitialValue = ({
4804
5034
 
4805
5035
  // src/components/content/content.tsx
4806
5036
  function ContentComponent(props) {
4807
- const [scriptStr, setScriptStr] = createSignal14(
5037
+ const [scriptStr, setScriptStr] = createSignal16(
4808
5038
  getUpdateVariantVisibilityScript({
4809
5039
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
4810
5040
  variationId: props.content?.testVariationId,
@@ -4812,7 +5042,7 @@ function ContentComponent(props) {
4812
5042
  contentId: props.content?.id
4813
5043
  })
4814
5044
  );
4815
- const [registeredComponents, setRegisteredComponents] = createSignal14(
5045
+ const [registeredComponents, setRegisteredComponents] = createSignal16(
4816
5046
  [
4817
5047
  ...getDefaultRegisteredComponents(),
4818
5048
  ...props.customComponents || []
@@ -4827,7 +5057,7 @@ function ContentComponent(props) {
4827
5057
  {}
4828
5058
  )
4829
5059
  );
4830
- const [builderContextSignal, setBuilderContextSignal] = createSignal14({
5060
+ const [builderContextSignal, setBuilderContextSignal] = createSignal16({
4831
5061
  content: getContentInitialValue({
4832
5062
  content: props.content,
4833
5063
  data: props.data
@@ -4885,16 +5115,16 @@ function ContentComponent(props) {
4885
5115
  setBuilderContextSignal
4886
5116
  }}
4887
5117
  >
4888
- <Show11 when={props.isSsrAbTest}><Inlined_script_default
5118
+ <Show12 when={props.isSsrAbTest}><Inlined_script_default
4889
5119
  id="builderio-variant-visibility"
4890
5120
  scriptStr={scriptStr()}
4891
- /></Show11>
4892
- <Show11 when={TARGET !== "reactNative"}><Styles_default
5121
+ /></Show12>
5122
+ <Show12 when={TARGET !== "reactNative"}><Styles_default
4893
5123
  isNestedRender={props.isNestedRender}
4894
5124
  contentId={builderContextSignal().content?.id}
4895
5125
  cssCode={builderContextSignal().content?.data?.cssCode}
4896
5126
  customFonts={builderContextSignal().content?.data?.customFonts}
4897
- /></Show11>
5127
+ /></Show12>
4898
5128
  <Blocks_default
4899
5129
  blocks={builderContextSignal().content?.data?.blocks}
4900
5130
  context={builderContextSignal()}
@@ -4907,13 +5137,13 @@ var Content_default = ContentComponent;
4907
5137
 
4908
5138
  // src/components/content-variants/content-variants.tsx
4909
5139
  function ContentVariants(props) {
4910
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal15(
5140
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
4911
5141
  checkShouldRenderVariants({
4912
5142
  canTrack: getDefaultCanTrack(props.canTrack),
4913
5143
  content: props.content
4914
5144
  })
4915
5145
  );
4916
- const updateCookieAndStylesScriptStr = createMemo15(() => {
5146
+ const updateCookieAndStylesScriptStr = createMemo17(() => {
4917
5147
  return getUpdateCookieAndStylesScript(
4918
5148
  getVariants(props.content).map((value) => ({
4919
5149
  id: value.testVariationId,
@@ -4922,10 +5152,10 @@ function ContentVariants(props) {
4922
5152
  props.content?.id || ""
4923
5153
  );
4924
5154
  });
4925
- const hideVariantsStyleString = createMemo15(() => {
5155
+ const hideVariantsStyleString = createMemo17(() => {
4926
5156
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
4927
5157
  });
4928
- const defaultContent = createMemo15(() => {
5158
+ const defaultContent = createMemo17(() => {
4929
5159
  return shouldRenderVariants() ? {
4930
5160
  ...props.content,
4931
5161
  testVariationId: props.content?.id
@@ -4938,11 +5168,11 @@ function ContentVariants(props) {
4938
5168
  setShouldRenderVariants(false);
4939
5169
  });
4940
5170
  return <>
4941
- <Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5171
+ <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
4942
5172
  id="builderio-init-variants-fns"
4943
5173
  scriptStr={getInitVariantsFnsScriptString()}
4944
- /></Show12>
4945
- <Show12 when={shouldRenderVariants()}>
5174
+ /></Show13>
5175
+ <Show13 when={shouldRenderVariants()}>
4946
5176
  <Inlined_styles_default
4947
5177
  id="builderio-variants"
4948
5178
  styles={hideVariantsStyleString()}
@@ -4951,7 +5181,7 @@ function ContentVariants(props) {
4951
5181
  id="builderio-variants-visibility"
4952
5182
  scriptStr={updateCookieAndStylesScriptStr()}
4953
5183
  />
4954
- <For7 each={getVariants(props.content)}>{(variant, _index) => {
5184
+ <For8 each={getVariants(props.content)}>{(variant, _index) => {
4955
5185
  const index = _index();
4956
5186
  return <Content_default
4957
5187
  isNestedRender={props.isNestedRender}
@@ -4975,8 +5205,8 @@ function ContentVariants(props) {
4975
5205
  contentWrapperProps={props.contentWrapperProps}
4976
5206
  trustedHosts={props.trustedHosts}
4977
5207
  />;
4978
- }}</For7>
4979
- </Show12>
5208
+ }}</For8>
5209
+ </Show13>
4980
5210
  <Content_default
4981
5211
  isNestedRender={props.isNestedRender}
4982
5212
  {...{}}
@@ -5029,8 +5259,14 @@ var fetchSymbolContent = async ({
5029
5259
 
5030
5260
  // src/blocks/symbol/symbol.tsx
5031
5261
  function Symbol(props) {
5032
- const [contentToUse, setContentToUse] = createSignal16(props.symbol?.content);
5033
- const className = createMemo16(() => {
5262
+ const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
5263
+ const blocksWrapper = createMemo18(() => {
5264
+ return "div";
5265
+ });
5266
+ const contentWrapper = createMemo18(() => {
5267
+ return "div";
5268
+ });
5269
+ const className = createMemo18(() => {
5034
5270
  return [
5035
5271
  ...[props.attributes[getClassPropName()]],
5036
5272
  "builder-symbol",
@@ -5052,7 +5288,7 @@ function Symbol(props) {
5052
5288
  }
5053
5289
  onMount5(() => {
5054
5290
  });
5055
- const onUpdateFn_0_props_symbol = createMemo16(() => props.symbol);
5291
+ const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
5056
5292
  function onUpdateFn_0() {
5057
5293
  setContent();
5058
5294
  }
@@ -5074,8 +5310,8 @@ function Symbol(props) {
5074
5310
  model={props.symbol?.model}
5075
5311
  content={contentToUse()}
5076
5312
  linkComponent={props.builderLinkComponent}
5077
- blocksWrapper="div"
5078
- contentWrapper="div"
5313
+ blocksWrapper={blocksWrapper()}
5314
+ contentWrapper={contentWrapper()}
5079
5315
  /></div>;
5080
5316
  }
5081
5317
  var symbol_default = Symbol;