@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.
package/lib/edge/dev.jsx CHANGED
@@ -3668,6 +3668,9 @@ function assign(target, ..._args) {
3668
3668
  return to;
3669
3669
  }
3670
3670
  function bindAnimations(animations) {
3671
+ if (TARGET === "reactNative") {
3672
+ return;
3673
+ }
3671
3674
  for (const animation of animations) {
3672
3675
  switch (animation.trigger) {
3673
3676
  case "pageLoad":
@@ -4612,6 +4615,7 @@ function Columns(props) {
4612
4615
  return breakpointSizes[size].max;
4613
4616
  }
4614
4617
  function columnsStyles() {
4618
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
4615
4619
  return `
4616
4620
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
4617
4621
  .${props.builderBlock.id}-breakpoints {
@@ -4619,7 +4623,7 @@ function Columns(props) {
4619
4623
  align-items: stretch;
4620
4624
  }
4621
4625
 
4622
- .${props.builderBlock.id}-breakpoints > .builder-column {
4626
+ ${childColumnDiv} {
4623
4627
  width: var(--column-width-tablet) !important;
4624
4628
  margin-left: var(--column-margin-left-tablet) !important;
4625
4629
  }
@@ -4631,7 +4635,7 @@ function Columns(props) {
4631
4635
  align-items: stretch;
4632
4636
  }
4633
4637
 
4634
- .${props.builderBlock.id}-breakpoints > .builder-column {
4638
+ ${childColumnDiv} {
4635
4639
  width: var(--column-width-mobile) !important;
4636
4640
  margin-left: var(--column-margin-left-mobile) !important;
4637
4641
  }
@@ -4650,7 +4654,7 @@ function Columns(props) {
4650
4654
  }
4651
4655
  return <>
4652
4656
  <div
4653
- class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
4657
+ class={getColumnsClass(props.builderBlock?.id) + " div-3ff242de"}
4654
4658
  style={columnsCssVars()}
4655
4659
  {...{}}
4656
4660
  >
@@ -4679,7 +4683,7 @@ function Columns(props) {
4679
4683
  /></Dynamic_renderer_default>;
4680
4684
  }}</For4>
4681
4685
  </div>
4682
- <style>{`.div-5b8fb3ac {
4686
+ <style>{`.div-3ff242de {
4683
4687
  display: flex;
4684
4688
  line-height: normal;
4685
4689
  }`}</style>
@@ -4694,7 +4698,7 @@ function FragmentComponent(props) {
4694
4698
  var fragment_default = FragmentComponent;
4695
4699
 
4696
4700
  // src/blocks/image/image.tsx
4697
- import { Show as Show7, createMemo as createMemo8 } from "solid-js";
4701
+ import { Show as Show7, onMount as onMount2, createMemo as createMemo8 } from "solid-js";
4698
4702
 
4699
4703
  // src/blocks/image/image.helpers.ts
4700
4704
  function removeProtocol(path) {
@@ -4784,12 +4788,14 @@ function Image(props) {
4784
4788
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
4785
4789
  return out;
4786
4790
  });
4791
+ onMount2(() => {
4792
+ });
4787
4793
  return <>
4788
4794
  <>
4789
4795
  <picture>
4790
4796
  <Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
4791
4797
  <img
4792
- class={"builder-image" + (props.className ? " " + props.className : "") + " img-e3b1053e"}
4798
+ class={"builder-image" + (props.className ? " " + props.className : "") + " img-4512e110"}
4793
4799
  loading={props.highPriority ? "eager" : "lazy"}
4794
4800
  fetchpriority={props.highPriority ? "high" : "auto"}
4795
4801
  alt={props.altText}
@@ -4807,22 +4813,22 @@ function Image(props) {
4807
4813
  <Show7
4808
4814
  when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
4809
4815
  ><div
4810
- class="builder-image-sizer div-e3b1053e"
4816
+ class="builder-image-sizer div-4512e110"
4811
4817
  style={{
4812
4818
  "padding-top": props.aspectRatio * 100 + "%"
4813
4819
  }}
4814
4820
  /></Show7>
4815
4821
  <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
4816
- <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-e3b1053e-2">{props.children}</div></Show7>
4822
+ <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-4512e110-2">{props.children}</div></Show7>
4817
4823
  </>
4818
- <style>{`.img-e3b1053e {
4824
+ <style>{`.img-4512e110 {
4819
4825
  opacity: 1;
4820
4826
  transition: opacity 0.2s ease-in-out;
4821
- }.div-e3b1053e {
4827
+ }.div-4512e110 {
4822
4828
  width: 100%;
4823
4829
  pointer-events: none;
4824
4830
  font-size: 0;
4825
- }.div-e3b1053e-2 {
4831
+ }.div-4512e110-2 {
4826
4832
  display: flex;
4827
4833
  flex-direction: column;
4828
4834
  align-items: stretch;
@@ -4858,10 +4864,10 @@ function SectionComponent(props) {
4858
4864
  var section_default = SectionComponent;
4859
4865
 
4860
4866
  // src/blocks/symbol/symbol.tsx
4861
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
4867
+ import { onMount as onMount6, on as on3, createEffect as createEffect3, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
4862
4868
 
4863
4869
  // src/components/content-variants/content-variants.tsx
4864
- import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
4870
+ import { Show as Show14, For as For9, onMount as onMount5, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
4865
4871
 
4866
4872
  // src/helpers/url.ts
4867
4873
  var getTopLevelDomain = (host) => {
@@ -5055,7 +5061,7 @@ var handleABTesting = async ({
5055
5061
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
5056
5062
 
5057
5063
  // src/components/content/content.tsx
5058
- import { Show as Show13, createSignal as createSignal17 } from "solid-js";
5064
+ import { Show as Show13, createSignal as createSignal18 } from "solid-js";
5059
5065
 
5060
5066
  // src/blocks/accordion/component-info.ts
5061
5067
  var defaultTitle = {
@@ -6069,7 +6075,8 @@ var tabs_default = Tabs;
6069
6075
  // src/blocks/text/component-info.ts
6070
6076
  var componentInfo10 = {
6071
6077
  shouldReceiveBuilderProps: {
6072
- builderBlock: TARGET === "reactNative" ? true : false
6078
+ builderBlock: TARGET === "reactNative" ? true : false,
6079
+ builderContext: true
6073
6080
  },
6074
6081
  name: "Text",
6075
6082
  static: true,
@@ -6091,10 +6098,31 @@ var componentInfo10 = {
6091
6098
  };
6092
6099
 
6093
6100
  // src/blocks/text/text.tsx
6101
+ import { createMemo as createMemo11 } from "solid-js";
6094
6102
  function Text(props) {
6103
+ const processedText = createMemo11(() => {
6104
+ const context = props.builderContext;
6105
+ const {
6106
+ context: contextContext,
6107
+ localState,
6108
+ rootState,
6109
+ rootSetState
6110
+ } = context;
6111
+ return String(props.text?.toString() || "").replace(
6112
+ /{{([^}]+)}}/g,
6113
+ (match, group) => evaluate({
6114
+ code: group,
6115
+ context: contextContext,
6116
+ localState,
6117
+ rootState,
6118
+ rootSetState,
6119
+ enableCache: false
6120
+ })
6121
+ );
6122
+ });
6095
6123
  return <><div
6096
6124
  class="builder-text"
6097
- innerHTML={props.text?.toString() || ""}
6125
+ innerHTML={processedText()}
6098
6126
  style={{
6099
6127
  outline: "none"
6100
6128
  }}
@@ -6128,12 +6156,12 @@ var componentInfo11 = {
6128
6156
  };
6129
6157
 
6130
6158
  // src/blocks/custom-code/custom-code.tsx
6131
- import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
6159
+ import { onMount as onMount3, createSignal as createSignal12 } from "solid-js";
6132
6160
  function CustomCode(props) {
6133
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
6134
- const [scriptsRun, setScriptsRun] = createSignal11([]);
6161
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
6162
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
6135
6163
  let elementRef;
6136
- onMount2(() => {
6164
+ onMount3(() => {
6137
6165
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
6138
6166
  return;
6139
6167
  }
@@ -6193,7 +6221,7 @@ var componentInfo12 = {
6193
6221
  };
6194
6222
 
6195
6223
  // src/blocks/embed/embed.tsx
6196
- import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
6224
+ import { on, createEffect, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
6197
6225
 
6198
6226
  // src/blocks/embed/helpers.ts
6199
6227
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -6201,9 +6229,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
6201
6229
 
6202
6230
  // src/blocks/embed/embed.tsx
6203
6231
  function Embed(props) {
6204
- const [scriptsInserted, setScriptsInserted] = createSignal12([]);
6205
- const [scriptsRun, setScriptsRun] = createSignal12([]);
6206
- const [ranInitFn, setRanInitFn] = createSignal12(false);
6232
+ const [scriptsInserted, setScriptsInserted] = createSignal13([]);
6233
+ const [scriptsRun, setScriptsRun] = createSignal13([]);
6234
+ const [ranInitFn, setRanInitFn] = createSignal13(false);
6207
6235
  function findAndRunScripts() {
6208
6236
  if (!elem || !elem.getElementsByTagName)
6209
6237
  return;
@@ -6227,8 +6255,8 @@ function Embed(props) {
6227
6255
  }
6228
6256
  }
6229
6257
  let elem;
6230
- const onUpdateFn_0_elem = createMemo12(() => elem);
6231
- const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
6258
+ const onUpdateFn_0_elem = createMemo13(() => elem);
6259
+ const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
6232
6260
  function onUpdateFn_0() {
6233
6261
  if (elem && !ranInitFn()) {
6234
6262
  setRanInitFn(true);
@@ -6483,7 +6511,7 @@ var componentInfo13 = {
6483
6511
  };
6484
6512
 
6485
6513
  // src/blocks/form/form/form.tsx
6486
- import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
6514
+ import { Show as Show10, For as For7, createSignal as createSignal14 } from "solid-js";
6487
6515
 
6488
6516
  // src/functions/get-env.ts
6489
6517
  var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
@@ -6500,9 +6528,9 @@ var get = (obj, path, defaultValue) => {
6500
6528
 
6501
6529
  // src/blocks/form/form/form.tsx
6502
6530
  function FormComponent(props) {
6503
- const [formState, setFormState] = createSignal13("unsubmitted");
6504
- const [responseData, setResponseData] = createSignal13(null);
6505
- const [formErrorMessage, setFormErrorMessage] = createSignal13("");
6531
+ const [formState, setFormState] = createSignal14("unsubmitted");
6532
+ const [responseData, setResponseData] = createSignal14(null);
6533
+ const [formErrorMessage, setFormErrorMessage] = createSignal14("");
6506
6534
  function mergeNewRootState(newData) {
6507
6535
  const combinedState = {
6508
6536
  ...props.builderContext.rootState,
@@ -7075,9 +7103,9 @@ var componentInfo19 = {
7075
7103
  };
7076
7104
 
7077
7105
  // src/blocks/video/video.tsx
7078
- import { Show as Show11, createMemo as createMemo14 } from "solid-js";
7106
+ import { Show as Show11, createMemo as createMemo15 } from "solid-js";
7079
7107
  function Video(props) {
7080
- const videoProps = createMemo14(() => {
7108
+ const videoProps = createMemo15(() => {
7081
7109
  return {
7082
7110
  ...props.autoPlay === true ? {
7083
7111
  autoPlay: true
@@ -7096,7 +7124,7 @@ function Video(props) {
7096
7124
  } : {}
7097
7125
  };
7098
7126
  });
7099
- const spreadProps = createMemo14(() => {
7127
+ const spreadProps = createMemo15(() => {
7100
7128
  return {
7101
7129
  ...videoProps()
7102
7130
  };
@@ -7234,17 +7262,14 @@ var serializeFn = (fnValue) => {
7234
7262
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
7235
7263
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
7236
7264
  };
7237
- var serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
7238
- var serializeComponentInfo = ({
7239
- inputs,
7240
- ...info
7241
- }) => ({
7242
- ...fastClone(info),
7243
- inputs: inputs?.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
7244
- ...acc,
7245
- [key]: serializeValue(value)
7246
- }), {}))
7247
- });
7265
+ function serializeComponentInfo(info) {
7266
+ return JSON.parse(JSON.stringify(info, (key, value) => {
7267
+ if (typeof value === "function") {
7268
+ return serializeFn(value);
7269
+ }
7270
+ return value;
7271
+ }));
7272
+ }
7248
7273
 
7249
7274
  // src/components/content-variants/inlined-fns.ts
7250
7275
  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}";
@@ -7305,11 +7330,11 @@ var Inlined_script_default = InlinedScript;
7305
7330
  // src/components/content/components/enable-editor.tsx
7306
7331
  import {
7307
7332
  Show as Show12,
7308
- onMount as onMount3,
7333
+ onMount as onMount4,
7309
7334
  on as on2,
7310
7335
  createEffect as createEffect2,
7311
- createMemo as createMemo15,
7312
- createSignal as createSignal15
7336
+ createMemo as createMemo16,
7337
+ createSignal as createSignal16
7313
7338
  } from "solid-js";
7314
7339
  import { Dynamic as Dynamic5 } from "solid-js/web";
7315
7340
 
@@ -7812,7 +7837,7 @@ function isFromTrustedHost(trustedHosts, e) {
7812
7837
  }
7813
7838
 
7814
7839
  // src/constants/sdk-version.ts
7815
- var SDK_VERSION = "2.0.2";
7840
+ var SDK_VERSION = "2.0.5";
7816
7841
 
7817
7842
  // src/functions/register.ts
7818
7843
  var registry = {};
@@ -8090,12 +8115,12 @@ var getWrapperClassName = (variationId) => {
8090
8115
 
8091
8116
  // src/components/content/components/enable-editor.tsx
8092
8117
  function EnableEditor(props) {
8093
- const [ContentWrapper, setContentWrapper] = createSignal15(
8118
+ const [ContentWrapper, setContentWrapper] = createSignal16(
8094
8119
  props.contentWrapper || "div"
8095
8120
  );
8096
- const [httpReqsData, setHttpReqsData] = createSignal15({});
8097
- const [httpReqsPending, setHttpReqsPending] = createSignal15({});
8098
- const [clicked, setClicked] = createSignal15(false);
8121
+ const [httpReqsData, setHttpReqsData] = createSignal16({});
8122
+ const [httpReqsPending, setHttpReqsPending] = createSignal16({});
8123
+ const [clicked, setClicked] = createSignal16(false);
8099
8124
  function mergeNewRootState(newData) {
8100
8125
  const combinedState = {
8101
8126
  ...props.builderContextSignal.rootState,
@@ -8129,7 +8154,7 @@ function EnableEditor(props) {
8129
8154
  content: newContentValue
8130
8155
  }));
8131
8156
  }
8132
- const showContentProps = createMemo15(() => {
8157
+ const showContentProps = createMemo16(() => {
8133
8158
  return props.showContent ? {} : {
8134
8159
  hidden: true,
8135
8160
  "aria-hidden": true
@@ -8249,7 +8274,7 @@ function EnableEditor(props) {
8249
8274
  }
8250
8275
  }
8251
8276
  let elementRef;
8252
- onMount3(() => {
8277
+ onMount4(() => {
8253
8278
  if (isBrowser()) {
8254
8279
  if (isEditing()) {
8255
8280
  window.addEventListener("message", processMessage);
@@ -8310,7 +8335,7 @@ function EnableEditor(props) {
8310
8335
  }
8311
8336
  }
8312
8337
  });
8313
- onMount3(() => {
8338
+ onMount4(() => {
8314
8339
  if (!props.apiKey) {
8315
8340
  logger.error(
8316
8341
  "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
@@ -8320,14 +8345,14 @@ function EnableEditor(props) {
8320
8345
  runHttpRequests();
8321
8346
  emitStateUpdate();
8322
8347
  });
8323
- const onUpdateFn_0_props_content = createMemo15(() => props.content);
8348
+ const onUpdateFn_0_props_content = createMemo16(() => props.content);
8324
8349
  function onUpdateFn_0() {
8325
8350
  if (props.content) {
8326
8351
  mergeNewContent(props.content);
8327
8352
  }
8328
8353
  }
8329
8354
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
8330
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
8355
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo16(() => props.builderContextSignal.content?.data?.jsCode);
8331
8356
  function onUpdateFn_1() {
8332
8357
  evaluateJsCode();
8333
8358
  }
@@ -8337,7 +8362,7 @@ function EnableEditor(props) {
8337
8362
  onUpdateFn_1
8338
8363
  )
8339
8364
  );
8340
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
8365
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo16(() => props.builderContextSignal.content?.data?.httpRequests);
8341
8366
  function onUpdateFn_2() {
8342
8367
  runHttpRequests();
8343
8368
  }
@@ -8349,7 +8374,7 @@ function EnableEditor(props) {
8349
8374
  onUpdateFn_2
8350
8375
  )
8351
8376
  );
8352
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
8377
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo16(
8353
8378
  () => props.builderContextSignal.rootState
8354
8379
  );
8355
8380
  function onUpdateFn_3() {
@@ -8361,14 +8386,14 @@ function EnableEditor(props) {
8361
8386
  onUpdateFn_3
8362
8387
  )
8363
8388
  );
8364
- const onUpdateFn_4_props_data = createMemo15(() => props.data);
8389
+ const onUpdateFn_4_props_data = createMemo16(() => props.data);
8365
8390
  function onUpdateFn_4() {
8366
8391
  if (props.data) {
8367
8392
  mergeNewRootState(props.data);
8368
8393
  }
8369
8394
  }
8370
8395
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
8371
- const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
8396
+ const onUpdateFn_5_props_locale = createMemo16(() => props.locale);
8372
8397
  function onUpdateFn_5() {
8373
8398
  if (props.locale) {
8374
8399
  mergeNewRootState({
@@ -8395,9 +8420,9 @@ function EnableEditor(props) {
8395
8420
  var Enable_editor_default = EnableEditor;
8396
8421
 
8397
8422
  // src/components/content/components/styles.tsx
8398
- import { createSignal as createSignal16 } from "solid-js";
8423
+ import { createSignal as createSignal17 } from "solid-js";
8399
8424
  function ContentStyles(props) {
8400
- const [injectedStyles, setInjectedStyles] = createSignal16(
8425
+ const [injectedStyles, setInjectedStyles] = createSignal17(
8401
8426
  `
8402
8427
  ${getCss({
8403
8428
  cssCode: props.cssCode,
@@ -8455,7 +8480,7 @@ var getContentInitialValue = ({
8455
8480
 
8456
8481
  // src/components/content/content.tsx
8457
8482
  function ContentComponent(props) {
8458
- const [scriptStr, setScriptStr] = createSignal17(
8483
+ const [scriptStr, setScriptStr] = createSignal18(
8459
8484
  getUpdateVariantVisibilityScript({
8460
8485
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
8461
8486
  variationId: props.content?.testVariationId,
@@ -8463,7 +8488,7 @@ function ContentComponent(props) {
8463
8488
  contentId: props.content?.id
8464
8489
  })
8465
8490
  );
8466
- const [registeredComponents, setRegisteredComponents] = createSignal17(
8491
+ const [registeredComponents, setRegisteredComponents] = createSignal18(
8467
8492
  [
8468
8493
  ...getDefaultRegisteredComponents(),
8469
8494
  ...props.customComponents?.filter(({ models }) => {
@@ -8484,7 +8509,7 @@ function ContentComponent(props) {
8484
8509
  {}
8485
8510
  )
8486
8511
  );
8487
- const [builderContextSignal, setBuilderContextSignal] = createSignal17({
8512
+ const [builderContextSignal, setBuilderContextSignal] = createSignal18({
8488
8513
  content: getContentInitialValue({
8489
8514
  content: props.content,
8490
8515
  data: props.data
@@ -8574,13 +8599,13 @@ var Content_default = ContentComponent;
8574
8599
 
8575
8600
  // src/components/content-variants/content-variants.tsx
8576
8601
  function ContentVariants(props) {
8577
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
8602
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
8578
8603
  checkShouldRenderVariants({
8579
8604
  canTrack: getDefaultCanTrack(props.canTrack),
8580
8605
  content: props.content
8581
8606
  })
8582
8607
  );
8583
- const updateCookieAndStylesScriptStr = createMemo18(() => {
8608
+ const updateCookieAndStylesScriptStr = createMemo19(() => {
8584
8609
  return getUpdateCookieAndStylesScript(
8585
8610
  getVariants(props.content).map((value) => ({
8586
8611
  id: value.testVariationId,
@@ -8589,10 +8614,10 @@ function ContentVariants(props) {
8589
8614
  props.content?.id || ""
8590
8615
  );
8591
8616
  });
8592
- const hideVariantsStyleString = createMemo18(() => {
8617
+ const hideVariantsStyleString = createMemo19(() => {
8593
8618
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
8594
8619
  });
8595
- const defaultContent = createMemo18(() => {
8620
+ const defaultContent = createMemo19(() => {
8596
8621
  return shouldRenderVariants() ? {
8597
8622
  ...props.content,
8598
8623
  testVariationId: props.content?.id
@@ -8601,7 +8626,7 @@ function ContentVariants(props) {
8601
8626
  canTrack: getDefaultCanTrack(props.canTrack)
8602
8627
  });
8603
8628
  });
8604
- onMount4(() => {
8629
+ onMount5(() => {
8605
8630
  setShouldRenderVariants(false);
8606
8631
  });
8607
8632
  return <><>
@@ -8701,14 +8726,14 @@ var fetchSymbolContent = async ({
8701
8726
 
8702
8727
  // src/blocks/symbol/symbol.tsx
8703
8728
  function Symbol2(props) {
8704
- const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
8705
- const blocksWrapper = createMemo19(() => {
8729
+ const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
8730
+ const blocksWrapper = createMemo20(() => {
8706
8731
  return "div";
8707
8732
  });
8708
- const contentWrapper = createMemo19(() => {
8733
+ const contentWrapper = createMemo20(() => {
8709
8734
  return "div";
8710
8735
  });
8711
- const className = createMemo19(() => {
8736
+ const className = createMemo20(() => {
8712
8737
  return [
8713
8738
  ...[props.attributes[getClassPropName()]],
8714
8739
  "builder-symbol",
@@ -8728,9 +8753,9 @@ function Symbol2(props) {
8728
8753
  }
8729
8754
  });
8730
8755
  }
8731
- onMount5(() => {
8756
+ onMount6(() => {
8732
8757
  });
8733
- const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
8758
+ const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
8734
8759
  function onUpdateFn_0() {
8735
8760
  setContent();
8736
8761
  }
package/lib/edge/index.js CHANGED
@@ -3677,6 +3677,9 @@ function assign(target, ..._args) {
3677
3677
  return to;
3678
3678
  }
3679
3679
  function bindAnimations(animations) {
3680
+ if (TARGET === "reactNative") {
3681
+ return;
3682
+ }
3680
3683
  for (const animation of animations) {
3681
3684
  switch (animation.trigger) {
3682
3685
  case "pageLoad":
@@ -4703,7 +4706,7 @@ var getColumnsClass = (id2) => {
4703
4706
 
4704
4707
  // src/blocks/columns/columns.tsx
4705
4708
  var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
4706
- var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-5b8fb3ac {
4709
+ var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-3ff242de {
4707
4710
  display: flex;
4708
4711
  line-height: normal;
4709
4712
  }`);
@@ -4783,6 +4786,7 @@ function Columns(props) {
4783
4786
  return breakpointSizes[size].max;
4784
4787
  }
4785
4788
  function columnsStyles() {
4789
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
4786
4790
  return `
4787
4791
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
4788
4792
  .${props.builderBlock.id}-breakpoints {
@@ -4790,7 +4794,7 @@ function Columns(props) {
4790
4794
  align-items: stretch;
4791
4795
  }
4792
4796
 
4793
- .${props.builderBlock.id}-breakpoints > .builder-column {
4797
+ ${childColumnDiv} {
4794
4798
  width: var(--column-width-tablet) !important;
4795
4799
  margin-left: var(--column-margin-left-tablet) !important;
4796
4800
  }
@@ -4802,7 +4806,7 @@ function Columns(props) {
4802
4806
  align-items: stretch;
4803
4807
  }
4804
4808
 
4805
- .${props.builderBlock.id}-breakpoints > .builder-column {
4809
+ ${childColumnDiv} {
4806
4810
  width: var(--column-width-mobile) !important;
4807
4811
  margin-left: var(--column-margin-left-mobile) !important;
4808
4812
  }
@@ -4823,7 +4827,7 @@ function Columns(props) {
4823
4827
  const _el$ = _tmpl$3();
4824
4828
  spread(_el$, mergeProps({
4825
4829
  get ["class"]() {
4826
- return getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac";
4830
+ return getColumnsClass(props.builderBlock?.id) + " div-3ff242de";
4827
4831
  },
4828
4832
  get style() {
4829
4833
  return columnsCssVars();
@@ -4948,16 +4952,16 @@ function getSrcSet(url) {
4948
4952
  // src/blocks/image/image.tsx
4949
4953
  var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
4950
4954
  var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
4951
- var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-e3b1053e">`);
4952
- var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-e3b1053e-2>`);
4953
- var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-e3b1053e {
4955
+ var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-4512e110">`);
4956
+ var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-4512e110-2>`);
4957
+ var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-4512e110 {
4954
4958
  opacity: 1;
4955
4959
  transition: opacity 0.2s ease-in-out;
4956
- }.div-e3b1053e {
4960
+ }.div-4512e110 {
4957
4961
  width: 100%;
4958
4962
  pointer-events: none;
4959
4963
  font-size: 0;
4960
- }.div-e3b1053e-2 {
4964
+ }.div-4512e110-2 {
4961
4965
  display: flex;
4962
4966
  flex-direction: column;
4963
4967
  align-items: stretch;
@@ -5006,6 +5010,8 @@ function Image(props) {
5006
5010
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
5007
5011
  return out;
5008
5012
  });
5013
+ onMount(() => {
5014
+ });
5009
5015
  return [[(() => {
5010
5016
  const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
5011
5017
  insert(_el$, createComponent(Show, {
@@ -5019,7 +5025,7 @@ function Image(props) {
5019
5025
  }
5020
5026
  }), _el$3);
5021
5027
  effect((_p$) => {
5022
- 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 = {
5028
+ 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 = {
5023
5029
  "object-position": props.backgroundPosition || "center",
5024
5030
  "object-fit": props.backgroundSize || "cover",
5025
5031
  ...aspectRatioCss()
@@ -6389,7 +6395,8 @@ delegateEvents(["click"]);
6389
6395
  // src/blocks/text/component-info.ts
6390
6396
  var componentInfo10 = {
6391
6397
  shouldReceiveBuilderProps: {
6392
- builderBlock: TARGET === "reactNative" ? true : false
6398
+ builderBlock: TARGET === "reactNative" ? true : false,
6399
+ builderContext: true
6393
6400
  },
6394
6401
  name: "Text",
6395
6402
  static: true,
@@ -6411,10 +6418,27 @@ var componentInfo10 = {
6411
6418
  };
6412
6419
  var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
6413
6420
  function Text(props) {
6421
+ const processedText = createMemo(() => {
6422
+ const context = props.builderContext;
6423
+ const {
6424
+ context: contextContext,
6425
+ localState,
6426
+ rootState,
6427
+ rootSetState
6428
+ } = context;
6429
+ return String(props.text?.toString() || "").replace(/{{([^}]+)}}/g, (match, group) => evaluate({
6430
+ code: group,
6431
+ context: contextContext,
6432
+ localState,
6433
+ rootState,
6434
+ rootSetState,
6435
+ enableCache: false
6436
+ }));
6437
+ });
6414
6438
  return (() => {
6415
6439
  const _el$ = _tmpl$10();
6416
6440
  _el$.style.setProperty("outline", "none");
6417
- effect(() => _el$.innerHTML = props.text?.toString() || "");
6441
+ effect(() => _el$.innerHTML = processedText());
6418
6442
  return _el$;
6419
6443
  })();
6420
6444
  }
@@ -7711,17 +7735,14 @@ var serializeFn = (fnValue) => {
7711
7735
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
7712
7736
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
7713
7737
  };
7714
- var serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
7715
- var serializeComponentInfo = ({
7716
- inputs,
7717
- ...info
7718
- }) => ({
7719
- ...fastClone(info),
7720
- inputs: inputs?.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
7721
- ...acc,
7722
- [key]: serializeValue(value)
7723
- }), {}))
7724
- });
7738
+ function serializeComponentInfo(info) {
7739
+ return JSON.parse(JSON.stringify(info, (key, value) => {
7740
+ if (typeof value === "function") {
7741
+ return serializeFn(value);
7742
+ }
7743
+ return value;
7744
+ }));
7745
+ }
7725
7746
 
7726
7747
  // src/components/content-variants/inlined-fns.ts
7727
7748
  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}";
@@ -8282,7 +8303,7 @@ function isFromTrustedHost(trustedHosts, e) {
8282
8303
  }
8283
8304
 
8284
8305
  // src/constants/sdk-version.ts
8285
- var SDK_VERSION = "2.0.2";
8306
+ var SDK_VERSION = "2.0.5";
8286
8307
 
8287
8308
  // src/functions/register.ts
8288
8309
  var registry = {};