@builder.io/sdk-solid 2.0.15 → 2.0.21

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
@@ -75,10 +75,10 @@ function Button(props) {
75
75
  var button_default = Button;
76
76
 
77
77
  // src/blocks/columns/columns.tsx
78
- import { Show as Show6, For as For4, createSignal as createSignal7 } from "solid-js";
78
+ import { Show as Show7, For as For4, createSignal as createSignal7 } from "solid-js";
79
79
 
80
80
  // src/components/blocks/blocks.tsx
81
- import { useContext, Show as Show5, For as For3 } from "solid-js";
81
+ import { useContext, Show as Show6, For as For3 } from "solid-js";
82
82
 
83
83
  // src/context/builder.context.ts
84
84
  import { createContext } from "solid-js";
@@ -104,9 +104,9 @@ var components_context_default = createContext2({ registeredComponents: {} });
104
104
 
105
105
  // src/components/block/block.tsx
106
106
  import {
107
- Show as Show4,
107
+ Show as Show5,
108
108
  For as For2,
109
- onMount,
109
+ onMount as onMount2,
110
110
  createMemo as createMemo5,
111
111
  createSignal as createSignal5
112
112
  } from "solid-js";
@@ -250,29 +250,6 @@ var parseCode = (code, {
250
250
  const useCode = useReturn ? `return (${code});` : code;
251
251
  return useCode;
252
252
  };
253
-
254
- // src/functions/evaluate/browser-runtime/browser.ts
255
- var runInBrowser = ({
256
- code,
257
- builder,
258
- context,
259
- event,
260
- localState,
261
- rootSetState,
262
- rootState
263
- }) => {
264
- const functionArgs = getFunctionArguments({
265
- builder,
266
- context,
267
- event,
268
- state: flattenState({
269
- rootState,
270
- localState,
271
- rootSetState
272
- })
273
- });
274
- return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
275
- };
276
253
  function flattenState({
277
254
  rootState,
278
255
  localState,
@@ -307,6 +284,29 @@ function flattenState({
307
284
  });
308
285
  }
309
286
 
287
+ // src/functions/evaluate/browser-runtime/browser.ts
288
+ var runInBrowser = ({
289
+ code,
290
+ builder,
291
+ context,
292
+ event,
293
+ localState,
294
+ rootSetState,
295
+ rootState
296
+ }) => {
297
+ const functionArgs = getFunctionArguments({
298
+ builder,
299
+ context,
300
+ event,
301
+ state: flattenState({
302
+ rootState,
303
+ localState,
304
+ rootSetState
305
+ })
306
+ });
307
+ return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
308
+ };
309
+
310
310
  // src/constants/sdk-name.ts
311
311
  var SDK_NAME_FOR_TARGET = (() => {
312
312
  switch (TARGET) {
@@ -401,7 +401,7 @@ if (typeof output === 'object' && output !== null) {
401
401
  };
402
402
  var IVM_INSTANCE = null;
403
403
  var IVM_CONTEXT = null;
404
- var SHOULD_MENTION_INITIALIZE_SCRIPT = SDK_NAME === "@builder.io/sdk-react-nextjs" || SDK_NAME === "@builder.io/sdk-react" || SDK_NAME === "@builder.io/sdk-qwik";
404
+ var SHOULD_MENTION_INITIALIZE_SCRIPT = SDK_NAME === "@builder.io/sdk-react-nextjs" || SDK_NAME === "@builder.io/sdk-react" || SDK_NAME === "@builder.io/sdk-qwik" || SDK_NAME === "@builder.io/sdk-vue";
405
405
  var getIvm = () => {
406
406
  try {
407
407
  if (IVM_INSTANCE)
@@ -501,24 +501,30 @@ function isNodeRuntime() {
501
501
  }
502
502
 
503
503
  // src/functions/evaluate/should-force-browser-runtime-in-node.ts
504
- var shouldForceBrowserRuntimeInNode = () => {
504
+ var shouldForceBrowserRuntimeInNode = ({
505
+ shouldLogWarning
506
+ }) => {
505
507
  if (!isNodeRuntime())
506
508
  return false;
507
509
  const isArm64 = process.arch === "arm64";
508
510
  const isNode20 = process.version.startsWith("v20");
509
511
  const hasNoNodeSnapshotNodeOption = process.env.NODE_OPTIONS?.includes("--no-node-snapshot");
510
512
  if (isArm64 && isNode20 && !hasNoNodeSnapshotNodeOption) {
511
- logger.log(`Skipping usage of \`isolated-vm\` to avoid crashes in Node v20 on an arm64 machine.
513
+ if (shouldLogWarning) {
514
+ logger.log(`Skipping usage of \`isolated-vm\` to avoid crashes in Node v20 on an arm64 machine.
512
515
  If you would like to use the \`isolated-vm\` package on this machine, please provide the \`NODE_OPTIONS=--no-node-snapshot\` config to your Node process.
513
516
  See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.
514
517
  `);
518
+ }
515
519
  return true;
516
520
  }
517
521
  return false;
518
522
  };
519
523
 
520
524
  // src/functions/evaluate/choose-eval.ts
521
- var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(args) : runInNode(args);
525
+ var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode({
526
+ shouldLogWarning: true
527
+ }) ? runInBrowser(args) : runInNode(args);
522
528
 
523
529
  // src/functions/evaluate/evaluate.ts
524
530
  var DISABLE_CACHE = true;
@@ -1258,12 +1264,23 @@ function BlockWrapper(props) {
1258
1264
  var Block_wrapper_default = BlockWrapper;
1259
1265
 
1260
1266
  // src/components/block/components/component-ref/component-ref.tsx
1261
- import { Show as Show3, For, createSignal as createSignal3 } from "solid-js";
1267
+ import { Show as Show4, For, createSignal as createSignal3 } from "solid-js";
1262
1268
  import { Dynamic as Dynamic3 } from "solid-js/web";
1263
1269
 
1264
1270
  // src/components/block/components/interactive-element.tsx
1265
- import { createMemo as createMemo2 } from "solid-js";
1271
+ import { Show as Show3, createMemo as createMemo2 } from "solid-js";
1266
1272
  import { Dynamic as Dynamic2 } from "solid-js/web";
1273
+
1274
+ // src/components/awaiter.tsx
1275
+ import { onMount } from "solid-js";
1276
+ function Awaiter(props) {
1277
+ onMount(() => {
1278
+ });
1279
+ return <><>{props.children}</></>;
1280
+ }
1281
+ var Awaiter_default = Awaiter;
1282
+
1283
+ // src/components/block/components/interactive-element.tsx
1267
1284
  function InteractiveElement(props) {
1268
1285
  const attributes = createMemo2(() => {
1269
1286
  return props.includeBlockProps ? {
@@ -1280,11 +1297,19 @@ function InteractiveElement(props) {
1280
1297
  })
1281
1298
  } : {};
1282
1299
  });
1283
- return <><Dynamic2
1284
- {...props.wrapperProps}
1300
+ return <><Show3
1301
+ fallback={<Dynamic2
1302
+ {...props.wrapperProps}
1303
+ attributes={attributes()}
1304
+ component={props.Wrapper}
1305
+ >{props.children}</Dynamic2>}
1306
+ when={props.Wrapper.load}
1307
+ ><Awaiter_default
1308
+ load={props.Wrapper.load}
1309
+ fallback={props.Wrapper.fallback}
1310
+ props={props.wrapperProps}
1285
1311
  attributes={attributes()}
1286
- component={props.Wrapper}
1287
- >{props.children}</Dynamic2></>;
1312
+ >{props.children}</Awaiter_default></Show3></>;
1288
1313
  }
1289
1314
  var interactive_element_default = InteractiveElement;
1290
1315
 
@@ -1326,7 +1351,7 @@ function ComponentRef(props) {
1326
1351
  const [Wrapper, setWrapper] = createSignal3(
1327
1352
  props.isInteractive ? interactive_element_default : props.componentRef
1328
1353
  );
1329
- return <><Show3 when={props.componentRef}><Dynamic3
1354
+ return <><Show4 when={props.componentRef}><Dynamic3
1330
1355
  {...getWrapperProps({
1331
1356
  componentOptions: props.componentOptions,
1332
1357
  builderBlock: props.builderBlock,
@@ -1347,7 +1372,7 @@ function ComponentRef(props) {
1347
1372
  registeredComponents={props.registeredComponents}
1348
1373
  linkComponent={props.linkComponent}
1349
1374
  />;
1350
- }}</For></Dynamic3></Show3></>;
1375
+ }}</For></Dynamic3></Show4></>;
1351
1376
  }
1352
1377
  var Component_ref_default = ComponentRef;
1353
1378
 
@@ -1436,7 +1461,7 @@ function Block(props) {
1436
1461
  isInteractive: !(blockComponent()?.isRSC && TARGET === "rsc")
1437
1462
  };
1438
1463
  });
1439
- onMount(() => {
1464
+ onMount2(() => {
1440
1465
  const blockId = processedBlock().id;
1441
1466
  const animations = processedBlock().animations;
1442
1467
  if (animations && blockId) {
@@ -1448,13 +1473,13 @@ function Block(props) {
1448
1473
  );
1449
1474
  }
1450
1475
  });
1451
- return <><Show4 when={canShowBlock()}>
1476
+ return <><Show5 when={canShowBlock()}>
1452
1477
  <Block_styles_default
1453
1478
  block={processedBlock()}
1454
1479
  context={props.context}
1455
1480
  />
1456
- <Show4
1457
- fallback={<Show4
1481
+ <Show5
1482
+ fallback={<Show5
1458
1483
  fallback={<For2 each={repeatItem()}>{(data, _index) => {
1459
1484
  const index = _index();
1460
1485
  return <Repeated_block_default
@@ -1476,9 +1501,9 @@ function Block(props) {
1476
1501
  builderBlock={componentRefProps().builderBlock}
1477
1502
  includeBlockProps={componentRefProps().includeBlockProps}
1478
1503
  isInteractive={componentRefProps().isInteractive}
1479
- /></Show4>}
1504
+ /></Show5>}
1480
1505
  when={!blockComponent()?.noWrap}
1481
- ><Show4
1506
+ ><Show5
1482
1507
  fallback={<For2 each={repeatItem()}>{(data, _index) => {
1483
1508
  const index = _index();
1484
1509
  return <Repeated_block_default
@@ -1516,13 +1541,13 @@ function Block(props) {
1516
1541
  context={props.context}
1517
1542
  />;
1518
1543
  }}</For2>
1519
- </Block_wrapper_default></Show4></Show4>
1520
- </Show4></>;
1544
+ </Block_wrapper_default></Show5></Show5>
1545
+ </Show5></>;
1521
1546
  }
1522
1547
  var Block_default = Block;
1523
1548
 
1524
1549
  // src/components/blocks/blocks-wrapper.tsx
1525
- import { onMount as onMount2, createMemo as createMemo6 } from "solid-js";
1550
+ import { onMount as onMount3, createMemo as createMemo6 } from "solid-js";
1526
1551
  import { Dynamic as Dynamic4 } from "solid-js/web";
1527
1552
  function BlocksWrapper(props) {
1528
1553
  const className = createMemo6(() => {
@@ -1557,11 +1582,11 @@ function BlocksWrapper(props) {
1557
1582
  }
1558
1583
  }
1559
1584
  let blocksWrapperRef;
1560
- onMount2(() => {
1585
+ onMount3(() => {
1561
1586
  });
1562
1587
  return <>
1563
1588
  <Dynamic4
1564
- class={className() + " dynamic-4da8c6f4"}
1589
+ class={className() + " dynamic-68b2d7fe"}
1565
1590
  ref={blocksWrapperRef}
1566
1591
  builder-path={props.path}
1567
1592
  builder-parent-id={props.parent}
@@ -1573,7 +1598,7 @@ function BlocksWrapper(props) {
1573
1598
  {...props.BlocksWrapperProps}
1574
1599
  component={props.BlocksWrapper}
1575
1600
  >{props.children}</Dynamic4>
1576
- <style>{`.dynamic-4da8c6f4 {
1601
+ <style>{`.dynamic-68b2d7fe {
1577
1602
  display: flex;
1578
1603
  flex-direction: column;
1579
1604
  align-items: stretch;
@@ -1593,7 +1618,7 @@ function Blocks(props) {
1593
1618
  styleProp={props.styleProp}
1594
1619
  BlocksWrapper={props.context?.BlocksWrapper || builderContext.BlocksWrapper}
1595
1620
  BlocksWrapperProps={props.context?.BlocksWrapperProps || builderContext.BlocksWrapperProps}
1596
- ><Show5 when={props.blocks}><For3 each={props.blocks}>{(block, _index) => {
1621
+ ><Show6 when={props.blocks}><For3 each={props.blocks}>{(block, _index) => {
1597
1622
  const index = _index();
1598
1623
  return <Block_default
1599
1624
  key={block.id}
@@ -1602,7 +1627,7 @@ function Blocks(props) {
1602
1627
  context={props.context || builderContext}
1603
1628
  registeredComponents={props.registeredComponents || componentsContext.registeredComponents}
1604
1629
  />;
1605
- }}</For3></Show5></Blocks_wrapper_default></>;
1630
+ }}</For3></Show6></Blocks_wrapper_default></>;
1606
1631
  }
1607
1632
  var Blocks_default = Blocks;
1608
1633
 
@@ -1733,15 +1758,15 @@ function Columns(props) {
1733
1758
  }
1734
1759
  return <>
1735
1760
  <div
1736
- class={getColumnsClass(props.builderBlock?.id) + " div-3ff242de"}
1761
+ class={getColumnsClass(props.builderBlock?.id) + " div-46766f1c"}
1737
1762
  style={columnsCssVars()}
1738
1763
  {...{}}
1739
1764
  >
1740
- <Show6 when={TARGET !== "reactNative"}><Inlined_styles_default
1765
+ <Show7 when={TARGET !== "reactNative"}><Inlined_styles_default
1741
1766
  id="builderio-columns"
1742
1767
  styles={columnsStyles()}
1743
1768
  nonce={props.builderContext.nonce}
1744
- /></Show6>
1769
+ /></Show7>
1745
1770
  <For4 each={props.columns}>{(column, _index) => {
1746
1771
  const index = _index();
1747
1772
  return <Dynamic_renderer_default
@@ -1762,7 +1787,7 @@ function Columns(props) {
1762
1787
  /></Dynamic_renderer_default>;
1763
1788
  }}</For4>
1764
1789
  </div>
1765
- <style>{`.div-3ff242de {
1790
+ <style>{`.div-46766f1c {
1766
1791
  display: flex;
1767
1792
  line-height: normal;
1768
1793
  }`}</style>
@@ -1777,7 +1802,7 @@ function FragmentComponent(props) {
1777
1802
  var fragment_default = FragmentComponent;
1778
1803
 
1779
1804
  // src/blocks/image/image.tsx
1780
- import { Show as Show7, onMount as onMount3, createMemo as createMemo8 } from "solid-js";
1805
+ import { Show as Show8, onMount as onMount4, createMemo as createMemo8 } from "solid-js";
1781
1806
 
1782
1807
  // src/blocks/image/image.helpers.ts
1783
1808
  function removeProtocol(path) {
@@ -1867,14 +1892,14 @@ function Image(props) {
1867
1892
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
1868
1893
  return out;
1869
1894
  });
1870
- onMount3(() => {
1895
+ onMount4(() => {
1871
1896
  });
1872
1897
  return <>
1873
1898
  <>
1874
1899
  <picture>
1875
- <Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
1900
+ <Show8 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show8>
1876
1901
  <img
1877
- class={"builder-image" + (props.className ? " " + props.className : "") + " img-4512e110"}
1902
+ class={"builder-image" + (props.className ? " " + props.className : "") + " img-7e6ffddc"}
1878
1903
  loading={props.highPriority ? "eager" : "lazy"}
1879
1904
  fetchpriority={props.highPriority ? "high" : "auto"}
1880
1905
  alt={props.altText}
@@ -1889,25 +1914,25 @@ function Image(props) {
1889
1914
  sizes={props.sizes}
1890
1915
  />
1891
1916
  </picture>
1892
- <Show7
1917
+ <Show8
1893
1918
  when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
1894
1919
  ><div
1895
- class="builder-image-sizer div-4512e110"
1920
+ class="builder-image-sizer div-7e6ffddc"
1896
1921
  style={{
1897
1922
  "padding-top": props.aspectRatio * 100 + "%"
1898
1923
  }}
1899
- /></Show7>
1900
- <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
1901
- <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-4512e110-2">{props.children}</div></Show7>
1924
+ /></Show8>
1925
+ <Show8 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show8>
1926
+ <Show8 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-7e6ffddc-2">{props.children}</div></Show8>
1902
1927
  </>
1903
- <style>{`.img-4512e110 {
1928
+ <style>{`.img-7e6ffddc {
1904
1929
  opacity: 1;
1905
1930
  transition: opacity 0.2s ease-in-out;
1906
- }.div-4512e110 {
1931
+ }.div-7e6ffddc {
1907
1932
  width: 100%;
1908
1933
  pointer-events: none;
1909
1934
  font-size: 0;
1910
- }.div-4512e110-2 {
1935
+ }.div-7e6ffddc-2 {
1911
1936
  display: flex;
1912
1937
  flex-direction: column;
1913
1938
  align-items: stretch;
@@ -1943,10 +1968,10 @@ function SectionComponent(props) {
1943
1968
  var section_default = SectionComponent;
1944
1969
 
1945
1970
  // src/blocks/symbol/symbol.tsx
1946
- import { onMount as onMount7, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
1971
+ import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
1947
1972
 
1948
1973
  // src/components/content-variants/content-variants.tsx
1949
- import { Show as Show14, For as For9, onMount as onMount6, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
1974
+ import { Show as Show15, For as For9, onMount as onMount7, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
1950
1975
 
1951
1976
  // src/helpers/url.ts
1952
1977
  var getTopLevelDomain = (host) => {
@@ -2140,7 +2165,7 @@ var handleABTesting = async ({
2140
2165
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
2141
2166
 
2142
2167
  // src/components/content/content.tsx
2143
- import { Show as Show13, createSignal as createSignal18 } from "solid-js";
2168
+ import { Show as Show14, createSignal as createSignal18 } from "solid-js";
2144
2169
 
2145
2170
  // src/blocks/accordion/component-info.ts
2146
2171
  var defaultTitle = {
@@ -2274,7 +2299,7 @@ var componentInfo = {
2274
2299
  };
2275
2300
 
2276
2301
  // src/blocks/accordion/accordion.tsx
2277
- import { Show as Show8, For as For5, createSignal as createSignal9, createMemo as createMemo9 } from "solid-js";
2302
+ import { Show as Show9, For as For5, createSignal as createSignal9, createMemo as createMemo9 } from "solid-js";
2278
2303
 
2279
2304
  // src/blocks/accordion/helpers.ts
2280
2305
  var convertOrderNumberToString = (order) => {
@@ -2408,7 +2433,7 @@ function Accordion(props) {
2408
2433
  registeredComponents={props.builderComponents}
2409
2434
  linkComponent={props.builderLinkComponent}
2410
2435
  /></div>
2411
- <Show8 when={open().includes(index)}><div
2436
+ <Show9 when={open().includes(index)}><div
2412
2437
  class={getAccordionDetailClassName(index)}
2413
2438
  style={accordionDetailStyles()}
2414
2439
  ><Blocks_default
@@ -2418,7 +2443,7 @@ function Accordion(props) {
2418
2443
  context={props.builderContext}
2419
2444
  registeredComponents={props.builderComponents}
2420
2445
  linkComponent={props.builderLinkComponent}
2421
- /></div></Show8>
2446
+ /></div></Show9>
2422
2447
  </>;
2423
2448
  }}</For5></div></>;
2424
2449
  }
@@ -3099,7 +3124,7 @@ var componentInfo9 = {
3099
3124
  };
3100
3125
 
3101
3126
  // src/blocks/tabs/tabs.tsx
3102
- import { Show as Show9, For as For6, createSignal as createSignal10 } from "solid-js";
3127
+ import { Show as Show10, For as For6, createSignal as createSignal10 } from "solid-js";
3103
3128
  function Tabs(props) {
3104
3129
  const [activeTab, setActiveTab] = createSignal10(
3105
3130
  props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
@@ -3141,14 +3166,14 @@ function Tabs(props) {
3141
3166
  linkComponent={props.builderLinkComponent}
3142
3167
  /></span>;
3143
3168
  }}</For6></div>
3144
- <Show9 when={activeTabContent(activeTab())}><div><Blocks_default
3169
+ <Show10 when={activeTabContent(activeTab())}><div><Blocks_default
3145
3170
  parent={props.builderBlock.id}
3146
3171
  path={`component.options.tabs.${activeTab()}.content`}
3147
3172
  blocks={activeTabContent(activeTab())}
3148
3173
  context={props.builderContext}
3149
3174
  registeredComponents={props.builderComponents}
3150
3175
  linkComponent={props.builderLinkComponent}
3151
- /></div></Show9>
3176
+ /></div></Show10>
3152
3177
  </div></>;
3153
3178
  }
3154
3179
  var tabs_default = Tabs;
@@ -3237,12 +3262,12 @@ var componentInfo11 = {
3237
3262
  };
3238
3263
 
3239
3264
  // src/blocks/custom-code/custom-code.tsx
3240
- import { onMount as onMount4, createSignal as createSignal12 } from "solid-js";
3265
+ import { onMount as onMount5, createSignal as createSignal12 } from "solid-js";
3241
3266
  function CustomCode(props) {
3242
3267
  const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3243
3268
  const [scriptsRun, setScriptsRun] = createSignal12([]);
3244
3269
  let elementRef;
3245
- onMount4(() => {
3270
+ onMount5(() => {
3246
3271
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
3247
3272
  return;
3248
3273
  }
@@ -3592,7 +3617,7 @@ var componentInfo13 = {
3592
3617
  };
3593
3618
 
3594
3619
  // src/blocks/form/form/form.tsx
3595
- import { Show as Show10, For as For7, createSignal as createSignal14 } from "solid-js";
3620
+ import { Show as Show11, For as For7, createSignal as createSignal14 } from "solid-js";
3596
3621
 
3597
3622
  // src/functions/get-env.ts
3598
3623
  var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
@@ -3807,7 +3832,7 @@ function FormComponent(props) {
3807
3832
  {...{}}
3808
3833
  {...props.attributes}
3809
3834
  >
3810
- <Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
3835
+ <Show11 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
3811
3836
  const idx = _index();
3812
3837
  return <Block_default
3813
3838
  key={`form-block-${idx}`}
@@ -3816,23 +3841,23 @@ function FormComponent(props) {
3816
3841
  registeredComponents={props.builderComponents}
3817
3842
  linkComponent={props.builderLinkComponent}
3818
3843
  />;
3819
- }}</For7></Show10>
3820
- <Show10 when={submissionState() === "error"}><Blocks_default
3844
+ }}</For7></Show11>
3845
+ <Show11 when={submissionState() === "error"}><Blocks_default
3821
3846
  path="errorMessage"
3822
3847
  blocks={props.errorMessage}
3823
3848
  context={props.builderContext}
3824
- /></Show10>
3825
- <Show10 when={submissionState() === "sending"}><Blocks_default
3849
+ /></Show11>
3850
+ <Show11 when={submissionState() === "sending"}><Blocks_default
3826
3851
  path="sendingMessage"
3827
3852
  blocks={props.sendingMessage}
3828
3853
  context={props.builderContext}
3829
- /></Show10>
3830
- <Show10 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-2e825338">{JSON.stringify(responseData(), null, 2)}</pre></Show10>
3831
- <Show10 when={submissionState() === "success"}><Blocks_default
3854
+ /></Show11>
3855
+ <Show11 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-2e825338">{JSON.stringify(responseData(), null, 2)}</pre></Show11>
3856
+ <Show11 when={submissionState() === "success"}><Blocks_default
3832
3857
  path="successMessage"
3833
3858
  blocks={props.successMessage}
3834
3859
  context={props.builderContext}
3835
- /></Show10>
3860
+ /></Show11>
3836
3861
  </form>
3837
3862
  <style>{`.pre-2e825338 {
3838
3863
  padding: 10px;
@@ -4184,7 +4209,7 @@ var componentInfo19 = {
4184
4209
  };
4185
4210
 
4186
4211
  // src/blocks/video/video.tsx
4187
- import { Show as Show11, createMemo as createMemo15 } from "solid-js";
4212
+ import { Show as Show12, createMemo as createMemo15 } from "solid-js";
4188
4213
  function Video(props) {
4189
4214
  const videoProps = createMemo15(() => {
4190
4215
  return {
@@ -4235,8 +4260,8 @@ function Video(props) {
4235
4260
  }}
4236
4261
  src={props.video || "no-src"}
4237
4262
  poster={props.posterImage}
4238
- ><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
4239
- <Show11
4263
+ ><Show12 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show12></video>
4264
+ <Show12
4240
4265
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
4241
4266
  ><div
4242
4267
  style={{
@@ -4245,15 +4270,15 @@ function Video(props) {
4245
4270
  "pointer-events": "none",
4246
4271
  "font-size": "0px"
4247
4272
  }}
4248
- /></Show11>
4249
- <Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
4273
+ /></Show12>
4274
+ <Show12 when={props.builderBlock?.children?.length && props.fitContent}><div
4250
4275
  style={{
4251
4276
  display: "flex",
4252
4277
  "flex-direction": "column",
4253
4278
  "align-items": "stretch"
4254
4279
  }}
4255
- >{props.children}</div></Show11>
4256
- <Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
4280
+ >{props.children}</div></Show12>
4281
+ <Show12 when={props.builderBlock?.children?.length && !props.fitContent}><div
4257
4282
  style={{
4258
4283
  "pointer-events": "none",
4259
4284
  display: "flex",
@@ -4265,7 +4290,7 @@ function Video(props) {
4265
4290
  width: "100%",
4266
4291
  height: "100%"
4267
4292
  }}
4268
- >{props.children}</div></Show11>
4293
+ >{props.children}</div></Show12>
4269
4294
  </div></>;
4270
4295
  }
4271
4296
  var video_default = Video;
@@ -4410,8 +4435,8 @@ var Inlined_script_default = InlinedScript;
4410
4435
 
4411
4436
  // src/components/content/components/enable-editor.tsx
4412
4437
  import {
4413
- Show as Show12,
4414
- onMount as onMount5,
4438
+ Show as Show13,
4439
+ onMount as onMount6,
4415
4440
  on as on3,
4416
4441
  createEffect as createEffect3,
4417
4442
  createMemo as createMemo16,
@@ -4918,7 +4943,7 @@ function isFromTrustedHost(trustedHosts, e) {
4918
4943
  }
4919
4944
 
4920
4945
  // src/constants/sdk-version.ts
4921
- var SDK_VERSION = "2.0.15";
4946
+ var SDK_VERSION = "2.0.21";
4922
4947
 
4923
4948
  // src/functions/register.ts
4924
4949
  var registry = {};
@@ -5271,22 +5296,6 @@ function EnableEditor(props) {
5271
5296
  }
5272
5297
  })(event);
5273
5298
  }
5274
- function evaluateJsCode() {
5275
- const jsCode = props.builderContextSignal.content?.data?.jsCode;
5276
- if (jsCode) {
5277
- evaluate({
5278
- code: jsCode,
5279
- context: props.context || {},
5280
- localState: void 0,
5281
- rootState: props.builderContextSignal.rootState,
5282
- rootSetState: props.builderContextSignal.rootSetState,
5283
- /**
5284
- * We don't want to cache the result of the JS code, since it's arbitrary side effect code.
5285
- */
5286
- enableCache: false
5287
- });
5288
- }
5289
- }
5290
5299
  function onClick(event) {
5291
5300
  if (props.builderContextSignal.content) {
5292
5301
  const variationId = props.builderContextSignal.content?.testVariationId;
@@ -5328,7 +5337,7 @@ function EnableEditor(props) {
5328
5337
  })
5329
5338
  )
5330
5339
  );
5331
- fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
5340
+ fetch(evaluatedUrl).then((response) => response.json()).then((json) => {
5332
5341
  mergeNewRootState({
5333
5342
  [key]: json
5334
5343
  });
@@ -5358,7 +5367,9 @@ function EnableEditor(props) {
5358
5367
  }
5359
5368
  }
5360
5369
  let elementRef;
5361
- onMount5(() => {
5370
+ runHttpRequests();
5371
+ emitStateUpdate();
5372
+ onMount6(() => {
5362
5373
  if (isBrowser()) {
5363
5374
  if (isEditing()) {
5364
5375
  window.addEventListener("message", processMessage);
@@ -5419,16 +5430,6 @@ function EnableEditor(props) {
5419
5430
  }
5420
5431
  }
5421
5432
  });
5422
- onMount5(() => {
5423
- if (!props.apiKey) {
5424
- logger.error(
5425
- "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
5426
- );
5427
- }
5428
- evaluateJsCode();
5429
- runHttpRequests();
5430
- emitStateUpdate();
5431
- });
5432
5433
  const onUpdateFn_0_props_content = createMemo16(() => props.content);
5433
5434
  function onUpdateFn_0() {
5434
5435
  if (props.content) {
@@ -5436,57 +5437,35 @@ function EnableEditor(props) {
5436
5437
  }
5437
5438
  }
5438
5439
  createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
5439
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo16(() => props.builderContextSignal.content?.data?.jsCode);
5440
- function onUpdateFn_1() {
5441
- evaluateJsCode();
5442
- }
5443
- createEffect3(
5444
- on3(
5445
- () => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
5446
- onUpdateFn_1
5447
- )
5448
- );
5449
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo16(() => props.builderContextSignal.content?.data?.httpRequests);
5450
- function onUpdateFn_2() {
5451
- runHttpRequests();
5452
- }
5453
- createEffect3(
5454
- on3(
5455
- () => [
5456
- onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
5457
- ],
5458
- onUpdateFn_2
5459
- )
5460
- );
5461
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo16(
5440
+ const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
5462
5441
  () => props.builderContextSignal.rootState
5463
5442
  );
5464
- function onUpdateFn_3() {
5443
+ function onUpdateFn_1() {
5465
5444
  emitStateUpdate();
5466
5445
  }
5467
5446
  createEffect3(
5468
5447
  on3(
5469
- () => [onUpdateFn_3_props_builderContextSignal_rootState()],
5470
- onUpdateFn_3
5448
+ () => [onUpdateFn_1_props_builderContextSignal_rootState()],
5449
+ onUpdateFn_1
5471
5450
  )
5472
5451
  );
5473
- const onUpdateFn_4_props_data = createMemo16(() => props.data);
5474
- function onUpdateFn_4() {
5452
+ const onUpdateFn_2_props_data = createMemo16(() => props.data);
5453
+ function onUpdateFn_2() {
5475
5454
  if (props.data) {
5476
5455
  mergeNewRootState(props.data);
5477
5456
  }
5478
5457
  }
5479
- createEffect3(on3(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
5480
- const onUpdateFn_5_props_locale = createMemo16(() => props.locale);
5481
- function onUpdateFn_5() {
5458
+ createEffect3(on3(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
5459
+ const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
5460
+ function onUpdateFn_3() {
5482
5461
  if (props.locale) {
5483
5462
  mergeNewRootState({
5484
5463
  locale: props.locale
5485
5464
  });
5486
5465
  }
5487
5466
  }
5488
- createEffect3(on3(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
5489
- return <><builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
5467
+ createEffect3(on3(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
5468
+ return <><builder_context_default.Provider value={props.builderContextSignal}><Show13 when={props.builderContextSignal.content}><Dynamic5
5490
5469
  class={getWrapperClassName(
5491
5470
  props.content?.testVariationId || props.content?.id
5492
5471
  )}
@@ -5499,7 +5478,7 @@ function EnableEditor(props) {
5499
5478
  {...showContentProps()}
5500
5479
  {...props.contentWrapperProps}
5501
5480
  component={ContentWrapper()}
5502
- >{props.children}</Dynamic5></Show12></builder_context_default.Provider></>;
5481
+ >{props.children}</Dynamic5></Show13></builder_context_default.Provider></>;
5503
5482
  }
5504
5483
  var Enable_editor_default = EnableEditor;
5505
5484
 
@@ -5636,6 +5615,31 @@ function ContentComponent(props) {
5636
5615
  rootState: newRootState
5637
5616
  }));
5638
5617
  }
5618
+ if (!props.apiKey) {
5619
+ logger.error(
5620
+ "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
5621
+ );
5622
+ }
5623
+ const jsCode = builderContextSignal().content?.data?.jsCode;
5624
+ if (jsCode) {
5625
+ evaluate({
5626
+ code: jsCode,
5627
+ context: props.context || {},
5628
+ localState: void 0,
5629
+ rootState: builderContextSignal().rootState,
5630
+ rootSetState: (newState) => {
5631
+ setBuilderContextSignal((PREVIOUS_VALUE) => ({
5632
+ ...PREVIOUS_VALUE,
5633
+ rootState: newState
5634
+ }));
5635
+ },
5636
+ isExpression: false,
5637
+ /**
5638
+ * We don't want to cache the result of the JS code, since it's arbitrary side effect code.
5639
+ */
5640
+ enableCache: false
5641
+ });
5642
+ }
5639
5643
  return <><components_context_default.Provider
5640
5644
  value={{
5641
5645
  registeredComponents: registeredComponents()
@@ -5659,18 +5663,18 @@ function ContentComponent(props) {
5659
5663
  setBuilderContextSignal
5660
5664
  }}
5661
5665
  >
5662
- <Show13 when={props.isSsrAbTest}><Inlined_script_default
5666
+ <Show14 when={props.isSsrAbTest}><Inlined_script_default
5663
5667
  id="builderio-variant-visibility"
5664
5668
  scriptStr={scriptStr()}
5665
5669
  nonce={props.nonce || ""}
5666
- /></Show13>
5667
- <Show13 when={TARGET !== "reactNative"}><Styles_default
5670
+ /></Show14>
5671
+ <Show14 when={TARGET !== "reactNative"}><Styles_default
5668
5672
  nonce={props.nonce || ""}
5669
5673
  isNestedRender={props.isNestedRender}
5670
5674
  contentId={builderContextSignal().content?.id}
5671
5675
  cssCode={builderContextSignal().content?.data?.cssCode}
5672
5676
  customFonts={builderContextSignal().content?.data?.customFonts}
5673
- /></Show13>
5677
+ /></Show14>
5674
5678
  <Blocks_default
5675
5679
  blocks={builderContextSignal().content?.data?.blocks}
5676
5680
  context={builderContextSignal()}
@@ -5710,16 +5714,16 @@ function ContentVariants(props) {
5710
5714
  canTrack: getDefaultCanTrack(props.canTrack)
5711
5715
  });
5712
5716
  });
5713
- onMount6(() => {
5717
+ onMount7(() => {
5714
5718
  setShouldRenderVariants(false);
5715
5719
  });
5716
5720
  return <><>
5717
- <Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5721
+ <Show15 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5718
5722
  id="builderio-init-variants-fns"
5719
5723
  scriptStr={getInitVariantsFnsScriptString()}
5720
5724
  nonce={props.nonce || ""}
5721
- /></Show14>
5722
- <Show14 when={shouldRenderVariants()}>
5725
+ /></Show15>
5726
+ <Show15 when={shouldRenderVariants()}>
5723
5727
  <Inlined_styles_default
5724
5728
  id="builderio-variants"
5725
5729
  styles={hideVariantsStyleString()}
@@ -5757,7 +5761,7 @@ function ContentVariants(props) {
5757
5761
  {...{}}
5758
5762
  />;
5759
5763
  }}</For9>
5760
- </Show14>
5764
+ </Show15>
5761
5765
  <Content_default
5762
5766
  nonce={props.nonce}
5763
5767
  isNestedRender={props.isNestedRender}
@@ -5838,7 +5842,7 @@ function Symbol(props) {
5838
5842
  }
5839
5843
  });
5840
5844
  }
5841
- onMount7(() => {
5845
+ onMount8(() => {
5842
5846
  });
5843
5847
  const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
5844
5848
  function onUpdateFn_0() {