@builder.io/sdk-solid 1.0.23 → 1.0.25

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) {
@@ -697,6 +701,7 @@ function mapStyleObjToStrIfNeeded(style) {
697
701
  case "svelte":
698
702
  case "vue":
699
703
  case "solid":
704
+ case "angular":
700
705
  return convertStyleMapToCSSArray(style).join(" ");
701
706
  case "qwik":
702
707
  case "reactNative":
@@ -772,6 +777,12 @@ var getRepeatItemData = ({
772
777
  }));
773
778
  return repeatArray;
774
779
  };
780
+ var shouldPassLinkComponent = (block) => {
781
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
782
+ };
783
+ var shouldPassRegisteredComponents = (block) => {
784
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
785
+ };
775
786
 
776
787
  // src/components/block/components/block-styles.tsx
777
788
  import { Show as Show2, createMemo } from "solid-js";
@@ -1015,15 +1026,15 @@ function BlockWrapper(props) {
1015
1026
  var Block_wrapper_default = BlockWrapper;
1016
1027
 
1017
1028
  // src/components/block/components/component-ref/component-ref.tsx
1018
- import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
1029
+ import { Show as Show3, For, createSignal as createSignal3 } from "solid-js";
1019
1030
  import { Dynamic as Dynamic3 } from "solid-js/web";
1020
1031
 
1021
1032
  // src/components/block/components/interactive-element.tsx
1033
+ import { createMemo as createMemo2 } from "solid-js";
1022
1034
  import { Dynamic as Dynamic2 } from "solid-js/web";
1023
1035
  function InteractiveElement(props) {
1024
- return <Dynamic2
1025
- {...props.wrapperProps}
1026
- attributes={props.includeBlockProps ? {
1036
+ const attributes = createMemo2(() => {
1037
+ return props.includeBlockProps ? {
1027
1038
  ...getBlockProperties({
1028
1039
  block: props.block,
1029
1040
  context: props.context
@@ -1035,7 +1046,11 @@ function InteractiveElement(props) {
1035
1046
  localState: props.context.localState,
1036
1047
  context: props.context.context
1037
1048
  })
1038
- } : {}}
1049
+ } : {};
1050
+ });
1051
+ return <Dynamic2
1052
+ {...props.wrapperProps}
1053
+ attributes={attributes()}
1039
1054
  component={props.Wrapper}
1040
1055
  >{props.children}</Dynamic2>;
1041
1056
  }
@@ -1076,7 +1091,7 @@ var getWrapperProps = ({
1076
1091
 
1077
1092
  // src/components/block/components/component-ref/component-ref.tsx
1078
1093
  function ComponentRef(props) {
1079
- const [Wrapper, setWrapper] = createSignal2(
1094
+ const [Wrapper, setWrapper] = createSignal3(
1080
1095
  props.isInteractive ? interactive_element_default : props.componentRef
1081
1096
  );
1082
1097
  return <Show3 when={props.componentRef}><Dynamic3
@@ -1105,9 +1120,9 @@ function ComponentRef(props) {
1105
1120
  var Component_ref_default = ComponentRef;
1106
1121
 
1107
1122
  // src/components/block/components/repeated-block.tsx
1108
- import { createSignal as createSignal3 } from "solid-js";
1123
+ import { createSignal as createSignal4 } from "solid-js";
1109
1124
  function RepeatedBlock(props) {
1110
- const [store, setStore] = createSignal3(props.repeatContext);
1125
+ const [store, setStore] = createSignal4(props.repeatContext);
1111
1126
  return <builder_context_default.Provider value={store()}><Block_default
1112
1127
  block={props.block}
1113
1128
  context={store()}
@@ -1119,20 +1134,20 @@ var Repeated_block_default = RepeatedBlock;
1119
1134
 
1120
1135
  // src/components/block/block.tsx
1121
1136
  function Block(props) {
1122
- const blockComponent = createMemo4(() => {
1137
+ const blockComponent = createMemo5(() => {
1123
1138
  return getComponent({
1124
1139
  block: props.block,
1125
1140
  context: props.context,
1126
1141
  registeredComponents: props.registeredComponents
1127
1142
  });
1128
1143
  });
1129
- const repeatItem = createMemo4(() => {
1144
+ const repeatItem = createMemo5(() => {
1130
1145
  return getRepeatItemData({
1131
1146
  block: props.block,
1132
1147
  context: props.context
1133
1148
  });
1134
1149
  });
1135
- const processedBlock = createMemo4(() => {
1150
+ const processedBlock = createMemo5(() => {
1136
1151
  return props.block.repeat?.collection ? props.block : getProcessedBlock({
1137
1152
  block: props.block,
1138
1153
  localState: props.context.localState,
@@ -1142,14 +1157,14 @@ function Block(props) {
1142
1157
  shouldEvaluateBindings: true
1143
1158
  });
1144
1159
  });
1145
- const Tag = createMemo4(() => {
1160
+ const Tag = createMemo5(() => {
1146
1161
  const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
1147
1162
  if (shouldUseLink) {
1148
1163
  return props.linkComponent || "a";
1149
1164
  }
1150
1165
  return props.block.tagName || "div";
1151
1166
  });
1152
- const canShowBlock = createMemo4(() => {
1167
+ const canShowBlock = createMemo5(() => {
1153
1168
  if (props.block.repeat?.collection) {
1154
1169
  if (repeatItem()?.length)
1155
1170
  return true;
@@ -1159,21 +1174,21 @@ function Block(props) {
1159
1174
  const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
1160
1175
  return shouldShow && !shouldHide;
1161
1176
  });
1162
- const childrenWithoutParentComponent = createMemo4(() => {
1177
+ const childrenWithoutParentComponent = createMemo5(() => {
1163
1178
  const shouldRenderChildrenOutsideRef = !blockComponent()?.component && !repeatItem();
1164
1179
  return shouldRenderChildrenOutsideRef ? processedBlock().children ?? [] : [];
1165
1180
  });
1166
- const componentRefProps = createMemo4(() => {
1181
+ const componentRefProps = createMemo5(() => {
1167
1182
  return {
1168
1183
  blockChildren: processedBlock().children ?? [],
1169
1184
  componentRef: blockComponent()?.component,
1170
1185
  componentOptions: {
1171
1186
  ...getBlockComponentOptions(processedBlock()),
1172
1187
  builderContext: props.context,
1173
- ...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1188
+ ...shouldPassLinkComponent(blockComponent()) ? {
1174
1189
  builderLinkComponent: props.linkComponent
1175
1190
  } : {},
1176
- ...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1191
+ ...shouldPassRegisteredComponents(blockComponent()) ? {
1177
1192
  builderComponents: props.registeredComponents
1178
1193
  } : {}
1179
1194
  },
@@ -1257,11 +1272,11 @@ function Block(props) {
1257
1272
  var Block_default = Block;
1258
1273
 
1259
1274
  // src/components/blocks/blocks-wrapper.tsx
1260
- import { createMemo as createMemo5 } from "solid-js";
1275
+ import { createMemo as createMemo6 } from "solid-js";
1261
1276
  import { Dynamic as Dynamic4 } from "solid-js/web";
1262
1277
  import { css } from "solid-styled-components";
1263
1278
  function BlocksWrapper(props) {
1264
- const className = createMemo5(() => {
1279
+ const className = createMemo6(() => {
1265
1280
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
1266
1281
  });
1267
1282
  function onClick() {
@@ -1335,16 +1350,24 @@ function Blocks(props) {
1335
1350
  }
1336
1351
  var Blocks_default = Blocks;
1337
1352
 
1353
+ // src/blocks/columns/helpers.ts
1354
+ var getColumnsClass = (id) => {
1355
+ return `builder-columns ${id}-breakpoints`;
1356
+ };
1357
+
1338
1358
  // src/blocks/columns/columns.tsx
1339
1359
  function Columns(props) {
1340
- const [gutterSize, setGutterSize] = createSignal6(
1360
+ const [gutterSize, setGutterSize] = createSignal7(
1341
1361
  typeof props.space === "number" ? props.space || 0 : 20
1342
1362
  );
1343
- const [cols, setCols] = createSignal6(props.columns || []);
1344
- const [stackAt, setStackAt] = createSignal6(props.stackColumnsAt || "tablet");
1345
- const [flexDir, setFlexDir] = createSignal6(
1363
+ const [cols, setCols] = createSignal7(props.columns || []);
1364
+ const [stackAt, setStackAt] = createSignal7(props.stackColumnsAt || "tablet");
1365
+ const [flexDir, setFlexDir] = createSignal7(
1346
1366
  props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column"
1347
1367
  );
1368
+ function getTagName(column) {
1369
+ return column.link ? props.builderLinkComponent || "a" : "div";
1370
+ }
1348
1371
  function getWidth(index) {
1349
1372
  return cols()[index]?.width || 100 / cols().length;
1350
1373
  }
@@ -1364,7 +1387,7 @@ function Columns(props) {
1364
1387
  }) {
1365
1388
  return stackAt() === "never" ? desktopStyle : stackedStyle;
1366
1389
  }
1367
- const columnsCssVars = createMemo6(() => {
1390
+ function columnsCssVars() {
1368
1391
  return {
1369
1392
  "--flex-dir": flexDir(),
1370
1393
  "--flex-dir-tablet": getTabletStyle({
@@ -1372,7 +1395,7 @@ function Columns(props) {
1372
1395
  desktopStyle: "row"
1373
1396
  })
1374
1397
  };
1375
- });
1398
+ }
1376
1399
  function columnCssVars(index) {
1377
1400
  const gutter = index === 0 ? 0 : gutterSize();
1378
1401
  const width = getColumnCssWidth(index);
@@ -1413,7 +1436,7 @@ function Columns(props) {
1413
1436
  );
1414
1437
  return breakpointSizes[size].max;
1415
1438
  }
1416
- const columnsStyles = createMemo6(() => {
1439
+ function columnsStyles() {
1417
1440
  return `
1418
1441
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
1419
1442
  .${props.builderBlock.id}-breakpoints {
@@ -1439,9 +1462,19 @@ function Columns(props) {
1439
1462
  }
1440
1463
  },
1441
1464
  `;
1442
- });
1465
+ }
1466
+ function getAttributes(column, index) {
1467
+ return {
1468
+ ...{},
1469
+ ...column.link ? {
1470
+ href: column.link
1471
+ } : {},
1472
+ [getClassPropName()]: "builder-column",
1473
+ style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1474
+ };
1475
+ }
1443
1476
  return <div
1444
- class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
1477
+ class={getColumnsClass(props.builderBlock?.id) + " " + css2({
1445
1478
  display: "flex",
1446
1479
  lineHeight: "normal"
1447
1480
  })}
@@ -1456,16 +1489,9 @@ function Columns(props) {
1456
1489
  const index = _index();
1457
1490
  return <Dynamic_renderer_default
1458
1491
  key={index}
1459
- TagName={column.link ? props.builderLinkComponent || "a" : "div"}
1492
+ TagName={getTagName(column)}
1460
1493
  actionAttributes={{}}
1461
- attributes={{
1462
- ...{},
1463
- ...column.link ? {
1464
- href: column.link
1465
- } : {},
1466
- [getClassPropName()]: "builder-column",
1467
- style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1468
- }}
1494
+ attributes={getAttributes(column, index)}
1469
1495
  ><Blocks_default
1470
1496
  path={`component.options.columns.${index}.blocks`}
1471
1497
  parent={props.builderBlock.id}
@@ -1489,7 +1515,7 @@ function FragmentComponent(props) {
1489
1515
  var fragment_default = FragmentComponent;
1490
1516
 
1491
1517
  // src/blocks/image/image.tsx
1492
- import { Show as Show7, createMemo as createMemo7 } from "solid-js";
1518
+ import { Show as Show7, createMemo as createMemo8 } from "solid-js";
1493
1519
  import { css as css3 } from "solid-styled-components";
1494
1520
 
1495
1521
  // src/blocks/image/image.helpers.ts
@@ -1541,7 +1567,7 @@ function getSrcSet(url) {
1541
1567
 
1542
1568
  // src/blocks/image/image.tsx
1543
1569
  function Image(props) {
1544
- const srcSetToUse = createMemo7(() => {
1570
+ const srcSetToUse = createMemo8(() => {
1545
1571
  const imageToUse = props.image || props.src;
1546
1572
  const url = imageToUse;
1547
1573
  if (!url || // We can auto add srcset for cdn.builder.io and shopify
@@ -1559,14 +1585,14 @@ function Image(props) {
1559
1585
  }
1560
1586
  return getSrcSet(url);
1561
1587
  });
1562
- const webpSrcSet = createMemo7(() => {
1588
+ const webpSrcSet = createMemo8(() => {
1563
1589
  if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
1564
1590
  return srcSetToUse().replace(/\?/g, "?format=webp&");
1565
1591
  } else {
1566
1592
  return "";
1567
1593
  }
1568
1594
  });
1569
- const aspectRatioCss = createMemo7(() => {
1595
+ const aspectRatioCss = createMemo8(() => {
1570
1596
  const aspectRatioStyles = {
1571
1597
  position: "absolute",
1572
1598
  height: "100%",
@@ -1611,7 +1637,7 @@ function Image(props) {
1611
1637
  }}
1612
1638
  /></Show7>
1613
1639
  <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
1614
- <Show7 when={!props.fitContent && props.children}><div
1640
+ <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div
1615
1641
  class={css3({
1616
1642
  display: "flex",
1617
1643
  flexDirection: "column",
@@ -1649,10 +1675,10 @@ function SectionComponent(props) {
1649
1675
  var section_default = SectionComponent;
1650
1676
 
1651
1677
  // src/blocks/symbol/symbol.tsx
1652
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo16, createSignal as createSignal16 } from "solid-js";
1678
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
1653
1679
 
1654
1680
  // src/components/content-variants/content-variants.tsx
1655
- import { Show as Show12, For as For7, onMount as onMount4, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
1681
+ import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
1656
1682
 
1657
1683
  // src/helpers/url.ts
1658
1684
  var getTopLevelDomain = (host) => {
@@ -1846,7 +1872,7 @@ var handleABTesting = async ({
1846
1872
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1847
1873
 
1848
1874
  // src/components/content/content.tsx
1849
- import { Show as Show11, createSignal as createSignal14 } from "solid-js";
1875
+ import { Show as Show12, createSignal as createSignal16 } from "solid-js";
1850
1876
 
1851
1877
  // src/blocks/button/component-info.ts
1852
1878
  var componentInfo = {
@@ -2348,8 +2374,203 @@ var componentInfo7 = {
2348
2374
  }]
2349
2375
  };
2350
2376
 
2351
- // src/blocks/text/component-info.ts
2377
+ // src/blocks/tabs/component-info.ts
2378
+ var defaultTab = {
2379
+ "@type": "@builder.io/sdk:Element",
2380
+ responsiveStyles: {
2381
+ large: {
2382
+ paddingLeft: "20px",
2383
+ paddingRight: "20px",
2384
+ paddingTop: "10px",
2385
+ paddingBottom: "10px",
2386
+ minWidth: "100px",
2387
+ textAlign: "center",
2388
+ display: "flex",
2389
+ flexDirection: "column",
2390
+ cursor: "pointer",
2391
+ userSelect: "none"
2392
+ }
2393
+ },
2394
+ component: {
2395
+ name: "Text",
2396
+ options: {
2397
+ text: "New tab"
2398
+ }
2399
+ }
2400
+ };
2401
+ var defaultElement = {
2402
+ "@type": "@builder.io/sdk:Element",
2403
+ responsiveStyles: {
2404
+ large: {
2405
+ height: "200px",
2406
+ display: "flex",
2407
+ marginTop: "20px",
2408
+ flexDirection: "column"
2409
+ }
2410
+ },
2411
+ component: {
2412
+ name: "Text",
2413
+ options: {
2414
+ text: "New tab content "
2415
+ }
2416
+ }
2417
+ };
2352
2418
  var componentInfo8 = {
2419
+ name: "Builder: Tabs",
2420
+ inputs: [{
2421
+ name: "tabs",
2422
+ type: "list",
2423
+ broadcast: true,
2424
+ subFields: [{
2425
+ name: "label",
2426
+ type: "uiBlocks",
2427
+ hideFromUI: true,
2428
+ defaultValue: [defaultTab]
2429
+ }, {
2430
+ name: "content",
2431
+ type: "uiBlocks",
2432
+ hideFromUI: true,
2433
+ defaultValue: [defaultElement]
2434
+ }],
2435
+ defaultValue: [{
2436
+ label: [{
2437
+ ...defaultTab,
2438
+ component: {
2439
+ name: "Text",
2440
+ options: {
2441
+ text: "Tab 1"
2442
+ }
2443
+ }
2444
+ }],
2445
+ content: [{
2446
+ ...defaultElement,
2447
+ component: {
2448
+ name: "Text",
2449
+ options: {
2450
+ text: "Tab 1 content"
2451
+ }
2452
+ }
2453
+ }]
2454
+ }, {
2455
+ label: [{
2456
+ ...defaultTab,
2457
+ component: {
2458
+ name: "Text",
2459
+ options: {
2460
+ text: "Tab 2"
2461
+ }
2462
+ }
2463
+ }],
2464
+ content: [{
2465
+ ...defaultElement,
2466
+ component: {
2467
+ name: "Text",
2468
+ options: {
2469
+ text: "Tab 2 content"
2470
+ }
2471
+ }
2472
+ }]
2473
+ }]
2474
+ }, {
2475
+ name: "activeTabStyle",
2476
+ type: "uiStyle",
2477
+ helperText: "CSS styles for the active tab",
2478
+ defaultValue: {
2479
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
2480
+ }
2481
+ }, {
2482
+ name: "defaultActiveTab",
2483
+ type: "number",
2484
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
2485
+ defaultValue: 1,
2486
+ advanced: true
2487
+ }, {
2488
+ name: "collapsible",
2489
+ type: "boolean",
2490
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
2491
+ defaultValue: false,
2492
+ advanced: true
2493
+ }, {
2494
+ name: "tabHeaderLayout",
2495
+ type: "enum",
2496
+ helperText: "Change the layout of the tab headers (uses justify-content)",
2497
+ defaultValue: "flex-start",
2498
+ enum: [{
2499
+ label: "Center",
2500
+ value: "center"
2501
+ }, {
2502
+ label: "Space between",
2503
+ value: "space-between"
2504
+ }, {
2505
+ label: "Space around",
2506
+ value: "space-around"
2507
+ }, {
2508
+ label: "Left",
2509
+ value: "flex-start"
2510
+ }, {
2511
+ label: "Right",
2512
+ value: "flex-end"
2513
+ }]
2514
+ }]
2515
+ };
2516
+
2517
+ // src/blocks/tabs/tabs.tsx
2518
+ import { Show as Show8, For as For5, createSignal as createSignal9 } from "solid-js";
2519
+ function Tabs(props) {
2520
+ const [activeTab, setActiveTab] = createSignal9(
2521
+ props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
2522
+ );
2523
+ function activeTabContent(active) {
2524
+ return props.tabs && props.tabs[active].content;
2525
+ }
2526
+ function getActiveTabStyle(index) {
2527
+ return activeTab() === index ? props.activeTabStyle : {};
2528
+ }
2529
+ return <div>
2530
+ <div
2531
+ class="builder-tabs-wrap"
2532
+ style={{
2533
+ display: "flex",
2534
+ "flex-direction": "row",
2535
+ "justify-content": props.tabHeaderLayout || "flex-start",
2536
+ overflow: "auto"
2537
+ }}
2538
+ ><For5 each={props.tabs}>{(tab, _index) => {
2539
+ const index = _index();
2540
+ return <span
2541
+ class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2542
+ key={index}
2543
+ style={getActiveTabStyle(index)}
2544
+ onClick={(event) => {
2545
+ if (index === activeTab() && props.collapsible) {
2546
+ setActiveTab(-1);
2547
+ } else {
2548
+ setActiveTab(index);
2549
+ }
2550
+ }}
2551
+ ><Blocks_default
2552
+ parent={props.builderBlock.id}
2553
+ path={`component.options.tabs.${index}.label`}
2554
+ blocks={tab.label}
2555
+ context={props.builderContext}
2556
+ registeredComponents={props.builderComponents}
2557
+ linkComponent={props.builderLinkComponent}
2558
+ /></span>;
2559
+ }}</For5></div>
2560
+ <Show8 when={activeTabContent(activeTab())}><div><Blocks_default
2561
+ parent={props.builderBlock.id}
2562
+ path={`component.options.tabs.${activeTab()}.content`}
2563
+ blocks={activeTabContent(activeTab())}
2564
+ context={props.builderContext}
2565
+ registeredComponents={props.builderComponents}
2566
+ linkComponent={props.builderLinkComponent}
2567
+ /></div></Show8>
2568
+ </div>;
2569
+ }
2570
+ var tabs_default = Tabs;
2571
+
2572
+ // src/blocks/text/component-info.ts
2573
+ var componentInfo9 = {
2353
2574
  name: "Text",
2354
2575
  static: true,
2355
2576
  isRSC: true,
@@ -2382,7 +2603,7 @@ function Text(props) {
2382
2603
  var text_default = Text;
2383
2604
 
2384
2605
  // src/blocks/custom-code/component-info.ts
2385
- var componentInfo9 = {
2606
+ var componentInfo10 = {
2386
2607
  name: "Custom Code",
2387
2608
  static: true,
2388
2609
  requiredPermissions: ["editCode"],
@@ -2407,10 +2628,10 @@ var componentInfo9 = {
2407
2628
  };
2408
2629
 
2409
2630
  // src/blocks/custom-code/custom-code.tsx
2410
- import { onMount as onMount2, createSignal as createSignal8 } from "solid-js";
2631
+ import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
2411
2632
  function CustomCode(props) {
2412
- const [scriptsInserted, setScriptsInserted] = createSignal8([]);
2413
- const [scriptsRun, setScriptsRun] = createSignal8([]);
2633
+ const [scriptsInserted, setScriptsInserted] = createSignal10([]);
2634
+ const [scriptsRun, setScriptsRun] = createSignal10([]);
2414
2635
  let elementRef;
2415
2636
  onMount2(() => {
2416
2637
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -2454,7 +2675,7 @@ function CustomCode(props) {
2454
2675
  var custom_code_default = CustomCode;
2455
2676
 
2456
2677
  // src/blocks/embed/component-info.ts
2457
- var componentInfo10 = {
2678
+ var componentInfo11 = {
2458
2679
  name: "Embed",
2459
2680
  static: true,
2460
2681
  inputs: [{
@@ -2492,7 +2713,7 @@ var componentInfo10 = {
2492
2713
  };
2493
2714
 
2494
2715
  // src/blocks/embed/embed.tsx
2495
- import { on, createEffect, createMemo as createMemo9, createSignal as createSignal9 } from "solid-js";
2716
+ import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
2496
2717
 
2497
2718
  // src/blocks/embed/helpers.ts
2498
2719
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -2500,9 +2721,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2500
2721
 
2501
2722
  // src/blocks/embed/embed.tsx
2502
2723
  function Embed(props) {
2503
- const [scriptsInserted, setScriptsInserted] = createSignal9([]);
2504
- const [scriptsRun, setScriptsRun] = createSignal9([]);
2505
- const [ranInitFn, setRanInitFn] = createSignal9(false);
2724
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2725
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
2726
+ const [ranInitFn, setRanInitFn] = createSignal11(false);
2506
2727
  function findAndRunScripts() {
2507
2728
  if (!elem || !elem.getElementsByTagName)
2508
2729
  return;
@@ -2526,8 +2747,8 @@ function Embed(props) {
2526
2747
  }
2527
2748
  }
2528
2749
  let elem;
2529
- const onUpdateFn_0_elem = createMemo9(() => elem);
2530
- const onUpdateFn_0_ranInitFn__ = createMemo9(() => ranInitFn());
2750
+ const onUpdateFn_0_elem = createMemo11(() => elem);
2751
+ const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
2531
2752
  function onUpdateFn_0() {
2532
2753
  if (elem && !ranInitFn()) {
2533
2754
  setRanInitFn(true);
@@ -2542,7 +2763,7 @@ function Embed(props) {
2542
2763
  var embed_default = Embed;
2543
2764
 
2544
2765
  // src/blocks/form/form/component-info.ts
2545
- var componentInfo11 = {
2766
+ var componentInfo12 = {
2546
2767
  name: "Form:Form",
2547
2768
  // editableTags: ['builder-form-error']
2548
2769
  defaults: {
@@ -2776,7 +2997,7 @@ var componentInfo11 = {
2776
2997
  };
2777
2998
 
2778
2999
  // src/blocks/form/form/form.tsx
2779
- import { Show as Show8, For as For5, createSignal as createSignal10 } from "solid-js";
3000
+ import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
2780
3001
  import { css as css4 } from "solid-styled-components";
2781
3002
 
2782
3003
  // src/functions/get-env.ts
@@ -2794,9 +3015,9 @@ var get = (obj, path, defaultValue) => {
2794
3015
 
2795
3016
  // src/blocks/form/form/form.tsx
2796
3017
  function FormComponent(props) {
2797
- const [formState, setFormState] = createSignal10("unsubmitted");
2798
- const [responseData, setResponseData] = createSignal10(null);
2799
- const [formErrorMessage, setFormErrorMessage] = createSignal10("");
3018
+ const [formState, setFormState] = createSignal12("unsubmitted");
3019
+ const [responseData, setResponseData] = createSignal12(null);
3020
+ const [formErrorMessage, setFormErrorMessage] = createSignal12("");
2800
3021
  function mergeNewRootState(newData) {
2801
3022
  const combinedState = {
2802
3023
  ...props.builderContext.rootState,
@@ -2992,7 +3213,7 @@ function FormComponent(props) {
2992
3213
  {...{}}
2993
3214
  {...props.attributes}
2994
3215
  >
2995
- <Show8 when={props.builderBlock && props.builderBlock.children}><For5 each={props.builderBlock?.children}>{(block, _index) => {
3216
+ <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
2996
3217
  const idx = _index();
2997
3218
  return <Block_default
2998
3219
  key={`form-block-${idx}`}
@@ -3001,35 +3222,35 @@ function FormComponent(props) {
3001
3222
  registeredComponents={props.builderComponents}
3002
3223
  linkComponent={props.builderLinkComponent}
3003
3224
  />;
3004
- }}</For5></Show8>
3005
- <Show8 when={submissionState() === "error"}><Blocks_default
3225
+ }}</For6></Show9>
3226
+ <Show9 when={submissionState() === "error"}><Blocks_default
3006
3227
  path="errorMessage"
3007
3228
  blocks={props.errorMessage}
3008
3229
  context={props.builderContext}
3009
- /></Show8>
3010
- <Show8 when={submissionState() === "sending"}><Blocks_default
3230
+ /></Show9>
3231
+ <Show9 when={submissionState() === "sending"}><Blocks_default
3011
3232
  path="sendingMessage"
3012
3233
  blocks={props.sendingMessage}
3013
3234
  context={props.builderContext}
3014
- /></Show8>
3015
- <Show8 when={submissionState() === "error" && responseData()}><pre
3235
+ /></Show9>
3236
+ <Show9 when={submissionState() === "error" && responseData()}><pre
3016
3237
  class={"builder-form-error-text " + css4({
3017
3238
  padding: "10px",
3018
3239
  color: "red",
3019
3240
  textAlign: "center"
3020
3241
  })}
3021
- >{JSON.stringify(responseData(), null, 2)}</pre></Show8>
3022
- <Show8 when={submissionState() === "success"}><Blocks_default
3242
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
3243
+ <Show9 when={submissionState() === "success"}><Blocks_default
3023
3244
  path="successMessage"
3024
3245
  blocks={props.successMessage}
3025
3246
  context={props.builderContext}
3026
- /></Show8>
3247
+ /></Show9>
3027
3248
  </form>;
3028
3249
  }
3029
3250
  var form_default = FormComponent;
3030
3251
 
3031
3252
  // src/blocks/form/input/component-info.ts
3032
- var componentInfo12 = {
3253
+ var componentInfo13 = {
3033
3254
  name: "Form:Input",
3034
3255
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3035
3256
  inputs: [
@@ -3099,7 +3320,7 @@ function FormInputComponent(props) {
3099
3320
  var input_default = FormInputComponent;
3100
3321
 
3101
3322
  // src/blocks/form/select/component-info.ts
3102
- var componentInfo13 = {
3323
+ var componentInfo14 = {
3103
3324
  name: "Form:Select",
3104
3325
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3105
3326
  defaultStyles: {
@@ -3144,7 +3365,7 @@ var componentInfo13 = {
3144
3365
  };
3145
3366
 
3146
3367
  // src/blocks/form/select/select.tsx
3147
- import { For as For6 } from "solid-js";
3368
+ import { For as For7 } from "solid-js";
3148
3369
  function SelectComponent(props) {
3149
3370
  return <select
3150
3371
  {...{}}
@@ -3153,15 +3374,15 @@ function SelectComponent(props) {
3153
3374
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
3154
3375
  defaultValue={props.defaultValue}
3155
3376
  name={props.name}
3156
- ><For6 each={props.options}>{(option, _index) => {
3377
+ ><For7 each={props.options}>{(option, _index) => {
3157
3378
  const index = _index();
3158
3379
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
3159
- }}</For6></select>;
3380
+ }}</For7></select>;
3160
3381
  }
3161
3382
  var select_default = SelectComponent;
3162
3383
 
3163
3384
  // src/blocks/form/submit-button/component-info.ts
3164
- var componentInfo14 = {
3385
+ var componentInfo15 = {
3165
3386
  name: "Form:SubmitButton",
3166
3387
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3167
3388
  defaultStyles: {
@@ -3195,7 +3416,7 @@ function SubmitButton(props) {
3195
3416
  var submit_button_default = SubmitButton;
3196
3417
 
3197
3418
  // src/blocks/img/component-info.ts
3198
- var componentInfo15 = {
3419
+ var componentInfo16 = {
3199
3420
  // friendlyName?
3200
3421
  name: "Raw:Img",
3201
3422
  hideFromInsertMenu: true,
@@ -3228,7 +3449,7 @@ function ImgComponent(props) {
3228
3449
  var img_default = ImgComponent;
3229
3450
 
3230
3451
  // src/blocks/video/component-info.ts
3231
- var componentInfo16 = {
3452
+ var componentInfo17 = {
3232
3453
  name: "Video",
3233
3454
  canHaveChildren: true,
3234
3455
  defaultStyles: {
@@ -3312,9 +3533,9 @@ var componentInfo16 = {
3312
3533
  };
3313
3534
 
3314
3535
  // src/blocks/video/video.tsx
3315
- import { Show as Show9, createMemo as createMemo11 } from "solid-js";
3536
+ import { Show as Show10, createMemo as createMemo13 } from "solid-js";
3316
3537
  function Video(props) {
3317
- const videoProps = createMemo11(() => {
3538
+ const videoProps = createMemo13(() => {
3318
3539
  return {
3319
3540
  ...props.autoPlay === true ? {
3320
3541
  autoPlay: true
@@ -3333,7 +3554,7 @@ function Video(props) {
3333
3554
  } : {}
3334
3555
  };
3335
3556
  });
3336
- const spreadProps = createMemo11(() => {
3557
+ const spreadProps = createMemo13(() => {
3337
3558
  return {
3338
3559
  ...videoProps()
3339
3560
  };
@@ -3363,8 +3584,8 @@ function Video(props) {
3363
3584
  }}
3364
3585
  src={props.video || "no-src"}
3365
3586
  poster={props.posterImage}
3366
- ><Show9 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show9></video>
3367
- <Show9
3587
+ ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
3588
+ <Show10
3368
3589
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
3369
3590
  ><div
3370
3591
  style={{
@@ -3373,15 +3594,15 @@ function Video(props) {
3373
3594
  "pointer-events": "none",
3374
3595
  "font-size": "0px"
3375
3596
  }}
3376
- /></Show9>
3377
- <Show9 when={props.builderBlock?.children?.length && props.fitContent}><div
3597
+ /></Show10>
3598
+ <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
3378
3599
  style={{
3379
3600
  display: "flex",
3380
3601
  "flex-direction": "column",
3381
3602
  "align-items": "stretch"
3382
3603
  }}
3383
- >{props.children}</div></Show9>
3384
- <Show9 when={props.builderBlock?.children?.length && !props.fitContent}><div
3604
+ >{props.children}</div></Show10>
3605
+ <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
3385
3606
  style={{
3386
3607
  "pointer-events": "none",
3387
3608
  display: "flex",
@@ -3393,7 +3614,7 @@ function Video(props) {
3393
3614
  width: "100%",
3394
3615
  height: "100%"
3395
3616
  }}
3396
- >{props.children}</div></Show9>
3617
+ >{props.children}</div></Show10>
3397
3618
  </div>;
3398
3619
  }
3399
3620
  var video_default = Video;
@@ -3401,28 +3622,28 @@ var video_default = Video;
3401
3622
  // src/constants/extra-components.ts
3402
3623
  var getExtraComponents = () => [{
3403
3624
  component: custom_code_default,
3404
- ...componentInfo9
3625
+ ...componentInfo10
3405
3626
  }, {
3406
3627
  component: embed_default,
3407
- ...componentInfo10
3628
+ ...componentInfo11
3408
3629
  }, ...TARGET === "rsc" ? [] : [{
3409
3630
  component: form_default,
3410
- ...componentInfo11
3631
+ ...componentInfo12
3411
3632
  }, {
3412
3633
  component: input_default,
3413
- ...componentInfo12
3634
+ ...componentInfo13
3414
3635
  }, {
3415
3636
  component: submit_button_default,
3416
- ...componentInfo14
3637
+ ...componentInfo15
3417
3638
  }, {
3418
3639
  component: select_default,
3419
- ...componentInfo13
3640
+ ...componentInfo14
3420
3641
  }], {
3421
3642
  component: img_default,
3422
- ...componentInfo15
3643
+ ...componentInfo16
3423
3644
  }, {
3424
3645
  component: video_default,
3425
- ...componentInfo16
3646
+ ...componentInfo17
3426
3647
  }];
3427
3648
 
3428
3649
  // src/constants/builder-registered-components.ts
@@ -3449,8 +3670,11 @@ var getDefaultRegisteredComponents = () => [{
3449
3670
  ...componentInfo7
3450
3671
  }, {
3451
3672
  component: text_default,
3673
+ ...componentInfo9
3674
+ }, ...TARGET === "rsc" ? [] : [{
3675
+ component: tabs_default,
3452
3676
  ...componentInfo8
3453
- }, ...getExtraComponents()];
3677
+ }], ...getExtraComponents()];
3454
3678
 
3455
3679
  // src/functions/register-component.ts
3456
3680
  var createRegisterComponentMessage = (info) => ({
@@ -3528,12 +3752,12 @@ var Inlined_script_default = InlinedScript;
3528
3752
 
3529
3753
  // src/components/content/components/enable-editor.tsx
3530
3754
  import {
3531
- Show as Show10,
3755
+ Show as Show11,
3532
3756
  onMount as onMount3,
3533
3757
  on as on2,
3534
3758
  createEffect as createEffect2,
3535
- createMemo as createMemo12,
3536
- createSignal as createSignal12
3759
+ createMemo as createMemo14,
3760
+ createSignal as createSignal14
3537
3761
  } from "solid-js";
3538
3762
  import { Dynamic as Dynamic5 } from "solid-js/web";
3539
3763
 
@@ -4021,7 +4245,7 @@ function isFromTrustedHost(trustedHosts, e) {
4021
4245
  }
4022
4246
 
4023
4247
  // src/constants/sdk-version.ts
4024
- var SDK_VERSION = "1.0.23";
4248
+ var SDK_VERSION = "1.0.25";
4025
4249
 
4026
4250
  // src/functions/register.ts
4027
4251
  var registry = {};
@@ -4218,14 +4442,93 @@ var subscribeToEditor = (model, callback, options) => {
4218
4442
  };
4219
4443
  };
4220
4444
 
4445
+ // src/components/content/components/styles.helpers.ts
4446
+ var getCssFromFont = (font) => {
4447
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4448
+ const name = family.split(",")[0];
4449
+ const url = font.fileUrl ?? font?.files?.regular;
4450
+ let str = "";
4451
+ if (url && family && name) {
4452
+ str += `
4453
+ @font-face {
4454
+ font-family: "${family}";
4455
+ src: local("${name}"), url('${url}') format('woff2');
4456
+ font-display: fallback;
4457
+ font-weight: 400;
4458
+ }
4459
+ `.trim();
4460
+ }
4461
+ if (font.files) {
4462
+ for (const weight in font.files) {
4463
+ const isNumber = String(Number(weight)) === weight;
4464
+ if (!isNumber) {
4465
+ continue;
4466
+ }
4467
+ const weightUrl = font.files[weight];
4468
+ if (weightUrl && weightUrl !== url) {
4469
+ str += `
4470
+ @font-face {
4471
+ font-family: "${family}";
4472
+ src: url('${weightUrl}') format('woff2');
4473
+ font-display: fallback;
4474
+ font-weight: ${weight};
4475
+ }
4476
+ `.trim();
4477
+ }
4478
+ }
4479
+ }
4480
+ return str;
4481
+ };
4482
+ var getFontCss = ({
4483
+ customFonts
4484
+ }) => {
4485
+ return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4486
+ };
4487
+ var getCss = ({
4488
+ cssCode,
4489
+ contentId
4490
+ }) => {
4491
+ if (!cssCode) {
4492
+ return "";
4493
+ }
4494
+ if (!contentId) {
4495
+ return cssCode;
4496
+ }
4497
+ return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4498
+ };
4499
+ var DEFAULT_STYLES = `
4500
+ .builder-button {
4501
+ all: unset;
4502
+ }
4503
+
4504
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4505
+ margin: 0;
4506
+ }
4507
+ .builder-text > p, .builder-text > .builder-paragraph {
4508
+ color: inherit;
4509
+ line-height: inherit;
4510
+ letter-spacing: inherit;
4511
+ font-weight: inherit;
4512
+ font-size: inherit;
4513
+ text-align: inherit;
4514
+ font-family: inherit;
4515
+ }
4516
+ `;
4517
+ var getDefaultStyles = (isNested) => {
4518
+ return !isNested ? DEFAULT_STYLES : "";
4519
+ };
4520
+ var getWrapperClassName = (variationId) => {
4521
+ return `variant-${variationId}`;
4522
+ };
4523
+
4221
4524
  // src/components/content/components/enable-editor.tsx
4222
4525
  function EnableEditor(props) {
4223
- const [ContentWrapper, setContentWrapper] = createSignal12(
4526
+ const [ContentWrapper, setContentWrapper] = createSignal14(
4224
4527
  props.contentWrapper || "div"
4225
4528
  );
4226
- const [httpReqsData, setHttpReqsData] = createSignal12({});
4227
- const [httpReqsPending, setHttpReqsPending] = createSignal12({});
4228
- const [clicked, setClicked] = createSignal12(false);
4529
+ const [httpReqsData, setHttpReqsData] = createSignal14({});
4530
+ const [httpReqsPending, setHttpReqsPending] = createSignal14({});
4531
+ const [clicked, setClicked] = createSignal14(false);
4229
4532
  function mergeNewRootState(newData) {
4230
4533
  const combinedState = {
4231
4534
  ...props.builderContextSignal.rootState,
@@ -4259,6 +4562,12 @@ function EnableEditor(props) {
4259
4562
  content: newContentValue
4260
4563
  }));
4261
4564
  }
4565
+ const showContentProps = createMemo14(() => {
4566
+ return props.showContent ? {} : {
4567
+ hidden: true,
4568
+ "aria-hidden": true
4569
+ };
4570
+ });
4262
4571
  function processMessage(event) {
4263
4572
  return createEditorListener({
4264
4573
  model: props.model,
@@ -4444,14 +4753,14 @@ function EnableEditor(props) {
4444
4753
  runHttpRequests();
4445
4754
  emitStateUpdate();
4446
4755
  });
4447
- const onUpdateFn_0_props_content = createMemo12(() => props.content);
4756
+ const onUpdateFn_0_props_content = createMemo14(() => props.content);
4448
4757
  function onUpdateFn_0() {
4449
4758
  if (props.content) {
4450
4759
  mergeNewContent(props.content);
4451
4760
  }
4452
4761
  }
4453
4762
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4454
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4763
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
4455
4764
  function onUpdateFn_1() {
4456
4765
  evaluateJsCode();
4457
4766
  }
@@ -4461,7 +4770,7 @@ function EnableEditor(props) {
4461
4770
  onUpdateFn_1
4462
4771
  )
4463
4772
  );
4464
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4773
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
4465
4774
  function onUpdateFn_2() {
4466
4775
  runHttpRequests();
4467
4776
  }
@@ -4473,7 +4782,7 @@ function EnableEditor(props) {
4473
4782
  onUpdateFn_2
4474
4783
  )
4475
4784
  );
4476
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
4785
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
4477
4786
  () => props.builderContextSignal.rootState
4478
4787
  );
4479
4788
  function onUpdateFn_3() {
@@ -4485,14 +4794,14 @@ function EnableEditor(props) {
4485
4794
  onUpdateFn_3
4486
4795
  )
4487
4796
  );
4488
- const onUpdateFn_4_props_data = createMemo12(() => props.data);
4797
+ const onUpdateFn_4_props_data = createMemo14(() => props.data);
4489
4798
  function onUpdateFn_4() {
4490
4799
  if (props.data) {
4491
4800
  mergeNewRootState(props.data);
4492
4801
  }
4493
4802
  }
4494
4803
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4495
- const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
4804
+ const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
4496
4805
  function onUpdateFn_5() {
4497
4806
  if (props.locale) {
4498
4807
  mergeNewRootState({
@@ -4501,106 +4810,27 @@ function EnableEditor(props) {
4501
4810
  }
4502
4811
  }
4503
4812
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4504
- return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
4505
- class={`variant-${props.content?.testVariationId || props.content?.id}`}
4813
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
4814
+ class={getWrapperClassName(
4815
+ props.content?.testVariationId || props.content?.id
4816
+ )}
4506
4817
  {...{}}
4507
4818
  ref={elementRef}
4508
4819
  onClick={(event) => onClick(event)}
4509
4820
  builder-content-id={props.builderContextSignal.content?.id}
4510
4821
  builder-model={props.model}
4511
4822
  {...{}}
4512
- {...props.showContent ? {} : {
4513
- hidden: true,
4514
- "aria-hidden": true
4515
- }}
4823
+ {...showContentProps()}
4516
4824
  {...props.contentWrapperProps}
4517
4825
  component={ContentWrapper()}
4518
- >{props.children}</Dynamic5></Show10></builder_context_default.Provider>;
4826
+ >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
4519
4827
  }
4520
4828
  var Enable_editor_default = EnableEditor;
4521
4829
 
4522
4830
  // src/components/content/components/styles.tsx
4523
- import { createSignal as createSignal13 } from "solid-js";
4524
-
4525
- // src/components/content/components/styles.helpers.ts
4526
- var getCssFromFont = (font) => {
4527
- const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4528
- const name = family.split(",")[0];
4529
- const url = font.fileUrl ?? font?.files?.regular;
4530
- let str = "";
4531
- if (url && family && name) {
4532
- str += `
4533
- @font-face {
4534
- font-family: "${family}";
4535
- src: local("${name}"), url('${url}') format('woff2');
4536
- font-display: fallback;
4537
- font-weight: 400;
4538
- }
4539
- `.trim();
4540
- }
4541
- if (font.files) {
4542
- for (const weight in font.files) {
4543
- const isNumber = String(Number(weight)) === weight;
4544
- if (!isNumber) {
4545
- continue;
4546
- }
4547
- const weightUrl = font.files[weight];
4548
- if (weightUrl && weightUrl !== url) {
4549
- str += `
4550
- @font-face {
4551
- font-family: "${family}";
4552
- src: url('${weightUrl}') format('woff2');
4553
- font-display: fallback;
4554
- font-weight: ${weight};
4555
- }
4556
- `.trim();
4557
- }
4558
- }
4559
- }
4560
- return str;
4561
- };
4562
- var getFontCss = ({
4563
- customFonts
4564
- }) => {
4565
- return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4566
- };
4567
- var getCss = ({
4568
- cssCode,
4569
- contentId
4570
- }) => {
4571
- if (!cssCode) {
4572
- return "";
4573
- }
4574
- if (!contentId) {
4575
- return cssCode;
4576
- }
4577
- return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4578
- };
4579
- var DEFAULT_STYLES = `
4580
- .builder-button {
4581
- all: unset;
4582
- }
4583
-
4584
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4585
- margin: 0;
4586
- }
4587
- .builder-text > p, .builder-text > .builder-paragraph {
4588
- color: inherit;
4589
- line-height: inherit;
4590
- letter-spacing: inherit;
4591
- font-weight: inherit;
4592
- font-size: inherit;
4593
- text-align: inherit;
4594
- font-family: inherit;
4595
- }
4596
- `;
4597
- var getDefaultStyles = (isNested) => {
4598
- return !isNested ? DEFAULT_STYLES : "";
4599
- };
4600
-
4601
- // src/components/content/components/styles.tsx
4831
+ import { createSignal as createSignal15 } from "solid-js";
4602
4832
  function ContentStyles(props) {
4603
- const [injectedStyles, setInjectedStyles] = createSignal13(
4833
+ const [injectedStyles, setInjectedStyles] = createSignal15(
4604
4834
  `
4605
4835
  ${getCss({
4606
4836
  cssCode: props.cssCode,
@@ -4657,7 +4887,7 @@ var getContentInitialValue = ({
4657
4887
 
4658
4888
  // src/components/content/content.tsx
4659
4889
  function ContentComponent(props) {
4660
- const [scriptStr, setScriptStr] = createSignal14(
4890
+ const [scriptStr, setScriptStr] = createSignal16(
4661
4891
  getUpdateVariantVisibilityScript({
4662
4892
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
4663
4893
  variationId: props.content?.testVariationId,
@@ -4665,7 +4895,7 @@ function ContentComponent(props) {
4665
4895
  contentId: props.content?.id
4666
4896
  })
4667
4897
  );
4668
- const [registeredComponents, setRegisteredComponents] = createSignal14(
4898
+ const [registeredComponents, setRegisteredComponents] = createSignal16(
4669
4899
  [
4670
4900
  ...getDefaultRegisteredComponents(),
4671
4901
  ...props.customComponents || []
@@ -4680,7 +4910,7 @@ function ContentComponent(props) {
4680
4910
  {}
4681
4911
  )
4682
4912
  );
4683
- const [builderContextSignal, setBuilderContextSignal] = createSignal14({
4913
+ const [builderContextSignal, setBuilderContextSignal] = createSignal16({
4684
4914
  content: getContentInitialValue({
4685
4915
  content: props.content,
4686
4916
  data: props.data
@@ -4738,16 +4968,16 @@ function ContentComponent(props) {
4738
4968
  setBuilderContextSignal
4739
4969
  }}
4740
4970
  >
4741
- <Show11 when={props.isSsrAbTest}><Inlined_script_default
4971
+ <Show12 when={props.isSsrAbTest}><Inlined_script_default
4742
4972
  id="builderio-variant-visibility"
4743
4973
  scriptStr={scriptStr()}
4744
- /></Show11>
4745
- <Show11 when={TARGET !== "reactNative"}><Styles_default
4974
+ /></Show12>
4975
+ <Show12 when={TARGET !== "reactNative"}><Styles_default
4746
4976
  isNestedRender={props.isNestedRender}
4747
4977
  contentId={builderContextSignal().content?.id}
4748
4978
  cssCode={builderContextSignal().content?.data?.cssCode}
4749
4979
  customFonts={builderContextSignal().content?.data?.customFonts}
4750
- /></Show11>
4980
+ /></Show12>
4751
4981
  <Blocks_default
4752
4982
  blocks={builderContextSignal().content?.data?.blocks}
4753
4983
  context={builderContextSignal()}
@@ -4760,13 +4990,13 @@ var Content_default = ContentComponent;
4760
4990
 
4761
4991
  // src/components/content-variants/content-variants.tsx
4762
4992
  function ContentVariants(props) {
4763
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal15(
4993
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
4764
4994
  checkShouldRenderVariants({
4765
4995
  canTrack: getDefaultCanTrack(props.canTrack),
4766
4996
  content: props.content
4767
4997
  })
4768
4998
  );
4769
- const updateCookieAndStylesScriptStr = createMemo15(() => {
4999
+ const updateCookieAndStylesScriptStr = createMemo17(() => {
4770
5000
  return getUpdateCookieAndStylesScript(
4771
5001
  getVariants(props.content).map((value) => ({
4772
5002
  id: value.testVariationId,
@@ -4775,10 +5005,10 @@ function ContentVariants(props) {
4775
5005
  props.content?.id || ""
4776
5006
  );
4777
5007
  });
4778
- const hideVariantsStyleString = createMemo15(() => {
5008
+ const hideVariantsStyleString = createMemo17(() => {
4779
5009
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
4780
5010
  });
4781
- const defaultContent = createMemo15(() => {
5011
+ const defaultContent = createMemo17(() => {
4782
5012
  return shouldRenderVariants() ? {
4783
5013
  ...props.content,
4784
5014
  testVariationId: props.content?.id
@@ -4791,11 +5021,11 @@ function ContentVariants(props) {
4791
5021
  setShouldRenderVariants(false);
4792
5022
  });
4793
5023
  return <>
4794
- <Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5024
+ <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
4795
5025
  id="builderio-init-variants-fns"
4796
5026
  scriptStr={getInitVariantsFnsScriptString()}
4797
- /></Show12>
4798
- <Show12 when={shouldRenderVariants()}>
5027
+ /></Show13>
5028
+ <Show13 when={shouldRenderVariants()}>
4799
5029
  <Inlined_styles_default
4800
5030
  id="builderio-variants"
4801
5031
  styles={hideVariantsStyleString()}
@@ -4804,7 +5034,7 @@ function ContentVariants(props) {
4804
5034
  id="builderio-variants-visibility"
4805
5035
  scriptStr={updateCookieAndStylesScriptStr()}
4806
5036
  />
4807
- <For7 each={getVariants(props.content)}>{(variant, _index) => {
5037
+ <For8 each={getVariants(props.content)}>{(variant, _index) => {
4808
5038
  const index = _index();
4809
5039
  return <Content_default
4810
5040
  isNestedRender={props.isNestedRender}
@@ -4828,8 +5058,8 @@ function ContentVariants(props) {
4828
5058
  contentWrapperProps={props.contentWrapperProps}
4829
5059
  trustedHosts={props.trustedHosts}
4830
5060
  />;
4831
- }}</For7>
4832
- </Show12>
5061
+ }}</For8>
5062
+ </Show13>
4833
5063
  <Content_default
4834
5064
  isNestedRender={props.isNestedRender}
4835
5065
  {...{}}
@@ -4882,8 +5112,14 @@ var fetchSymbolContent = async ({
4882
5112
 
4883
5113
  // src/blocks/symbol/symbol.tsx
4884
5114
  function Symbol(props) {
4885
- const [contentToUse, setContentToUse] = createSignal16(props.symbol?.content);
4886
- const className = createMemo16(() => {
5115
+ const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
5116
+ const blocksWrapper = createMemo18(() => {
5117
+ return "div";
5118
+ });
5119
+ const contentWrapper = createMemo18(() => {
5120
+ return "div";
5121
+ });
5122
+ const className = createMemo18(() => {
4887
5123
  return [
4888
5124
  ...[props.attributes[getClassPropName()]],
4889
5125
  "builder-symbol",
@@ -4905,7 +5141,7 @@ function Symbol(props) {
4905
5141
  }
4906
5142
  onMount5(() => {
4907
5143
  });
4908
- const onUpdateFn_0_props_symbol = createMemo16(() => props.symbol);
5144
+ const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
4909
5145
  function onUpdateFn_0() {
4910
5146
  setContent();
4911
5147
  }
@@ -4927,8 +5163,8 @@ function Symbol(props) {
4927
5163
  model={props.symbol?.model}
4928
5164
  content={contentToUse()}
4929
5165
  linkComponent={props.builderLinkComponent}
4930
- blocksWrapper="div"
4931
- contentWrapper="div"
5166
+ blocksWrapper={blocksWrapper()}
5167
+ contentWrapper={contentWrapper()}
4932
5168
  /></div>;
4933
5169
  }
4934
5170
  var symbol_default = Symbol;