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