@builder.io/sdk-solid 4.2.0 → 4.2.2

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.js CHANGED
@@ -4501,11 +4501,6 @@ var getWrapperProps = ({
4501
4501
  function ComponentRef(props) {
4502
4502
  createSignal(false);
4503
4503
  const [Wrapper, setWrapper] = createSignal(props.isInteractive ? interactive_element_default : props.componentRef);
4504
- const onUpdateFn_0_props_componentOptions = createMemo(() => props.componentOptions);
4505
- const onUpdateFn_0_props_blockChildren = createMemo(() => props.blockChildren);
4506
- function onUpdateFn_0() {
4507
- }
4508
- createEffect(on(() => [onUpdateFn_0_props_componentOptions(), onUpdateFn_0_props_blockChildren()], onUpdateFn_0));
4509
4504
  return createComponent(Show, {
4510
4505
  get when() {
4511
4506
  return props.componentRef;
@@ -4525,25 +4520,32 @@ function ComponentRef(props) {
4525
4520
  return Wrapper();
4526
4521
  },
4527
4522
  get children() {
4528
- return createComponent(For, {
4529
- get each() {
4530
- return props.blockChildren;
4523
+ return createComponent(Show, {
4524
+ get when() {
4525
+ return props.componentRef;
4531
4526
  },
4532
- children: (child, _index) => {
4533
- _index();
4534
- return createComponent(block_default, {
4535
- get key() {
4536
- return child.id;
4537
- },
4538
- block: child,
4539
- get context() {
4540
- return props.context;
4541
- },
4542
- get registeredComponents() {
4543
- return props.registeredComponents;
4527
+ get children() {
4528
+ return createComponent(For, {
4529
+ get each() {
4530
+ return props.blockChildren;
4544
4531
  },
4545
- get linkComponent() {
4546
- return props.linkComponent;
4532
+ children: (child, _index) => {
4533
+ _index();
4534
+ return createComponent(block_default, {
4535
+ get key() {
4536
+ return child.id;
4537
+ },
4538
+ block: child,
4539
+ get context() {
4540
+ return props.context;
4541
+ },
4542
+ get registeredComponents() {
4543
+ return props.registeredComponents;
4544
+ },
4545
+ get linkComponent() {
4546
+ return props.linkComponent;
4547
+ }
4548
+ });
4547
4549
  }
4548
4550
  });
4549
4551
  }
@@ -4850,7 +4852,7 @@ function Block(props) {
4850
4852
  });
4851
4853
  }
4852
4854
  var block_default = Block;
4853
- var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-450facf4 {
4855
+ var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-4d836538 {
4854
4856
  display: flex;
4855
4857
  flex-direction: column;
4856
4858
  align-items: stretch;
@@ -4899,7 +4901,7 @@ function BlocksWrapper(props) {
4899
4901
  createEffect(on(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
4900
4902
  return [createComponent(Dynamic, mergeProps({
4901
4903
  get ["class"]() {
4902
- return className() + " dynamic-450facf4";
4904
+ return className() + " dynamic-4d836538";
4903
4905
  },
4904
4906
  ref(r$) {
4905
4907
  const _ref$ = blocksWrapperRef;
@@ -7154,6 +7156,9 @@ function Tabs(props) {
7154
7156
  function activeTabContent(active) {
7155
7157
  return props.tabs && props.tabs[active].content;
7156
7158
  }
7159
+ function getTabStyle(index) {
7160
+ return index === activeTab() ? props.activeTabStyle : {};
7161
+ }
7157
7162
  function onClick(index) {
7158
7163
  if (index === activeTab() && props.collapsible) {
7159
7164
  setActiveTab(-1);
@@ -7195,9 +7200,7 @@ function Tabs(props) {
7195
7200
  }
7196
7201
  }));
7197
7202
  effect((_p$) => {
7198
- const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = {
7199
- ...activeTab() === index ? props.activeTabStyle : {}
7200
- };
7203
+ const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getTabStyle(index);
7201
7204
  _v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
7202
7205
  _p$._v$2 = style(_el$4, _v$2, _p$._v$2);
7203
7206
  return _p$;
@@ -7693,9 +7696,9 @@ function logFetch(url) {
7693
7696
  }
7694
7697
 
7695
7698
  // src/blocks/form/form/form.tsx
7696
- var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-7430044e">`);
7699
+ var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-74261216">`);
7697
7700
  var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
7698
- var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-7430044e {
7701
+ var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-74261216 {
7699
7702
  padding: 10px;
7700
7703
  color: red;
7701
7704
  text-align: center;
@@ -7718,6 +7721,9 @@ function FormComponent(props) {
7718
7721
  function submissionState() {
7719
7722
  return isEditing() && props.previewState || formState();
7720
7723
  }
7724
+ function errorResponse(response) {
7725
+ return JSON.stringify(response, null, 2);
7726
+ }
7721
7727
  function onSubmit(event) {
7722
7728
  const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
7723
7729
  if (props.sendSubmissionsTo === "zapier") {
@@ -7732,13 +7738,13 @@ function FormComponent(props) {
7732
7738
  const headers = props.customHeaders || {};
7733
7739
  let body;
7734
7740
  const formData = new FormData(el);
7735
- const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
7741
+ const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).filter((el2) => !!el2.name && (el2.type !== "radio" || el2.checked)).map((el2) => {
7736
7742
  let value;
7737
7743
  const key = el2.name;
7738
7744
  if (el2 instanceof HTMLInputElement) {
7739
7745
  if (el2.type === "radio") {
7740
7746
  if (el2.checked) {
7741
- value = el2.name;
7747
+ value = el2.value;
7742
7748
  return {
7743
7749
  key,
7744
7750
  value
@@ -7966,7 +7972,7 @@ function FormComponent(props) {
7966
7972
  },
7967
7973
  get children() {
7968
7974
  const _el$2 = _tmpl$15();
7969
- insert(_el$2, () => JSON.stringify(responseData(), null, 2));
7975
+ insert(_el$2, () => errorResponse(responseData()));
7970
7976
  return _el$2;
7971
7977
  }
7972
7978
  }), null);
@@ -8683,7 +8689,7 @@ function getPreviewContent(_searchParams) {
8683
8689
  }
8684
8690
 
8685
8691
  // src/constants/sdk-version.ts
8686
- var SDK_VERSION = "4.2.0";
8692
+ var SDK_VERSION = "4.2.2";
8687
8693
 
8688
8694
  // src/helpers/sdk-headers.ts
8689
8695
  var getSdkHeaders = () => ({
@@ -9492,6 +9498,8 @@ var getWrapperClassName = (variationId) => {
9492
9498
  // src/components/content/components/enable-editor.tsx
9493
9499
  function EnableEditor(props) {
9494
9500
  createSignal(false);
9501
+ const [prevData, setPrevData] = createSignal(null);
9502
+ const [prevLocale, setPrevLocale] = createSignal("");
9495
9503
  const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
9496
9504
  const [httpReqsData, setHttpReqsData] = createSignal({});
9497
9505
  const [httpReqsPending, setHttpReqsPending] = createSignal({});
@@ -9616,11 +9624,15 @@ function EnableEditor(props) {
9616
9624
  method: "GET"
9617
9625
  };
9618
9626
  logFetch(JSON.stringify(fetchRequestObj));
9619
- fetch(fetchRequestObj.url, {
9627
+ const fetchOptions = {
9620
9628
  method: fetchRequestObj.method,
9621
9629
  headers: fetchRequestObj.headers,
9622
9630
  body: fetchRequestObj.body
9623
- }).then((response) => response.json()).then((json) => {
9631
+ };
9632
+ if (fetchRequestObj.method === "GET") {
9633
+ delete fetchOptions.body;
9634
+ }
9635
+ fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
9624
9636
  mergeNewRootState({
9625
9637
  [key]: json
9626
9638
  });
@@ -9729,16 +9741,24 @@ function EnableEditor(props) {
9729
9741
  const onUpdateFn_2_props_data = createMemo(() => props.data);
9730
9742
  function onUpdateFn_2() {
9731
9743
  if (props.data) {
9744
+ if (prevData() === props.data) {
9745
+ return;
9746
+ }
9732
9747
  mergeNewRootState(props.data);
9748
+ setPrevData(props.data);
9733
9749
  }
9734
9750
  }
9735
9751
  createEffect(on(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
9736
9752
  const onUpdateFn_3_props_locale = createMemo(() => props.locale);
9737
9753
  function onUpdateFn_3() {
9738
9754
  if (props.locale) {
9755
+ if (prevLocale() === props.locale) {
9756
+ return;
9757
+ }
9739
9758
  mergeNewRootState({
9740
9759
  locale: props.locale
9741
9760
  });
9761
+ setPrevLocale(props.locale);
9742
9762
  }
9743
9763
  }
9744
9764
  createEffect(on(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
@@ -10288,6 +10308,9 @@ function Symbol2(props) {
10288
10308
  const contentWrapper = createMemo(() => {
10289
10309
  return "div";
10290
10310
  });
10311
+ const customComponents = createMemo(() => {
10312
+ return Object.values(props.builderComponents);
10313
+ });
10291
10314
  const className = createMemo(() => {
10292
10315
  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(" ");
10293
10316
  });
@@ -10336,7 +10359,7 @@ function Symbol2(props) {
10336
10359
  };
10337
10360
  },
10338
10361
  get customComponents() {
10339
- return Object.values(props.builderComponents);
10362
+ return customComponents();
10340
10363
  },
10341
10364
  get data() {
10342
10365
  return {
@@ -10398,6 +10421,18 @@ function register(type, info) {
10398
10421
  }
10399
10422
  }
10400
10423
  }
10424
+ function registerAction(action) {
10425
+ if (isBrowser()) {
10426
+ const actionClone = JSON.parse(JSON.stringify(action));
10427
+ if (action.action) {
10428
+ actionClone.action = action.action.toString();
10429
+ }
10430
+ window.parent?.postMessage({
10431
+ type: "builder.registerAction",
10432
+ data: actionClone
10433
+ }, "*");
10434
+ }
10435
+ }
10401
10436
 
10402
10437
  // src/functions/set-editor-settings.ts
10403
10438
  var settings = {};
@@ -10434,4 +10469,4 @@ var fetchBuilderProps = async (_args) => {
10434
10469
  };
10435
10470
  };
10436
10471
 
10437
- export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setClientUserAttributes, setEditorSettings, subscribeToEditor, track };
10472
+ export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, registerAction, setClientUserAttributes, setEditorSettings, subscribeToEditor, track };
package/lib/edge/dev.jsx CHANGED
@@ -4383,14 +4383,7 @@ function BlockWrapper(props) {
4383
4383
  var Block_wrapper_default = BlockWrapper;
4384
4384
 
4385
4385
  // src/components/block/components/component-ref/component-ref.tsx
4386
- import {
4387
- Show as Show4,
4388
- For,
4389
- on as on2,
4390
- createEffect as createEffect2,
4391
- createMemo as createMemo3,
4392
- createSignal as createSignal3
4393
- } from "solid-js";
4386
+ import { Show as Show4, For, createSignal as createSignal3 } from "solid-js";
4394
4387
  import { Dynamic as Dynamic3 } from "solid-js/web";
4395
4388
 
4396
4389
  // src/components/block/components/interactive-element.tsx
@@ -4497,23 +4490,6 @@ function ComponentRef(props) {
4497
4490
  const [Wrapper, setWrapper] = createSignal3(
4498
4491
  props.isInteractive ? interactive_element_default : props.componentRef
4499
4492
  );
4500
- const onUpdateFn_0_props_componentOptions = createMemo3(
4501
- () => props.componentOptions
4502
- );
4503
- const onUpdateFn_0_props_blockChildren = createMemo3(
4504
- () => props.blockChildren
4505
- );
4506
- function onUpdateFn_0() {
4507
- }
4508
- createEffect2(
4509
- on2(
4510
- () => [
4511
- onUpdateFn_0_props_componentOptions(),
4512
- onUpdateFn_0_props_blockChildren()
4513
- ],
4514
- onUpdateFn_0
4515
- )
4516
- );
4517
4493
  return <><Show4 when={props.componentRef}><Dynamic3
4518
4494
  {...getWrapperProps({
4519
4495
  componentOptions: props.componentOptions,
@@ -4526,7 +4502,7 @@ function ComponentRef(props) {
4526
4502
  contextValue: props.context
4527
4503
  })}
4528
4504
  component={Wrapper()}
4529
- ><For each={props.blockChildren}>{(child, _index) => {
4505
+ ><Show4 when={props.componentRef}><For each={props.blockChildren}>{(child, _index) => {
4530
4506
  const index = _index();
4531
4507
  return <Block_default
4532
4508
  key={child.id}
@@ -4535,12 +4511,12 @@ function ComponentRef(props) {
4535
4511
  registeredComponents={props.registeredComponents}
4536
4512
  linkComponent={props.linkComponent}
4537
4513
  />;
4538
- }}</For></Dynamic3></Show4></>;
4514
+ }}</For></Show4></Dynamic3></Show4></>;
4539
4515
  }
4540
4516
  var Component_ref_default = ComponentRef;
4541
4517
 
4542
4518
  // src/components/block/components/repeated-block.tsx
4543
- import { on as on3, createEffect as createEffect3, createMemo as createMemo4, createSignal as createSignal4 } from "solid-js";
4519
+ import { on as on2, createEffect as createEffect2, createMemo as createMemo4, createSignal as createSignal4 } from "solid-js";
4544
4520
  function RepeatedBlock(props) {
4545
4521
  const [store, setStore] = createSignal4(props.repeatContext);
4546
4522
  const onUpdateFn_0_props_repeatContext = createMemo4(
@@ -4549,7 +4525,7 @@ function RepeatedBlock(props) {
4549
4525
  function onUpdateFn_0() {
4550
4526
  setStore(props.repeatContext);
4551
4527
  }
4552
- createEffect3(on3(() => [onUpdateFn_0_props_repeatContext()], onUpdateFn_0));
4528
+ createEffect2(on2(() => [onUpdateFn_0_props_repeatContext()], onUpdateFn_0));
4553
4529
  return <><builder_context_default.Provider value={store()}><Block_default
4554
4530
  block={props.block}
4555
4531
  context={store()}
@@ -4718,7 +4694,7 @@ function Block(props) {
4718
4694
  var Block_default = Block;
4719
4695
 
4720
4696
  // src/components/blocks/blocks-wrapper.tsx
4721
- import { onMount as onMount3, on as on5, createEffect as createEffect5, createMemo as createMemo6, createSignal as createSignal6 } from "solid-js";
4697
+ import { onMount as onMount3, on as on4, createEffect as createEffect4, createMemo as createMemo6, createSignal as createSignal6 } from "solid-js";
4722
4698
  import { Dynamic as Dynamic4 } from "solid-js/web";
4723
4699
  function BlocksWrapper(props) {
4724
4700
  const [shouldUpdate, setShouldUpdate] = createSignal6(false);
@@ -4771,10 +4747,10 @@ function BlocksWrapper(props) {
4771
4747
  const onUpdateFn_0_props_blocks = createMemo6(() => props.blocks);
4772
4748
  function onUpdateFn_0() {
4773
4749
  }
4774
- createEffect5(on5(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
4750
+ createEffect4(on4(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
4775
4751
  return <>
4776
4752
  <Dynamic4
4777
- class={className() + " dynamic-450facf4"}
4753
+ class={className() + " dynamic-4d836538"}
4778
4754
  ref={blocksWrapperRef}
4779
4755
  builder-path={dataPath()}
4780
4756
  builder-parent-id={props.parent}
@@ -4786,7 +4762,7 @@ function BlocksWrapper(props) {
4786
4762
  {...props.BlocksWrapperProps}
4787
4763
  component={props.BlocksWrapper}
4788
4764
  >{props.children}</Dynamic4>
4789
- <style>{`.dynamic-450facf4 {
4765
+ <style>{`.dynamic-4d836538 {
4790
4766
  display: flex;
4791
4767
  flex-direction: column;
4792
4768
  align-items: stretch;
@@ -5166,7 +5142,7 @@ function SectionComponent(props) {
5166
5142
  var section_default = SectionComponent;
5167
5143
 
5168
5144
  // src/blocks/symbol/symbol.tsx
5169
- import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
5145
+ import { onMount as onMount10, on as on8, createEffect as createEffect8, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
5170
5146
 
5171
5147
  // src/components/content-variants/content-variants.tsx
5172
5148
  import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
@@ -6807,6 +6783,9 @@ function Tabs(props) {
6807
6783
  function activeTabContent(active) {
6808
6784
  return props.tabs && props.tabs[active].content;
6809
6785
  }
6786
+ function getTabStyle(index) {
6787
+ return index === activeTab() ? props.activeTabStyle : {};
6788
+ }
6810
6789
  function onClick(index) {
6811
6790
  if (index === activeTab() && props.collapsible) {
6812
6791
  setActiveTab(-1);
@@ -6828,9 +6807,7 @@ function Tabs(props) {
6828
6807
  return <span
6829
6808
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
6830
6809
  key={index}
6831
- style={{
6832
- ...activeTab() === index ? props.activeTabStyle : {}
6833
- }}
6810
+ style={getTabStyle(index)}
6834
6811
  onClick={(event) => onClick(index)}
6835
6812
  ><Blocks_default
6836
6813
  parent={props.builderBlock.id}
@@ -6916,7 +6893,7 @@ var componentInfo12 = {
6916
6893
  };
6917
6894
 
6918
6895
  // src/blocks/custom-code/custom-code.tsx
6919
- import { onMount as onMount6, on as on6, createEffect as createEffect6, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
6896
+ import { onMount as onMount6, on as on5, createEffect as createEffect5, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
6920
6897
  function CustomCode(props) {
6921
6898
  const [scriptsInserted, setScriptsInserted] = createSignal12([]);
6922
6899
  const [scriptsRun, setScriptsRun] = createSignal12([]);
@@ -6966,7 +6943,7 @@ function CustomCode(props) {
6966
6943
  runScripts();
6967
6944
  }
6968
6945
  }
6969
- createEffect6(on6(() => [onUpdateFn_0_props_code()], onUpdateFn_0));
6946
+ createEffect5(on5(() => [onUpdateFn_0_props_code()], onUpdateFn_0));
6970
6947
  return <><div
6971
6948
  class={"builder-custom-code" + (props.replaceNodes ? " replace-nodes" : "")}
6972
6949
  ref={elementRef}
@@ -6994,7 +6971,7 @@ var componentInfo13 = {
6994
6971
  };
6995
6972
 
6996
6973
  // src/blocks/embed/embed.tsx
6997
- import { on as on7, createEffect as createEffect7, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
6974
+ import { on as on6, createEffect as createEffect6, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
6998
6975
 
6999
6976
  // src/blocks/embed/helpers.ts
7000
6977
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -7036,8 +7013,8 @@ function Embed(props) {
7036
7013
  findAndRunScripts();
7037
7014
  }
7038
7015
  }
7039
- createEffect7(
7040
- on7(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
7016
+ createEffect6(
7017
+ on6(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
7041
7018
  );
7042
7019
  return <><div class="builder-embed" ref={elem} innerHTML={props.content} /></>;
7043
7020
  }
@@ -7321,6 +7298,9 @@ function FormComponent(props) {
7321
7298
  function submissionState() {
7322
7299
  return isEditing() && props.previewState || formState();
7323
7300
  }
7301
+ function errorResponse(response) {
7302
+ return JSON.stringify(response, null, 2);
7303
+ }
7324
7304
  function onSubmit(event) {
7325
7305
  const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
7326
7306
  if (props.sendSubmissionsTo === "zapier") {
@@ -7335,13 +7315,15 @@ function FormComponent(props) {
7335
7315
  const headers = props.customHeaders || {};
7336
7316
  let body;
7337
7317
  const formData = new FormData(el);
7338
- const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
7318
+ const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).filter(
7319
+ (el2) => !!el2.name && (el2.type !== "radio" || el2.checked)
7320
+ ).map((el2) => {
7339
7321
  let value;
7340
7322
  const key = el2.name;
7341
7323
  if (el2 instanceof HTMLInputElement) {
7342
7324
  if (el2.type === "radio") {
7343
7325
  if (el2.checked) {
7344
- value = el2.name;
7326
+ value = el2.value;
7345
7327
  return {
7346
7328
  key,
7347
7329
  value
@@ -7534,14 +7516,14 @@ function FormComponent(props) {
7534
7516
  blocks={props.sendingMessage}
7535
7517
  context={props.builderContext}
7536
7518
  /></Show12>
7537
- <Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-7430044e">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
7519
+ <Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-74261216">{errorResponse(responseData())}</pre></Show12>
7538
7520
  <Show12 when={submissionState() === "success"}><Blocks_default
7539
7521
  path="successMessage"
7540
7522
  blocks={props.successMessage}
7541
7523
  context={props.builderContext}
7542
7524
  /></Show12>
7543
7525
  </form>
7544
- <style>{`.pre-7430044e {
7526
+ <style>{`.pre-74261216 {
7545
7527
  padding: 10px;
7546
7528
  color: red;
7547
7529
  text-align: center;
@@ -8164,8 +8146,8 @@ var getUpdateVariantVisibilityScript = ({
8164
8146
  import {
8165
8147
  Show as Show14,
8166
8148
  onMount as onMount8,
8167
- on as on8,
8168
- createEffect as createEffect8,
8149
+ on as on7,
8150
+ createEffect as createEffect7,
8169
8151
  createMemo as createMemo17,
8170
8152
  createSignal as createSignal17
8171
8153
  } from "solid-js";
@@ -8177,7 +8159,7 @@ function getPreviewContent(_searchParams) {
8177
8159
  }
8178
8160
 
8179
8161
  // src/constants/sdk-version.ts
8180
- var SDK_VERSION = "4.2.0";
8162
+ var SDK_VERSION = "4.2.2";
8181
8163
 
8182
8164
  // src/helpers/sdk-headers.ts
8183
8165
  var getSdkHeaders = () => ({
@@ -8986,6 +8968,8 @@ var getWrapperClassName = (variationId) => {
8986
8968
  // src/components/content/components/enable-editor.tsx
8987
8969
  function EnableEditor(props) {
8988
8970
  const [hasExecuted, setHasExecuted] = createSignal17(false);
8971
+ const [prevData, setPrevData] = createSignal17(null);
8972
+ const [prevLocale, setPrevLocale] = createSignal17("");
8989
8973
  const [ContentWrapper, setContentWrapper] = createSignal17(
8990
8974
  props.contentWrapper || "div"
8991
8975
  );
@@ -9115,11 +9099,15 @@ function EnableEditor(props) {
9115
9099
  method: "GET"
9116
9100
  };
9117
9101
  logFetch(JSON.stringify(fetchRequestObj));
9118
- fetch(fetchRequestObj.url, {
9102
+ const fetchOptions = {
9119
9103
  method: fetchRequestObj.method,
9120
9104
  headers: fetchRequestObj.headers,
9121
9105
  body: fetchRequestObj.body
9122
- }).then((response) => response.json()).then((json) => {
9106
+ };
9107
+ if (fetchRequestObj.method === "GET") {
9108
+ delete fetchOptions.body;
9109
+ }
9110
+ fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
9123
9111
  mergeNewRootState({
9124
9112
  [key]: json
9125
9113
  });
@@ -9236,15 +9224,15 @@ function EnableEditor(props) {
9236
9224
  mergeNewContent(props.content);
9237
9225
  }
9238
9226
  }
9239
- createEffect8(on8(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
9227
+ createEffect7(on7(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
9240
9228
  const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
9241
9229
  () => props.builderContextSignal.rootState
9242
9230
  );
9243
9231
  function onUpdateFn_1() {
9244
9232
  emitStateUpdate();
9245
9233
  }
9246
- createEffect8(
9247
- on8(
9234
+ createEffect7(
9235
+ on7(
9248
9236
  () => [onUpdateFn_1_props_builderContextSignal_rootState()],
9249
9237
  onUpdateFn_1
9250
9238
  )
@@ -9252,19 +9240,27 @@ function EnableEditor(props) {
9252
9240
  const onUpdateFn_2_props_data = createMemo17(() => props.data);
9253
9241
  function onUpdateFn_2() {
9254
9242
  if (props.data) {
9243
+ if (prevData() === props.data) {
9244
+ return;
9245
+ }
9255
9246
  mergeNewRootState(props.data);
9247
+ setPrevData(props.data);
9256
9248
  }
9257
9249
  }
9258
- createEffect8(on8(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
9250
+ createEffect7(on7(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
9259
9251
  const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
9260
9252
  function onUpdateFn_3() {
9261
9253
  if (props.locale) {
9254
+ if (prevLocale() === props.locale) {
9255
+ return;
9256
+ }
9262
9257
  mergeNewRootState({
9263
9258
  locale: props.locale
9264
9259
  });
9260
+ setPrevLocale(props.locale);
9265
9261
  }
9266
9262
  }
9267
- createEffect8(on8(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
9263
+ createEffect7(on7(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
9268
9264
  return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
9269
9265
  when={props.builderContextSignal.content || needsElementRefDivForEditing()}
9270
9266
  ><Dynamic5
@@ -9624,6 +9620,9 @@ function Symbol2(props) {
9624
9620
  const contentWrapper = createMemo21(() => {
9625
9621
  return "div";
9626
9622
  });
9623
+ const customComponents = createMemo21(() => {
9624
+ return Object.values(props.builderComponents);
9625
+ });
9627
9626
  const className = createMemo21(() => {
9628
9627
  return [
9629
9628
  ...[props.attributes[getClassPropName()]],
@@ -9651,7 +9650,7 @@ function Symbol2(props) {
9651
9650
  function onUpdateFn_0() {
9652
9651
  setContent();
9653
9652
  }
9654
- createEffect9(on9(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
9653
+ createEffect8(on8(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
9655
9654
  return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
9656
9655
  nonce={props.builderContext.nonce}
9657
9656
  isNestedRender={true}
@@ -9661,7 +9660,7 @@ function Symbol2(props) {
9661
9660
  ...props.builderContext.context,
9662
9661
  symbolId: props.builderBlock?.id
9663
9662
  }}
9664
- customComponents={Object.values(props.builderComponents)}
9663
+ customComponents={customComponents()}
9665
9664
  data={{
9666
9665
  ...props.symbol?.data,
9667
9666
  ...props.builderContext.localState,
@@ -9706,6 +9705,18 @@ function register(type, info) {
9706
9705
  }
9707
9706
  }
9708
9707
  }
9708
+ function registerAction(action) {
9709
+ if (isBrowser()) {
9710
+ const actionClone = JSON.parse(JSON.stringify(action));
9711
+ if (action.action) {
9712
+ actionClone.action = action.action.toString();
9713
+ }
9714
+ window.parent?.postMessage({
9715
+ type: "builder.registerAction",
9716
+ data: actionClone
9717
+ }, "*");
9718
+ }
9719
+ }
9709
9720
 
9710
9721
  // src/functions/set-editor-settings.ts
9711
9722
  var settings = {};
@@ -9762,6 +9773,7 @@ export {
9762
9773
  isEditing,
9763
9774
  isPreviewing,
9764
9775
  register,
9776
+ registerAction,
9765
9777
  setClientUserAttributes,
9766
9778
  setEditorSettings,
9767
9779
  subscribeToEditor,