@builder.io/sdk-solid 2.0.28 → 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.
package/lib/node/index.js CHANGED
@@ -1684,7 +1684,7 @@ function Block(props) {
1684
1684
  });
1685
1685
  }
1686
1686
  var block_default = Block;
1687
- var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-6567ee94 {
1687
+ var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-5b6a86b6 {
1688
1688
  display: flex;
1689
1689
  flex-direction: column;
1690
1690
  align-items: stretch;
@@ -1693,13 +1693,20 @@ function BlocksWrapper(props) {
1693
1693
  const className = createMemo(() => {
1694
1694
  return ["builder-blocks", !props.blocks?.length ? "no-blocks" : "", props.classNameProp].filter(Boolean).join(" ");
1695
1695
  });
1696
+ const dataPath = createMemo(() => {
1697
+ if (!props.path) {
1698
+ return void 0;
1699
+ }
1700
+ const pathPrefix = "component.options.";
1701
+ return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1702
+ });
1696
1703
  function onClick() {
1697
1704
  if (isEditing() && !props.blocks?.length) {
1698
1705
  window.parent?.postMessage({
1699
1706
  type: "builder.clickEmptyBlocks",
1700
1707
  data: {
1701
1708
  parentElementId: props.parent,
1702
- dataPath: props.path
1709
+ dataPath: dataPath()
1703
1710
  }
1704
1711
  }, "*");
1705
1712
  }
@@ -1710,7 +1717,7 @@ function BlocksWrapper(props) {
1710
1717
  type: "builder.hoverEmptyBlocks",
1711
1718
  data: {
1712
1719
  parentElementId: props.parent,
1713
- dataPath: props.path
1720
+ dataPath: dataPath()
1714
1721
  }
1715
1722
  }, "*");
1716
1723
  }
@@ -1720,14 +1727,14 @@ function BlocksWrapper(props) {
1720
1727
  });
1721
1728
  return [createComponent(Dynamic, mergeProps({
1722
1729
  get ["class"]() {
1723
- return className() + " dynamic-6567ee94";
1730
+ return className() + " dynamic-5b6a86b6";
1724
1731
  },
1725
1732
  ref(r$) {
1726
1733
  const _ref$ = blocksWrapperRef;
1727
1734
  typeof _ref$ === "function" ? _ref$(r$) : blocksWrapperRef = r$;
1728
1735
  },
1729
1736
  get ["builder-path"]() {
1730
- return props.path;
1737
+ return dataPath();
1731
1738
  },
1732
1739
  get ["builder-parent-id"]() {
1733
1740
  return props.parent;
@@ -1819,7 +1826,7 @@ var getColumnsClass = (id) => {
1819
1826
 
1820
1827
  // src/blocks/columns/columns.tsx
1821
1828
  var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
1822
- var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-a1dad3b8 {
1829
+ var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-2ac94efa {
1823
1830
  display: flex;
1824
1831
  line-height: normal;
1825
1832
  }`);
@@ -1948,7 +1955,7 @@ function Columns(props) {
1948
1955
  const _el$ = _tmpl$3();
1949
1956
  spread(_el$, mergeProps({
1950
1957
  get ["class"]() {
1951
- return getColumnsClass(props.builderBlock?.id) + " div-a1dad3b8";
1958
+ return getColumnsClass(props.builderBlock?.id) + " div-2ac94efa";
1952
1959
  },
1953
1960
  get style() {
1954
1961
  return columnsCssVars();
@@ -1985,7 +1992,7 @@ function Columns(props) {
1985
1992
  },
1986
1993
  get children() {
1987
1994
  return createComponent(blocks_default, {
1988
- path: `component.options.columns.${index}.blocks`,
1995
+ path: `columns.${index}.blocks`,
1989
1996
  get parent() {
1990
1997
  return props.builderBlock.id;
1991
1998
  },
@@ -2678,9 +2685,11 @@ function Accordion(props) {
2678
2685
  effect((_p$) => {
2679
2686
  const _v$ = getAccordionTitleClassName(index), _v$2 = {
2680
2687
  ...accordionTitleStyles(),
2681
- width: props.grid ? props.gridRowWidth : void 0,
2682
- ...{
2683
- order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2688
+ ...props.grid && {
2689
+ width: props.gridRowWidth,
2690
+ ...{
2691
+ order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2692
+ }
2684
2693
  }
2685
2694
  };
2686
2695
  _v$ !== _p$._v$ && className(_el$2, _p$._v$ = _v$);
@@ -3452,7 +3461,7 @@ function Tabs(props) {
3452
3461
  get parent() {
3453
3462
  return props.builderBlock.id;
3454
3463
  },
3455
- path: `component.options.tabs.${index}.label`,
3464
+ path: `tabs.${index}.label`,
3456
3465
  get blocks() {
3457
3466
  return tab.label;
3458
3467
  },
@@ -3492,7 +3501,7 @@ function Tabs(props) {
3492
3501
  return props.builderBlock.id;
3493
3502
  },
3494
3503
  get path() {
3495
- return `component.options.tabs.${activeTab()}.content`;
3504
+ return `tabs.${activeTab()}.content`;
3496
3505
  },
3497
3506
  get blocks() {
3498
3507
  return activeTabContent(activeTab());
@@ -4933,7 +4942,7 @@ function getPreviewContent(_searchParams) {
4933
4942
  }
4934
4943
 
4935
4944
  // src/constants/sdk-version.ts
4936
- var SDK_VERSION = "2.0.28";
4945
+ var SDK_VERSION = "2.0.29";
4937
4946
 
4938
4947
  // src/helpers/sdk-headers.ts
4939
4948
  var getSdkHeaders = () => ({
@@ -1528,6 +1528,13 @@ function BlocksWrapper(props) {
1528
1528
  props.classNameProp
1529
1529
  ].filter(Boolean).join(" ");
1530
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
+ });
1531
1538
  function onClick() {
1532
1539
  if (isEditing() && !props.blocks?.length) {
1533
1540
  window.parent?.postMessage(
@@ -1535,7 +1542,7 @@ function BlocksWrapper(props) {
1535
1542
  type: "builder.clickEmptyBlocks",
1536
1543
  data: {
1537
1544
  parentElementId: props.parent,
1538
- dataPath: props.path
1545
+ dataPath: dataPath()
1539
1546
  }
1540
1547
  },
1541
1548
  "*"
@@ -1549,7 +1556,7 @@ function BlocksWrapper(props) {
1549
1556
  type: "builder.hoverEmptyBlocks",
1550
1557
  data: {
1551
1558
  parentElementId: props.parent,
1552
- dataPath: props.path
1559
+ dataPath: dataPath()
1553
1560
  }
1554
1561
  },
1555
1562
  "*"
@@ -1561,9 +1568,9 @@ function BlocksWrapper(props) {
1561
1568
  });
1562
1569
  return <>
1563
1570
  <Dynamic4
1564
- class={className() + " dynamic-6567ee94"}
1571
+ class={className() + " dynamic-5b6a86b6"}
1565
1572
  ref={blocksWrapperRef}
1566
- builder-path={props.path}
1573
+ builder-path={dataPath()}
1567
1574
  builder-parent-id={props.parent}
1568
1575
  {...{}}
1569
1576
  style={props.styleProp}
@@ -1573,7 +1580,7 @@ function BlocksWrapper(props) {
1573
1580
  {...props.BlocksWrapperProps}
1574
1581
  component={props.BlocksWrapper}
1575
1582
  >{props.children}</Dynamic4>
1576
- <style>{`.dynamic-6567ee94 {
1583
+ <style>{`.dynamic-5b6a86b6 {
1577
1584
  display: flex;
1578
1585
  flex-direction: column;
1579
1586
  align-items: stretch;
@@ -1738,7 +1745,7 @@ function Columns(props) {
1738
1745
  }
1739
1746
  return <>
1740
1747
  <div
1741
- class={getColumnsClass(props.builderBlock?.id) + " div-a1dad3b8"}
1748
+ class={getColumnsClass(props.builderBlock?.id) + " div-2ac94efa"}
1742
1749
  style={columnsCssVars()}
1743
1750
  {...{}}
1744
1751
  >
@@ -1755,7 +1762,7 @@ function Columns(props) {
1755
1762
  actionAttributes={{}}
1756
1763
  attributes={getAttributes(column, index)}
1757
1764
  ><Blocks_default
1758
- path={`component.options.columns.${index}.blocks`}
1765
+ path={`columns.${index}.blocks`}
1759
1766
  parent={props.builderBlock.id}
1760
1767
  styleProp={{
1761
1768
  flexGrow: "1"
@@ -1767,7 +1774,7 @@ function Columns(props) {
1767
1774
  /></Dynamic_renderer_default>;
1768
1775
  }}</For4>
1769
1776
  </div>
1770
- <style>{`.div-a1dad3b8 {
1777
+ <style>{`.div-2ac94efa {
1771
1778
  display: flex;
1772
1779
  line-height: normal;
1773
1780
  }`}</style>
@@ -2397,9 +2404,11 @@ function Accordion(props) {
2397
2404
  class={getAccordionTitleClassName(index)}
2398
2405
  style={{
2399
2406
  ...accordionTitleStyles(),
2400
- width: props.grid ? props.gridRowWidth : void 0,
2401
- ...{
2402
- 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
+ }
2403
2412
  }
2404
2413
  }}
2405
2414
  data-index={index}
@@ -3137,7 +3146,7 @@ function Tabs(props) {
3137
3146
  onClick={(event) => onClick(index)}
3138
3147
  ><Blocks_default
3139
3148
  parent={props.builderBlock.id}
3140
- path={`component.options.tabs.${index}.label`}
3149
+ path={`tabs.${index}.label`}
3141
3150
  blocks={tab.label}
3142
3151
  context={props.builderContext}
3143
3152
  registeredComponents={props.builderComponents}
@@ -3146,7 +3155,7 @@ function Tabs(props) {
3146
3155
  }}</For6></div>
3147
3156
  <Show10 when={activeTabContent(activeTab())}><div><Blocks_default
3148
3157
  parent={props.builderBlock.id}
3149
- path={`component.options.tabs.${activeTab()}.content`}
3158
+ path={`tabs.${activeTab()}.content`}
3150
3159
  blocks={activeTabContent(activeTab())}
3151
3160
  context={props.builderContext}
3152
3161
  registeredComponents={props.builderComponents}
@@ -4419,7 +4428,7 @@ function getPreviewContent(_searchParams) {
4419
4428
  }
4420
4429
 
4421
4430
  // src/constants/sdk-version.ts
4422
- var SDK_VERSION = "2.0.28";
4431
+ var SDK_VERSION = "2.0.29";
4423
4432
 
4424
4433
  // src/helpers/sdk-headers.ts
4425
4434
  var getSdkHeaders = () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-solid",
3
- "version": "2.0.28",
3
+ "version": "2.0.29",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",