@builder.io/sdk-solid 0.14.5 → 1.0.12

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.
@@ -1,5 +1,5 @@
1
1
  import { createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
2
- import { createContext, useContext, Show, For, createSignal, onMount, createEffect, on } from 'solid-js';
2
+ import { createContext, useContext, Show, For, createSignal, createMemo, onMount, createEffect, on } from 'solid-js';
3
3
  import { css } from 'solid-styled-components';
4
4
 
5
5
  // src/blocks/button/button.tsx
@@ -281,7 +281,7 @@ function flattenState({
281
281
  return localState[prop];
282
282
  }
283
283
  const val = target[prop];
284
- if (typeof val === "object") {
284
+ if (typeof val === "object" && val !== null) {
285
285
  return flattenState({
286
286
  rootState: val,
287
287
  localState: void 0,
@@ -333,6 +333,30 @@ var shouldForceBrowserRuntimeInNode = () => {
333
333
  var chooseBrowserOrServerEval = (args) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(args) : runInBrowser(args);
334
334
 
335
335
  // src/functions/evaluate/evaluate.ts
336
+ var EvalCache = class _EvalCache {
337
+ static cacheLimit = 20;
338
+ static cache = /* @__PURE__ */ new Map();
339
+ static getCacheKey(args) {
340
+ return JSON.stringify({
341
+ ...args,
342
+ // replace the event with a random number to break cache
343
+ // thats because we can't serialize the event object due to circular refs in DOM node refs.
344
+ event: args.event ? Math.random() : void 0
345
+ });
346
+ }
347
+ static getCachedValue(key) {
348
+ const cachedVal = _EvalCache.cache.get(key);
349
+ return cachedVal;
350
+ }
351
+ static setCachedValue(key, value) {
352
+ if (_EvalCache.cache.size > 20) {
353
+ _EvalCache.cache.delete(_EvalCache.cache.keys().next().value);
354
+ }
355
+ _EvalCache.cache.set(key, {
356
+ value
357
+ });
358
+ }
359
+ };
336
360
  function evaluate({
337
361
  code,
338
362
  context,
@@ -340,11 +364,12 @@ function evaluate({
340
364
  rootState,
341
365
  rootSetState,
342
366
  event,
343
- isExpression = true
367
+ isExpression = true,
368
+ enableCache
344
369
  }) {
345
370
  if (code === "") {
346
371
  logger.warn("Skipping evaluation of empty code block.");
347
- return;
372
+ return void 0;
348
373
  }
349
374
  const args = {
350
375
  code: parseCode(code, {
@@ -357,8 +382,20 @@ function evaluate({
357
382
  rootState,
358
383
  localState
359
384
  };
385
+ if (enableCache) {
386
+ const cacheKey = EvalCache.getCacheKey(args);
387
+ const cachedValue = EvalCache.getCachedValue(cacheKey);
388
+ if (cachedValue) {
389
+ return cachedValue.value;
390
+ }
391
+ }
360
392
  try {
361
- return chooseBrowserOrServerEval(args);
393
+ const newEval = chooseBrowserOrServerEval(args);
394
+ if (enableCache) {
395
+ const cacheKey = EvalCache.getCacheKey(args);
396
+ EvalCache.setCachedValue(cacheKey, newEval);
397
+ }
398
+ return newEval;
362
399
  } catch (e) {
363
400
  logger.error("Failed code evaluation: " + e.message, {
364
401
  code
@@ -413,7 +450,8 @@ var evaluateBindings = ({
413
450
  localState,
414
451
  rootState,
415
452
  rootSetState,
416
- context
453
+ context,
454
+ enableCache: true
417
455
  });
418
456
  set(copied, binding, value);
419
457
  }
@@ -647,6 +685,70 @@ function bindScrollInViewAnimation(animation) {
647
685
  });
648
686
  }
649
687
 
688
+ // src/functions/camel-to-kebab-case.ts
689
+ var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
690
+
691
+ // src/helpers/css.ts
692
+ var convertStyleMapToCSSArray = (style) => {
693
+ const cssProps = Object.entries(style).map(([key, value]) => {
694
+ if (typeof value === "string") {
695
+ return `${camelToKebabCase(key)}: ${value};`;
696
+ } else {
697
+ return void 0;
698
+ }
699
+ });
700
+ return cssProps.filter(checkIsDefined);
701
+ };
702
+ var convertStyleMapToCSS = (style) => convertStyleMapToCSSArray(style).join("\n");
703
+ var createCssClass = ({
704
+ mediaQuery,
705
+ className,
706
+ styles
707
+ }) => {
708
+ const cssClass = `.${className} {
709
+ ${convertStyleMapToCSS(styles)}
710
+ }`;
711
+ if (mediaQuery) {
712
+ return `${mediaQuery} {
713
+ ${cssClass}
714
+ }`;
715
+ } else {
716
+ return cssClass;
717
+ }
718
+ };
719
+
720
+ // src/functions/transform-style-property.ts
721
+ function transformStyleProperty({
722
+ style
723
+ }) {
724
+ return style;
725
+ }
726
+
727
+ // src/functions/get-style.ts
728
+ var getStyle = ({
729
+ block,
730
+ context
731
+ }) => {
732
+ return mapStyleObjToStrIfNeeded(transformStyleProperty({
733
+ style: block.style || {},
734
+ context,
735
+ block
736
+ }));
737
+ };
738
+ function mapStyleObjToStrIfNeeded(style) {
739
+ switch (TARGET) {
740
+ case "svelte":
741
+ case "vue":
742
+ case "solid":
743
+ return convertStyleMapToCSSArray(style).join(" ");
744
+ case "qwik":
745
+ case "reactNative":
746
+ case "react":
747
+ case "rsc":
748
+ return style;
749
+ }
750
+ }
751
+
650
752
  // src/components/block/block.helpers.ts
651
753
  var getComponent = ({
652
754
  block,
@@ -690,7 +792,8 @@ var getRepeatItemData = ({
690
792
  localState: context.localState,
691
793
  rootState: context.rootState,
692
794
  rootSetState: context.rootSetState,
693
- context: context.context
795
+ context: context.context,
796
+ enableCache: true
694
797
  });
695
798
  if (!Array.isArray(itemsArray)) {
696
799
  return void 0;
@@ -761,38 +864,6 @@ var getSizesForBreakpoints = ({
761
864
  };
762
865
  return newSizes;
763
866
  };
764
-
765
- // src/functions/camel-to-kebab-case.ts
766
- var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
767
-
768
- // src/helpers/css.ts
769
- var convertStyleMapToCSSArray = (style) => {
770
- const cssProps = Object.entries(style).map(([key, value]) => {
771
- if (typeof value === "string") {
772
- return `${camelToKebabCase(key)}: ${value};`;
773
- } else {
774
- return void 0;
775
- }
776
- });
777
- return cssProps.filter(checkIsDefined);
778
- };
779
- var convertStyleMapToCSS = (style) => convertStyleMapToCSSArray(style).join("\n");
780
- var createCssClass = ({
781
- mediaQuery,
782
- className,
783
- styles
784
- }) => {
785
- const cssClass = `.${className} {
786
- ${convertStyleMapToCSS(styles)}
787
- }`;
788
- if (mediaQuery) {
789
- return `${mediaQuery} {
790
- ${cssClass}
791
- }`;
792
- } else {
793
- return cssClass;
794
- }
795
- };
796
867
  var _tmpl$ = /* @__PURE__ */ template(`<style>`);
797
868
  function InlinedStyles(props) {
798
869
  return (() => {
@@ -813,7 +884,7 @@ var inlined_styles_default = InlinedStyles;
813
884
 
814
885
  // src/components/block/components/block-styles.tsx
815
886
  function BlockStyles(props) {
816
- function canShowBlock() {
887
+ const canShowBlock = createMemo(() => {
817
888
  const processedBlock = getProcessedBlock({
818
889
  block: props.block,
819
890
  localState: props.context.localState,
@@ -829,8 +900,8 @@ function BlockStyles(props) {
829
900
  return processedBlock.show;
830
901
  }
831
902
  return true;
832
- }
833
- function css5() {
903
+ });
904
+ const css5 = createMemo(() => {
834
905
  const processedBlock = getProcessedBlock({
835
906
  block: props.block,
836
907
  localState: props.context.localState,
@@ -864,7 +935,7 @@ function BlockStyles(props) {
864
935
  mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
865
936
  }) : "";
866
937
  return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
867
- }
938
+ });
868
939
  return createComponent(Show, {
869
940
  get when() {
870
941
  return memo(() => !!(TARGET !== "reactNative" && css5()))() && canShowBlock();
@@ -894,7 +965,8 @@ var createEventHandler = (value, options) => (event) => evaluate({
894
965
  rootState: options.rootState,
895
966
  rootSetState: options.rootSetState,
896
967
  event,
897
- isExpression: false
968
+ isExpression: false,
969
+ enableCache: true
898
970
  });
899
971
 
900
972
  // src/functions/get-block-actions.ts
@@ -922,38 +994,6 @@ function getBlockActions(options) {
922
994
  return obj;
923
995
  }
924
996
 
925
- // src/functions/transform-style-property.ts
926
- function transformStyleProperty({
927
- style
928
- }) {
929
- return style;
930
- }
931
-
932
- // src/functions/get-style.ts
933
- var getStyle = ({
934
- block,
935
- context
936
- }) => {
937
- return mapStyleObjToStrIfNeeded(transformStyleProperty({
938
- style: block.style || {},
939
- context,
940
- block
941
- }));
942
- };
943
- function mapStyleObjToStrIfNeeded(style) {
944
- switch (TARGET) {
945
- case "svelte":
946
- case "vue":
947
- case "solid":
948
- return convertStyleMapToCSSArray(style).join(" ");
949
- case "qwik":
950
- case "reactNative":
951
- case "react":
952
- case "rsc":
953
- return style;
954
- }
955
- }
956
-
957
997
  // src/functions/transform-block-properties.ts
958
998
  function transformBlockProperties({
959
999
  properties
@@ -1155,21 +1195,20 @@ var repeated_block_default = RepeatedBlock;
1155
1195
 
1156
1196
  // src/components/block/block.tsx
1157
1197
  function Block(props) {
1158
- const [childrenContext, setChildrenContext] = createSignal(props.context);
1159
- function blockComponent() {
1198
+ const blockComponent = createMemo(() => {
1160
1199
  return getComponent({
1161
1200
  block: props.block,
1162
1201
  context: props.context,
1163
1202
  registeredComponents: props.registeredComponents
1164
1203
  });
1165
- }
1166
- function repeatItem() {
1204
+ });
1205
+ const repeatItem = createMemo(() => {
1167
1206
  return getRepeatItemData({
1168
1207
  block: props.block,
1169
1208
  context: props.context
1170
1209
  });
1171
- }
1172
- function processedBlock() {
1210
+ });
1211
+ const processedBlock = createMemo(() => {
1173
1212
  return props.block.repeat?.collection ? props.block : getProcessedBlock({
1174
1213
  block: props.block,
1175
1214
  localState: props.context.localState,
@@ -1178,15 +1217,15 @@ function Block(props) {
1178
1217
  context: props.context.context,
1179
1218
  shouldEvaluateBindings: true
1180
1219
  });
1181
- }
1182
- function Tag() {
1220
+ });
1221
+ const Tag = createMemo(() => {
1183
1222
  const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
1184
1223
  if (shouldUseLink) {
1185
1224
  return props.linkComponent || "a";
1186
1225
  }
1187
1226
  return props.block.tagName || "div";
1188
- }
1189
- function canShowBlock() {
1227
+ });
1228
+ const canShowBlock = createMemo(() => {
1190
1229
  if (props.block.repeat?.collection) {
1191
1230
  if (repeatItem()?.length)
1192
1231
  return true;
@@ -1195,12 +1234,12 @@ function Block(props) {
1195
1234
  const shouldHide = "hide" in processedBlock() ? processedBlock().hide : false;
1196
1235
  const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
1197
1236
  return shouldShow && !shouldHide;
1198
- }
1199
- function childrenWithoutParentComponent() {
1237
+ });
1238
+ const childrenWithoutParentComponent = createMemo(() => {
1200
1239
  const shouldRenderChildrenOutsideRef = !blockComponent()?.component && !repeatItem();
1201
1240
  return shouldRenderChildrenOutsideRef ? processedBlock().children ?? [] : [];
1202
- }
1203
- function componentRefProps() {
1241
+ });
1242
+ const componentRefProps = createMemo(() => {
1204
1243
  return {
1205
1244
  blockChildren: processedBlock().children ?? [],
1206
1245
  componentRef: blockComponent()?.component,
@@ -1214,14 +1253,14 @@ function Block(props) {
1214
1253
  builderComponents: props.registeredComponents
1215
1254
  } : {}
1216
1255
  },
1217
- context: childrenContext(),
1256
+ context: props.context,
1218
1257
  linkComponent: props.linkComponent,
1219
1258
  registeredComponents: props.registeredComponents,
1220
1259
  builderBlock: processedBlock(),
1221
1260
  includeBlockProps: blockComponent()?.noWrap === true,
1222
1261
  isInteractive: !blockComponent()?.isRSC
1223
1262
  };
1224
- }
1263
+ });
1225
1264
  onMount(() => {
1226
1265
  const blockId = processedBlock().id;
1227
1266
  const animations = processedBlock().animations;
@@ -1363,14 +1402,14 @@ function Block(props) {
1363
1402
  return child.id;
1364
1403
  },
1365
1404
  block: child,
1366
- get context() {
1367
- return childrenContext();
1368
- },
1369
1405
  get registeredComponents() {
1370
1406
  return props.registeredComponents;
1371
1407
  },
1372
1408
  get linkComponent() {
1373
1409
  return props.linkComponent;
1410
+ },
1411
+ get context() {
1412
+ return props.context;
1374
1413
  }
1375
1414
  });
1376
1415
  }
@@ -1386,9 +1425,9 @@ function Block(props) {
1386
1425
  }
1387
1426
  var block_default = Block;
1388
1427
  function BlocksWrapper(props) {
1389
- function className() {
1428
+ const className = createMemo(() => {
1390
1429
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
1391
- }
1430
+ });
1392
1431
  function onClick() {
1393
1432
  if (isEditing() && !props.blocks?.length) {
1394
1433
  window.parent?.postMessage({
@@ -1528,7 +1567,7 @@ function Columns(props) {
1528
1567
  }) {
1529
1568
  return stackAt() === "never" ? desktopStyle : stackedStyle;
1530
1569
  }
1531
- function columnsCssVars() {
1570
+ const columnsCssVars = createMemo(() => {
1532
1571
  return {
1533
1572
  "--flex-dir": flexDir(),
1534
1573
  "--flex-dir-tablet": getTabletStyle({
@@ -1536,7 +1575,7 @@ function Columns(props) {
1536
1575
  desktopStyle: "row"
1537
1576
  })
1538
1577
  };
1539
- }
1578
+ });
1540
1579
  function columnCssVars(index) {
1541
1580
  const gutter = index === 0 ? 0 : gutterSize();
1542
1581
  const width = getColumnCssWidth(index);
@@ -1575,7 +1614,7 @@ function Columns(props) {
1575
1614
  const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
1576
1615
  return breakpointSizes[size].max;
1577
1616
  }
1578
- function columnsStyles() {
1617
+ const columnsStyles = createMemo(() => {
1579
1618
  return `
1580
1619
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
1581
1620
  .${props.builderBlock.id}-breakpoints {
@@ -1601,7 +1640,7 @@ function Columns(props) {
1601
1640
  }
1602
1641
  },
1603
1642
  `;
1604
- }
1643
+ });
1605
1644
  return (() => {
1606
1645
  const _el$ = _tmpl$2();
1607
1646
  spread(_el$, mergeProps({
@@ -1739,7 +1778,7 @@ var _tmpl$4 = /* @__PURE__ */ template(`<source type=image/webp>`);
1739
1778
  var _tmpl$22 = /* @__PURE__ */ template(`<picture><img loading=lazy>`);
1740
1779
  var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
1741
1780
  function Image(props) {
1742
- function srcSetToUse() {
1781
+ const srcSetToUse = createMemo(() => {
1743
1782
  const imageToUse = props.image || props.src;
1744
1783
  const url = imageToUse;
1745
1784
  if (!url || // We can auto add srcset for cdn.builder.io and shopify
@@ -1756,15 +1795,15 @@ function Image(props) {
1756
1795
  return getSrcSet(url);
1757
1796
  }
1758
1797
  return getSrcSet(url);
1759
- }
1760
- function webpSrcSet() {
1798
+ });
1799
+ const webpSrcSet = createMemo(() => {
1761
1800
  if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
1762
1801
  return srcSetToUse().replace(/\?/g, "?format=webp&");
1763
1802
  } else {
1764
1803
  return "";
1765
1804
  }
1766
- }
1767
- function aspectRatioCss() {
1805
+ });
1806
+ const aspectRatioCss = createMemo(() => {
1768
1807
  const aspectRatioStyles = {
1769
1808
  position: "absolute",
1770
1809
  height: "100%",
@@ -1774,7 +1813,7 @@ function Image(props) {
1774
1813
  };
1775
1814
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
1776
1815
  return out;
1777
- }
1816
+ });
1778
1817
  return [(() => {
1779
1818
  const _el$ = _tmpl$22(), _el$3 = _el$.firstChild;
1780
1819
  insert(_el$, createComponent(Show, {
@@ -1791,7 +1830,7 @@ function Image(props) {
1791
1830
  const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " " + css({
1792
1831
  opacity: "1",
1793
1832
  transition: "opacity 0.2s ease-in-out"
1794
- }), _v$2 = props.altText, _v$3 = props.altText ? "presentation" : void 0, _v$4 = {
1833
+ }), _v$2 = props.altText, _v$3 = props.altText ? void 0 : "presentation", _v$4 = {
1795
1834
  "object-position": props.backgroundPosition || "center",
1796
1835
  "object-fit": props.backgroundSize || "cover",
1797
1836
  ...aspectRatioCss()
@@ -2767,13 +2806,15 @@ function Embed(props) {
2767
2806
  }
2768
2807
  }
2769
2808
  let elem;
2809
+ const onUpdateFn_0_elem = createMemo(() => elem);
2810
+ const onUpdateFn_0_ranInitFn__ = createMemo(() => ranInitFn());
2770
2811
  function onUpdateFn_0() {
2771
2812
  if (elem && !ranInitFn()) {
2772
2813
  setRanInitFn(true);
2773
2814
  findAndRunScripts();
2774
2815
  }
2775
2816
  }
2776
- createEffect(on(() => [elem, ranInitFn()], onUpdateFn_0));
2817
+ createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
2777
2818
  return (() => {
2778
2819
  const _el$ = _tmpl$9();
2779
2820
  const _ref$ = elem;
@@ -3667,7 +3708,7 @@ var _tmpl$15 = /* @__PURE__ */ template(`<source type=video/mp4>`);
3667
3708
  var _tmpl$25 = /* @__PURE__ */ template(`<div>`);
3668
3709
  var _tmpl$33 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
3669
3710
  function Video(props) {
3670
- function videoProps() {
3711
+ const videoProps = createMemo(() => {
3671
3712
  return {
3672
3713
  ...props.autoPlay === true ? {
3673
3714
  autoPlay: true
@@ -3685,12 +3726,12 @@ function Video(props) {
3685
3726
  playsInline: true
3686
3727
  } : {}
3687
3728
  };
3688
- }
3689
- function spreadProps() {
3729
+ });
3730
+ const spreadProps = createMemo(() => {
3690
3731
  return {
3691
3732
  ...videoProps()
3692
3733
  };
3693
- }
3734
+ });
3694
3735
  return (() => {
3695
3736
  const _el$ = _tmpl$33(), _el$2 = _el$.firstChild;
3696
3737
  _el$.style.setProperty("position", "relative");
@@ -4405,7 +4446,7 @@ function isFromTrustedHost(trustedHosts, e) {
4405
4446
  }
4406
4447
 
4407
4448
  // src/constants/sdk-version.ts
4408
- var SDK_VERSION = "0.14.5";
4449
+ var SDK_VERSION = "1.0.12";
4409
4450
 
4410
4451
  // src/functions/register.ts
4411
4452
  var registry = {};
@@ -4684,7 +4725,11 @@ function EnableEditor(props) {
4684
4725
  context: props.context || {},
4685
4726
  localState: void 0,
4686
4727
  rootState: props.builderContextSignal.rootState,
4687
- rootSetState: props.builderContextSignal.rootSetState
4728
+ rootSetState: props.builderContextSignal.rootSetState,
4729
+ /**
4730
+ * We don't want to cache the result of the JS code, since it's arbitrary side effect code.
4731
+ */
4732
+ enableCache: false
4688
4733
  });
4689
4734
  }
4690
4735
  }
@@ -4707,13 +4752,14 @@ function EnableEditor(props) {
4707
4752
  }
4708
4753
  }
4709
4754
  function evalExpression(expression) {
4710
- return expression.replace(/{{([^}]+)}}/g, (_match, group) => evaluate({
4755
+ return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
4711
4756
  code: group,
4712
4757
  context: props.context || {},
4713
4758
  localState: void 0,
4714
4759
  rootState: props.builderContextSignal.rootState,
4715
- rootSetState: props.builderContextSignal.rootSetState
4716
- }));
4760
+ rootSetState: props.builderContextSignal.rootSetState,
4761
+ enableCache: true
4762
+ })));
4717
4763
  }
4718
4764
  function handleRequest({
4719
4765
  url,
@@ -4818,33 +4864,40 @@ function EnableEditor(props) {
4818
4864
  runHttpRequests();
4819
4865
  emitStateUpdate();
4820
4866
  });
4867
+ const onUpdateFn_0_props_content = createMemo(() => props.content);
4821
4868
  function onUpdateFn_0() {
4822
4869
  if (props.content) {
4823
4870
  mergeNewContent(props.content);
4824
4871
  }
4825
4872
  }
4826
- createEffect(on(() => [props.content], onUpdateFn_0));
4873
+ createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4874
+ const onUpdateFn_1_shouldSendResetCookie__ = createMemo(() => shouldSendResetCookie());
4827
4875
  function onUpdateFn_1() {
4828
4876
  }
4829
- createEffect(on(() => [shouldSendResetCookie()], onUpdateFn_1));
4877
+ createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
4878
+ const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
4830
4879
  function onUpdateFn_2() {
4831
4880
  evaluateJsCode();
4832
4881
  }
4833
- createEffect(on(() => [props.builderContextSignal.content?.data?.jsCode], onUpdateFn_2));
4882
+ createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__jsCode()], onUpdateFn_2));
4883
+ const onUpdateFn_3_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
4834
4884
  function onUpdateFn_3() {
4835
4885
  runHttpRequests();
4836
4886
  }
4837
- createEffect(on(() => [props.builderContextSignal.content?.data?.httpRequests], onUpdateFn_3));
4887
+ createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_3));
4888
+ const onUpdateFn_4_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
4838
4889
  function onUpdateFn_4() {
4839
4890
  emitStateUpdate();
4840
4891
  }
4841
- createEffect(on(() => [props.builderContextSignal.rootState], onUpdateFn_4));
4892
+ createEffect(on(() => [onUpdateFn_4_props_builderContextSignal_rootState()], onUpdateFn_4));
4893
+ const onUpdateFn_5_props_data = createMemo(() => props.data);
4842
4894
  function onUpdateFn_5() {
4843
4895
  if (props.data) {
4844
4896
  mergeNewRootState(props.data);
4845
4897
  }
4846
4898
  }
4847
- createEffect(on(() => [props.data], onUpdateFn_5));
4899
+ createEffect(on(() => [onUpdateFn_5_props_data()], onUpdateFn_5));
4900
+ const onUpdateFn_6_props_locale = createMemo(() => props.locale);
4848
4901
  function onUpdateFn_6() {
4849
4902
  if (props.locale) {
4850
4903
  mergeNewRootState({
@@ -4852,7 +4905,7 @@ function EnableEditor(props) {
4852
4905
  });
4853
4906
  }
4854
4907
  }
4855
- createEffect(on(() => [props.locale], onUpdateFn_6));
4908
+ createEffect(on(() => [onUpdateFn_6_props_locale()], onUpdateFn_6));
4856
4909
  return createComponent(builder_context_default.Provider, {
4857
4910
  get value() {
4858
4911
  return props.builderContextSignal;
@@ -5184,16 +5237,16 @@ function ContentVariants(props) {
5184
5237
  canTrack: getDefaultCanTrack(props.canTrack),
5185
5238
  content: props.content
5186
5239
  }));
5187
- function updateCookieAndStylesScriptStr() {
5240
+ const updateCookieAndStylesScriptStr = createMemo(() => {
5188
5241
  return getUpdateCookieAndStylesScript(getVariants(props.content).map((value) => ({
5189
5242
  id: value.testVariationId,
5190
5243
  testRatio: value.testRatio
5191
5244
  })), props.content?.id || "");
5192
- }
5193
- function hideVariantsStyleString() {
5245
+ });
5246
+ const hideVariantsStyleString = createMemo(() => {
5194
5247
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
5195
- }
5196
- function defaultContent() {
5248
+ });
5249
+ const defaultContent = createMemo(() => {
5197
5250
  return shouldRenderVariants() ? {
5198
5251
  ...props.content,
5199
5252
  testVariationId: props.content?.id
@@ -5201,7 +5254,7 @@ function ContentVariants(props) {
5201
5254
  item: props.content,
5202
5255
  canTrack: getDefaultCanTrack(props.canTrack)
5203
5256
  });
5204
- }
5257
+ });
5205
5258
  onMount(() => {
5206
5259
  setShouldRenderVariants(false);
5207
5260
  });
@@ -5381,9 +5434,9 @@ var fetchSymbolContent = async ({
5381
5434
  var _tmpl$17 = /* @__PURE__ */ template(`<div>`);
5382
5435
  function Symbol(props) {
5383
5436
  const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
5384
- function className() {
5437
+ const className = createMemo(() => {
5385
5438
  return [...[props.attributes[getClassPropName()]], "builder-symbol", props.symbol?.inline ? "builder-inline-symbol" : void 0, props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0].filter(Boolean).join(" ");
5386
- }
5439
+ });
5387
5440
  function setContent() {
5388
5441
  if (contentToUse())
5389
5442
  return;
@@ -5397,12 +5450,12 @@ function Symbol(props) {
5397
5450
  });
5398
5451
  }
5399
5452
  onMount(() => {
5400
- setContent();
5401
5453
  });
5454
+ const onUpdateFn_0_props_symbol = createMemo(() => props.symbol);
5402
5455
  function onUpdateFn_0() {
5403
5456
  setContent();
5404
5457
  }
5405
- createEffect(on(() => [props.symbol], onUpdateFn_0));
5458
+ createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
5406
5459
  return (() => {
5407
5460
  const _el$ = _tmpl$17();
5408
5461
  spread(_el$, mergeProps({