@builder.io/sdk-solid 4.0.6 → 4.0.7

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.
@@ -1093,6 +1093,9 @@ var provideBuilderContext = (block, context) => {
1093
1093
  };
1094
1094
  return {};
1095
1095
  };
1096
+ var generateKey = (index) => {
1097
+ return index.toString();
1098
+ };
1096
1099
 
1097
1100
  // src/components/block/components/block-styles.tsx
1098
1101
  import { Show as Show2, createMemo } from "solid-js";
@@ -1400,9 +1403,12 @@ function InteractiveElement(props) {
1400
1403
  })
1401
1404
  } : {};
1402
1405
  });
1406
+ const targetWrapperProps = createMemo2(() => {
1407
+ return props.wrapperProps;
1408
+ });
1403
1409
  return <><Show3
1404
1410
  fallback={<Dynamic2
1405
- {...props.wrapperProps}
1411
+ {...targetWrapperProps()}
1406
1412
  attributes={attributes()}
1407
1413
  component={props.Wrapper}
1408
1414
  >{props.children}</Dynamic2>}
@@ -1498,9 +1504,16 @@ function ComponentRef(props) {
1498
1504
  var Component_ref_default = ComponentRef;
1499
1505
 
1500
1506
  // src/components/block/components/repeated-block.tsx
1501
- import { createSignal as createSignal4 } from "solid-js";
1507
+ import { on as on2, createEffect as createEffect2, createMemo as createMemo4, createSignal as createSignal4 } from "solid-js";
1502
1508
  function RepeatedBlock(props) {
1503
1509
  const [store, setStore] = createSignal4(props.repeatContext);
1510
+ const onUpdateFn_0_props_repeatContext = createMemo4(
1511
+ () => props.repeatContext
1512
+ );
1513
+ function onUpdateFn_0() {
1514
+ setStore(props.repeatContext);
1515
+ }
1516
+ createEffect2(on2(() => [onUpdateFn_0_props_repeatContext()], onUpdateFn_0));
1504
1517
  return <><builder_context_default.Provider value={store()}><Block_default
1505
1518
  block={props.block}
1506
1519
  context={store()}
@@ -1605,7 +1618,7 @@ function Block(props) {
1605
1618
  fallback={<For2 each={repeatItem()}>{(data, _index) => {
1606
1619
  const index = _index();
1607
1620
  return <Repeated_block_default
1608
- key={index}
1621
+ key={generateKey(index)}
1609
1622
  repeatContext={data.context}
1610
1623
  block={data.block}
1611
1624
  registeredComponents={props.registeredComponents}
@@ -1629,7 +1642,7 @@ function Block(props) {
1629
1642
  fallback={<For2 each={repeatItem()}>{(data, _index) => {
1630
1643
  const index = _index();
1631
1644
  return <Repeated_block_default
1632
- key={index}
1645
+ key={generateKey(index)}
1633
1646
  repeatContext={data.context}
1634
1647
  block={data.block}
1635
1648
  registeredComponents={props.registeredComponents}
@@ -1669,7 +1682,7 @@ function Block(props) {
1669
1682
  var Block_default = Block;
1670
1683
 
1671
1684
  // src/components/blocks/blocks-wrapper.tsx
1672
- import { onMount as onMount3, on as on3, createEffect as createEffect3, createMemo as createMemo6, createSignal as createSignal6 } from "solid-js";
1685
+ import { onMount as onMount3, on as on4, createEffect as createEffect4, createMemo as createMemo6, createSignal as createSignal6 } from "solid-js";
1673
1686
  import { Dynamic as Dynamic4 } from "solid-js/web";
1674
1687
  function BlocksWrapper(props) {
1675
1688
  const [shouldUpdate, setShouldUpdate] = createSignal6(false);
@@ -1722,7 +1735,7 @@ function BlocksWrapper(props) {
1722
1735
  const onUpdateFn_0_props_blocks = createMemo6(() => props.blocks);
1723
1736
  function onUpdateFn_0() {
1724
1737
  }
1725
- createEffect3(on3(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
1738
+ createEffect4(on4(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
1726
1739
  return <>
1727
1740
  <Dynamic4
1728
1741
  class={className() + " dynamic-023c60f2"}
@@ -1947,7 +1960,7 @@ function FragmentComponent(props) {
1947
1960
  var fragment_default = FragmentComponent;
1948
1961
 
1949
1962
  // src/blocks/image/image.tsx
1950
- import { Show as Show8, createMemo as createMemo8 } from "solid-js";
1963
+ import { Show as Show8, onMount as onMount4, createMemo as createMemo8 } from "solid-js";
1951
1964
 
1952
1965
  // src/blocks/image/image.helpers.ts
1953
1966
  function removeProtocol(path) {
@@ -2036,12 +2049,14 @@ function Image(props) {
2036
2049
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
2037
2050
  return out;
2038
2051
  });
2052
+ onMount4(() => {
2053
+ });
2039
2054
  return <>
2040
2055
  <>
2041
2056
  <picture>
2042
2057
  <Show8 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show8>
2043
2058
  <img
2044
- class={"builder-image" + (props.className ? " " + props.className : "") + " img-040e729e"}
2059
+ class={"builder-image" + (props.className ? " " + props.className : "") + " img-5f381e78"}
2045
2060
  loading={props.highPriority ? "eager" : "lazy"}
2046
2061
  fetchpriority={props.highPriority ? "high" : "auto"}
2047
2062
  alt={props.altText}
@@ -2060,22 +2075,22 @@ function Image(props) {
2060
2075
  <Show8
2061
2076
  when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
2062
2077
  ><div
2063
- class="builder-image-sizer div-040e729e"
2078
+ class="builder-image-sizer div-5f381e78"
2064
2079
  style={{
2065
2080
  "padding-top": props.aspectRatio * 100 + "%"
2066
2081
  }}
2067
2082
  /></Show8>
2068
2083
  <Show8 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show8>
2069
- <Show8 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-040e729e-2">{props.children}</div></Show8>
2084
+ <Show8 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-5f381e78-2">{props.children}</div></Show8>
2070
2085
  </>
2071
- <style>{`.img-040e729e {
2086
+ <style>{`.img-5f381e78 {
2072
2087
  opacity: 1;
2073
2088
  transition: opacity 0.2s ease-in-out;
2074
- }.div-040e729e {
2089
+ }.div-5f381e78 {
2075
2090
  width: 100%;
2076
2091
  pointer-events: none;
2077
2092
  font-size: 0;
2078
- }.div-040e729e-2 {
2093
+ }.div-5f381e78-2 {
2079
2094
  display: flex;
2080
2095
  flex-direction: column;
2081
2096
  align-items: stretch;
@@ -2111,10 +2126,10 @@ function SectionComponent(props) {
2111
2126
  var section_default = SectionComponent;
2112
2127
 
2113
2128
  // src/blocks/symbol/symbol.tsx
2114
- import { onMount as onMount9, on as on7, createEffect as createEffect7, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
2129
+ import { onMount as onMount10, on as on8, createEffect as createEffect8, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
2115
2130
 
2116
2131
  // src/components/content-variants/content-variants.tsx
2117
- import { Show as Show16, For as For9, onMount as onMount8, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
2132
+ import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
2118
2133
 
2119
2134
  // src/helpers/url.ts
2120
2135
  var getTopLevelDomain = (host) => {
@@ -3095,7 +3110,7 @@ var componentInfo6 = {
3095
3110
  };
3096
3111
 
3097
3112
  // src/blocks/personalization-container/personalization-container.tsx
3098
- import { Show as Show10, For as For6, onMount as onMount4, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
3113
+ import { Show as Show10, For as For6, onMount as onMount5, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
3099
3114
 
3100
3115
  // src/components/inlined-script.tsx
3101
3116
  function InlinedScript(props) {
@@ -3360,7 +3375,7 @@ function PersonalizationContainer(props) {
3360
3375
  ).join("");
3361
3376
  });
3362
3377
  let rootRef;
3363
- onMount4(() => {
3378
+ onMount5(() => {
3364
3379
  setIsHydrated(true);
3365
3380
  const unsub = userAttributesService.subscribeOnUserAttributesChange(
3366
3381
  (attrs) => {
@@ -3762,10 +3777,10 @@ var tabs_default = Tabs;
3762
3777
 
3763
3778
  // src/blocks/text/component-info.ts
3764
3779
  var componentInfo11 = {
3765
- shouldReceiveBuilderProps: {
3766
- builderBlock: TARGET === "reactNative" ? true : false,
3780
+ shouldReceiveBuilderProps: TARGET === "reactNative" ? {
3781
+ builderBlock: true,
3767
3782
  builderContext: true
3768
- },
3783
+ } : {},
3769
3784
  name: "Text",
3770
3785
  static: true,
3771
3786
  isRSC: true,
@@ -3823,7 +3838,7 @@ var componentInfo12 = {
3823
3838
  };
3824
3839
 
3825
3840
  // src/blocks/custom-code/custom-code.tsx
3826
- import { onMount as onMount5, on as on4, createEffect as createEffect4, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
3841
+ import { onMount as onMount6, on as on5, createEffect as createEffect5, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
3827
3842
  function CustomCode(props) {
3828
3843
  const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3829
3844
  const [scriptsRun, setScriptsRun] = createSignal12([]);
@@ -3864,7 +3879,7 @@ function CustomCode(props) {
3864
3879
  }
3865
3880
  }
3866
3881
  let elementRef;
3867
- onMount5(() => {
3882
+ onMount6(() => {
3868
3883
  runScripts();
3869
3884
  });
3870
3885
  const onUpdateFn_0_props_code = createMemo12(() => props.code);
@@ -3873,7 +3888,7 @@ function CustomCode(props) {
3873
3888
  runScripts();
3874
3889
  }
3875
3890
  }
3876
- createEffect4(on4(() => [onUpdateFn_0_props_code()], onUpdateFn_0));
3891
+ createEffect5(on5(() => [onUpdateFn_0_props_code()], onUpdateFn_0));
3877
3892
  return <><div
3878
3893
  class={"builder-custom-code" + (props.replaceNodes ? " replace-nodes" : "")}
3879
3894
  ref={elementRef}
@@ -3901,7 +3916,7 @@ var componentInfo13 = {
3901
3916
  };
3902
3917
 
3903
3918
  // src/blocks/embed/embed.tsx
3904
- import { on as on5, createEffect as createEffect5, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
3919
+ import { on as on6, createEffect as createEffect6, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
3905
3920
 
3906
3921
  // src/blocks/embed/helpers.ts
3907
3922
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -3943,8 +3958,8 @@ function Embed(props) {
3943
3958
  findAndRunScripts();
3944
3959
  }
3945
3960
  }
3946
- createEffect5(
3947
- on5(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
3961
+ createEffect6(
3962
+ on6(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
3948
3963
  );
3949
3964
  return <><div class="builder-embed" ref={elem} innerHTML={props.content} /></>;
3950
3965
  }
@@ -4776,7 +4791,7 @@ var componentInfo20 = {
4776
4791
  };
4777
4792
 
4778
4793
  // src/blocks/video/video.tsx
4779
- import { Show as Show13, onMount as onMount6, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
4794
+ import { Show as Show13, onMount as onMount7, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
4780
4795
  function Video(props) {
4781
4796
  const [lazyVideoObserver, setLazyVideoObserver] = createSignal15(void 0);
4782
4797
  const videoProps = createMemo15(() => {
@@ -4804,7 +4819,7 @@ function Video(props) {
4804
4819
  };
4805
4820
  });
4806
4821
  let videoRef;
4807
- onMount6(() => {
4822
+ onMount7(() => {
4808
4823
  if (props.lazyLoad) {
4809
4824
  const oberver = new IntersectionObserver(function(entries) {
4810
4825
  entries.forEach(function(entry) {
@@ -5034,9 +5049,9 @@ var getUpdateVariantVisibilityScript = ({
5034
5049
  // src/components/content/components/enable-editor.tsx
5035
5050
  import {
5036
5051
  Show as Show14,
5037
- onMount as onMount7,
5038
- on as on6,
5039
- createEffect as createEffect6,
5052
+ onMount as onMount8,
5053
+ on as on7,
5054
+ createEffect as createEffect7,
5040
5055
  createMemo as createMemo16,
5041
5056
  createSignal as createSignal16
5042
5057
  } from "solid-js";
@@ -5048,7 +5063,7 @@ function getPreviewContent(_searchParams) {
5048
5063
  }
5049
5064
 
5050
5065
  // src/constants/sdk-version.ts
5051
- var SDK_VERSION = "4.0.6";
5066
+ var SDK_VERSION = "4.0.7";
5052
5067
 
5053
5068
  // src/helpers/sdk-headers.ts
5054
5069
  var getSdkHeaders = () => ({
@@ -6052,7 +6067,7 @@ function EnableEditor(props) {
6052
6067
  let elementRef;
6053
6068
  runHttpRequests();
6054
6069
  emitStateUpdate();
6055
- onMount7(() => {
6070
+ onMount8(() => {
6056
6071
  if (isBrowser()) {
6057
6072
  if (isEditing() && !props.isNestedRender) {
6058
6073
  window.addEventListener("message", processMessage);
@@ -6133,15 +6148,15 @@ function EnableEditor(props) {
6133
6148
  mergeNewContent(props.content);
6134
6149
  }
6135
6150
  }
6136
- createEffect6(on6(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
6151
+ createEffect7(on7(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
6137
6152
  const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
6138
6153
  () => props.builderContextSignal.rootState
6139
6154
  );
6140
6155
  function onUpdateFn_1() {
6141
6156
  emitStateUpdate();
6142
6157
  }
6143
- createEffect6(
6144
- on6(
6158
+ createEffect7(
6159
+ on7(
6145
6160
  () => [onUpdateFn_1_props_builderContextSignal_rootState()],
6146
6161
  onUpdateFn_1
6147
6162
  )
@@ -6152,7 +6167,7 @@ function EnableEditor(props) {
6152
6167
  mergeNewRootState(props.data);
6153
6168
  }
6154
6169
  }
6155
- createEffect6(on6(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
6170
+ createEffect7(on7(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
6156
6171
  const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
6157
6172
  function onUpdateFn_3() {
6158
6173
  if (props.locale) {
@@ -6161,7 +6176,7 @@ function EnableEditor(props) {
6161
6176
  });
6162
6177
  }
6163
6178
  }
6164
- createEffect6(on6(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
6179
+ createEffect7(on7(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
6165
6180
  return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
6166
6181
  when={props.builderContextSignal.content || needsElementRefDivForEditing()}
6167
6182
  ><Dynamic5
@@ -6403,7 +6418,7 @@ function ContentVariants(props) {
6403
6418
  canTrack: getDefaultCanTrack(props.canTrack)
6404
6419
  });
6405
6420
  });
6406
- onMount8(() => {
6421
+ onMount9(() => {
6407
6422
  setShouldRenderVariants(false);
6408
6423
  });
6409
6424
  return <><>
@@ -6533,13 +6548,13 @@ function Symbol(props) {
6533
6548
  }
6534
6549
  });
6535
6550
  }
6536
- onMount9(() => {
6551
+ onMount10(() => {
6537
6552
  });
6538
6553
  const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
6539
6554
  function onUpdateFn_0() {
6540
6555
  setContent();
6541
6556
  }
6542
- createEffect7(on7(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
6557
+ createEffect8(on8(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
6543
6558
  return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
6544
6559
  nonce={props.builderContext.nonce}
6545
6560
  isNestedRender={true}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-solid",
3
- "version": "4.0.6",
3
+ "version": "4.0.7",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",