@builder.io/sdk-solid 1.0.23 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,14 +46,15 @@ var getClassPropName = () => {
46
46
  case "vue":
47
47
  case "solid":
48
48
  case "qwik":
49
+ case "angular":
49
50
  return "class";
50
51
  }
51
52
  };
52
53
 
53
54
  // src/blocks/button/button.tsx
54
55
  function Button(props) {
55
- return <Dynamic_renderer_default
56
- attributes={{
56
+ function attrs() {
57
+ return {
57
58
  ...props.attributes,
58
59
  [getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
59
60
  ...props.link ? {
@@ -63,7 +64,10 @@ function Button(props) {
63
64
  } : {
64
65
  role: "button"
65
66
  }
66
- }}
67
+ };
68
+ }
69
+ return <Dynamic_renderer_default
70
+ attributes={attrs()}
67
71
  TagName={props.link ? props.builderLinkComponent || "a" : "button"}
68
72
  actionAttributes={{}}
69
73
  >{props.text}</Dynamic_renderer_default>;
@@ -71,7 +75,7 @@ function Button(props) {
71
75
  var button_default = Button;
72
76
 
73
77
  // src/blocks/columns/columns.tsx
74
- import { Show as Show6, For as For4, createSignal as createSignal6, createMemo as createMemo6 } from "solid-js";
78
+ import { Show as Show6, For as For4, createSignal as createSignal7 } from "solid-js";
75
79
  import { css as css2 } from "solid-styled-components";
76
80
 
77
81
  // src/components/blocks/blocks.tsx
@@ -99,7 +103,7 @@ import { createContext as createContext2 } from "solid-js";
99
103
  var components_context_default = createContext2({ registeredComponents: {} });
100
104
 
101
105
  // src/components/block/block.tsx
102
- import { Show as Show4, For as For2, onMount, createMemo as createMemo4 } from "solid-js";
106
+ import { Show as Show4, For as For2, onMount, createMemo as createMemo5 } from "solid-js";
103
107
 
104
108
  // src/functions/get-block-component-options.ts
105
109
  function getBlockComponentOptions(block) {
@@ -361,16 +365,17 @@ function theFunction() {
361
365
  ${code}
362
366
  }
363
367
 
364
- let output = theFunction()
368
+ const output = theFunction()
365
369
 
366
370
  if (typeof output === 'object' && output !== null) {
367
- output = JSON.stringify(output.copySync ? output.copySync() : output);
371
+ return JSON.stringify(output.copySync ? output.copySync() : output);
372
+ } else {
373
+ return output;
368
374
  }
369
-
370
- output;
371
375
  `;
372
376
  };
373
377
  var IVM_INSTANCE = null;
378
+ var IVM_CONTEXT = null;
374
379
  var getIvm = () => {
375
380
  try {
376
381
  if (IVM_INSTANCE)
@@ -390,12 +395,25 @@ var getIvm = () => {
390
395
  Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
391
396
  `);
392
397
  };
393
- var getIsolateContext = () => {
398
+ function setIsolateContext(options = {
399
+ memoryLimit: 128
400
+ }) {
394
401
  const ivm = getIvm();
395
- const isolate = new ivm.Isolate({
396
- memoryLimit: 128
402
+ const isolate = new ivm.Isolate(options);
403
+ const context = isolate.createContextSync();
404
+ const jail = context.global;
405
+ jail.setSync("global", jail.derefInto());
406
+ jail.setSync("log", function(...logArgs) {
397
407
  });
398
- return isolate.createContextSync();
408
+ jail.setSync(INJECTED_IVM_GLOBAL, ivm);
409
+ IVM_CONTEXT = context;
410
+ return context;
411
+ }
412
+ var getIsolateContext = () => {
413
+ if (IVM_CONTEXT)
414
+ return IVM_CONTEXT;
415
+ const context = setIsolateContext();
416
+ return context;
399
417
  };
400
418
  var runInNode = ({
401
419
  code,
@@ -419,9 +437,6 @@ var runInNode = ({
419
437
  });
420
438
  const isolateContext = getIsolateContext();
421
439
  const jail = isolateContext.global;
422
- jail.setSync("global", jail.derefInto());
423
- jail.setSync("log", function(...logArgs) {
424
- });
425
440
  jail.setSync(BUILDER_SET_STATE_NAME, function(key, value) {
426
441
  set(rootState, key, value);
427
442
  rootSetState?.(rootState);
@@ -436,12 +451,11 @@ var runInNode = ({
436
451
  ) : null;
437
452
  jail.setSync(getSyncValName(key), val);
438
453
  });
439
- jail.setSync(INJECTED_IVM_GLOBAL, ivm);
440
454
  const evalStr = processCode({
441
455
  code,
442
456
  args
443
457
  });
444
- const resultStr = isolateContext.evalSync(evalStr);
458
+ const resultStr = isolateContext.evalClosureSync(evalStr);
445
459
  try {
446
460
  const res = JSON.parse(resultStr);
447
461
  return res;
@@ -841,6 +855,7 @@ function mapStyleObjToStrIfNeeded(style) {
841
855
  case "svelte":
842
856
  case "vue":
843
857
  case "solid":
858
+ case "angular":
844
859
  return convertStyleMapToCSSArray(style).join(" ");
845
860
  case "qwik":
846
861
  case "reactNative":
@@ -913,6 +928,12 @@ var getRepeatItemData = ({
913
928
  }));
914
929
  return repeatArray;
915
930
  };
931
+ var shouldPassLinkComponent = (block) => {
932
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
933
+ };
934
+ var shouldPassRegisteredComponents = (block) => {
935
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
936
+ };
916
937
 
917
938
  // src/components/block/components/block-styles.tsx
918
939
  import { Show as Show2, createMemo } from "solid-js";
@@ -1156,15 +1177,15 @@ function BlockWrapper(props) {
1156
1177
  var Block_wrapper_default = BlockWrapper;
1157
1178
 
1158
1179
  // src/components/block/components/component-ref/component-ref.tsx
1159
- import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
1180
+ import { Show as Show3, For, createSignal as createSignal3 } from "solid-js";
1160
1181
  import { Dynamic as Dynamic3 } from "solid-js/web";
1161
1182
 
1162
1183
  // src/components/block/components/interactive-element.tsx
1184
+ import { createMemo as createMemo2 } from "solid-js";
1163
1185
  import { Dynamic as Dynamic2 } from "solid-js/web";
1164
1186
  function InteractiveElement(props) {
1165
- return <Dynamic2
1166
- {...props.wrapperProps}
1167
- attributes={props.includeBlockProps ? {
1187
+ const attributes = createMemo2(() => {
1188
+ return props.includeBlockProps ? {
1168
1189
  ...getBlockProperties({
1169
1190
  block: props.block,
1170
1191
  context: props.context
@@ -1176,7 +1197,11 @@ function InteractiveElement(props) {
1176
1197
  localState: props.context.localState,
1177
1198
  context: props.context.context
1178
1199
  })
1179
- } : {}}
1200
+ } : {};
1201
+ });
1202
+ return <Dynamic2
1203
+ {...props.wrapperProps}
1204
+ attributes={attributes()}
1180
1205
  component={props.Wrapper}
1181
1206
  >{props.children}</Dynamic2>;
1182
1207
  }
@@ -1217,7 +1242,7 @@ var getWrapperProps = ({
1217
1242
 
1218
1243
  // src/components/block/components/component-ref/component-ref.tsx
1219
1244
  function ComponentRef(props) {
1220
- const [Wrapper, setWrapper] = createSignal2(
1245
+ const [Wrapper, setWrapper] = createSignal3(
1221
1246
  props.isInteractive ? interactive_element_default : props.componentRef
1222
1247
  );
1223
1248
  return <Show3 when={props.componentRef}><Dynamic3
@@ -1246,9 +1271,9 @@ function ComponentRef(props) {
1246
1271
  var Component_ref_default = ComponentRef;
1247
1272
 
1248
1273
  // src/components/block/components/repeated-block.tsx
1249
- import { createSignal as createSignal3 } from "solid-js";
1274
+ import { createSignal as createSignal4 } from "solid-js";
1250
1275
  function RepeatedBlock(props) {
1251
- const [store, setStore] = createSignal3(props.repeatContext);
1276
+ const [store, setStore] = createSignal4(props.repeatContext);
1252
1277
  return <builder_context_default.Provider value={store()}><Block_default
1253
1278
  block={props.block}
1254
1279
  context={store()}
@@ -1260,20 +1285,20 @@ var Repeated_block_default = RepeatedBlock;
1260
1285
 
1261
1286
  // src/components/block/block.tsx
1262
1287
  function Block(props) {
1263
- const blockComponent = createMemo4(() => {
1288
+ const blockComponent = createMemo5(() => {
1264
1289
  return getComponent({
1265
1290
  block: props.block,
1266
1291
  context: props.context,
1267
1292
  registeredComponents: props.registeredComponents
1268
1293
  });
1269
1294
  });
1270
- const repeatItem = createMemo4(() => {
1295
+ const repeatItem = createMemo5(() => {
1271
1296
  return getRepeatItemData({
1272
1297
  block: props.block,
1273
1298
  context: props.context
1274
1299
  });
1275
1300
  });
1276
- const processedBlock = createMemo4(() => {
1301
+ const processedBlock = createMemo5(() => {
1277
1302
  return props.block.repeat?.collection ? props.block : getProcessedBlock({
1278
1303
  block: props.block,
1279
1304
  localState: props.context.localState,
@@ -1283,14 +1308,14 @@ function Block(props) {
1283
1308
  shouldEvaluateBindings: true
1284
1309
  });
1285
1310
  });
1286
- const Tag = createMemo4(() => {
1311
+ const Tag = createMemo5(() => {
1287
1312
  const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
1288
1313
  if (shouldUseLink) {
1289
1314
  return props.linkComponent || "a";
1290
1315
  }
1291
1316
  return props.block.tagName || "div";
1292
1317
  });
1293
- const canShowBlock = createMemo4(() => {
1318
+ const canShowBlock = createMemo5(() => {
1294
1319
  if (props.block.repeat?.collection) {
1295
1320
  if (repeatItem()?.length)
1296
1321
  return true;
@@ -1300,21 +1325,21 @@ function Block(props) {
1300
1325
  const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
1301
1326
  return shouldShow && !shouldHide;
1302
1327
  });
1303
- const childrenWithoutParentComponent = createMemo4(() => {
1328
+ const childrenWithoutParentComponent = createMemo5(() => {
1304
1329
  const shouldRenderChildrenOutsideRef = !blockComponent()?.component && !repeatItem();
1305
1330
  return shouldRenderChildrenOutsideRef ? processedBlock().children ?? [] : [];
1306
1331
  });
1307
- const componentRefProps = createMemo4(() => {
1332
+ const componentRefProps = createMemo5(() => {
1308
1333
  return {
1309
1334
  blockChildren: processedBlock().children ?? [],
1310
1335
  componentRef: blockComponent()?.component,
1311
1336
  componentOptions: {
1312
1337
  ...getBlockComponentOptions(processedBlock()),
1313
1338
  builderContext: props.context,
1314
- ...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1339
+ ...shouldPassLinkComponent(blockComponent()) ? {
1315
1340
  builderLinkComponent: props.linkComponent
1316
1341
  } : {},
1317
- ...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1342
+ ...shouldPassRegisteredComponents(blockComponent()) ? {
1318
1343
  builderComponents: props.registeredComponents
1319
1344
  } : {}
1320
1345
  },
@@ -1398,11 +1423,11 @@ function Block(props) {
1398
1423
  var Block_default = Block;
1399
1424
 
1400
1425
  // src/components/blocks/blocks-wrapper.tsx
1401
- import { createMemo as createMemo5 } from "solid-js";
1426
+ import { createMemo as createMemo6 } from "solid-js";
1402
1427
  import { Dynamic as Dynamic4 } from "solid-js/web";
1403
1428
  import { css } from "solid-styled-components";
1404
1429
  function BlocksWrapper(props) {
1405
- const className = createMemo5(() => {
1430
+ const className = createMemo6(() => {
1406
1431
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
1407
1432
  });
1408
1433
  function onClick() {
@@ -1476,16 +1501,24 @@ function Blocks(props) {
1476
1501
  }
1477
1502
  var Blocks_default = Blocks;
1478
1503
 
1504
+ // src/blocks/columns/helpers.ts
1505
+ var getColumnsClass = (id) => {
1506
+ return `builder-columns ${id}-breakpoints`;
1507
+ };
1508
+
1479
1509
  // src/blocks/columns/columns.tsx
1480
1510
  function Columns(props) {
1481
- const [gutterSize, setGutterSize] = createSignal6(
1511
+ const [gutterSize, setGutterSize] = createSignal7(
1482
1512
  typeof props.space === "number" ? props.space || 0 : 20
1483
1513
  );
1484
- const [cols, setCols] = createSignal6(props.columns || []);
1485
- const [stackAt, setStackAt] = createSignal6(props.stackColumnsAt || "tablet");
1486
- const [flexDir, setFlexDir] = createSignal6(
1514
+ const [cols, setCols] = createSignal7(props.columns || []);
1515
+ const [stackAt, setStackAt] = createSignal7(props.stackColumnsAt || "tablet");
1516
+ const [flexDir, setFlexDir] = createSignal7(
1487
1517
  props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column"
1488
1518
  );
1519
+ function getTagName(column) {
1520
+ return column.link ? props.builderLinkComponent || "a" : "div";
1521
+ }
1489
1522
  function getWidth(index) {
1490
1523
  return cols()[index]?.width || 100 / cols().length;
1491
1524
  }
@@ -1505,7 +1538,7 @@ function Columns(props) {
1505
1538
  }) {
1506
1539
  return stackAt() === "never" ? desktopStyle : stackedStyle;
1507
1540
  }
1508
- const columnsCssVars = createMemo6(() => {
1541
+ function columnsCssVars() {
1509
1542
  return {
1510
1543
  "--flex-dir": flexDir(),
1511
1544
  "--flex-dir-tablet": getTabletStyle({
@@ -1513,7 +1546,7 @@ function Columns(props) {
1513
1546
  desktopStyle: "row"
1514
1547
  })
1515
1548
  };
1516
- });
1549
+ }
1517
1550
  function columnCssVars(index) {
1518
1551
  const gutter = index === 0 ? 0 : gutterSize();
1519
1552
  const width = getColumnCssWidth(index);
@@ -1554,7 +1587,7 @@ function Columns(props) {
1554
1587
  );
1555
1588
  return breakpointSizes[size].max;
1556
1589
  }
1557
- const columnsStyles = createMemo6(() => {
1590
+ function columnsStyles() {
1558
1591
  return `
1559
1592
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
1560
1593
  .${props.builderBlock.id}-breakpoints {
@@ -1580,9 +1613,19 @@ function Columns(props) {
1580
1613
  }
1581
1614
  },
1582
1615
  `;
1583
- });
1616
+ }
1617
+ function getAttributes(column, index) {
1618
+ return {
1619
+ ...{},
1620
+ ...column.link ? {
1621
+ href: column.link
1622
+ } : {},
1623
+ [getClassPropName()]: "builder-column",
1624
+ style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1625
+ };
1626
+ }
1584
1627
  return <div
1585
- class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
1628
+ class={getColumnsClass(props.builderBlock?.id) + " " + css2({
1586
1629
  display: "flex",
1587
1630
  lineHeight: "normal"
1588
1631
  })}
@@ -1597,16 +1640,9 @@ function Columns(props) {
1597
1640
  const index = _index();
1598
1641
  return <Dynamic_renderer_default
1599
1642
  key={index}
1600
- TagName={column.link ? props.builderLinkComponent || "a" : "div"}
1643
+ TagName={getTagName(column)}
1601
1644
  actionAttributes={{}}
1602
- attributes={{
1603
- ...{},
1604
- ...column.link ? {
1605
- href: column.link
1606
- } : {},
1607
- [getClassPropName()]: "builder-column",
1608
- style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1609
- }}
1645
+ attributes={getAttributes(column, index)}
1610
1646
  ><Blocks_default
1611
1647
  path={`component.options.columns.${index}.blocks`}
1612
1648
  parent={props.builderBlock.id}
@@ -1630,7 +1666,7 @@ function FragmentComponent(props) {
1630
1666
  var fragment_default = FragmentComponent;
1631
1667
 
1632
1668
  // src/blocks/image/image.tsx
1633
- import { Show as Show7, createMemo as createMemo7 } from "solid-js";
1669
+ import { Show as Show7, createMemo as createMemo8 } from "solid-js";
1634
1670
  import { css as css3 } from "solid-styled-components";
1635
1671
 
1636
1672
  // src/blocks/image/image.helpers.ts
@@ -1682,7 +1718,7 @@ function getSrcSet(url) {
1682
1718
 
1683
1719
  // src/blocks/image/image.tsx
1684
1720
  function Image(props) {
1685
- const srcSetToUse = createMemo7(() => {
1721
+ const srcSetToUse = createMemo8(() => {
1686
1722
  const imageToUse = props.image || props.src;
1687
1723
  const url = imageToUse;
1688
1724
  if (!url || // We can auto add srcset for cdn.builder.io and shopify
@@ -1699,14 +1735,14 @@ function Image(props) {
1699
1735
  }
1700
1736
  return getSrcSet(url);
1701
1737
  });
1702
- const webpSrcSet = createMemo7(() => {
1738
+ const webpSrcSet = createMemo8(() => {
1703
1739
  if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
1704
1740
  return srcSetToUse().replace(/\?/g, "?format=webp&");
1705
1741
  } else {
1706
1742
  return "";
1707
1743
  }
1708
1744
  });
1709
- const aspectRatioCss = createMemo7(() => {
1745
+ const aspectRatioCss = createMemo8(() => {
1710
1746
  const aspectRatioStyles = {
1711
1747
  position: "absolute",
1712
1748
  height: "100%",
@@ -1751,7 +1787,7 @@ function Image(props) {
1751
1787
  }}
1752
1788
  /></Show7>
1753
1789
  <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
1754
- <Show7 when={!props.fitContent && props.children}><div
1790
+ <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div
1755
1791
  class={css3({
1756
1792
  display: "flex",
1757
1793
  flexDirection: "column",
@@ -1789,10 +1825,10 @@ function SectionComponent(props) {
1789
1825
  var section_default = SectionComponent;
1790
1826
 
1791
1827
  // src/blocks/symbol/symbol.tsx
1792
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo16, createSignal as createSignal16 } from "solid-js";
1828
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
1793
1829
 
1794
1830
  // src/components/content-variants/content-variants.tsx
1795
- import { Show as Show12, For as For7, onMount as onMount4, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
1831
+ import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
1796
1832
 
1797
1833
  // src/helpers/url.ts
1798
1834
  var getTopLevelDomain = (host) => {
@@ -1986,7 +2022,7 @@ var handleABTesting = async ({
1986
2022
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1987
2023
 
1988
2024
  // src/components/content/content.tsx
1989
- import { Show as Show11, createSignal as createSignal14 } from "solid-js";
2025
+ import { Show as Show12, createSignal as createSignal16 } from "solid-js";
1990
2026
 
1991
2027
  // src/blocks/button/component-info.ts
1992
2028
  var componentInfo = {
@@ -2487,8 +2523,203 @@ var componentInfo7 = {
2487
2523
  }]
2488
2524
  };
2489
2525
 
2490
- // src/blocks/text/component-info.ts
2526
+ // src/blocks/tabs/component-info.ts
2527
+ var defaultTab = {
2528
+ "@type": "@builder.io/sdk:Element",
2529
+ responsiveStyles: {
2530
+ large: {
2531
+ paddingLeft: "20px",
2532
+ paddingRight: "20px",
2533
+ paddingTop: "10px",
2534
+ paddingBottom: "10px",
2535
+ minWidth: "100px",
2536
+ textAlign: "center",
2537
+ display: "flex",
2538
+ flexDirection: "column",
2539
+ cursor: "pointer",
2540
+ userSelect: "none"
2541
+ }
2542
+ },
2543
+ component: {
2544
+ name: "Text",
2545
+ options: {
2546
+ text: "New tab"
2547
+ }
2548
+ }
2549
+ };
2550
+ var defaultElement = {
2551
+ "@type": "@builder.io/sdk:Element",
2552
+ responsiveStyles: {
2553
+ large: {
2554
+ height: "200px",
2555
+ display: "flex",
2556
+ marginTop: "20px",
2557
+ flexDirection: "column"
2558
+ }
2559
+ },
2560
+ component: {
2561
+ name: "Text",
2562
+ options: {
2563
+ text: "New tab content "
2564
+ }
2565
+ }
2566
+ };
2491
2567
  var componentInfo8 = {
2568
+ name: "Builder: Tabs",
2569
+ inputs: [{
2570
+ name: "tabs",
2571
+ type: "list",
2572
+ broadcast: true,
2573
+ subFields: [{
2574
+ name: "label",
2575
+ type: "uiBlocks",
2576
+ hideFromUI: true,
2577
+ defaultValue: [defaultTab]
2578
+ }, {
2579
+ name: "content",
2580
+ type: "uiBlocks",
2581
+ hideFromUI: true,
2582
+ defaultValue: [defaultElement]
2583
+ }],
2584
+ defaultValue: [{
2585
+ label: [{
2586
+ ...defaultTab,
2587
+ component: {
2588
+ name: "Text",
2589
+ options: {
2590
+ text: "Tab 1"
2591
+ }
2592
+ }
2593
+ }],
2594
+ content: [{
2595
+ ...defaultElement,
2596
+ component: {
2597
+ name: "Text",
2598
+ options: {
2599
+ text: "Tab 1 content"
2600
+ }
2601
+ }
2602
+ }]
2603
+ }, {
2604
+ label: [{
2605
+ ...defaultTab,
2606
+ component: {
2607
+ name: "Text",
2608
+ options: {
2609
+ text: "Tab 2"
2610
+ }
2611
+ }
2612
+ }],
2613
+ content: [{
2614
+ ...defaultElement,
2615
+ component: {
2616
+ name: "Text",
2617
+ options: {
2618
+ text: "Tab 2 content"
2619
+ }
2620
+ }
2621
+ }]
2622
+ }]
2623
+ }, {
2624
+ name: "activeTabStyle",
2625
+ type: "uiStyle",
2626
+ helperText: "CSS styles for the active tab",
2627
+ defaultValue: {
2628
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
2629
+ }
2630
+ }, {
2631
+ name: "defaultActiveTab",
2632
+ type: "number",
2633
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
2634
+ defaultValue: 1,
2635
+ advanced: true
2636
+ }, {
2637
+ name: "collapsible",
2638
+ type: "boolean",
2639
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
2640
+ defaultValue: false,
2641
+ advanced: true
2642
+ }, {
2643
+ name: "tabHeaderLayout",
2644
+ type: "enum",
2645
+ helperText: "Change the layout of the tab headers (uses justify-content)",
2646
+ defaultValue: "flex-start",
2647
+ enum: [{
2648
+ label: "Center",
2649
+ value: "center"
2650
+ }, {
2651
+ label: "Space between",
2652
+ value: "space-between"
2653
+ }, {
2654
+ label: "Space around",
2655
+ value: "space-around"
2656
+ }, {
2657
+ label: "Left",
2658
+ value: "flex-start"
2659
+ }, {
2660
+ label: "Right",
2661
+ value: "flex-end"
2662
+ }]
2663
+ }]
2664
+ };
2665
+
2666
+ // src/blocks/tabs/tabs.tsx
2667
+ import { Show as Show8, For as For5, createSignal as createSignal9 } from "solid-js";
2668
+ function Tabs(props) {
2669
+ const [activeTab, setActiveTab] = createSignal9(
2670
+ props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
2671
+ );
2672
+ function activeTabContent(active) {
2673
+ return props.tabs && props.tabs[active].content;
2674
+ }
2675
+ function getActiveTabStyle(index) {
2676
+ return activeTab() === index ? props.activeTabStyle : {};
2677
+ }
2678
+ return <div>
2679
+ <div
2680
+ class="builder-tabs-wrap"
2681
+ style={{
2682
+ display: "flex",
2683
+ "flex-direction": "row",
2684
+ "justify-content": props.tabHeaderLayout || "flex-start",
2685
+ overflow: "auto"
2686
+ }}
2687
+ ><For5 each={props.tabs}>{(tab, _index) => {
2688
+ const index = _index();
2689
+ return <span
2690
+ class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2691
+ key={index}
2692
+ style={getActiveTabStyle(index)}
2693
+ onClick={(event) => {
2694
+ if (index === activeTab() && props.collapsible) {
2695
+ setActiveTab(-1);
2696
+ } else {
2697
+ setActiveTab(index);
2698
+ }
2699
+ }}
2700
+ ><Blocks_default
2701
+ parent={props.builderBlock.id}
2702
+ path={`component.options.tabs.${index}.label`}
2703
+ blocks={tab.label}
2704
+ context={props.builderContext}
2705
+ registeredComponents={props.builderComponents}
2706
+ linkComponent={props.builderLinkComponent}
2707
+ /></span>;
2708
+ }}</For5></div>
2709
+ <Show8 when={activeTabContent(activeTab())}><div><Blocks_default
2710
+ parent={props.builderBlock.id}
2711
+ path={`component.options.tabs.${activeTab()}.content`}
2712
+ blocks={activeTabContent(activeTab())}
2713
+ context={props.builderContext}
2714
+ registeredComponents={props.builderComponents}
2715
+ linkComponent={props.builderLinkComponent}
2716
+ /></div></Show8>
2717
+ </div>;
2718
+ }
2719
+ var tabs_default = Tabs;
2720
+
2721
+ // src/blocks/text/component-info.ts
2722
+ var componentInfo9 = {
2492
2723
  name: "Text",
2493
2724
  static: true,
2494
2725
  isRSC: true,
@@ -2521,7 +2752,7 @@ function Text(props) {
2521
2752
  var text_default = Text;
2522
2753
 
2523
2754
  // src/blocks/custom-code/component-info.ts
2524
- var componentInfo9 = {
2755
+ var componentInfo10 = {
2525
2756
  name: "Custom Code",
2526
2757
  static: true,
2527
2758
  requiredPermissions: ["editCode"],
@@ -2546,10 +2777,10 @@ var componentInfo9 = {
2546
2777
  };
2547
2778
 
2548
2779
  // src/blocks/custom-code/custom-code.tsx
2549
- import { onMount as onMount2, createSignal as createSignal8 } from "solid-js";
2780
+ import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
2550
2781
  function CustomCode(props) {
2551
- const [scriptsInserted, setScriptsInserted] = createSignal8([]);
2552
- const [scriptsRun, setScriptsRun] = createSignal8([]);
2782
+ const [scriptsInserted, setScriptsInserted] = createSignal10([]);
2783
+ const [scriptsRun, setScriptsRun] = createSignal10([]);
2553
2784
  let elementRef;
2554
2785
  onMount2(() => {
2555
2786
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -2592,7 +2823,7 @@ function CustomCode(props) {
2592
2823
  var custom_code_default = CustomCode;
2593
2824
 
2594
2825
  // src/blocks/embed/component-info.ts
2595
- var componentInfo10 = {
2826
+ var componentInfo11 = {
2596
2827
  name: "Embed",
2597
2828
  static: true,
2598
2829
  inputs: [{
@@ -2630,7 +2861,7 @@ var componentInfo10 = {
2630
2861
  };
2631
2862
 
2632
2863
  // src/blocks/embed/embed.tsx
2633
- import { on, createEffect, createMemo as createMemo9, createSignal as createSignal9 } from "solid-js";
2864
+ import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
2634
2865
 
2635
2866
  // src/blocks/embed/helpers.ts
2636
2867
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -2638,9 +2869,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2638
2869
 
2639
2870
  // src/blocks/embed/embed.tsx
2640
2871
  function Embed(props) {
2641
- const [scriptsInserted, setScriptsInserted] = createSignal9([]);
2642
- const [scriptsRun, setScriptsRun] = createSignal9([]);
2643
- const [ranInitFn, setRanInitFn] = createSignal9(false);
2872
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2873
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
2874
+ const [ranInitFn, setRanInitFn] = createSignal11(false);
2644
2875
  function findAndRunScripts() {
2645
2876
  if (!elem || !elem.getElementsByTagName)
2646
2877
  return;
@@ -2663,8 +2894,8 @@ function Embed(props) {
2663
2894
  }
2664
2895
  }
2665
2896
  let elem;
2666
- const onUpdateFn_0_elem = createMemo9(() => elem);
2667
- const onUpdateFn_0_ranInitFn__ = createMemo9(() => ranInitFn());
2897
+ const onUpdateFn_0_elem = createMemo11(() => elem);
2898
+ const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
2668
2899
  function onUpdateFn_0() {
2669
2900
  if (elem && !ranInitFn()) {
2670
2901
  setRanInitFn(true);
@@ -2679,7 +2910,7 @@ function Embed(props) {
2679
2910
  var embed_default = Embed;
2680
2911
 
2681
2912
  // src/blocks/form/form/component-info.ts
2682
- var componentInfo11 = {
2913
+ var componentInfo12 = {
2683
2914
  name: "Form:Form",
2684
2915
  // editableTags: ['builder-form-error']
2685
2916
  defaults: {
@@ -2913,7 +3144,7 @@ var componentInfo11 = {
2913
3144
  };
2914
3145
 
2915
3146
  // src/blocks/form/form/form.tsx
2916
- import { Show as Show8, For as For5, createSignal as createSignal10 } from "solid-js";
3147
+ import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
2917
3148
  import { css as css4 } from "solid-styled-components";
2918
3149
 
2919
3150
  // src/functions/get-env.ts
@@ -2931,9 +3162,9 @@ var get = (obj, path, defaultValue) => {
2931
3162
 
2932
3163
  // src/blocks/form/form/form.tsx
2933
3164
  function FormComponent(props) {
2934
- const [formState, setFormState] = createSignal10("unsubmitted");
2935
- const [responseData, setResponseData] = createSignal10(null);
2936
- const [formErrorMessage, setFormErrorMessage] = createSignal10("");
3165
+ const [formState, setFormState] = createSignal12("unsubmitted");
3166
+ const [responseData, setResponseData] = createSignal12(null);
3167
+ const [formErrorMessage, setFormErrorMessage] = createSignal12("");
2937
3168
  function mergeNewRootState(newData) {
2938
3169
  const combinedState = {
2939
3170
  ...props.builderContext.rootState,
@@ -3129,7 +3360,7 @@ function FormComponent(props) {
3129
3360
  {...{}}
3130
3361
  {...props.attributes}
3131
3362
  >
3132
- <Show8 when={props.builderBlock && props.builderBlock.children}><For5 each={props.builderBlock?.children}>{(block, _index) => {
3363
+ <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
3133
3364
  const idx = _index();
3134
3365
  return <Block_default
3135
3366
  key={`form-block-${idx}`}
@@ -3138,35 +3369,35 @@ function FormComponent(props) {
3138
3369
  registeredComponents={props.builderComponents}
3139
3370
  linkComponent={props.builderLinkComponent}
3140
3371
  />;
3141
- }}</For5></Show8>
3142
- <Show8 when={submissionState() === "error"}><Blocks_default
3372
+ }}</For6></Show9>
3373
+ <Show9 when={submissionState() === "error"}><Blocks_default
3143
3374
  path="errorMessage"
3144
3375
  blocks={props.errorMessage}
3145
3376
  context={props.builderContext}
3146
- /></Show8>
3147
- <Show8 when={submissionState() === "sending"}><Blocks_default
3377
+ /></Show9>
3378
+ <Show9 when={submissionState() === "sending"}><Blocks_default
3148
3379
  path="sendingMessage"
3149
3380
  blocks={props.sendingMessage}
3150
3381
  context={props.builderContext}
3151
- /></Show8>
3152
- <Show8 when={submissionState() === "error" && responseData()}><pre
3382
+ /></Show9>
3383
+ <Show9 when={submissionState() === "error" && responseData()}><pre
3153
3384
  class={"builder-form-error-text " + css4({
3154
3385
  padding: "10px",
3155
3386
  color: "red",
3156
3387
  textAlign: "center"
3157
3388
  })}
3158
- >{JSON.stringify(responseData(), null, 2)}</pre></Show8>
3159
- <Show8 when={submissionState() === "success"}><Blocks_default
3389
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
3390
+ <Show9 when={submissionState() === "success"}><Blocks_default
3160
3391
  path="successMessage"
3161
3392
  blocks={props.successMessage}
3162
3393
  context={props.builderContext}
3163
- /></Show8>
3394
+ /></Show9>
3164
3395
  </form>;
3165
3396
  }
3166
3397
  var form_default = FormComponent;
3167
3398
 
3168
3399
  // src/blocks/form/input/component-info.ts
3169
- var componentInfo12 = {
3400
+ var componentInfo13 = {
3170
3401
  name: "Form:Input",
3171
3402
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3172
3403
  inputs: [
@@ -3236,7 +3467,7 @@ function FormInputComponent(props) {
3236
3467
  var input_default = FormInputComponent;
3237
3468
 
3238
3469
  // src/blocks/form/select/component-info.ts
3239
- var componentInfo13 = {
3470
+ var componentInfo14 = {
3240
3471
  name: "Form:Select",
3241
3472
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3242
3473
  defaultStyles: {
@@ -3281,7 +3512,7 @@ var componentInfo13 = {
3281
3512
  };
3282
3513
 
3283
3514
  // src/blocks/form/select/select.tsx
3284
- import { For as For6 } from "solid-js";
3515
+ import { For as For7 } from "solid-js";
3285
3516
  function SelectComponent(props) {
3286
3517
  return <select
3287
3518
  {...{}}
@@ -3290,15 +3521,15 @@ function SelectComponent(props) {
3290
3521
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
3291
3522
  defaultValue={props.defaultValue}
3292
3523
  name={props.name}
3293
- ><For6 each={props.options}>{(option, _index) => {
3524
+ ><For7 each={props.options}>{(option, _index) => {
3294
3525
  const index = _index();
3295
3526
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
3296
- }}</For6></select>;
3527
+ }}</For7></select>;
3297
3528
  }
3298
3529
  var select_default = SelectComponent;
3299
3530
 
3300
3531
  // src/blocks/form/submit-button/component-info.ts
3301
- var componentInfo14 = {
3532
+ var componentInfo15 = {
3302
3533
  name: "Form:SubmitButton",
3303
3534
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3304
3535
  defaultStyles: {
@@ -3332,7 +3563,7 @@ function SubmitButton(props) {
3332
3563
  var submit_button_default = SubmitButton;
3333
3564
 
3334
3565
  // src/blocks/img/component-info.ts
3335
- var componentInfo15 = {
3566
+ var componentInfo16 = {
3336
3567
  // friendlyName?
3337
3568
  name: "Raw:Img",
3338
3569
  hideFromInsertMenu: true,
@@ -3365,7 +3596,7 @@ function ImgComponent(props) {
3365
3596
  var img_default = ImgComponent;
3366
3597
 
3367
3598
  // src/blocks/video/component-info.ts
3368
- var componentInfo16 = {
3599
+ var componentInfo17 = {
3369
3600
  name: "Video",
3370
3601
  canHaveChildren: true,
3371
3602
  defaultStyles: {
@@ -3449,9 +3680,9 @@ var componentInfo16 = {
3449
3680
  };
3450
3681
 
3451
3682
  // src/blocks/video/video.tsx
3452
- import { Show as Show9, createMemo as createMemo11 } from "solid-js";
3683
+ import { Show as Show10, createMemo as createMemo13 } from "solid-js";
3453
3684
  function Video(props) {
3454
- const videoProps = createMemo11(() => {
3685
+ const videoProps = createMemo13(() => {
3455
3686
  return {
3456
3687
  ...props.autoPlay === true ? {
3457
3688
  autoPlay: true
@@ -3470,7 +3701,7 @@ function Video(props) {
3470
3701
  } : {}
3471
3702
  };
3472
3703
  });
3473
- const spreadProps = createMemo11(() => {
3704
+ const spreadProps = createMemo13(() => {
3474
3705
  return {
3475
3706
  ...videoProps()
3476
3707
  };
@@ -3500,8 +3731,8 @@ function Video(props) {
3500
3731
  }}
3501
3732
  src={props.video || "no-src"}
3502
3733
  poster={props.posterImage}
3503
- ><Show9 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show9></video>
3504
- <Show9
3734
+ ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
3735
+ <Show10
3505
3736
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
3506
3737
  ><div
3507
3738
  style={{
@@ -3510,15 +3741,15 @@ function Video(props) {
3510
3741
  "pointer-events": "none",
3511
3742
  "font-size": "0px"
3512
3743
  }}
3513
- /></Show9>
3514
- <Show9 when={props.builderBlock?.children?.length && props.fitContent}><div
3744
+ /></Show10>
3745
+ <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
3515
3746
  style={{
3516
3747
  display: "flex",
3517
3748
  "flex-direction": "column",
3518
3749
  "align-items": "stretch"
3519
3750
  }}
3520
- >{props.children}</div></Show9>
3521
- <Show9 when={props.builderBlock?.children?.length && !props.fitContent}><div
3751
+ >{props.children}</div></Show10>
3752
+ <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
3522
3753
  style={{
3523
3754
  "pointer-events": "none",
3524
3755
  display: "flex",
@@ -3530,7 +3761,7 @@ function Video(props) {
3530
3761
  width: "100%",
3531
3762
  height: "100%"
3532
3763
  }}
3533
- >{props.children}</div></Show9>
3764
+ >{props.children}</div></Show10>
3534
3765
  </div>;
3535
3766
  }
3536
3767
  var video_default = Video;
@@ -3538,28 +3769,28 @@ var video_default = Video;
3538
3769
  // src/constants/extra-components.ts
3539
3770
  var getExtraComponents = () => [{
3540
3771
  component: custom_code_default,
3541
- ...componentInfo9
3772
+ ...componentInfo10
3542
3773
  }, {
3543
3774
  component: embed_default,
3544
- ...componentInfo10
3775
+ ...componentInfo11
3545
3776
  }, ...TARGET === "rsc" ? [] : [{
3546
3777
  component: form_default,
3547
- ...componentInfo11
3778
+ ...componentInfo12
3548
3779
  }, {
3549
3780
  component: input_default,
3550
- ...componentInfo12
3781
+ ...componentInfo13
3551
3782
  }, {
3552
3783
  component: submit_button_default,
3553
- ...componentInfo14
3784
+ ...componentInfo15
3554
3785
  }, {
3555
3786
  component: select_default,
3556
- ...componentInfo13
3787
+ ...componentInfo14
3557
3788
  }], {
3558
3789
  component: img_default,
3559
- ...componentInfo15
3790
+ ...componentInfo16
3560
3791
  }, {
3561
3792
  component: video_default,
3562
- ...componentInfo16
3793
+ ...componentInfo17
3563
3794
  }];
3564
3795
 
3565
3796
  // src/constants/builder-registered-components.ts
@@ -3586,8 +3817,11 @@ var getDefaultRegisteredComponents = () => [{
3586
3817
  ...componentInfo7
3587
3818
  }, {
3588
3819
  component: text_default,
3820
+ ...componentInfo9
3821
+ }, ...TARGET === "rsc" ? [] : [{
3822
+ component: tabs_default,
3589
3823
  ...componentInfo8
3590
- }, ...getExtraComponents()];
3824
+ }], ...getExtraComponents()];
3591
3825
 
3592
3826
  // src/functions/register-component.ts
3593
3827
  var createRegisterComponentMessage = (info) => ({
@@ -3665,12 +3899,12 @@ var Inlined_script_default = InlinedScript;
3665
3899
 
3666
3900
  // src/components/content/components/enable-editor.tsx
3667
3901
  import {
3668
- Show as Show10,
3902
+ Show as Show11,
3669
3903
  onMount as onMount3,
3670
3904
  on as on2,
3671
3905
  createEffect as createEffect2,
3672
- createMemo as createMemo12,
3673
- createSignal as createSignal12
3906
+ createMemo as createMemo14,
3907
+ createSignal as createSignal14
3674
3908
  } from "solid-js";
3675
3909
  import { Dynamic as Dynamic5 } from "solid-js/web";
3676
3910
 
@@ -4153,7 +4387,7 @@ function isFromTrustedHost(trustedHosts, e) {
4153
4387
  }
4154
4388
 
4155
4389
  // src/constants/sdk-version.ts
4156
- var SDK_VERSION = "1.0.23";
4390
+ var SDK_VERSION = "1.0.25";
4157
4391
 
4158
4392
  // src/functions/register.ts
4159
4393
  var registry = {};
@@ -4349,14 +4583,93 @@ var subscribeToEditor = (model, callback, options) => {
4349
4583
  };
4350
4584
  };
4351
4585
 
4586
+ // src/components/content/components/styles.helpers.ts
4587
+ var getCssFromFont = (font) => {
4588
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4589
+ const name = family.split(",")[0];
4590
+ const url = font.fileUrl ?? font?.files?.regular;
4591
+ let str = "";
4592
+ if (url && family && name) {
4593
+ str += `
4594
+ @font-face {
4595
+ font-family: "${family}";
4596
+ src: local("${name}"), url('${url}') format('woff2');
4597
+ font-display: fallback;
4598
+ font-weight: 400;
4599
+ }
4600
+ `.trim();
4601
+ }
4602
+ if (font.files) {
4603
+ for (const weight in font.files) {
4604
+ const isNumber = String(Number(weight)) === weight;
4605
+ if (!isNumber) {
4606
+ continue;
4607
+ }
4608
+ const weightUrl = font.files[weight];
4609
+ if (weightUrl && weightUrl !== url) {
4610
+ str += `
4611
+ @font-face {
4612
+ font-family: "${family}";
4613
+ src: url('${weightUrl}') format('woff2');
4614
+ font-display: fallback;
4615
+ font-weight: ${weight};
4616
+ }
4617
+ `.trim();
4618
+ }
4619
+ }
4620
+ }
4621
+ return str;
4622
+ };
4623
+ var getFontCss = ({
4624
+ customFonts
4625
+ }) => {
4626
+ return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4627
+ };
4628
+ var getCss = ({
4629
+ cssCode,
4630
+ contentId
4631
+ }) => {
4632
+ if (!cssCode) {
4633
+ return "";
4634
+ }
4635
+ if (!contentId) {
4636
+ return cssCode;
4637
+ }
4638
+ return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4639
+ };
4640
+ var DEFAULT_STYLES = `
4641
+ .builder-button {
4642
+ all: unset;
4643
+ }
4644
+
4645
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4646
+ margin: 0;
4647
+ }
4648
+ .builder-text > p, .builder-text > .builder-paragraph {
4649
+ color: inherit;
4650
+ line-height: inherit;
4651
+ letter-spacing: inherit;
4652
+ font-weight: inherit;
4653
+ font-size: inherit;
4654
+ text-align: inherit;
4655
+ font-family: inherit;
4656
+ }
4657
+ `;
4658
+ var getDefaultStyles = (isNested) => {
4659
+ return !isNested ? DEFAULT_STYLES : "";
4660
+ };
4661
+ var getWrapperClassName = (variationId) => {
4662
+ return `variant-${variationId}`;
4663
+ };
4664
+
4352
4665
  // src/components/content/components/enable-editor.tsx
4353
4666
  function EnableEditor(props) {
4354
- const [ContentWrapper, setContentWrapper] = createSignal12(
4667
+ const [ContentWrapper, setContentWrapper] = createSignal14(
4355
4668
  props.contentWrapper || "div"
4356
4669
  );
4357
- const [httpReqsData, setHttpReqsData] = createSignal12({});
4358
- const [httpReqsPending, setHttpReqsPending] = createSignal12({});
4359
- const [clicked, setClicked] = createSignal12(false);
4670
+ const [httpReqsData, setHttpReqsData] = createSignal14({});
4671
+ const [httpReqsPending, setHttpReqsPending] = createSignal14({});
4672
+ const [clicked, setClicked] = createSignal14(false);
4360
4673
  function mergeNewRootState(newData) {
4361
4674
  const combinedState = {
4362
4675
  ...props.builderContextSignal.rootState,
@@ -4390,6 +4703,12 @@ function EnableEditor(props) {
4390
4703
  content: newContentValue
4391
4704
  }));
4392
4705
  }
4706
+ const showContentProps = createMemo14(() => {
4707
+ return props.showContent ? {} : {
4708
+ hidden: true,
4709
+ "aria-hidden": true
4710
+ };
4711
+ });
4393
4712
  function processMessage(event) {
4394
4713
  return createEditorListener({
4395
4714
  model: props.model,
@@ -4574,14 +4893,14 @@ function EnableEditor(props) {
4574
4893
  runHttpRequests();
4575
4894
  emitStateUpdate();
4576
4895
  });
4577
- const onUpdateFn_0_props_content = createMemo12(() => props.content);
4896
+ const onUpdateFn_0_props_content = createMemo14(() => props.content);
4578
4897
  function onUpdateFn_0() {
4579
4898
  if (props.content) {
4580
4899
  mergeNewContent(props.content);
4581
4900
  }
4582
4901
  }
4583
4902
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4584
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4903
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
4585
4904
  function onUpdateFn_1() {
4586
4905
  evaluateJsCode();
4587
4906
  }
@@ -4591,7 +4910,7 @@ function EnableEditor(props) {
4591
4910
  onUpdateFn_1
4592
4911
  )
4593
4912
  );
4594
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4913
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
4595
4914
  function onUpdateFn_2() {
4596
4915
  runHttpRequests();
4597
4916
  }
@@ -4603,7 +4922,7 @@ function EnableEditor(props) {
4603
4922
  onUpdateFn_2
4604
4923
  )
4605
4924
  );
4606
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
4925
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
4607
4926
  () => props.builderContextSignal.rootState
4608
4927
  );
4609
4928
  function onUpdateFn_3() {
@@ -4615,14 +4934,14 @@ function EnableEditor(props) {
4615
4934
  onUpdateFn_3
4616
4935
  )
4617
4936
  );
4618
- const onUpdateFn_4_props_data = createMemo12(() => props.data);
4937
+ const onUpdateFn_4_props_data = createMemo14(() => props.data);
4619
4938
  function onUpdateFn_4() {
4620
4939
  if (props.data) {
4621
4940
  mergeNewRootState(props.data);
4622
4941
  }
4623
4942
  }
4624
4943
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4625
- const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
4944
+ const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
4626
4945
  function onUpdateFn_5() {
4627
4946
  if (props.locale) {
4628
4947
  mergeNewRootState({
@@ -4631,106 +4950,27 @@ function EnableEditor(props) {
4631
4950
  }
4632
4951
  }
4633
4952
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4634
- return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
4635
- class={`variant-${props.content?.testVariationId || props.content?.id}`}
4953
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
4954
+ class={getWrapperClassName(
4955
+ props.content?.testVariationId || props.content?.id
4956
+ )}
4636
4957
  {...{}}
4637
4958
  ref={elementRef}
4638
4959
  onClick={(event) => onClick(event)}
4639
4960
  builder-content-id={props.builderContextSignal.content?.id}
4640
4961
  builder-model={props.model}
4641
4962
  {...{}}
4642
- {...props.showContent ? {} : {
4643
- hidden: true,
4644
- "aria-hidden": true
4645
- }}
4963
+ {...showContentProps()}
4646
4964
  {...props.contentWrapperProps}
4647
4965
  component={ContentWrapper()}
4648
- >{props.children}</Dynamic5></Show10></builder_context_default.Provider>;
4966
+ >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
4649
4967
  }
4650
4968
  var Enable_editor_default = EnableEditor;
4651
4969
 
4652
4970
  // src/components/content/components/styles.tsx
4653
- import { createSignal as createSignal13 } from "solid-js";
4654
-
4655
- // src/components/content/components/styles.helpers.ts
4656
- var getCssFromFont = (font) => {
4657
- const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
4658
- const name = family.split(",")[0];
4659
- const url = font.fileUrl ?? font?.files?.regular;
4660
- let str = "";
4661
- if (url && family && name) {
4662
- str += `
4663
- @font-face {
4664
- font-family: "${family}";
4665
- src: local("${name}"), url('${url}') format('woff2');
4666
- font-display: fallback;
4667
- font-weight: 400;
4668
- }
4669
- `.trim();
4670
- }
4671
- if (font.files) {
4672
- for (const weight in font.files) {
4673
- const isNumber = String(Number(weight)) === weight;
4674
- if (!isNumber) {
4675
- continue;
4676
- }
4677
- const weightUrl = font.files[weight];
4678
- if (weightUrl && weightUrl !== url) {
4679
- str += `
4680
- @font-face {
4681
- font-family: "${family}";
4682
- src: url('${weightUrl}') format('woff2');
4683
- font-display: fallback;
4684
- font-weight: ${weight};
4685
- }
4686
- `.trim();
4687
- }
4688
- }
4689
- }
4690
- return str;
4691
- };
4692
- var getFontCss = ({
4693
- customFonts
4694
- }) => {
4695
- return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
4696
- };
4697
- var getCss = ({
4698
- cssCode,
4699
- contentId
4700
- }) => {
4701
- if (!cssCode) {
4702
- return "";
4703
- }
4704
- if (!contentId) {
4705
- return cssCode;
4706
- }
4707
- return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
4708
- };
4709
- var DEFAULT_STYLES = `
4710
- .builder-button {
4711
- all: unset;
4712
- }
4713
-
4714
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
4715
- margin: 0;
4716
- }
4717
- .builder-text > p, .builder-text > .builder-paragraph {
4718
- color: inherit;
4719
- line-height: inherit;
4720
- letter-spacing: inherit;
4721
- font-weight: inherit;
4722
- font-size: inherit;
4723
- text-align: inherit;
4724
- font-family: inherit;
4725
- }
4726
- `;
4727
- var getDefaultStyles = (isNested) => {
4728
- return !isNested ? DEFAULT_STYLES : "";
4729
- };
4730
-
4731
- // src/components/content/components/styles.tsx
4971
+ import { createSignal as createSignal15 } from "solid-js";
4732
4972
  function ContentStyles(props) {
4733
- const [injectedStyles, setInjectedStyles] = createSignal13(
4973
+ const [injectedStyles, setInjectedStyles] = createSignal15(
4734
4974
  `
4735
4975
  ${getCss({
4736
4976
  cssCode: props.cssCode,
@@ -4787,7 +5027,7 @@ var getContentInitialValue = ({
4787
5027
 
4788
5028
  // src/components/content/content.tsx
4789
5029
  function ContentComponent(props) {
4790
- const [scriptStr, setScriptStr] = createSignal14(
5030
+ const [scriptStr, setScriptStr] = createSignal16(
4791
5031
  getUpdateVariantVisibilityScript({
4792
5032
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
4793
5033
  variationId: props.content?.testVariationId,
@@ -4795,7 +5035,7 @@ function ContentComponent(props) {
4795
5035
  contentId: props.content?.id
4796
5036
  })
4797
5037
  );
4798
- const [registeredComponents, setRegisteredComponents] = createSignal14(
5038
+ const [registeredComponents, setRegisteredComponents] = createSignal16(
4799
5039
  [
4800
5040
  ...getDefaultRegisteredComponents(),
4801
5041
  ...props.customComponents || []
@@ -4810,7 +5050,7 @@ function ContentComponent(props) {
4810
5050
  {}
4811
5051
  )
4812
5052
  );
4813
- const [builderContextSignal, setBuilderContextSignal] = createSignal14({
5053
+ const [builderContextSignal, setBuilderContextSignal] = createSignal16({
4814
5054
  content: getContentInitialValue({
4815
5055
  content: props.content,
4816
5056
  data: props.data
@@ -4868,16 +5108,16 @@ function ContentComponent(props) {
4868
5108
  setBuilderContextSignal
4869
5109
  }}
4870
5110
  >
4871
- <Show11 when={props.isSsrAbTest}><Inlined_script_default
5111
+ <Show12 when={props.isSsrAbTest}><Inlined_script_default
4872
5112
  id="builderio-variant-visibility"
4873
5113
  scriptStr={scriptStr()}
4874
- /></Show11>
4875
- <Show11 when={TARGET !== "reactNative"}><Styles_default
5114
+ /></Show12>
5115
+ <Show12 when={TARGET !== "reactNative"}><Styles_default
4876
5116
  isNestedRender={props.isNestedRender}
4877
5117
  contentId={builderContextSignal().content?.id}
4878
5118
  cssCode={builderContextSignal().content?.data?.cssCode}
4879
5119
  customFonts={builderContextSignal().content?.data?.customFonts}
4880
- /></Show11>
5120
+ /></Show12>
4881
5121
  <Blocks_default
4882
5122
  blocks={builderContextSignal().content?.data?.blocks}
4883
5123
  context={builderContextSignal()}
@@ -4890,13 +5130,13 @@ var Content_default = ContentComponent;
4890
5130
 
4891
5131
  // src/components/content-variants/content-variants.tsx
4892
5132
  function ContentVariants(props) {
4893
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal15(
5133
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
4894
5134
  checkShouldRenderVariants({
4895
5135
  canTrack: getDefaultCanTrack(props.canTrack),
4896
5136
  content: props.content
4897
5137
  })
4898
5138
  );
4899
- const updateCookieAndStylesScriptStr = createMemo15(() => {
5139
+ const updateCookieAndStylesScriptStr = createMemo17(() => {
4900
5140
  return getUpdateCookieAndStylesScript(
4901
5141
  getVariants(props.content).map((value) => ({
4902
5142
  id: value.testVariationId,
@@ -4905,10 +5145,10 @@ function ContentVariants(props) {
4905
5145
  props.content?.id || ""
4906
5146
  );
4907
5147
  });
4908
- const hideVariantsStyleString = createMemo15(() => {
5148
+ const hideVariantsStyleString = createMemo17(() => {
4909
5149
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
4910
5150
  });
4911
- const defaultContent = createMemo15(() => {
5151
+ const defaultContent = createMemo17(() => {
4912
5152
  return shouldRenderVariants() ? {
4913
5153
  ...props.content,
4914
5154
  testVariationId: props.content?.id
@@ -4921,11 +5161,11 @@ function ContentVariants(props) {
4921
5161
  setShouldRenderVariants(false);
4922
5162
  });
4923
5163
  return <>
4924
- <Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5164
+ <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
4925
5165
  id="builderio-init-variants-fns"
4926
5166
  scriptStr={getInitVariantsFnsScriptString()}
4927
- /></Show12>
4928
- <Show12 when={shouldRenderVariants()}>
5167
+ /></Show13>
5168
+ <Show13 when={shouldRenderVariants()}>
4929
5169
  <Inlined_styles_default
4930
5170
  id="builderio-variants"
4931
5171
  styles={hideVariantsStyleString()}
@@ -4934,7 +5174,7 @@ function ContentVariants(props) {
4934
5174
  id="builderio-variants-visibility"
4935
5175
  scriptStr={updateCookieAndStylesScriptStr()}
4936
5176
  />
4937
- <For7 each={getVariants(props.content)}>{(variant, _index) => {
5177
+ <For8 each={getVariants(props.content)}>{(variant, _index) => {
4938
5178
  const index = _index();
4939
5179
  return <Content_default
4940
5180
  isNestedRender={props.isNestedRender}
@@ -4958,8 +5198,8 @@ function ContentVariants(props) {
4958
5198
  contentWrapperProps={props.contentWrapperProps}
4959
5199
  trustedHosts={props.trustedHosts}
4960
5200
  />;
4961
- }}</For7>
4962
- </Show12>
5201
+ }}</For8>
5202
+ </Show13>
4963
5203
  <Content_default
4964
5204
  isNestedRender={props.isNestedRender}
4965
5205
  {...{}}
@@ -5012,8 +5252,14 @@ var fetchSymbolContent = async ({
5012
5252
 
5013
5253
  // src/blocks/symbol/symbol.tsx
5014
5254
  function Symbol(props) {
5015
- const [contentToUse, setContentToUse] = createSignal16(props.symbol?.content);
5016
- const className = createMemo16(() => {
5255
+ const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
5256
+ const blocksWrapper = createMemo18(() => {
5257
+ return "div";
5258
+ });
5259
+ const contentWrapper = createMemo18(() => {
5260
+ return "div";
5261
+ });
5262
+ const className = createMemo18(() => {
5017
5263
  return [
5018
5264
  ...[props.attributes[getClassPropName()]],
5019
5265
  "builder-symbol",
@@ -5035,7 +5281,7 @@ function Symbol(props) {
5035
5281
  }
5036
5282
  onMount5(() => {
5037
5283
  });
5038
- const onUpdateFn_0_props_symbol = createMemo16(() => props.symbol);
5284
+ const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
5039
5285
  function onUpdateFn_0() {
5040
5286
  setContent();
5041
5287
  }
@@ -5057,8 +5303,8 @@ function Symbol(props) {
5057
5303
  model={props.symbol?.model}
5058
5304
  content={contentToUse()}
5059
5305
  linkComponent={props.builderLinkComponent}
5060
- blocksWrapper="div"
5061
- contentWrapper="div"
5306
+ blocksWrapper={blocksWrapper()}
5307
+ contentWrapper={contentWrapper()}
5062
5308
  /></div>;
5063
5309
  }
5064
5310
  var symbol_default = Symbol;