@builder.io/sdk-solid 1.0.23 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/node/dev.jsx CHANGED
@@ -46,14 +46,15 @@ var getClassPropName = () => {
46
46
  case "vue":
47
47
  case "solid":
48
48
  case "qwik":
49
+ case "angular":
49
50
  return "class";
50
51
  }
51
52
  };
52
53
 
53
54
  // src/blocks/button/button.tsx
54
55
  function Button(props) {
55
- return <Dynamic_renderer_default
56
- attributes={{
56
+ function attrs() {
57
+ return {
57
58
  ...props.attributes,
58
59
  [getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
59
60
  ...props.link ? {
@@ -63,7 +64,10 @@ function Button(props) {
63
64
  } : {
64
65
  role: "button"
65
66
  }
66
- }}
67
+ };
68
+ }
69
+ return <Dynamic_renderer_default
70
+ attributes={attrs()}
67
71
  TagName={props.link ? props.builderLinkComponent || "a" : "button"}
68
72
  actionAttributes={{}}
69
73
  >{props.text}</Dynamic_renderer_default>;
@@ -71,7 +75,7 @@ function Button(props) {
71
75
  var button_default = Button;
72
76
 
73
77
  // src/blocks/columns/columns.tsx
74
- import { Show as Show6, For as For4, createSignal as createSignal6, createMemo as createMemo6 } from "solid-js";
78
+ import { Show as Show6, For as For4, createSignal as createSignal7 } from "solid-js";
75
79
  import { css as css2 } from "solid-styled-components";
76
80
 
77
81
  // src/components/blocks/blocks.tsx
@@ -99,7 +103,7 @@ import { createContext as createContext2 } from "solid-js";
99
103
  var components_context_default = createContext2({ registeredComponents: {} });
100
104
 
101
105
  // src/components/block/block.tsx
102
- import { Show as Show4, For as For2, onMount, createMemo as createMemo4 } from "solid-js";
106
+ import { Show as Show4, For as For2, onMount, createMemo as createMemo5 } from "solid-js";
103
107
 
104
108
  // src/functions/get-block-component-options.ts
105
109
  function getBlockComponentOptions(block) {
@@ -362,16 +366,17 @@ function theFunction() {
362
366
  ${code}
363
367
  }
364
368
 
365
- let output = theFunction()
369
+ const output = theFunction()
366
370
 
367
371
  if (typeof output === 'object' && output !== null) {
368
- output = JSON.stringify(output.copySync ? output.copySync() : output);
372
+ return JSON.stringify(output.copySync ? output.copySync() : output);
373
+ } else {
374
+ return output;
369
375
  }
370
-
371
- output;
372
376
  `;
373
377
  };
374
378
  var IVM_INSTANCE = null;
379
+ var IVM_CONTEXT = null;
375
380
  var getIvm = () => {
376
381
  try {
377
382
  if (IVM_INSTANCE)
@@ -391,12 +396,26 @@ var getIvm = () => {
391
396
  Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
392
397
  `);
393
398
  };
394
- var getIsolateContext = () => {
399
+ function setIsolateContext(options = {
400
+ memoryLimit: 128
401
+ }) {
395
402
  const ivm = getIvm();
396
- const isolate = new ivm.Isolate({
397
- memoryLimit: 128
403
+ const isolate = new ivm.Isolate(options);
404
+ const context = isolate.createContextSync();
405
+ const jail = context.global;
406
+ jail.setSync("global", jail.derefInto());
407
+ jail.setSync("log", function(...logArgs) {
408
+ console.log(...logArgs);
398
409
  });
399
- return isolate.createContextSync();
410
+ jail.setSync(INJECTED_IVM_GLOBAL, ivm);
411
+ IVM_CONTEXT = context;
412
+ return context;
413
+ }
414
+ var getIsolateContext = () => {
415
+ if (IVM_CONTEXT)
416
+ return IVM_CONTEXT;
417
+ const context = setIsolateContext();
418
+ return context;
400
419
  };
401
420
  var runInNode = ({
402
421
  code,
@@ -420,10 +439,6 @@ var runInNode = ({
420
439
  });
421
440
  const isolateContext = getIsolateContext();
422
441
  const jail = isolateContext.global;
423
- jail.setSync("global", jail.derefInto());
424
- jail.setSync("log", function(...logArgs) {
425
- console.log(...logArgs);
426
- });
427
442
  jail.setSync(BUILDER_SET_STATE_NAME, function(key, value) {
428
443
  set(rootState, key, value);
429
444
  rootSetState?.(rootState);
@@ -438,12 +453,11 @@ var runInNode = ({
438
453
  ) : null;
439
454
  jail.setSync(getSyncValName(key), val);
440
455
  });
441
- jail.setSync(INJECTED_IVM_GLOBAL, ivm);
442
456
  const evalStr = processCode({
443
457
  code,
444
458
  args
445
459
  });
446
- const resultStr = isolateContext.evalSync(evalStr);
460
+ const resultStr = isolateContext.evalClosureSync(evalStr);
447
461
  try {
448
462
  const res = JSON.parse(resultStr);
449
463
  return res;
@@ -844,6 +858,7 @@ function mapStyleObjToStrIfNeeded(style) {
844
858
  case "svelte":
845
859
  case "vue":
846
860
  case "solid":
861
+ case "angular":
847
862
  return convertStyleMapToCSSArray(style).join(" ");
848
863
  case "qwik":
849
864
  case "reactNative":
@@ -919,6 +934,12 @@ var getRepeatItemData = ({
919
934
  }));
920
935
  return repeatArray;
921
936
  };
937
+ var shouldPassLinkComponent = (block) => {
938
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
939
+ };
940
+ var shouldPassRegisteredComponents = (block) => {
941
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
942
+ };
922
943
 
923
944
  // src/components/block/components/block-styles.tsx
924
945
  import { Show as Show2, createMemo } from "solid-js";
@@ -1162,15 +1183,15 @@ function BlockWrapper(props) {
1162
1183
  var Block_wrapper_default = BlockWrapper;
1163
1184
 
1164
1185
  // src/components/block/components/component-ref/component-ref.tsx
1165
- import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
1186
+ import { Show as Show3, For, createSignal as createSignal3 } from "solid-js";
1166
1187
  import { Dynamic as Dynamic3 } from "solid-js/web";
1167
1188
 
1168
1189
  // src/components/block/components/interactive-element.tsx
1190
+ import { createMemo as createMemo2 } from "solid-js";
1169
1191
  import { Dynamic as Dynamic2 } from "solid-js/web";
1170
1192
  function InteractiveElement(props) {
1171
- return <Dynamic2
1172
- {...props.wrapperProps}
1173
- attributes={props.includeBlockProps ? {
1193
+ const attributes = createMemo2(() => {
1194
+ return props.includeBlockProps ? {
1174
1195
  ...getBlockProperties({
1175
1196
  block: props.block,
1176
1197
  context: props.context
@@ -1182,7 +1203,11 @@ function InteractiveElement(props) {
1182
1203
  localState: props.context.localState,
1183
1204
  context: props.context.context
1184
1205
  })
1185
- } : {}}
1206
+ } : {};
1207
+ });
1208
+ return <Dynamic2
1209
+ {...props.wrapperProps}
1210
+ attributes={attributes()}
1186
1211
  component={props.Wrapper}
1187
1212
  >{props.children}</Dynamic2>;
1188
1213
  }
@@ -1223,7 +1248,7 @@ var getWrapperProps = ({
1223
1248
 
1224
1249
  // src/components/block/components/component-ref/component-ref.tsx
1225
1250
  function ComponentRef(props) {
1226
- const [Wrapper, setWrapper] = createSignal2(
1251
+ const [Wrapper, setWrapper] = createSignal3(
1227
1252
  props.isInteractive ? interactive_element_default : props.componentRef
1228
1253
  );
1229
1254
  return <Show3 when={props.componentRef}><Dynamic3
@@ -1252,9 +1277,9 @@ function ComponentRef(props) {
1252
1277
  var Component_ref_default = ComponentRef;
1253
1278
 
1254
1279
  // src/components/block/components/repeated-block.tsx
1255
- import { createSignal as createSignal3 } from "solid-js";
1280
+ import { createSignal as createSignal4 } from "solid-js";
1256
1281
  function RepeatedBlock(props) {
1257
- const [store, setStore] = createSignal3(props.repeatContext);
1282
+ const [store, setStore] = createSignal4(props.repeatContext);
1258
1283
  return <builder_context_default.Provider value={store()}><Block_default
1259
1284
  block={props.block}
1260
1285
  context={store()}
@@ -1266,20 +1291,20 @@ var Repeated_block_default = RepeatedBlock;
1266
1291
 
1267
1292
  // src/components/block/block.tsx
1268
1293
  function Block(props) {
1269
- const blockComponent = createMemo4(() => {
1294
+ const blockComponent = createMemo5(() => {
1270
1295
  return getComponent({
1271
1296
  block: props.block,
1272
1297
  context: props.context,
1273
1298
  registeredComponents: props.registeredComponents
1274
1299
  });
1275
1300
  });
1276
- const repeatItem = createMemo4(() => {
1301
+ const repeatItem = createMemo5(() => {
1277
1302
  return getRepeatItemData({
1278
1303
  block: props.block,
1279
1304
  context: props.context
1280
1305
  });
1281
1306
  });
1282
- const processedBlock = createMemo4(() => {
1307
+ const processedBlock = createMemo5(() => {
1283
1308
  return props.block.repeat?.collection ? props.block : getProcessedBlock({
1284
1309
  block: props.block,
1285
1310
  localState: props.context.localState,
@@ -1289,14 +1314,14 @@ function Block(props) {
1289
1314
  shouldEvaluateBindings: true
1290
1315
  });
1291
1316
  });
1292
- const Tag = createMemo4(() => {
1317
+ const Tag = createMemo5(() => {
1293
1318
  const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
1294
1319
  if (shouldUseLink) {
1295
1320
  return props.linkComponent || "a";
1296
1321
  }
1297
1322
  return props.block.tagName || "div";
1298
1323
  });
1299
- const canShowBlock = createMemo4(() => {
1324
+ const canShowBlock = createMemo5(() => {
1300
1325
  if (props.block.repeat?.collection) {
1301
1326
  if (repeatItem()?.length)
1302
1327
  return true;
@@ -1306,21 +1331,21 @@ function Block(props) {
1306
1331
  const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
1307
1332
  return shouldShow && !shouldHide;
1308
1333
  });
1309
- const childrenWithoutParentComponent = createMemo4(() => {
1334
+ const childrenWithoutParentComponent = createMemo5(() => {
1310
1335
  const shouldRenderChildrenOutsideRef = !blockComponent()?.component && !repeatItem();
1311
1336
  return shouldRenderChildrenOutsideRef ? processedBlock().children ?? [] : [];
1312
1337
  });
1313
- const componentRefProps = createMemo4(() => {
1338
+ const componentRefProps = createMemo5(() => {
1314
1339
  return {
1315
1340
  blockChildren: processedBlock().children ?? [],
1316
1341
  componentRef: blockComponent()?.component,
1317
1342
  componentOptions: {
1318
1343
  ...getBlockComponentOptions(processedBlock()),
1319
1344
  builderContext: props.context,
1320
- ...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1345
+ ...shouldPassLinkComponent(blockComponent()) ? {
1321
1346
  builderLinkComponent: props.linkComponent
1322
1347
  } : {},
1323
- ...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1348
+ ...shouldPassRegisteredComponents(blockComponent()) ? {
1324
1349
  builderComponents: props.registeredComponents
1325
1350
  } : {}
1326
1351
  },
@@ -1404,11 +1429,11 @@ function Block(props) {
1404
1429
  var Block_default = Block;
1405
1430
 
1406
1431
  // src/components/blocks/blocks-wrapper.tsx
1407
- import { createMemo as createMemo5 } from "solid-js";
1432
+ import { createMemo as createMemo6 } from "solid-js";
1408
1433
  import { Dynamic as Dynamic4 } from "solid-js/web";
1409
1434
  import { css } from "solid-styled-components";
1410
1435
  function BlocksWrapper(props) {
1411
- const className = createMemo5(() => {
1436
+ const className = createMemo6(() => {
1412
1437
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
1413
1438
  });
1414
1439
  function onClick() {
@@ -1482,16 +1507,24 @@ function Blocks(props) {
1482
1507
  }
1483
1508
  var Blocks_default = Blocks;
1484
1509
 
1510
+ // src/blocks/columns/helpers.ts
1511
+ var getColumnsClass = (id) => {
1512
+ return `builder-columns ${id}-breakpoints`;
1513
+ };
1514
+
1485
1515
  // src/blocks/columns/columns.tsx
1486
1516
  function Columns(props) {
1487
- const [gutterSize, setGutterSize] = createSignal6(
1517
+ const [gutterSize, setGutterSize] = createSignal7(
1488
1518
  typeof props.space === "number" ? props.space || 0 : 20
1489
1519
  );
1490
- const [cols, setCols] = createSignal6(props.columns || []);
1491
- const [stackAt, setStackAt] = createSignal6(props.stackColumnsAt || "tablet");
1492
- const [flexDir, setFlexDir] = createSignal6(
1520
+ const [cols, setCols] = createSignal7(props.columns || []);
1521
+ const [stackAt, setStackAt] = createSignal7(props.stackColumnsAt || "tablet");
1522
+ const [flexDir, setFlexDir] = createSignal7(
1493
1523
  props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column"
1494
1524
  );
1525
+ function getTagName(column) {
1526
+ return column.link ? props.builderLinkComponent || "a" : "div";
1527
+ }
1495
1528
  function getWidth(index) {
1496
1529
  return cols()[index]?.width || 100 / cols().length;
1497
1530
  }
@@ -1511,7 +1544,7 @@ function Columns(props) {
1511
1544
  }) {
1512
1545
  return stackAt() === "never" ? desktopStyle : stackedStyle;
1513
1546
  }
1514
- const columnsCssVars = createMemo6(() => {
1547
+ function columnsCssVars() {
1515
1548
  return {
1516
1549
  "--flex-dir": flexDir(),
1517
1550
  "--flex-dir-tablet": getTabletStyle({
@@ -1519,7 +1552,7 @@ function Columns(props) {
1519
1552
  desktopStyle: "row"
1520
1553
  })
1521
1554
  };
1522
- });
1555
+ }
1523
1556
  function columnCssVars(index) {
1524
1557
  const gutter = index === 0 ? 0 : gutterSize();
1525
1558
  const width = getColumnCssWidth(index);
@@ -1560,7 +1593,7 @@ function Columns(props) {
1560
1593
  );
1561
1594
  return breakpointSizes[size].max;
1562
1595
  }
1563
- const columnsStyles = createMemo6(() => {
1596
+ function columnsStyles() {
1564
1597
  return `
1565
1598
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
1566
1599
  .${props.builderBlock.id}-breakpoints {
@@ -1586,9 +1619,19 @@ function Columns(props) {
1586
1619
  }
1587
1620
  },
1588
1621
  `;
1589
- });
1622
+ }
1623
+ function getAttributes(column, index) {
1624
+ return {
1625
+ ...{},
1626
+ ...column.link ? {
1627
+ href: column.link
1628
+ } : {},
1629
+ [getClassPropName()]: "builder-column",
1630
+ style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1631
+ };
1632
+ }
1590
1633
  return <div
1591
- class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
1634
+ class={getColumnsClass(props.builderBlock?.id) + " " + css2({
1592
1635
  display: "flex",
1593
1636
  lineHeight: "normal"
1594
1637
  })}
@@ -1603,16 +1646,9 @@ function Columns(props) {
1603
1646
  const index = _index();
1604
1647
  return <Dynamic_renderer_default
1605
1648
  key={index}
1606
- TagName={column.link ? props.builderLinkComponent || "a" : "div"}
1649
+ TagName={getTagName(column)}
1607
1650
  actionAttributes={{}}
1608
- attributes={{
1609
- ...{},
1610
- ...column.link ? {
1611
- href: column.link
1612
- } : {},
1613
- [getClassPropName()]: "builder-column",
1614
- style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1615
- }}
1651
+ attributes={getAttributes(column, index)}
1616
1652
  ><Blocks_default
1617
1653
  path={`component.options.columns.${index}.blocks`}
1618
1654
  parent={props.builderBlock.id}
@@ -1636,7 +1672,7 @@ function FragmentComponent(props) {
1636
1672
  var fragment_default = FragmentComponent;
1637
1673
 
1638
1674
  // src/blocks/image/image.tsx
1639
- import { Show as Show7, createMemo as createMemo7 } from "solid-js";
1675
+ import { Show as Show7, createMemo as createMemo8 } from "solid-js";
1640
1676
  import { css as css3 } from "solid-styled-components";
1641
1677
 
1642
1678
  // src/blocks/image/image.helpers.ts
@@ -1688,7 +1724,7 @@ function getSrcSet(url) {
1688
1724
 
1689
1725
  // src/blocks/image/image.tsx
1690
1726
  function Image(props) {
1691
- const srcSetToUse = createMemo7(() => {
1727
+ const srcSetToUse = createMemo8(() => {
1692
1728
  const imageToUse = props.image || props.src;
1693
1729
  const url = imageToUse;
1694
1730
  if (!url || // We can auto add srcset for cdn.builder.io and shopify
@@ -1706,14 +1742,14 @@ function Image(props) {
1706
1742
  }
1707
1743
  return getSrcSet(url);
1708
1744
  });
1709
- const webpSrcSet = createMemo7(() => {
1745
+ const webpSrcSet = createMemo8(() => {
1710
1746
  if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
1711
1747
  return srcSetToUse().replace(/\?/g, "?format=webp&");
1712
1748
  } else {
1713
1749
  return "";
1714
1750
  }
1715
1751
  });
1716
- const aspectRatioCss = createMemo7(() => {
1752
+ const aspectRatioCss = createMemo8(() => {
1717
1753
  const aspectRatioStyles = {
1718
1754
  position: "absolute",
1719
1755
  height: "100%",
@@ -1758,7 +1794,7 @@ function Image(props) {
1758
1794
  }}
1759
1795
  /></Show7>
1760
1796
  <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
1761
- <Show7 when={!props.fitContent && props.children}><div
1797
+ <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div
1762
1798
  class={css3({
1763
1799
  display: "flex",
1764
1800
  flexDirection: "column",
@@ -1796,10 +1832,10 @@ function SectionComponent(props) {
1796
1832
  var section_default = SectionComponent;
1797
1833
 
1798
1834
  // src/blocks/symbol/symbol.tsx
1799
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo16, createSignal as createSignal16 } from "solid-js";
1835
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
1800
1836
 
1801
1837
  // src/components/content-variants/content-variants.tsx
1802
- import { Show as Show12, For as For7, onMount as onMount4, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
1838
+ import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
1803
1839
 
1804
1840
  // src/helpers/url.ts
1805
1841
  var getTopLevelDomain = (host) => {
@@ -1993,7 +2029,7 @@ var handleABTesting = async ({
1993
2029
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1994
2030
 
1995
2031
  // src/components/content/content.tsx
1996
- import { Show as Show11, createSignal as createSignal14 } from "solid-js";
2032
+ import { Show as Show12, createSignal as createSignal16 } from "solid-js";
1997
2033
 
1998
2034
  // src/blocks/button/component-info.ts
1999
2035
  var componentInfo = {
@@ -2495,8 +2531,203 @@ var componentInfo7 = {
2495
2531
  }]
2496
2532
  };
2497
2533
 
2498
- // src/blocks/text/component-info.ts
2534
+ // src/blocks/tabs/component-info.ts
2535
+ var defaultTab = {
2536
+ "@type": "@builder.io/sdk:Element",
2537
+ responsiveStyles: {
2538
+ large: {
2539
+ paddingLeft: "20px",
2540
+ paddingRight: "20px",
2541
+ paddingTop: "10px",
2542
+ paddingBottom: "10px",
2543
+ minWidth: "100px",
2544
+ textAlign: "center",
2545
+ display: "flex",
2546
+ flexDirection: "column",
2547
+ cursor: "pointer",
2548
+ userSelect: "none"
2549
+ }
2550
+ },
2551
+ component: {
2552
+ name: "Text",
2553
+ options: {
2554
+ text: "New tab"
2555
+ }
2556
+ }
2557
+ };
2558
+ var defaultElement = {
2559
+ "@type": "@builder.io/sdk:Element",
2560
+ responsiveStyles: {
2561
+ large: {
2562
+ height: "200px",
2563
+ display: "flex",
2564
+ marginTop: "20px",
2565
+ flexDirection: "column"
2566
+ }
2567
+ },
2568
+ component: {
2569
+ name: "Text",
2570
+ options: {
2571
+ text: "New tab content "
2572
+ }
2573
+ }
2574
+ };
2499
2575
  var componentInfo8 = {
2576
+ name: "Builder: Tabs",
2577
+ inputs: [{
2578
+ name: "tabs",
2579
+ type: "list",
2580
+ broadcast: true,
2581
+ subFields: [{
2582
+ name: "label",
2583
+ type: "uiBlocks",
2584
+ hideFromUI: true,
2585
+ defaultValue: [defaultTab]
2586
+ }, {
2587
+ name: "content",
2588
+ type: "uiBlocks",
2589
+ hideFromUI: true,
2590
+ defaultValue: [defaultElement]
2591
+ }],
2592
+ defaultValue: [{
2593
+ label: [{
2594
+ ...defaultTab,
2595
+ component: {
2596
+ name: "Text",
2597
+ options: {
2598
+ text: "Tab 1"
2599
+ }
2600
+ }
2601
+ }],
2602
+ content: [{
2603
+ ...defaultElement,
2604
+ component: {
2605
+ name: "Text",
2606
+ options: {
2607
+ text: "Tab 1 content"
2608
+ }
2609
+ }
2610
+ }]
2611
+ }, {
2612
+ label: [{
2613
+ ...defaultTab,
2614
+ component: {
2615
+ name: "Text",
2616
+ options: {
2617
+ text: "Tab 2"
2618
+ }
2619
+ }
2620
+ }],
2621
+ content: [{
2622
+ ...defaultElement,
2623
+ component: {
2624
+ name: "Text",
2625
+ options: {
2626
+ text: "Tab 2 content"
2627
+ }
2628
+ }
2629
+ }]
2630
+ }]
2631
+ }, {
2632
+ name: "activeTabStyle",
2633
+ type: "uiStyle",
2634
+ helperText: "CSS styles for the active tab",
2635
+ defaultValue: {
2636
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
2637
+ }
2638
+ }, {
2639
+ name: "defaultActiveTab",
2640
+ type: "number",
2641
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
2642
+ defaultValue: 1,
2643
+ advanced: true
2644
+ }, {
2645
+ name: "collapsible",
2646
+ type: "boolean",
2647
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
2648
+ defaultValue: false,
2649
+ advanced: true
2650
+ }, {
2651
+ name: "tabHeaderLayout",
2652
+ type: "enum",
2653
+ helperText: "Change the layout of the tab headers (uses justify-content)",
2654
+ defaultValue: "flex-start",
2655
+ enum: [{
2656
+ label: "Center",
2657
+ value: "center"
2658
+ }, {
2659
+ label: "Space between",
2660
+ value: "space-between"
2661
+ }, {
2662
+ label: "Space around",
2663
+ value: "space-around"
2664
+ }, {
2665
+ label: "Left",
2666
+ value: "flex-start"
2667
+ }, {
2668
+ label: "Right",
2669
+ value: "flex-end"
2670
+ }]
2671
+ }]
2672
+ };
2673
+
2674
+ // src/blocks/tabs/tabs.tsx
2675
+ import { Show as Show8, For as For5, createSignal as createSignal9 } from "solid-js";
2676
+ function Tabs(props) {
2677
+ const [activeTab, setActiveTab] = createSignal9(
2678
+ props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
2679
+ );
2680
+ function activeTabContent(active) {
2681
+ return props.tabs && props.tabs[active].content;
2682
+ }
2683
+ function getActiveTabStyle(index) {
2684
+ return activeTab() === index ? props.activeTabStyle : {};
2685
+ }
2686
+ return <div>
2687
+ <div
2688
+ class="builder-tabs-wrap"
2689
+ style={{
2690
+ display: "flex",
2691
+ "flex-direction": "row",
2692
+ "justify-content": props.tabHeaderLayout || "flex-start",
2693
+ overflow: "auto"
2694
+ }}
2695
+ ><For5 each={props.tabs}>{(tab, _index) => {
2696
+ const index = _index();
2697
+ return <span
2698
+ class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2699
+ key={index}
2700
+ style={getActiveTabStyle(index)}
2701
+ onClick={(event) => {
2702
+ if (index === activeTab() && props.collapsible) {
2703
+ setActiveTab(-1);
2704
+ } else {
2705
+ setActiveTab(index);
2706
+ }
2707
+ }}
2708
+ ><Blocks_default
2709
+ parent={props.builderBlock.id}
2710
+ path={`component.options.tabs.${index}.label`}
2711
+ blocks={tab.label}
2712
+ context={props.builderContext}
2713
+ registeredComponents={props.builderComponents}
2714
+ linkComponent={props.builderLinkComponent}
2715
+ /></span>;
2716
+ }}</For5></div>
2717
+ <Show8 when={activeTabContent(activeTab())}><div><Blocks_default
2718
+ parent={props.builderBlock.id}
2719
+ path={`component.options.tabs.${activeTab()}.content`}
2720
+ blocks={activeTabContent(activeTab())}
2721
+ context={props.builderContext}
2722
+ registeredComponents={props.builderComponents}
2723
+ linkComponent={props.builderLinkComponent}
2724
+ /></div></Show8>
2725
+ </div>;
2726
+ }
2727
+ var tabs_default = Tabs;
2728
+
2729
+ // src/blocks/text/component-info.ts
2730
+ var componentInfo9 = {
2500
2731
  name: "Text",
2501
2732
  static: true,
2502
2733
  isRSC: true,
@@ -2529,7 +2760,7 @@ function Text(props) {
2529
2760
  var text_default = Text;
2530
2761
 
2531
2762
  // src/blocks/custom-code/component-info.ts
2532
- var componentInfo9 = {
2763
+ var componentInfo10 = {
2533
2764
  name: "Custom Code",
2534
2765
  static: true,
2535
2766
  requiredPermissions: ["editCode"],
@@ -2554,10 +2785,10 @@ var componentInfo9 = {
2554
2785
  };
2555
2786
 
2556
2787
  // src/blocks/custom-code/custom-code.tsx
2557
- import { onMount as onMount2, createSignal as createSignal8 } from "solid-js";
2788
+ import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
2558
2789
  function CustomCode(props) {
2559
- const [scriptsInserted, setScriptsInserted] = createSignal8([]);
2560
- const [scriptsRun, setScriptsRun] = createSignal8([]);
2790
+ const [scriptsInserted, setScriptsInserted] = createSignal10([]);
2791
+ const [scriptsRun, setScriptsRun] = createSignal10([]);
2561
2792
  let elementRef;
2562
2793
  onMount2(() => {
2563
2794
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -2601,7 +2832,7 @@ function CustomCode(props) {
2601
2832
  var custom_code_default = CustomCode;
2602
2833
 
2603
2834
  // src/blocks/embed/component-info.ts
2604
- var componentInfo10 = {
2835
+ var componentInfo11 = {
2605
2836
  name: "Embed",
2606
2837
  static: true,
2607
2838
  inputs: [{
@@ -2639,7 +2870,7 @@ var componentInfo10 = {
2639
2870
  };
2640
2871
 
2641
2872
  // src/blocks/embed/embed.tsx
2642
- import { on, createEffect, createMemo as createMemo9, createSignal as createSignal9 } from "solid-js";
2873
+ import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
2643
2874
 
2644
2875
  // src/blocks/embed/helpers.ts
2645
2876
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -2647,9 +2878,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2647
2878
 
2648
2879
  // src/blocks/embed/embed.tsx
2649
2880
  function Embed(props) {
2650
- const [scriptsInserted, setScriptsInserted] = createSignal9([]);
2651
- const [scriptsRun, setScriptsRun] = createSignal9([]);
2652
- const [ranInitFn, setRanInitFn] = createSignal9(false);
2881
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2882
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
2883
+ const [ranInitFn, setRanInitFn] = createSignal11(false);
2653
2884
  function findAndRunScripts() {
2654
2885
  if (!elem || !elem.getElementsByTagName)
2655
2886
  return;
@@ -2673,8 +2904,8 @@ function Embed(props) {
2673
2904
  }
2674
2905
  }
2675
2906
  let elem;
2676
- const onUpdateFn_0_elem = createMemo9(() => elem);
2677
- const onUpdateFn_0_ranInitFn__ = createMemo9(() => ranInitFn());
2907
+ const onUpdateFn_0_elem = createMemo11(() => elem);
2908
+ const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
2678
2909
  function onUpdateFn_0() {
2679
2910
  if (elem && !ranInitFn()) {
2680
2911
  setRanInitFn(true);
@@ -2689,7 +2920,7 @@ function Embed(props) {
2689
2920
  var embed_default = Embed;
2690
2921
 
2691
2922
  // src/blocks/form/form/component-info.ts
2692
- var componentInfo11 = {
2923
+ var componentInfo12 = {
2693
2924
  name: "Form:Form",
2694
2925
  // editableTags: ['builder-form-error']
2695
2926
  defaults: {
@@ -2923,7 +3154,7 @@ var componentInfo11 = {
2923
3154
  };
2924
3155
 
2925
3156
  // src/blocks/form/form/form.tsx
2926
- import { Show as Show8, For as For5, createSignal as createSignal10 } from "solid-js";
3157
+ import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
2927
3158
  import { css as css4 } from "solid-styled-components";
2928
3159
 
2929
3160
  // src/functions/get-env.ts
@@ -2941,9 +3172,9 @@ var get = (obj, path, defaultValue) => {
2941
3172
 
2942
3173
  // src/blocks/form/form/form.tsx
2943
3174
  function FormComponent(props) {
2944
- const [formState, setFormState] = createSignal10("unsubmitted");
2945
- const [responseData, setResponseData] = createSignal10(null);
2946
- const [formErrorMessage, setFormErrorMessage] = createSignal10("");
3175
+ const [formState, setFormState] = createSignal12("unsubmitted");
3176
+ const [responseData, setResponseData] = createSignal12(null);
3177
+ const [formErrorMessage, setFormErrorMessage] = createSignal12("");
2947
3178
  function mergeNewRootState(newData) {
2948
3179
  const combinedState = {
2949
3180
  ...props.builderContext.rootState,
@@ -3139,7 +3370,7 @@ function FormComponent(props) {
3139
3370
  {...{}}
3140
3371
  {...props.attributes}
3141
3372
  >
3142
- <Show8 when={props.builderBlock && props.builderBlock.children}><For5 each={props.builderBlock?.children}>{(block, _index) => {
3373
+ <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
3143
3374
  const idx = _index();
3144
3375
  return <Block_default
3145
3376
  key={`form-block-${idx}`}
@@ -3148,35 +3379,35 @@ function FormComponent(props) {
3148
3379
  registeredComponents={props.builderComponents}
3149
3380
  linkComponent={props.builderLinkComponent}
3150
3381
  />;
3151
- }}</For5></Show8>
3152
- <Show8 when={submissionState() === "error"}><Blocks_default
3382
+ }}</For6></Show9>
3383
+ <Show9 when={submissionState() === "error"}><Blocks_default
3153
3384
  path="errorMessage"
3154
3385
  blocks={props.errorMessage}
3155
3386
  context={props.builderContext}
3156
- /></Show8>
3157
- <Show8 when={submissionState() === "sending"}><Blocks_default
3387
+ /></Show9>
3388
+ <Show9 when={submissionState() === "sending"}><Blocks_default
3158
3389
  path="sendingMessage"
3159
3390
  blocks={props.sendingMessage}
3160
3391
  context={props.builderContext}
3161
- /></Show8>
3162
- <Show8 when={submissionState() === "error" && responseData()}><pre
3392
+ /></Show9>
3393
+ <Show9 when={submissionState() === "error" && responseData()}><pre
3163
3394
  class={"builder-form-error-text " + css4({
3164
3395
  padding: "10px",
3165
3396
  color: "red",
3166
3397
  textAlign: "center"
3167
3398
  })}
3168
- >{JSON.stringify(responseData(), null, 2)}</pre></Show8>
3169
- <Show8 when={submissionState() === "success"}><Blocks_default
3399
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
3400
+ <Show9 when={submissionState() === "success"}><Blocks_default
3170
3401
  path="successMessage"
3171
3402
  blocks={props.successMessage}
3172
3403
  context={props.builderContext}
3173
- /></Show8>
3404
+ /></Show9>
3174
3405
  </form>;
3175
3406
  }
3176
3407
  var form_default = FormComponent;
3177
3408
 
3178
3409
  // src/blocks/form/input/component-info.ts
3179
- var componentInfo12 = {
3410
+ var componentInfo13 = {
3180
3411
  name: "Form:Input",
3181
3412
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3182
3413
  inputs: [
@@ -3246,7 +3477,7 @@ function FormInputComponent(props) {
3246
3477
  var input_default = FormInputComponent;
3247
3478
 
3248
3479
  // src/blocks/form/select/component-info.ts
3249
- var componentInfo13 = {
3480
+ var componentInfo14 = {
3250
3481
  name: "Form:Select",
3251
3482
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3252
3483
  defaultStyles: {
@@ -3291,7 +3522,7 @@ var componentInfo13 = {
3291
3522
  };
3292
3523
 
3293
3524
  // src/blocks/form/select/select.tsx
3294
- import { For as For6 } from "solid-js";
3525
+ import { For as For7 } from "solid-js";
3295
3526
  function SelectComponent(props) {
3296
3527
  return <select
3297
3528
  {...{}}
@@ -3300,15 +3531,15 @@ function SelectComponent(props) {
3300
3531
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
3301
3532
  defaultValue={props.defaultValue}
3302
3533
  name={props.name}
3303
- ><For6 each={props.options}>{(option, _index) => {
3534
+ ><For7 each={props.options}>{(option, _index) => {
3304
3535
  const index = _index();
3305
3536
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
3306
- }}</For6></select>;
3537
+ }}</For7></select>;
3307
3538
  }
3308
3539
  var select_default = SelectComponent;
3309
3540
 
3310
3541
  // src/blocks/form/submit-button/component-info.ts
3311
- var componentInfo14 = {
3542
+ var componentInfo15 = {
3312
3543
  name: "Form:SubmitButton",
3313
3544
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3314
3545
  defaultStyles: {
@@ -3342,7 +3573,7 @@ function SubmitButton(props) {
3342
3573
  var submit_button_default = SubmitButton;
3343
3574
 
3344
3575
  // src/blocks/img/component-info.ts
3345
- var componentInfo15 = {
3576
+ var componentInfo16 = {
3346
3577
  // friendlyName?
3347
3578
  name: "Raw:Img",
3348
3579
  hideFromInsertMenu: true,
@@ -3375,7 +3606,7 @@ function ImgComponent(props) {
3375
3606
  var img_default = ImgComponent;
3376
3607
 
3377
3608
  // src/blocks/video/component-info.ts
3378
- var componentInfo16 = {
3609
+ var componentInfo17 = {
3379
3610
  name: "Video",
3380
3611
  canHaveChildren: true,
3381
3612
  defaultStyles: {
@@ -3459,9 +3690,9 @@ var componentInfo16 = {
3459
3690
  };
3460
3691
 
3461
3692
  // src/blocks/video/video.tsx
3462
- import { Show as Show9, createMemo as createMemo11 } from "solid-js";
3693
+ import { Show as Show10, createMemo as createMemo13 } from "solid-js";
3463
3694
  function Video(props) {
3464
- const videoProps = createMemo11(() => {
3695
+ const videoProps = createMemo13(() => {
3465
3696
  return {
3466
3697
  ...props.autoPlay === true ? {
3467
3698
  autoPlay: true
@@ -3480,7 +3711,7 @@ function Video(props) {
3480
3711
  } : {}
3481
3712
  };
3482
3713
  });
3483
- const spreadProps = createMemo11(() => {
3714
+ const spreadProps = createMemo13(() => {
3484
3715
  return {
3485
3716
  ...videoProps()
3486
3717
  };
@@ -3510,8 +3741,8 @@ function Video(props) {
3510
3741
  }}
3511
3742
  src={props.video || "no-src"}
3512
3743
  poster={props.posterImage}
3513
- ><Show9 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show9></video>
3514
- <Show9
3744
+ ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
3745
+ <Show10
3515
3746
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
3516
3747
  ><div
3517
3748
  style={{
@@ -3520,15 +3751,15 @@ function Video(props) {
3520
3751
  "pointer-events": "none",
3521
3752
  "font-size": "0px"
3522
3753
  }}
3523
- /></Show9>
3524
- <Show9 when={props.builderBlock?.children?.length && props.fitContent}><div
3754
+ /></Show10>
3755
+ <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
3525
3756
  style={{
3526
3757
  display: "flex",
3527
3758
  "flex-direction": "column",
3528
3759
  "align-items": "stretch"
3529
3760
  }}
3530
- >{props.children}</div></Show9>
3531
- <Show9 when={props.builderBlock?.children?.length && !props.fitContent}><div
3761
+ >{props.children}</div></Show10>
3762
+ <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
3532
3763
  style={{
3533
3764
  "pointer-events": "none",
3534
3765
  display: "flex",
@@ -3540,7 +3771,7 @@ function Video(props) {
3540
3771
  width: "100%",
3541
3772
  height: "100%"
3542
3773
  }}
3543
- >{props.children}</div></Show9>
3774
+ >{props.children}</div></Show10>
3544
3775
  </div>;
3545
3776
  }
3546
3777
  var video_default = Video;
@@ -3548,28 +3779,28 @@ var video_default = Video;
3548
3779
  // src/constants/extra-components.ts
3549
3780
  var getExtraComponents = () => [{
3550
3781
  component: custom_code_default,
3551
- ...componentInfo9
3782
+ ...componentInfo10
3552
3783
  }, {
3553
3784
  component: embed_default,
3554
- ...componentInfo10
3785
+ ...componentInfo11
3555
3786
  }, ...TARGET === "rsc" ? [] : [{
3556
3787
  component: form_default,
3557
- ...componentInfo11
3788
+ ...componentInfo12
3558
3789
  }, {
3559
3790
  component: input_default,
3560
- ...componentInfo12
3791
+ ...componentInfo13
3561
3792
  }, {
3562
3793
  component: submit_button_default,
3563
- ...componentInfo14
3794
+ ...componentInfo15
3564
3795
  }, {
3565
3796
  component: select_default,
3566
- ...componentInfo13
3797
+ ...componentInfo14
3567
3798
  }], {
3568
3799
  component: img_default,
3569
- ...componentInfo15
3800
+ ...componentInfo16
3570
3801
  }, {
3571
3802
  component: video_default,
3572
- ...componentInfo16
3803
+ ...componentInfo17
3573
3804
  }];
3574
3805
 
3575
3806
  // src/constants/builder-registered-components.ts
@@ -3596,8 +3827,11 @@ var getDefaultRegisteredComponents = () => [{
3596
3827
  ...componentInfo7
3597
3828
  }, {
3598
3829
  component: text_default,
3830
+ ...componentInfo9
3831
+ }, ...TARGET === "rsc" ? [] : [{
3832
+ component: tabs_default,
3599
3833
  ...componentInfo8
3600
- }, ...getExtraComponents()];
3834
+ }], ...getExtraComponents()];
3601
3835
 
3602
3836
  // src/functions/register-component.ts
3603
3837
  var createRegisterComponentMessage = (info) => ({
@@ -3675,12 +3909,12 @@ var Inlined_script_default = InlinedScript;
3675
3909
 
3676
3910
  // src/components/content/components/enable-editor.tsx
3677
3911
  import {
3678
- Show as Show10,
3912
+ Show as Show11,
3679
3913
  onMount as onMount3,
3680
3914
  on as on2,
3681
3915
  createEffect as createEffect2,
3682
- createMemo as createMemo12,
3683
- createSignal as createSignal12
3916
+ createMemo as createMemo14,
3917
+ createSignal as createSignal14
3684
3918
  } from "solid-js";
3685
3919
  import { Dynamic as Dynamic5 } from "solid-js/web";
3686
3920
 
@@ -4168,7 +4402,7 @@ function isFromTrustedHost(trustedHosts, e) {
4168
4402
  }
4169
4403
 
4170
4404
  // src/constants/sdk-version.ts
4171
- var SDK_VERSION = "1.0.23";
4405
+ var SDK_VERSION = "1.0.25";
4172
4406
 
4173
4407
  // src/functions/register.ts
4174
4408
  var registry = {};
@@ -4365,14 +4599,93 @@ var subscribeToEditor = (model, callback, options) => {
4365
4599
  };
4366
4600
  };
4367
4601
 
4602
+ // src/components/content/components/styles.helpers.ts
4603
+ var getCssFromFont = (font) => {
4604
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4605
+ const name = family.split(",")[0];
4606
+ const url = font.fileUrl ?? font?.files?.regular;
4607
+ let str = "";
4608
+ if (url && family && name) {
4609
+ str += `
4610
+ @font-face {
4611
+ font-family: "${family}";
4612
+ src: local("${name}"), url('${url}') format('woff2');
4613
+ font-display: fallback;
4614
+ font-weight: 400;
4615
+ }
4616
+ `.trim();
4617
+ }
4618
+ if (font.files) {
4619
+ for (const weight in font.files) {
4620
+ const isNumber = String(Number(weight)) === weight;
4621
+ if (!isNumber) {
4622
+ continue;
4623
+ }
4624
+ const weightUrl = font.files[weight];
4625
+ if (weightUrl && weightUrl !== url) {
4626
+ str += `
4627
+ @font-face {
4628
+ font-family: "${family}";
4629
+ src: url('${weightUrl}') format('woff2');
4630
+ font-display: fallback;
4631
+ font-weight: ${weight};
4632
+ }
4633
+ `.trim();
4634
+ }
4635
+ }
4636
+ }
4637
+ return str;
4638
+ };
4639
+ var getFontCss = ({
4640
+ customFonts
4641
+ }) => {
4642
+ return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4643
+ };
4644
+ var getCss = ({
4645
+ cssCode,
4646
+ contentId
4647
+ }) => {
4648
+ if (!cssCode) {
4649
+ return "";
4650
+ }
4651
+ if (!contentId) {
4652
+ return cssCode;
4653
+ }
4654
+ return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4655
+ };
4656
+ var DEFAULT_STYLES = `
4657
+ .builder-button {
4658
+ all: unset;
4659
+ }
4660
+
4661
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4662
+ margin: 0;
4663
+ }
4664
+ .builder-text > p, .builder-text > .builder-paragraph {
4665
+ color: inherit;
4666
+ line-height: inherit;
4667
+ letter-spacing: inherit;
4668
+ font-weight: inherit;
4669
+ font-size: inherit;
4670
+ text-align: inherit;
4671
+ font-family: inherit;
4672
+ }
4673
+ `;
4674
+ var getDefaultStyles = (isNested) => {
4675
+ return !isNested ? DEFAULT_STYLES : "";
4676
+ };
4677
+ var getWrapperClassName = (variationId) => {
4678
+ return `variant-${variationId}`;
4679
+ };
4680
+
4368
4681
  // src/components/content/components/enable-editor.tsx
4369
4682
  function EnableEditor(props) {
4370
- const [ContentWrapper, setContentWrapper] = createSignal12(
4683
+ const [ContentWrapper, setContentWrapper] = createSignal14(
4371
4684
  props.contentWrapper || "div"
4372
4685
  );
4373
- const [httpReqsData, setHttpReqsData] = createSignal12({});
4374
- const [httpReqsPending, setHttpReqsPending] = createSignal12({});
4375
- const [clicked, setClicked] = createSignal12(false);
4686
+ const [httpReqsData, setHttpReqsData] = createSignal14({});
4687
+ const [httpReqsPending, setHttpReqsPending] = createSignal14({});
4688
+ const [clicked, setClicked] = createSignal14(false);
4376
4689
  function mergeNewRootState(newData) {
4377
4690
  const combinedState = {
4378
4691
  ...props.builderContextSignal.rootState,
@@ -4406,6 +4719,12 @@ function EnableEditor(props) {
4406
4719
  content: newContentValue
4407
4720
  }));
4408
4721
  }
4722
+ const showContentProps = createMemo14(() => {
4723
+ return props.showContent ? {} : {
4724
+ hidden: true,
4725
+ "aria-hidden": true
4726
+ };
4727
+ });
4409
4728
  function processMessage(event) {
4410
4729
  return createEditorListener({
4411
4730
  model: props.model,
@@ -4591,14 +4910,14 @@ function EnableEditor(props) {
4591
4910
  runHttpRequests();
4592
4911
  emitStateUpdate();
4593
4912
  });
4594
- const onUpdateFn_0_props_content = createMemo12(() => props.content);
4913
+ const onUpdateFn_0_props_content = createMemo14(() => props.content);
4595
4914
  function onUpdateFn_0() {
4596
4915
  if (props.content) {
4597
4916
  mergeNewContent(props.content);
4598
4917
  }
4599
4918
  }
4600
4919
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4601
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4920
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
4602
4921
  function onUpdateFn_1() {
4603
4922
  evaluateJsCode();
4604
4923
  }
@@ -4608,7 +4927,7 @@ function EnableEditor(props) {
4608
4927
  onUpdateFn_1
4609
4928
  )
4610
4929
  );
4611
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4930
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
4612
4931
  function onUpdateFn_2() {
4613
4932
  runHttpRequests();
4614
4933
  }
@@ -4620,7 +4939,7 @@ function EnableEditor(props) {
4620
4939
  onUpdateFn_2
4621
4940
  )
4622
4941
  );
4623
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
4942
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
4624
4943
  () => props.builderContextSignal.rootState
4625
4944
  );
4626
4945
  function onUpdateFn_3() {
@@ -4632,14 +4951,14 @@ function EnableEditor(props) {
4632
4951
  onUpdateFn_3
4633
4952
  )
4634
4953
  );
4635
- const onUpdateFn_4_props_data = createMemo12(() => props.data);
4954
+ const onUpdateFn_4_props_data = createMemo14(() => props.data);
4636
4955
  function onUpdateFn_4() {
4637
4956
  if (props.data) {
4638
4957
  mergeNewRootState(props.data);
4639
4958
  }
4640
4959
  }
4641
4960
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4642
- const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
4961
+ const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
4643
4962
  function onUpdateFn_5() {
4644
4963
  if (props.locale) {
4645
4964
  mergeNewRootState({
@@ -4648,106 +4967,27 @@ function EnableEditor(props) {
4648
4967
  }
4649
4968
  }
4650
4969
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4651
- return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
4652
- class={`variant-${props.content?.testVariationId || props.content?.id}`}
4970
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
4971
+ class={getWrapperClassName(
4972
+ props.content?.testVariationId || props.content?.id
4973
+ )}
4653
4974
  {...{}}
4654
4975
  ref={elementRef}
4655
4976
  onClick={(event) => onClick(event)}
4656
4977
  builder-content-id={props.builderContextSignal.content?.id}
4657
4978
  builder-model={props.model}
4658
4979
  {...{}}
4659
- {...props.showContent ? {} : {
4660
- hidden: true,
4661
- "aria-hidden": true
4662
- }}
4980
+ {...showContentProps()}
4663
4981
  {...props.contentWrapperProps}
4664
4982
  component={ContentWrapper()}
4665
- >{props.children}</Dynamic5></Show10></builder_context_default.Provider>;
4983
+ >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
4666
4984
  }
4667
4985
  var Enable_editor_default = EnableEditor;
4668
4986
 
4669
4987
  // src/components/content/components/styles.tsx
4670
- import { createSignal as createSignal13 } from "solid-js";
4671
-
4672
- // src/components/content/components/styles.helpers.ts
4673
- var getCssFromFont = (font) => {
4674
- const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4675
- const name = family.split(",")[0];
4676
- const url = font.fileUrl ?? font?.files?.regular;
4677
- let str = "";
4678
- if (url && family && name) {
4679
- str += `
4680
- @font-face {
4681
- font-family: "${family}";
4682
- src: local("${name}"), url('${url}') format('woff2');
4683
- font-display: fallback;
4684
- font-weight: 400;
4685
- }
4686
- `.trim();
4687
- }
4688
- if (font.files) {
4689
- for (const weight in font.files) {
4690
- const isNumber = String(Number(weight)) === weight;
4691
- if (!isNumber) {
4692
- continue;
4693
- }
4694
- const weightUrl = font.files[weight];
4695
- if (weightUrl && weightUrl !== url) {
4696
- str += `
4697
- @font-face {
4698
- font-family: "${family}";
4699
- src: url('${weightUrl}') format('woff2');
4700
- font-display: fallback;
4701
- font-weight: ${weight};
4702
- }
4703
- `.trim();
4704
- }
4705
- }
4706
- }
4707
- return str;
4708
- };
4709
- var getFontCss = ({
4710
- customFonts
4711
- }) => {
4712
- return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4713
- };
4714
- var getCss = ({
4715
- cssCode,
4716
- contentId
4717
- }) => {
4718
- if (!cssCode) {
4719
- return "";
4720
- }
4721
- if (!contentId) {
4722
- return cssCode;
4723
- }
4724
- return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4725
- };
4726
- var DEFAULT_STYLES = `
4727
- .builder-button {
4728
- all: unset;
4729
- }
4730
-
4731
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4732
- margin: 0;
4733
- }
4734
- .builder-text > p, .builder-text > .builder-paragraph {
4735
- color: inherit;
4736
- line-height: inherit;
4737
- letter-spacing: inherit;
4738
- font-weight: inherit;
4739
- font-size: inherit;
4740
- text-align: inherit;
4741
- font-family: inherit;
4742
- }
4743
- `;
4744
- var getDefaultStyles = (isNested) => {
4745
- return !isNested ? DEFAULT_STYLES : "";
4746
- };
4747
-
4748
- // src/components/content/components/styles.tsx
4988
+ import { createSignal as createSignal15 } from "solid-js";
4749
4989
  function ContentStyles(props) {
4750
- const [injectedStyles, setInjectedStyles] = createSignal13(
4990
+ const [injectedStyles, setInjectedStyles] = createSignal15(
4751
4991
  `
4752
4992
  ${getCss({
4753
4993
  cssCode: props.cssCode,
@@ -4804,7 +5044,7 @@ var getContentInitialValue = ({
4804
5044
 
4805
5045
  // src/components/content/content.tsx
4806
5046
  function ContentComponent(props) {
4807
- const [scriptStr, setScriptStr] = createSignal14(
5047
+ const [scriptStr, setScriptStr] = createSignal16(
4808
5048
  getUpdateVariantVisibilityScript({
4809
5049
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
4810
5050
  variationId: props.content?.testVariationId,
@@ -4812,7 +5052,7 @@ function ContentComponent(props) {
4812
5052
  contentId: props.content?.id
4813
5053
  })
4814
5054
  );
4815
- const [registeredComponents, setRegisteredComponents] = createSignal14(
5055
+ const [registeredComponents, setRegisteredComponents] = createSignal16(
4816
5056
  [
4817
5057
  ...getDefaultRegisteredComponents(),
4818
5058
  ...props.customComponents || []
@@ -4827,7 +5067,7 @@ function ContentComponent(props) {
4827
5067
  {}
4828
5068
  )
4829
5069
  );
4830
- const [builderContextSignal, setBuilderContextSignal] = createSignal14({
5070
+ const [builderContextSignal, setBuilderContextSignal] = createSignal16({
4831
5071
  content: getContentInitialValue({
4832
5072
  content: props.content,
4833
5073
  data: props.data
@@ -4885,16 +5125,16 @@ function ContentComponent(props) {
4885
5125
  setBuilderContextSignal
4886
5126
  }}
4887
5127
  >
4888
- <Show11 when={props.isSsrAbTest}><Inlined_script_default
5128
+ <Show12 when={props.isSsrAbTest}><Inlined_script_default
4889
5129
  id="builderio-variant-visibility"
4890
5130
  scriptStr={scriptStr()}
4891
- /></Show11>
4892
- <Show11 when={TARGET !== "reactNative"}><Styles_default
5131
+ /></Show12>
5132
+ <Show12 when={TARGET !== "reactNative"}><Styles_default
4893
5133
  isNestedRender={props.isNestedRender}
4894
5134
  contentId={builderContextSignal().content?.id}
4895
5135
  cssCode={builderContextSignal().content?.data?.cssCode}
4896
5136
  customFonts={builderContextSignal().content?.data?.customFonts}
4897
- /></Show11>
5137
+ /></Show12>
4898
5138
  <Blocks_default
4899
5139
  blocks={builderContextSignal().content?.data?.blocks}
4900
5140
  context={builderContextSignal()}
@@ -4907,13 +5147,13 @@ var Content_default = ContentComponent;
4907
5147
 
4908
5148
  // src/components/content-variants/content-variants.tsx
4909
5149
  function ContentVariants(props) {
4910
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal15(
5150
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
4911
5151
  checkShouldRenderVariants({
4912
5152
  canTrack: getDefaultCanTrack(props.canTrack),
4913
5153
  content: props.content
4914
5154
  })
4915
5155
  );
4916
- const updateCookieAndStylesScriptStr = createMemo15(() => {
5156
+ const updateCookieAndStylesScriptStr = createMemo17(() => {
4917
5157
  return getUpdateCookieAndStylesScript(
4918
5158
  getVariants(props.content).map((value) => ({
4919
5159
  id: value.testVariationId,
@@ -4922,10 +5162,10 @@ function ContentVariants(props) {
4922
5162
  props.content?.id || ""
4923
5163
  );
4924
5164
  });
4925
- const hideVariantsStyleString = createMemo15(() => {
5165
+ const hideVariantsStyleString = createMemo17(() => {
4926
5166
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
4927
5167
  });
4928
- const defaultContent = createMemo15(() => {
5168
+ const defaultContent = createMemo17(() => {
4929
5169
  return shouldRenderVariants() ? {
4930
5170
  ...props.content,
4931
5171
  testVariationId: props.content?.id
@@ -4938,11 +5178,11 @@ function ContentVariants(props) {
4938
5178
  setShouldRenderVariants(false);
4939
5179
  });
4940
5180
  return <>
4941
- <Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5181
+ <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
4942
5182
  id="builderio-init-variants-fns"
4943
5183
  scriptStr={getInitVariantsFnsScriptString()}
4944
- /></Show12>
4945
- <Show12 when={shouldRenderVariants()}>
5184
+ /></Show13>
5185
+ <Show13 when={shouldRenderVariants()}>
4946
5186
  <Inlined_styles_default
4947
5187
  id="builderio-variants"
4948
5188
  styles={hideVariantsStyleString()}
@@ -4951,7 +5191,7 @@ function ContentVariants(props) {
4951
5191
  id="builderio-variants-visibility"
4952
5192
  scriptStr={updateCookieAndStylesScriptStr()}
4953
5193
  />
4954
- <For7 each={getVariants(props.content)}>{(variant, _index) => {
5194
+ <For8 each={getVariants(props.content)}>{(variant, _index) => {
4955
5195
  const index = _index();
4956
5196
  return <Content_default
4957
5197
  isNestedRender={props.isNestedRender}
@@ -4975,8 +5215,8 @@ function ContentVariants(props) {
4975
5215
  contentWrapperProps={props.contentWrapperProps}
4976
5216
  trustedHosts={props.trustedHosts}
4977
5217
  />;
4978
- }}</For7>
4979
- </Show12>
5218
+ }}</For8>
5219
+ </Show13>
4980
5220
  <Content_default
4981
5221
  isNestedRender={props.isNestedRender}
4982
5222
  {...{}}
@@ -5029,8 +5269,14 @@ var fetchSymbolContent = async ({
5029
5269
 
5030
5270
  // src/blocks/symbol/symbol.tsx
5031
5271
  function Symbol(props) {
5032
- const [contentToUse, setContentToUse] = createSignal16(props.symbol?.content);
5033
- const className = createMemo16(() => {
5272
+ const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
5273
+ const blocksWrapper = createMemo18(() => {
5274
+ return "div";
5275
+ });
5276
+ const contentWrapper = createMemo18(() => {
5277
+ return "div";
5278
+ });
5279
+ const className = createMemo18(() => {
5034
5280
  return [
5035
5281
  ...[props.attributes[getClassPropName()]],
5036
5282
  "builder-symbol",
@@ -5052,7 +5298,7 @@ function Symbol(props) {
5052
5298
  }
5053
5299
  onMount5(() => {
5054
5300
  });
5055
- const onUpdateFn_0_props_symbol = createMemo16(() => props.symbol);
5301
+ const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
5056
5302
  function onUpdateFn_0() {
5057
5303
  setContent();
5058
5304
  }
@@ -5074,8 +5320,8 @@ function Symbol(props) {
5074
5320
  model={props.symbol?.model}
5075
5321
  content={contentToUse()}
5076
5322
  linkComponent={props.builderLinkComponent}
5077
- blocksWrapper="div"
5078
- contentWrapper="div"
5323
+ blocksWrapper={blocksWrapper()}
5324
+ contentWrapper={contentWrapper()}
5079
5325
  /></div>;
5080
5326
  }
5081
5327
  var symbol_default = Symbol;