@builder.io/sdk-solid 2.0.26 → 2.0.29

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.
@@ -75,7 +75,7 @@ function Button(props) {
75
75
  var button_default = Button;
76
76
 
77
77
  // src/blocks/columns/columns.tsx
78
- import { Show as Show7, For as For4, createSignal as createSignal7 } from "solid-js";
78
+ import { Show as Show7, For as For4, createMemo as createMemo7 } from "solid-js";
79
79
 
80
80
  // src/components/blocks/blocks.tsx
81
81
  import { useContext, Show as Show6, For as For3 } from "solid-js";
@@ -430,6 +430,8 @@ var getIvm = () => {
430
430
  function setIsolateContext(options = {
431
431
  memoryLimit: 128
432
432
  }) {
433
+ if (IVM_CONTEXT)
434
+ return IVM_CONTEXT;
433
435
  const ivm = getIvm();
434
436
  const isolate = new ivm.Isolate(options);
435
437
  const context = isolate.createContextSync();
@@ -442,10 +444,7 @@ function setIsolateContext(options = {
442
444
  return context;
443
445
  }
444
446
  var getIsolateContext = () => {
445
- if (IVM_CONTEXT)
446
- return IVM_CONTEXT;
447
- const context = setIsolateContext();
448
- return context;
447
+ return setIsolateContext();
449
448
  };
450
449
  var runInNode = ({
451
450
  code,
@@ -1529,6 +1528,13 @@ function BlocksWrapper(props) {
1529
1528
  props.classNameProp
1530
1529
  ].filter(Boolean).join(" ");
1531
1530
  });
1531
+ const dataPath = createMemo6(() => {
1532
+ if (!props.path) {
1533
+ return void 0;
1534
+ }
1535
+ const pathPrefix = "component.options.";
1536
+ return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1537
+ });
1532
1538
  function onClick() {
1533
1539
  if (isEditing() && !props.blocks?.length) {
1534
1540
  window.parent?.postMessage(
@@ -1536,7 +1542,7 @@ function BlocksWrapper(props) {
1536
1542
  type: "builder.clickEmptyBlocks",
1537
1543
  data: {
1538
1544
  parentElementId: props.parent,
1539
- dataPath: props.path
1545
+ dataPath: dataPath()
1540
1546
  }
1541
1547
  },
1542
1548
  "*"
@@ -1550,7 +1556,7 @@ function BlocksWrapper(props) {
1550
1556
  type: "builder.hoverEmptyBlocks",
1551
1557
  data: {
1552
1558
  parentElementId: props.parent,
1553
- dataPath: props.path
1559
+ dataPath: dataPath()
1554
1560
  }
1555
1561
  },
1556
1562
  "*"
@@ -1562,9 +1568,9 @@ function BlocksWrapper(props) {
1562
1568
  });
1563
1569
  return <>
1564
1570
  <Dynamic4
1565
- class={className() + " dynamic-6567ee94"}
1571
+ class={className() + " dynamic-5b6a86b6"}
1566
1572
  ref={blocksWrapperRef}
1567
- builder-path={props.path}
1573
+ builder-path={dataPath()}
1568
1574
  builder-parent-id={props.parent}
1569
1575
  {...{}}
1570
1576
  style={props.styleProp}
@@ -1574,7 +1580,7 @@ function BlocksWrapper(props) {
1574
1580
  {...props.BlocksWrapperProps}
1575
1581
  component={props.BlocksWrapper}
1576
1582
  >{props.children}</Dynamic4>
1577
- <style>{`.dynamic-6567ee94 {
1583
+ <style>{`.dynamic-5b6a86b6 {
1578
1584
  display: flex;
1579
1585
  flex-direction: column;
1580
1586
  align-items: stretch;
@@ -1615,14 +1621,15 @@ var getColumnsClass = (id) => {
1615
1621
 
1616
1622
  // src/blocks/columns/columns.tsx
1617
1623
  function Columns(props) {
1618
- const [gutterSize, setGutterSize] = createSignal7(
1619
- typeof props.space === "number" ? props.space || 0 : 20
1620
- );
1621
- const [cols, setCols] = createSignal7(props.columns || []);
1622
- const [stackAt, setStackAt] = createSignal7(props.stackColumnsAt || "tablet");
1623
- const [flexDir, setFlexDir] = createSignal7(
1624
- props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column"
1625
- );
1624
+ const gutterSize = createMemo7(() => {
1625
+ return typeof props.space === "number" ? props.space || 0 : 20;
1626
+ });
1627
+ const cols = createMemo7(() => {
1628
+ return props.columns || [];
1629
+ });
1630
+ const stackAt = createMemo7(() => {
1631
+ return props.stackColumnsAt || "tablet";
1632
+ });
1626
1633
  function getTagName(column) {
1627
1634
  return column.link ? props.builderLinkComponent || "a" : "div";
1628
1635
  }
@@ -1646,6 +1653,9 @@ function Columns(props) {
1646
1653
  }) {
1647
1654
  return stackAt() === "never" ? desktopStyle : stackedStyle;
1648
1655
  }
1656
+ const flexDir = createMemo7(() => {
1657
+ return props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column";
1658
+ });
1649
1659
  function columnsCssVars() {
1650
1660
  return {
1651
1661
  "--flex-dir": flexDir(),
@@ -1735,7 +1745,7 @@ function Columns(props) {
1735
1745
  }
1736
1746
  return <>
1737
1747
  <div
1738
- class={getColumnsClass(props.builderBlock?.id) + " div-46766f1c"}
1748
+ class={getColumnsClass(props.builderBlock?.id) + " div-2ac94efa"}
1739
1749
  style={columnsCssVars()}
1740
1750
  {...{}}
1741
1751
  >
@@ -1752,7 +1762,7 @@ function Columns(props) {
1752
1762
  actionAttributes={{}}
1753
1763
  attributes={getAttributes(column, index)}
1754
1764
  ><Blocks_default
1755
- path={`component.options.columns.${index}.blocks`}
1765
+ path={`columns.${index}.blocks`}
1756
1766
  parent={props.builderBlock.id}
1757
1767
  styleProp={{
1758
1768
  flexGrow: "1"
@@ -1764,7 +1774,7 @@ function Columns(props) {
1764
1774
  /></Dynamic_renderer_default>;
1765
1775
  }}</For4>
1766
1776
  </div>
1767
- <style>{`.div-46766f1c {
1777
+ <style>{`.div-2ac94efa {
1768
1778
  display: flex;
1769
1779
  line-height: normal;
1770
1780
  }`}</style>
@@ -2394,9 +2404,11 @@ function Accordion(props) {
2394
2404
  class={getAccordionTitleClassName(index)}
2395
2405
  style={{
2396
2406
  ...accordionTitleStyles(),
2397
- width: props.grid ? props.gridRowWidth : void 0,
2398
- ...{
2399
- order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2407
+ ...props.grid && {
2408
+ width: props.gridRowWidth,
2409
+ ...{
2410
+ order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2411
+ }
2400
2412
  }
2401
2413
  }}
2402
2414
  data-index={index}
@@ -3134,7 +3146,7 @@ function Tabs(props) {
3134
3146
  onClick={(event) => onClick(index)}
3135
3147
  ><Blocks_default
3136
3148
  parent={props.builderBlock.id}
3137
- path={`component.options.tabs.${index}.label`}
3149
+ path={`tabs.${index}.label`}
3138
3150
  blocks={tab.label}
3139
3151
  context={props.builderContext}
3140
3152
  registeredComponents={props.builderComponents}
@@ -3143,7 +3155,7 @@ function Tabs(props) {
3143
3155
  }}</For6></div>
3144
3156
  <Show10 when={activeTabContent(activeTab())}><div><Blocks_default
3145
3157
  parent={props.builderBlock.id}
3146
- path={`component.options.tabs.${activeTab()}.content`}
3158
+ path={`tabs.${activeTab()}.content`}
3147
3159
  blocks={activeTabContent(activeTab())}
3148
3160
  context={props.builderContext}
3149
3161
  registeredComponents={props.builderComponents}
@@ -4416,7 +4428,7 @@ function getPreviewContent(_searchParams) {
4416
4428
  }
4417
4429
 
4418
4430
  // src/constants/sdk-version.ts
4419
- var SDK_VERSION = "2.0.26";
4431
+ var SDK_VERSION = "2.0.29";
4420
4432
 
4421
4433
  // src/helpers/sdk-headers.ts
4422
4434
  var getSdkHeaders = () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-solid",
3
- "version": "2.0.26",
3
+ "version": "2.0.29",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",