@builder.io/sdk-solid 1.0.22 → 1.0.24

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