@builder.io/sdk-solid 2.0.2 → 2.0.5

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.
@@ -518,6 +518,9 @@ function assign(target, ..._args) {
518
518
  return to;
519
519
  }
520
520
  function bindAnimations(animations) {
521
+ if (TARGET === "reactNative") {
522
+ return;
523
+ }
521
524
  for (const animation of animations) {
522
525
  switch (animation.trigger) {
523
526
  case "pageLoad":
@@ -1458,6 +1461,7 @@ function Columns(props) {
1458
1461
  return breakpointSizes[size].max;
1459
1462
  }
1460
1463
  function columnsStyles() {
1464
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
1461
1465
  return `
1462
1466
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
1463
1467
  .${props.builderBlock.id}-breakpoints {
@@ -1465,7 +1469,7 @@ function Columns(props) {
1465
1469
  align-items: stretch;
1466
1470
  }
1467
1471
 
1468
- .${props.builderBlock.id}-breakpoints > .builder-column {
1472
+ ${childColumnDiv} {
1469
1473
  width: var(--column-width-tablet) !important;
1470
1474
  margin-left: var(--column-margin-left-tablet) !important;
1471
1475
  }
@@ -1477,7 +1481,7 @@ function Columns(props) {
1477
1481
  align-items: stretch;
1478
1482
  }
1479
1483
 
1480
- .${props.builderBlock.id}-breakpoints > .builder-column {
1484
+ ${childColumnDiv} {
1481
1485
  width: var(--column-width-mobile) !important;
1482
1486
  margin-left: var(--column-margin-left-mobile) !important;
1483
1487
  }
@@ -1496,7 +1500,7 @@ function Columns(props) {
1496
1500
  }
1497
1501
  return <>
1498
1502
  <div
1499
- class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
1503
+ class={getColumnsClass(props.builderBlock?.id) + " div-3ff242de"}
1500
1504
  style={columnsCssVars()}
1501
1505
  {...{}}
1502
1506
  >
@@ -1525,7 +1529,7 @@ function Columns(props) {
1525
1529
  /></Dynamic_renderer_default>;
1526
1530
  }}</For4>
1527
1531
  </div>
1528
- <style>{`.div-5b8fb3ac {
1532
+ <style>{`.div-3ff242de {
1529
1533
  display: flex;
1530
1534
  line-height: normal;
1531
1535
  }`}</style>
@@ -1540,7 +1544,7 @@ function FragmentComponent(props) {
1540
1544
  var fragment_default = FragmentComponent;
1541
1545
 
1542
1546
  // src/blocks/image/image.tsx
1543
- import { Show as Show7, createMemo as createMemo8 } from "solid-js";
1547
+ import { Show as Show7, onMount as onMount2, createMemo as createMemo8 } from "solid-js";
1544
1548
 
1545
1549
  // src/blocks/image/image.helpers.ts
1546
1550
  function removeProtocol(path) {
@@ -1629,12 +1633,14 @@ function Image(props) {
1629
1633
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
1630
1634
  return out;
1631
1635
  });
1636
+ onMount2(() => {
1637
+ });
1632
1638
  return <>
1633
1639
  <>
1634
1640
  <picture>
1635
1641
  <Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
1636
1642
  <img
1637
- class={"builder-image" + (props.className ? " " + props.className : "") + " img-e3b1053e"}
1643
+ class={"builder-image" + (props.className ? " " + props.className : "") + " img-4512e110"}
1638
1644
  loading={props.highPriority ? "eager" : "lazy"}
1639
1645
  fetchpriority={props.highPriority ? "high" : "auto"}
1640
1646
  alt={props.altText}
@@ -1652,22 +1658,22 @@ function Image(props) {
1652
1658
  <Show7
1653
1659
  when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
1654
1660
  ><div
1655
- class="builder-image-sizer div-e3b1053e"
1661
+ class="builder-image-sizer div-4512e110"
1656
1662
  style={{
1657
1663
  "padding-top": props.aspectRatio * 100 + "%"
1658
1664
  }}
1659
1665
  /></Show7>
1660
1666
  <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
1661
- <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-e3b1053e-2">{props.children}</div></Show7>
1667
+ <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-4512e110-2">{props.children}</div></Show7>
1662
1668
  </>
1663
- <style>{`.img-e3b1053e {
1669
+ <style>{`.img-4512e110 {
1664
1670
  opacity: 1;
1665
1671
  transition: opacity 0.2s ease-in-out;
1666
- }.div-e3b1053e {
1672
+ }.div-4512e110 {
1667
1673
  width: 100%;
1668
1674
  pointer-events: none;
1669
1675
  font-size: 0;
1670
- }.div-e3b1053e-2 {
1676
+ }.div-4512e110-2 {
1671
1677
  display: flex;
1672
1678
  flex-direction: column;
1673
1679
  align-items: stretch;
@@ -1703,10 +1709,10 @@ function SectionComponent(props) {
1703
1709
  var section_default = SectionComponent;
1704
1710
 
1705
1711
  // src/blocks/symbol/symbol.tsx
1706
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
1712
+ import { onMount as onMount6, on as on3, createEffect as createEffect3, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
1707
1713
 
1708
1714
  // src/components/content-variants/content-variants.tsx
1709
- import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
1715
+ import { Show as Show14, For as For9, onMount as onMount5, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
1710
1716
 
1711
1717
  // src/helpers/url.ts
1712
1718
  var getTopLevelDomain = (host) => {
@@ -1900,7 +1906,7 @@ var handleABTesting = async ({
1900
1906
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1901
1907
 
1902
1908
  // src/components/content/content.tsx
1903
- import { Show as Show13, createSignal as createSignal17 } from "solid-js";
1909
+ import { Show as Show13, createSignal as createSignal18 } from "solid-js";
1904
1910
 
1905
1911
  // src/blocks/accordion/component-info.ts
1906
1912
  var defaultTitle = {
@@ -2913,7 +2919,8 @@ var tabs_default = Tabs;
2913
2919
  // src/blocks/text/component-info.ts
2914
2920
  var componentInfo10 = {
2915
2921
  shouldReceiveBuilderProps: {
2916
- builderBlock: TARGET === "reactNative" ? true : false
2922
+ builderBlock: TARGET === "reactNative" ? true : false,
2923
+ builderContext: true
2917
2924
  },
2918
2925
  name: "Text",
2919
2926
  static: true,
@@ -2935,10 +2942,31 @@ var componentInfo10 = {
2935
2942
  };
2936
2943
 
2937
2944
  // src/blocks/text/text.tsx
2945
+ import { createMemo as createMemo11 } from "solid-js";
2938
2946
  function Text(props) {
2947
+ const processedText = createMemo11(() => {
2948
+ const context = props.builderContext;
2949
+ const {
2950
+ context: contextContext,
2951
+ localState,
2952
+ rootState,
2953
+ rootSetState
2954
+ } = context;
2955
+ return String(props.text?.toString() || "").replace(
2956
+ /{{([^}]+)}}/g,
2957
+ (match, group) => evaluate({
2958
+ code: group,
2959
+ context: contextContext,
2960
+ localState,
2961
+ rootState,
2962
+ rootSetState,
2963
+ enableCache: false
2964
+ })
2965
+ );
2966
+ });
2939
2967
  return <><div
2940
2968
  class="builder-text"
2941
- innerHTML={props.text?.toString() || ""}
2969
+ innerHTML={processedText()}
2942
2970
  style={{
2943
2971
  outline: "none"
2944
2972
  }}
@@ -2972,12 +3000,12 @@ var componentInfo11 = {
2972
3000
  };
2973
3001
 
2974
3002
  // src/blocks/custom-code/custom-code.tsx
2975
- import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
3003
+ import { onMount as onMount3, createSignal as createSignal12 } from "solid-js";
2976
3004
  function CustomCode(props) {
2977
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2978
- const [scriptsRun, setScriptsRun] = createSignal11([]);
3005
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3006
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
2979
3007
  let elementRef;
2980
- onMount2(() => {
3008
+ onMount3(() => {
2981
3009
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
2982
3010
  return;
2983
3011
  }
@@ -3036,7 +3064,7 @@ var componentInfo12 = {
3036
3064
  };
3037
3065
 
3038
3066
  // src/blocks/embed/embed.tsx
3039
- import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
3067
+ import { on, createEffect, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
3040
3068
 
3041
3069
  // src/blocks/embed/helpers.ts
3042
3070
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -3044,9 +3072,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
3044
3072
 
3045
3073
  // src/blocks/embed/embed.tsx
3046
3074
  function Embed(props) {
3047
- const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3048
- const [scriptsRun, setScriptsRun] = createSignal12([]);
3049
- const [ranInitFn, setRanInitFn] = createSignal12(false);
3075
+ const [scriptsInserted, setScriptsInserted] = createSignal13([]);
3076
+ const [scriptsRun, setScriptsRun] = createSignal13([]);
3077
+ const [ranInitFn, setRanInitFn] = createSignal13(false);
3050
3078
  function findAndRunScripts() {
3051
3079
  if (!elem || !elem.getElementsByTagName)
3052
3080
  return;
@@ -3069,8 +3097,8 @@ function Embed(props) {
3069
3097
  }
3070
3098
  }
3071
3099
  let elem;
3072
- const onUpdateFn_0_elem = createMemo12(() => elem);
3073
- const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
3100
+ const onUpdateFn_0_elem = createMemo13(() => elem);
3101
+ const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
3074
3102
  function onUpdateFn_0() {
3075
3103
  if (elem && !ranInitFn()) {
3076
3104
  setRanInitFn(true);
@@ -3325,7 +3353,7 @@ var componentInfo13 = {
3325
3353
  };
3326
3354
 
3327
3355
  // src/blocks/form/form/form.tsx
3328
- import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
3356
+ import { Show as Show10, For as For7, createSignal as createSignal14 } from "solid-js";
3329
3357
 
3330
3358
  // src/functions/get-env.ts
3331
3359
  var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
@@ -3342,9 +3370,9 @@ var get = (obj, path, defaultValue) => {
3342
3370
 
3343
3371
  // src/blocks/form/form/form.tsx
3344
3372
  function FormComponent(props) {
3345
- const [formState, setFormState] = createSignal13("unsubmitted");
3346
- const [responseData, setResponseData] = createSignal13(null);
3347
- const [formErrorMessage, setFormErrorMessage] = createSignal13("");
3373
+ const [formState, setFormState] = createSignal14("unsubmitted");
3374
+ const [responseData, setResponseData] = createSignal14(null);
3375
+ const [formErrorMessage, setFormErrorMessage] = createSignal14("");
3348
3376
  function mergeNewRootState(newData) {
3349
3377
  const combinedState = {
3350
3378
  ...props.builderContext.rootState,
@@ -3917,9 +3945,9 @@ var componentInfo19 = {
3917
3945
  };
3918
3946
 
3919
3947
  // src/blocks/video/video.tsx
3920
- import { Show as Show11, createMemo as createMemo14 } from "solid-js";
3948
+ import { Show as Show11, createMemo as createMemo15 } from "solid-js";
3921
3949
  function Video(props) {
3922
- const videoProps = createMemo14(() => {
3950
+ const videoProps = createMemo15(() => {
3923
3951
  return {
3924
3952
  ...props.autoPlay === true ? {
3925
3953
  autoPlay: true
@@ -3938,7 +3966,7 @@ function Video(props) {
3938
3966
  } : {}
3939
3967
  };
3940
3968
  });
3941
- const spreadProps = createMemo14(() => {
3969
+ const spreadProps = createMemo15(() => {
3942
3970
  return {
3943
3971
  ...videoProps()
3944
3972
  };
@@ -4076,17 +4104,14 @@ var serializeFn = (fnValue) => {
4076
4104
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
4077
4105
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
4078
4106
  };
4079
- var serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
4080
- var serializeComponentInfo = ({
4081
- inputs,
4082
- ...info
4083
- }) => ({
4084
- ...fastClone(info),
4085
- inputs: inputs?.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
4086
- ...acc,
4087
- [key]: serializeValue(value)
4088
- }), {}))
4089
- });
4107
+ function serializeComponentInfo(info) {
4108
+ return JSON.parse(JSON.stringify(info, (key, value) => {
4109
+ if (typeof value === "function") {
4110
+ return serializeFn(value);
4111
+ }
4112
+ return value;
4113
+ }));
4114
+ }
4090
4115
 
4091
4116
  // src/components/content-variants/inlined-fns.ts
4092
4117
  var UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
@@ -4147,11 +4172,11 @@ var Inlined_script_default = InlinedScript;
4147
4172
  // src/components/content/components/enable-editor.tsx
4148
4173
  import {
4149
4174
  Show as Show12,
4150
- onMount as onMount3,
4175
+ onMount as onMount4,
4151
4176
  on as on2,
4152
4177
  createEffect as createEffect2,
4153
- createMemo as createMemo15,
4154
- createSignal as createSignal15
4178
+ createMemo as createMemo16,
4179
+ createSignal as createSignal16
4155
4180
  } from "solid-js";
4156
4181
  import { Dynamic as Dynamic5 } from "solid-js/web";
4157
4182
 
@@ -4649,7 +4674,7 @@ function isFromTrustedHost(trustedHosts, e) {
4649
4674
  }
4650
4675
 
4651
4676
  // src/constants/sdk-version.ts
4652
- var SDK_VERSION = "2.0.2";
4677
+ var SDK_VERSION = "2.0.5";
4653
4678
 
4654
4679
  // src/functions/register.ts
4655
4680
  var registry = {};
@@ -4926,12 +4951,12 @@ var getWrapperClassName = (variationId) => {
4926
4951
 
4927
4952
  // src/components/content/components/enable-editor.tsx
4928
4953
  function EnableEditor(props) {
4929
- const [ContentWrapper, setContentWrapper] = createSignal15(
4954
+ const [ContentWrapper, setContentWrapper] = createSignal16(
4930
4955
  props.contentWrapper || "div"
4931
4956
  );
4932
- const [httpReqsData, setHttpReqsData] = createSignal15({});
4933
- const [httpReqsPending, setHttpReqsPending] = createSignal15({});
4934
- const [clicked, setClicked] = createSignal15(false);
4957
+ const [httpReqsData, setHttpReqsData] = createSignal16({});
4958
+ const [httpReqsPending, setHttpReqsPending] = createSignal16({});
4959
+ const [clicked, setClicked] = createSignal16(false);
4935
4960
  function mergeNewRootState(newData) {
4936
4961
  const combinedState = {
4937
4962
  ...props.builderContextSignal.rootState,
@@ -4965,7 +4990,7 @@ function EnableEditor(props) {
4965
4990
  content: newContentValue
4966
4991
  }));
4967
4992
  }
4968
- const showContentProps = createMemo15(() => {
4993
+ const showContentProps = createMemo16(() => {
4969
4994
  return props.showContent ? {} : {
4970
4995
  hidden: true,
4971
4996
  "aria-hidden": true
@@ -5084,7 +5109,7 @@ function EnableEditor(props) {
5084
5109
  }
5085
5110
  }
5086
5111
  let elementRef;
5087
- onMount3(() => {
5112
+ onMount4(() => {
5088
5113
  if (isBrowser()) {
5089
5114
  if (isEditing()) {
5090
5115
  window.addEventListener("message", processMessage);
@@ -5145,7 +5170,7 @@ function EnableEditor(props) {
5145
5170
  }
5146
5171
  }
5147
5172
  });
5148
- onMount3(() => {
5173
+ onMount4(() => {
5149
5174
  if (!props.apiKey) {
5150
5175
  logger.error(
5151
5176
  "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
@@ -5155,14 +5180,14 @@ function EnableEditor(props) {
5155
5180
  runHttpRequests();
5156
5181
  emitStateUpdate();
5157
5182
  });
5158
- const onUpdateFn_0_props_content = createMemo15(() => props.content);
5183
+ const onUpdateFn_0_props_content = createMemo16(() => props.content);
5159
5184
  function onUpdateFn_0() {
5160
5185
  if (props.content) {
5161
5186
  mergeNewContent(props.content);
5162
5187
  }
5163
5188
  }
5164
5189
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
5165
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
5190
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo16(() => props.builderContextSignal.content?.data?.jsCode);
5166
5191
  function onUpdateFn_1() {
5167
5192
  evaluateJsCode();
5168
5193
  }
@@ -5172,7 +5197,7 @@ function EnableEditor(props) {
5172
5197
  onUpdateFn_1
5173
5198
  )
5174
5199
  );
5175
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
5200
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo16(() => props.builderContextSignal.content?.data?.httpRequests);
5176
5201
  function onUpdateFn_2() {
5177
5202
  runHttpRequests();
5178
5203
  }
@@ -5184,7 +5209,7 @@ function EnableEditor(props) {
5184
5209
  onUpdateFn_2
5185
5210
  )
5186
5211
  );
5187
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
5212
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo16(
5188
5213
  () => props.builderContextSignal.rootState
5189
5214
  );
5190
5215
  function onUpdateFn_3() {
@@ -5196,14 +5221,14 @@ function EnableEditor(props) {
5196
5221
  onUpdateFn_3
5197
5222
  )
5198
5223
  );
5199
- const onUpdateFn_4_props_data = createMemo15(() => props.data);
5224
+ const onUpdateFn_4_props_data = createMemo16(() => props.data);
5200
5225
  function onUpdateFn_4() {
5201
5226
  if (props.data) {
5202
5227
  mergeNewRootState(props.data);
5203
5228
  }
5204
5229
  }
5205
5230
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
5206
- const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
5231
+ const onUpdateFn_5_props_locale = createMemo16(() => props.locale);
5207
5232
  function onUpdateFn_5() {
5208
5233
  if (props.locale) {
5209
5234
  mergeNewRootState({
@@ -5230,9 +5255,9 @@ function EnableEditor(props) {
5230
5255
  var Enable_editor_default = EnableEditor;
5231
5256
 
5232
5257
  // src/components/content/components/styles.tsx
5233
- import { createSignal as createSignal16 } from "solid-js";
5258
+ import { createSignal as createSignal17 } from "solid-js";
5234
5259
  function ContentStyles(props) {
5235
- const [injectedStyles, setInjectedStyles] = createSignal16(
5260
+ const [injectedStyles, setInjectedStyles] = createSignal17(
5236
5261
  `
5237
5262
  ${getCss({
5238
5263
  cssCode: props.cssCode,
@@ -5290,7 +5315,7 @@ var getContentInitialValue = ({
5290
5315
 
5291
5316
  // src/components/content/content.tsx
5292
5317
  function ContentComponent(props) {
5293
- const [scriptStr, setScriptStr] = createSignal17(
5318
+ const [scriptStr, setScriptStr] = createSignal18(
5294
5319
  getUpdateVariantVisibilityScript({
5295
5320
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
5296
5321
  variationId: props.content?.testVariationId,
@@ -5298,7 +5323,7 @@ function ContentComponent(props) {
5298
5323
  contentId: props.content?.id
5299
5324
  })
5300
5325
  );
5301
- const [registeredComponents, setRegisteredComponents] = createSignal17(
5326
+ const [registeredComponents, setRegisteredComponents] = createSignal18(
5302
5327
  [
5303
5328
  ...getDefaultRegisteredComponents(),
5304
5329
  ...props.customComponents?.filter(({ models }) => {
@@ -5319,7 +5344,7 @@ function ContentComponent(props) {
5319
5344
  {}
5320
5345
  )
5321
5346
  );
5322
- const [builderContextSignal, setBuilderContextSignal] = createSignal17({
5347
+ const [builderContextSignal, setBuilderContextSignal] = createSignal18({
5323
5348
  content: getContentInitialValue({
5324
5349
  content: props.content,
5325
5350
  data: props.data
@@ -5409,13 +5434,13 @@ var Content_default = ContentComponent;
5409
5434
 
5410
5435
  // src/components/content-variants/content-variants.tsx
5411
5436
  function ContentVariants(props) {
5412
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
5437
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
5413
5438
  checkShouldRenderVariants({
5414
5439
  canTrack: getDefaultCanTrack(props.canTrack),
5415
5440
  content: props.content
5416
5441
  })
5417
5442
  );
5418
- const updateCookieAndStylesScriptStr = createMemo18(() => {
5443
+ const updateCookieAndStylesScriptStr = createMemo19(() => {
5419
5444
  return getUpdateCookieAndStylesScript(
5420
5445
  getVariants(props.content).map((value) => ({
5421
5446
  id: value.testVariationId,
@@ -5424,10 +5449,10 @@ function ContentVariants(props) {
5424
5449
  props.content?.id || ""
5425
5450
  );
5426
5451
  });
5427
- const hideVariantsStyleString = createMemo18(() => {
5452
+ const hideVariantsStyleString = createMemo19(() => {
5428
5453
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
5429
5454
  });
5430
- const defaultContent = createMemo18(() => {
5455
+ const defaultContent = createMemo19(() => {
5431
5456
  return shouldRenderVariants() ? {
5432
5457
  ...props.content,
5433
5458
  testVariationId: props.content?.id
@@ -5436,7 +5461,7 @@ function ContentVariants(props) {
5436
5461
  canTrack: getDefaultCanTrack(props.canTrack)
5437
5462
  });
5438
5463
  });
5439
- onMount4(() => {
5464
+ onMount5(() => {
5440
5465
  setShouldRenderVariants(false);
5441
5466
  });
5442
5467
  return <><>
@@ -5536,14 +5561,14 @@ var fetchSymbolContent = async ({
5536
5561
 
5537
5562
  // src/blocks/symbol/symbol.tsx
5538
5563
  function Symbol(props) {
5539
- const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
5540
- const blocksWrapper = createMemo19(() => {
5564
+ const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
5565
+ const blocksWrapper = createMemo20(() => {
5541
5566
  return "div";
5542
5567
  });
5543
- const contentWrapper = createMemo19(() => {
5568
+ const contentWrapper = createMemo20(() => {
5544
5569
  return "div";
5545
5570
  });
5546
- const className = createMemo19(() => {
5571
+ const className = createMemo20(() => {
5547
5572
  return [
5548
5573
  ...[props.attributes[getClassPropName()]],
5549
5574
  "builder-symbol",
@@ -5563,9 +5588,9 @@ function Symbol(props) {
5563
5588
  }
5564
5589
  });
5565
5590
  }
5566
- onMount5(() => {
5591
+ onMount6(() => {
5567
5592
  });
5568
- const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
5593
+ const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
5569
5594
  function onUpdateFn_0() {
5570
5595
  setContent();
5571
5596
  }
package/lib/edge/dev.js CHANGED
@@ -3679,6 +3679,9 @@ function assign(target, ..._args) {
3679
3679
  return to;
3680
3680
  }
3681
3681
  function bindAnimations(animations) {
3682
+ if (TARGET === "reactNative") {
3683
+ return;
3684
+ }
3682
3685
  for (const animation of animations) {
3683
3686
  switch (animation.trigger) {
3684
3687
  case "pageLoad":
@@ -4709,7 +4712,7 @@ var getColumnsClass = (id2) => {
4709
4712
 
4710
4713
  // src/blocks/columns/columns.tsx
4711
4714
  var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
4712
- var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-5b8fb3ac {
4715
+ var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-3ff242de {
4713
4716
  display: flex;
4714
4717
  line-height: normal;
4715
4718
  }`);
@@ -4789,6 +4792,7 @@ function Columns(props) {
4789
4792
  return breakpointSizes[size].max;
4790
4793
  }
4791
4794
  function columnsStyles() {
4795
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
4792
4796
  return `
4793
4797
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
4794
4798
  .${props.builderBlock.id}-breakpoints {
@@ -4796,7 +4800,7 @@ function Columns(props) {
4796
4800
  align-items: stretch;
4797
4801
  }
4798
4802
 
4799
- .${props.builderBlock.id}-breakpoints > .builder-column {
4803
+ ${childColumnDiv} {
4800
4804
  width: var(--column-width-tablet) !important;
4801
4805
  margin-left: var(--column-margin-left-tablet) !important;
4802
4806
  }
@@ -4808,7 +4812,7 @@ function Columns(props) {
4808
4812
  align-items: stretch;
4809
4813
  }
4810
4814
 
4811
- .${props.builderBlock.id}-breakpoints > .builder-column {
4815
+ ${childColumnDiv} {
4812
4816
  width: var(--column-width-mobile) !important;
4813
4817
  margin-left: var(--column-margin-left-mobile) !important;
4814
4818
  }
@@ -4829,7 +4833,7 @@ function Columns(props) {
4829
4833
  const _el$ = _tmpl$3();
4830
4834
  spread(_el$, mergeProps({
4831
4835
  get ["class"]() {
4832
- return getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac";
4836
+ return getColumnsClass(props.builderBlock?.id) + " div-3ff242de";
4833
4837
  },
4834
4838
  get style() {
4835
4839
  return columnsCssVars();
@@ -4954,16 +4958,16 @@ function getSrcSet(url) {
4954
4958
  // src/blocks/image/image.tsx
4955
4959
  var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
4956
4960
  var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
4957
- var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-e3b1053e">`);
4958
- var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-e3b1053e-2>`);
4959
- var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-e3b1053e {
4961
+ var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-4512e110">`);
4962
+ var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-4512e110-2>`);
4963
+ var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-4512e110 {
4960
4964
  opacity: 1;
4961
4965
  transition: opacity 0.2s ease-in-out;
4962
- }.div-e3b1053e {
4966
+ }.div-4512e110 {
4963
4967
  width: 100%;
4964
4968
  pointer-events: none;
4965
4969
  font-size: 0;
4966
- }.div-e3b1053e-2 {
4970
+ }.div-4512e110-2 {
4967
4971
  display: flex;
4968
4972
  flex-direction: column;
4969
4973
  align-items: stretch;
@@ -5013,6 +5017,8 @@ function Image(props) {
5013
5017
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
5014
5018
  return out;
5015
5019
  });
5020
+ onMount(() => {
5021
+ });
5016
5022
  return [[(() => {
5017
5023
  const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
5018
5024
  insert(_el$, createComponent(Show, {
@@ -5026,7 +5032,7 @@ function Image(props) {
5026
5032
  }
5027
5033
  }), _el$3);
5028
5034
  effect((_p$) => {
5029
- const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-e3b1053e", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
5035
+ const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-4512e110", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
5030
5036
  "object-position": props.backgroundPosition || "center",
5031
5037
  "object-fit": props.backgroundSize || "cover",
5032
5038
  ...aspectRatioCss()
@@ -6397,7 +6403,8 @@ delegateEvents(["click"]);
6397
6403
  // src/blocks/text/component-info.ts
6398
6404
  var componentInfo10 = {
6399
6405
  shouldReceiveBuilderProps: {
6400
- builderBlock: TARGET === "reactNative" ? true : false
6406
+ builderBlock: TARGET === "reactNative" ? true : false,
6407
+ builderContext: true
6401
6408
  },
6402
6409
  name: "Text",
6403
6410
  static: true,
@@ -6419,10 +6426,27 @@ var componentInfo10 = {
6419
6426
  };
6420
6427
  var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
6421
6428
  function Text(props) {
6429
+ const processedText = createMemo(() => {
6430
+ const context = props.builderContext;
6431
+ const {
6432
+ context: contextContext,
6433
+ localState,
6434
+ rootState,
6435
+ rootSetState
6436
+ } = context;
6437
+ return String(props.text?.toString() || "").replace(/{{([^}]+)}}/g, (match, group) => evaluate({
6438
+ code: group,
6439
+ context: contextContext,
6440
+ localState,
6441
+ rootState,
6442
+ rootSetState,
6443
+ enableCache: false
6444
+ }));
6445
+ });
6422
6446
  return (() => {
6423
6447
  const _el$ = _tmpl$10();
6424
6448
  _el$.style.setProperty("outline", "none");
6425
- effect(() => _el$.innerHTML = props.text?.toString() || "");
6449
+ effect(() => _el$.innerHTML = processedText());
6426
6450
  return _el$;
6427
6451
  })();
6428
6452
  }
@@ -7721,17 +7745,14 @@ var serializeFn = (fnValue) => {
7721
7745
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
7722
7746
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
7723
7747
  };
7724
- var serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
7725
- var serializeComponentInfo = ({
7726
- inputs,
7727
- ...info
7728
- }) => ({
7729
- ...fastClone(info),
7730
- inputs: inputs?.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
7731
- ...acc,
7732
- [key]: serializeValue(value)
7733
- }), {}))
7734
- });
7748
+ function serializeComponentInfo(info) {
7749
+ return JSON.parse(JSON.stringify(info, (key, value) => {
7750
+ if (typeof value === "function") {
7751
+ return serializeFn(value);
7752
+ }
7753
+ return value;
7754
+ }));
7755
+ }
7735
7756
 
7736
7757
  // src/components/content-variants/inlined-fns.ts
7737
7758
  var UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
@@ -8297,7 +8318,7 @@ function isFromTrustedHost(trustedHosts, e) {
8297
8318
  }
8298
8319
 
8299
8320
  // src/constants/sdk-version.ts
8300
- var SDK_VERSION = "2.0.2";
8321
+ var SDK_VERSION = "2.0.5";
8301
8322
 
8302
8323
  // src/functions/register.ts
8303
8324
  var registry = {};