@builder.io/sdk-solid 1.0.13 → 1.0.15

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/dist/index.d.ts CHANGED
@@ -921,6 +921,14 @@ interface GetContentOptions {
921
921
  * draft mode and un-archived. Default is false.
922
922
  */
923
923
  includeUnpublished?: boolean;
924
+ /**
925
+ * Optional override of the `fetch` function. (Defaults to global `fetch`)
926
+ */
927
+ fetch?: typeof global.fetch;
928
+ /**
929
+ * Optional fetch options to be passed to the `fetch` function.
930
+ */
931
+ fetchOptions?: RequestInit;
924
932
  }
925
933
 
926
934
  type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
@@ -4135,7 +4135,8 @@ async function fetchOneEntry(options) {
4135
4135
  }
4136
4136
  var _fetchContent = async (options) => {
4137
4137
  const url = generateContentUrl(options);
4138
- const res = await fetch2(url.href);
4138
+ const _fetch = options.fetch ?? fetch2;
4139
+ const res = await _fetch(url.href, options.fetchOptions);
4139
4140
  const content = await res.json();
4140
4141
  return content;
4141
4142
  };
@@ -4446,7 +4447,7 @@ function isFromTrustedHost(trustedHosts, e) {
4446
4447
  }
4447
4448
 
4448
4449
  // src/constants/sdk-version.ts
4449
- var SDK_VERSION = "1.0.13";
4450
+ var SDK_VERSION = "1.0.15";
4450
4451
 
4451
4452
  // src/functions/register.ts
4452
4453
  var registry = {};
@@ -4645,10 +4646,6 @@ var subscribeToEditor = (model, callback, options) => {
4645
4646
 
4646
4647
  // src/components/content/components/enable-editor.tsx
4647
4648
  function EnableEditor(props) {
4648
- const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
4649
- createSignal(true);
4650
- createSignal(0);
4651
- const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
4652
4649
  const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
4653
4650
  const [httpReqsData, setHttpReqsData] = createSignal({});
4654
4651
  const [clicked, setClicked] = createSignal(false);
@@ -4704,7 +4701,6 @@ function EnableEditor(props) {
4704
4701
  breakpoints
4705
4702
  }
4706
4703
  });
4707
- setForceReRenderCount(forceReRenderCount() + 1);
4708
4704
  }
4709
4705
  },
4710
4706
  animation: (animation) => {
@@ -4712,7 +4708,6 @@ function EnableEditor(props) {
4712
4708
  },
4713
4709
  contentUpdate: (newContent) => {
4714
4710
  mergeNewContent(newContent);
4715
- setForceReRenderCount(forceReRenderCount() + 1);
4716
4711
  }
4717
4712
  }
4718
4713
  })(event);
@@ -4804,7 +4799,6 @@ function EnableEditor(props) {
4804
4799
  onMount(() => {
4805
4800
  if (isBrowser()) {
4806
4801
  if (isEditing()) {
4807
- setForceReRenderCount(forceReRenderCount() + 1);
4808
4802
  window.addEventListener("message", processMessage);
4809
4803
  registerInsertMenu();
4810
4804
  setupBrowserForEditing({
@@ -4871,41 +4865,37 @@ function EnableEditor(props) {
4871
4865
  }
4872
4866
  }
4873
4867
  createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4874
- const onUpdateFn_1_shouldSendResetCookie__ = createMemo(() => shouldSendResetCookie());
4868
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
4875
4869
  function onUpdateFn_1() {
4876
- }
4877
- createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
4878
- const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
4879
- function onUpdateFn_2() {
4880
4870
  evaluateJsCode();
4881
4871
  }
4882
- createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__jsCode()], onUpdateFn_2));
4883
- const onUpdateFn_3_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
4884
- function onUpdateFn_3() {
4872
+ createEffect(on(() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()], onUpdateFn_1));
4873
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
4874
+ function onUpdateFn_2() {
4885
4875
  runHttpRequests();
4886
4876
  }
4887
- createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_3));
4888
- const onUpdateFn_4_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
4889
- function onUpdateFn_4() {
4877
+ createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_2));
4878
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
4879
+ function onUpdateFn_3() {
4890
4880
  emitStateUpdate();
4891
4881
  }
4892
- createEffect(on(() => [onUpdateFn_4_props_builderContextSignal_rootState()], onUpdateFn_4));
4893
- const onUpdateFn_5_props_data = createMemo(() => props.data);
4894
- function onUpdateFn_5() {
4882
+ createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_rootState()], onUpdateFn_3));
4883
+ const onUpdateFn_4_props_data = createMemo(() => props.data);
4884
+ function onUpdateFn_4() {
4895
4885
  if (props.data) {
4896
4886
  mergeNewRootState(props.data);
4897
4887
  }
4898
4888
  }
4899
- createEffect(on(() => [onUpdateFn_5_props_data()], onUpdateFn_5));
4900
- const onUpdateFn_6_props_locale = createMemo(() => props.locale);
4901
- function onUpdateFn_6() {
4889
+ createEffect(on(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4890
+ const onUpdateFn_5_props_locale = createMemo(() => props.locale);
4891
+ function onUpdateFn_5() {
4902
4892
  if (props.locale) {
4903
4893
  mergeNewRootState({
4904
4894
  locale: props.locale
4905
4895
  });
4906
4896
  }
4907
4897
  }
4908
- createEffect(on(() => [onUpdateFn_6_props_locale()], onUpdateFn_6));
4898
+ createEffect(on(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4909
4899
  return createComponent(builder_context_default.Provider, {
4910
4900
  get value() {
4911
4901
  return props.builderContextSignal;
@@ -4921,9 +4911,6 @@ function EnableEditor(props) {
4921
4911
  return `variant-${props.content?.testVariationId || props.content?.id}`;
4922
4912
  }
4923
4913
  }, {}, {
4924
- get key() {
4925
- return forceReRenderCount();
4926
- },
4927
4914
  ref(r$) {
4928
4915
  const _ref$ = elementRef;
4929
4916
  typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;
@@ -3718,7 +3718,8 @@ async function fetchOneEntry(options) {
3718
3718
  }
3719
3719
  var _fetchContent = async (options) => {
3720
3720
  const url = generateContentUrl(options);
3721
- const res = await fetch2(url.href);
3721
+ const _fetch = options.fetch ?? fetch2;
3722
+ const res = await _fetch(url.href, options.fetchOptions);
3722
3723
  const content = await res.json();
3723
3724
  return content;
3724
3725
  };
@@ -4029,7 +4030,7 @@ function isFromTrustedHost(trustedHosts, e) {
4029
4030
  }
4030
4031
 
4031
4032
  // src/constants/sdk-version.ts
4032
- var SDK_VERSION = "1.0.13";
4033
+ var SDK_VERSION = "1.0.15";
4033
4034
 
4034
4035
  // src/functions/register.ts
4035
4036
  var registry = {};
@@ -4228,10 +4229,6 @@ var subscribeToEditor = (model, callback, options) => {
4228
4229
 
4229
4230
  // src/components/content/components/enable-editor.tsx
4230
4231
  function EnableEditor(props) {
4231
- const [forceReRenderCount, setForceReRenderCount] = createSignal12(0);
4232
- const [firstRender, setFirstRender] = createSignal12(true);
4233
- const [lastUpdated, setLastUpdated] = createSignal12(0);
4234
- const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal12(false);
4235
4232
  const [ContentWrapper, setContentWrapper] = createSignal12(
4236
4233
  props.contentWrapper || "div"
4237
4234
  );
@@ -4286,7 +4283,6 @@ function EnableEditor(props) {
4286
4283
  breakpoints
4287
4284
  }
4288
4285
  });
4289
- setForceReRenderCount(forceReRenderCount() + 1);
4290
4286
  }
4291
4287
  },
4292
4288
  animation: (animation) => {
@@ -4294,7 +4290,6 @@ function EnableEditor(props) {
4294
4290
  },
4295
4291
  contentUpdate: (newContent) => {
4296
4292
  mergeNewContent(newContent);
4297
- setForceReRenderCount(forceReRenderCount() + 1);
4298
4293
  }
4299
4294
  }
4300
4295
  })(event);
@@ -4393,7 +4388,6 @@ function EnableEditor(props) {
4393
4388
  onMount3(() => {
4394
4389
  if (isBrowser()) {
4395
4390
  if (isEditing()) {
4396
- setForceReRenderCount(forceReRenderCount() + 1);
4397
4391
  window.addEventListener("message", processMessage);
4398
4392
  registerInsertMenu();
4399
4393
  setupBrowserForEditing({
@@ -4469,68 +4463,59 @@ function EnableEditor(props) {
4469
4463
  }
4470
4464
  }
4471
4465
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4472
- const onUpdateFn_1_shouldSendResetCookie__ = createMemo12(
4473
- () => shouldSendResetCookie()
4474
- );
4466
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4475
4467
  function onUpdateFn_1() {
4476
- }
4477
- createEffect2(
4478
- on2(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1)
4479
- );
4480
- const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4481
- function onUpdateFn_2() {
4482
4468
  evaluateJsCode();
4483
4469
  }
4484
4470
  createEffect2(
4485
4471
  on2(
4486
- () => [onUpdateFn_2_props_builderContextSignal_content__data__jsCode()],
4487
- onUpdateFn_2
4472
+ () => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
4473
+ onUpdateFn_1
4488
4474
  )
4489
4475
  );
4490
- const onUpdateFn_3_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4491
- function onUpdateFn_3() {
4476
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4477
+ function onUpdateFn_2() {
4492
4478
  runHttpRequests();
4493
4479
  }
4494
4480
  createEffect2(
4495
4481
  on2(
4496
4482
  () => [
4497
- onUpdateFn_3_props_builderContextSignal_content__data__httpRequests()
4483
+ onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
4498
4484
  ],
4499
- onUpdateFn_3
4485
+ onUpdateFn_2
4500
4486
  )
4501
4487
  );
4502
- const onUpdateFn_4_props_builderContextSignal_rootState = createMemo12(
4488
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
4503
4489
  () => props.builderContextSignal.rootState
4504
4490
  );
4505
- function onUpdateFn_4() {
4491
+ function onUpdateFn_3() {
4506
4492
  emitStateUpdate();
4507
4493
  }
4508
4494
  createEffect2(
4509
4495
  on2(
4510
- () => [onUpdateFn_4_props_builderContextSignal_rootState()],
4511
- onUpdateFn_4
4496
+ () => [onUpdateFn_3_props_builderContextSignal_rootState()],
4497
+ onUpdateFn_3
4512
4498
  )
4513
4499
  );
4514
- const onUpdateFn_5_props_data = createMemo12(() => props.data);
4515
- function onUpdateFn_5() {
4500
+ const onUpdateFn_4_props_data = createMemo12(() => props.data);
4501
+ function onUpdateFn_4() {
4516
4502
  if (props.data) {
4517
4503
  mergeNewRootState(props.data);
4518
4504
  }
4519
4505
  }
4520
- createEffect2(on2(() => [onUpdateFn_5_props_data()], onUpdateFn_5));
4521
- const onUpdateFn_6_props_locale = createMemo12(() => props.locale);
4522
- function onUpdateFn_6() {
4506
+ createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4507
+ const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
4508
+ function onUpdateFn_5() {
4523
4509
  if (props.locale) {
4524
4510
  mergeNewRootState({
4525
4511
  locale: props.locale
4526
4512
  });
4527
4513
  }
4528
4514
  }
4529
- createEffect2(on2(() => [onUpdateFn_6_props_locale()], onUpdateFn_6));
4515
+ createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4530
4516
  return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
4531
4517
  class={`variant-${props.content?.testVariationId || props.content?.id}`}
4532
4518
  {...{}}
4533
- key={forceReRenderCount()}
4534
4519
  ref={elementRef}
4535
4520
  onClick={(event) => onClick(event)}
4536
4521
  builder-content-id={props.builderContextSignal.content?.id}
@@ -4123,7 +4123,8 @@ async function fetchOneEntry(options) {
4123
4123
  }
4124
4124
  var _fetchContent = async (options) => {
4125
4125
  const url = generateContentUrl(options);
4126
- const res = await fetch2(url.href);
4126
+ const _fetch = options.fetch ?? fetch2;
4127
+ const res = await _fetch(url.href, options.fetchOptions);
4127
4128
  const content = await res.json();
4128
4129
  return content;
4129
4130
  };
@@ -4431,7 +4432,7 @@ function isFromTrustedHost(trustedHosts, e) {
4431
4432
  }
4432
4433
 
4433
4434
  // src/constants/sdk-version.ts
4434
- var SDK_VERSION = "1.0.13";
4435
+ var SDK_VERSION = "1.0.15";
4435
4436
 
4436
4437
  // src/functions/register.ts
4437
4438
  var registry = {};
@@ -4629,10 +4630,6 @@ var subscribeToEditor = (model, callback, options) => {
4629
4630
 
4630
4631
  // src/components/content/components/enable-editor.tsx
4631
4632
  function EnableEditor(props) {
4632
- const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
4633
- createSignal(true);
4634
- createSignal(0);
4635
- const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
4636
4633
  const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
4637
4634
  const [httpReqsData, setHttpReqsData] = createSignal({});
4638
4635
  const [clicked, setClicked] = createSignal(false);
@@ -4688,7 +4685,6 @@ function EnableEditor(props) {
4688
4685
  breakpoints
4689
4686
  }
4690
4687
  });
4691
- setForceReRenderCount(forceReRenderCount() + 1);
4692
4688
  }
4693
4689
  },
4694
4690
  animation: (animation) => {
@@ -4696,7 +4692,6 @@ function EnableEditor(props) {
4696
4692
  },
4697
4693
  contentUpdate: (newContent) => {
4698
4694
  mergeNewContent(newContent);
4699
- setForceReRenderCount(forceReRenderCount() + 1);
4700
4695
  }
4701
4696
  }
4702
4697
  })(event);
@@ -4787,7 +4782,6 @@ function EnableEditor(props) {
4787
4782
  onMount(() => {
4788
4783
  if (isBrowser()) {
4789
4784
  if (isEditing()) {
4790
- setForceReRenderCount(forceReRenderCount() + 1);
4791
4785
  window.addEventListener("message", processMessage);
4792
4786
  registerInsertMenu();
4793
4787
  setupBrowserForEditing({
@@ -4854,41 +4848,37 @@ function EnableEditor(props) {
4854
4848
  }
4855
4849
  }
4856
4850
  createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4857
- const onUpdateFn_1_shouldSendResetCookie__ = createMemo(() => shouldSendResetCookie());
4851
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
4858
4852
  function onUpdateFn_1() {
4859
- }
4860
- createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
4861
- const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
4862
- function onUpdateFn_2() {
4863
4853
  evaluateJsCode();
4864
4854
  }
4865
- createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__jsCode()], onUpdateFn_2));
4866
- const onUpdateFn_3_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
4867
- function onUpdateFn_3() {
4855
+ createEffect(on(() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()], onUpdateFn_1));
4856
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
4857
+ function onUpdateFn_2() {
4868
4858
  runHttpRequests();
4869
4859
  }
4870
- createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_3));
4871
- const onUpdateFn_4_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
4872
- function onUpdateFn_4() {
4860
+ createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_2));
4861
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
4862
+ function onUpdateFn_3() {
4873
4863
  emitStateUpdate();
4874
4864
  }
4875
- createEffect(on(() => [onUpdateFn_4_props_builderContextSignal_rootState()], onUpdateFn_4));
4876
- const onUpdateFn_5_props_data = createMemo(() => props.data);
4877
- function onUpdateFn_5() {
4865
+ createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_rootState()], onUpdateFn_3));
4866
+ const onUpdateFn_4_props_data = createMemo(() => props.data);
4867
+ function onUpdateFn_4() {
4878
4868
  if (props.data) {
4879
4869
  mergeNewRootState(props.data);
4880
4870
  }
4881
4871
  }
4882
- createEffect(on(() => [onUpdateFn_5_props_data()], onUpdateFn_5));
4883
- const onUpdateFn_6_props_locale = createMemo(() => props.locale);
4884
- function onUpdateFn_6() {
4872
+ createEffect(on(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4873
+ const onUpdateFn_5_props_locale = createMemo(() => props.locale);
4874
+ function onUpdateFn_5() {
4885
4875
  if (props.locale) {
4886
4876
  mergeNewRootState({
4887
4877
  locale: props.locale
4888
4878
  });
4889
4879
  }
4890
4880
  }
4891
- createEffect(on(() => [onUpdateFn_6_props_locale()], onUpdateFn_6));
4881
+ createEffect(on(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4892
4882
  return createComponent(builder_context_default.Provider, {
4893
4883
  get value() {
4894
4884
  return props.builderContextSignal;
@@ -4904,9 +4894,6 @@ function EnableEditor(props) {
4904
4894
  return `variant-${props.content?.testVariationId || props.content?.id}`;
4905
4895
  }
4906
4896
  }, {}, {
4907
- get key() {
4908
- return forceReRenderCount();
4909
- },
4910
4897
  ref(r$) {
4911
4898
  const _ref$ = elementRef;
4912
4899
  typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;
@@ -3706,7 +3706,8 @@ async function fetchOneEntry(options) {
3706
3706
  }
3707
3707
  var _fetchContent = async (options) => {
3708
3708
  const url = generateContentUrl(options);
3709
- const res = await fetch2(url.href);
3709
+ const _fetch = options.fetch ?? fetch2;
3710
+ const res = await _fetch(url.href, options.fetchOptions);
3710
3711
  const content = await res.json();
3711
3712
  return content;
3712
3713
  };
@@ -4014,7 +4015,7 @@ function isFromTrustedHost(trustedHosts, e) {
4014
4015
  }
4015
4016
 
4016
4017
  // src/constants/sdk-version.ts
4017
- var SDK_VERSION = "1.0.13";
4018
+ var SDK_VERSION = "1.0.15";
4018
4019
 
4019
4020
  // src/functions/register.ts
4020
4021
  var registry = {};
@@ -4212,10 +4213,6 @@ var subscribeToEditor = (model, callback, options) => {
4212
4213
 
4213
4214
  // src/components/content/components/enable-editor.tsx
4214
4215
  function EnableEditor(props) {
4215
- const [forceReRenderCount, setForceReRenderCount] = createSignal12(0);
4216
- const [firstRender, setFirstRender] = createSignal12(true);
4217
- const [lastUpdated, setLastUpdated] = createSignal12(0);
4218
- const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal12(false);
4219
4216
  const [ContentWrapper, setContentWrapper] = createSignal12(
4220
4217
  props.contentWrapper || "div"
4221
4218
  );
@@ -4270,7 +4267,6 @@ function EnableEditor(props) {
4270
4267
  breakpoints
4271
4268
  }
4272
4269
  });
4273
- setForceReRenderCount(forceReRenderCount() + 1);
4274
4270
  }
4275
4271
  },
4276
4272
  animation: (animation) => {
@@ -4278,7 +4274,6 @@ function EnableEditor(props) {
4278
4274
  },
4279
4275
  contentUpdate: (newContent) => {
4280
4276
  mergeNewContent(newContent);
4281
- setForceReRenderCount(forceReRenderCount() + 1);
4282
4277
  }
4283
4278
  }
4284
4279
  })(event);
@@ -4376,7 +4371,6 @@ function EnableEditor(props) {
4376
4371
  onMount3(() => {
4377
4372
  if (isBrowser()) {
4378
4373
  if (isEditing()) {
4379
- setForceReRenderCount(forceReRenderCount() + 1);
4380
4374
  window.addEventListener("message", processMessage);
4381
4375
  registerInsertMenu();
4382
4376
  setupBrowserForEditing({
@@ -4452,68 +4446,59 @@ function EnableEditor(props) {
4452
4446
  }
4453
4447
  }
4454
4448
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4455
- const onUpdateFn_1_shouldSendResetCookie__ = createMemo12(
4456
- () => shouldSendResetCookie()
4457
- );
4449
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4458
4450
  function onUpdateFn_1() {
4459
- }
4460
- createEffect2(
4461
- on2(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1)
4462
- );
4463
- const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4464
- function onUpdateFn_2() {
4465
4451
  evaluateJsCode();
4466
4452
  }
4467
4453
  createEffect2(
4468
4454
  on2(
4469
- () => [onUpdateFn_2_props_builderContextSignal_content__data__jsCode()],
4470
- onUpdateFn_2
4455
+ () => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
4456
+ onUpdateFn_1
4471
4457
  )
4472
4458
  );
4473
- const onUpdateFn_3_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4474
- function onUpdateFn_3() {
4459
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4460
+ function onUpdateFn_2() {
4475
4461
  runHttpRequests();
4476
4462
  }
4477
4463
  createEffect2(
4478
4464
  on2(
4479
4465
  () => [
4480
- onUpdateFn_3_props_builderContextSignal_content__data__httpRequests()
4466
+ onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
4481
4467
  ],
4482
- onUpdateFn_3
4468
+ onUpdateFn_2
4483
4469
  )
4484
4470
  );
4485
- const onUpdateFn_4_props_builderContextSignal_rootState = createMemo12(
4471
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
4486
4472
  () => props.builderContextSignal.rootState
4487
4473
  );
4488
- function onUpdateFn_4() {
4474
+ function onUpdateFn_3() {
4489
4475
  emitStateUpdate();
4490
4476
  }
4491
4477
  createEffect2(
4492
4478
  on2(
4493
- () => [onUpdateFn_4_props_builderContextSignal_rootState()],
4494
- onUpdateFn_4
4479
+ () => [onUpdateFn_3_props_builderContextSignal_rootState()],
4480
+ onUpdateFn_3
4495
4481
  )
4496
4482
  );
4497
- const onUpdateFn_5_props_data = createMemo12(() => props.data);
4498
- function onUpdateFn_5() {
4483
+ const onUpdateFn_4_props_data = createMemo12(() => props.data);
4484
+ function onUpdateFn_4() {
4499
4485
  if (props.data) {
4500
4486
  mergeNewRootState(props.data);
4501
4487
  }
4502
4488
  }
4503
- createEffect2(on2(() => [onUpdateFn_5_props_data()], onUpdateFn_5));
4504
- const onUpdateFn_6_props_locale = createMemo12(() => props.locale);
4505
- function onUpdateFn_6() {
4489
+ createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4490
+ const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
4491
+ function onUpdateFn_5() {
4506
4492
  if (props.locale) {
4507
4493
  mergeNewRootState({
4508
4494
  locale: props.locale
4509
4495
  });
4510
4496
  }
4511
4497
  }
4512
- createEffect2(on2(() => [onUpdateFn_6_props_locale()], onUpdateFn_6));
4498
+ createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4513
4499
  return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
4514
4500
  class={`variant-${props.content?.testVariationId || props.content?.id}`}
4515
4501
  {...{}}
4516
- key={forceReRenderCount()}
4517
4502
  ref={elementRef}
4518
4503
  onClick={(event) => onClick(event)}
4519
4504
  builder-content-id={props.builderContextSignal.content?.id}
package/lib/edge/dev.js CHANGED
@@ -7288,7 +7288,8 @@ async function fetchOneEntry(options) {
7288
7288
  }
7289
7289
  var _fetchContent = async (options) => {
7290
7290
  const url = generateContentUrl(options);
7291
- const res = await fetch2(url.href);
7291
+ const _fetch = options.fetch ?? fetch2;
7292
+ const res = await _fetch(url.href, options.fetchOptions);
7292
7293
  const content = await res.json();
7293
7294
  return content;
7294
7295
  };
@@ -7599,7 +7600,7 @@ function isFromTrustedHost(trustedHosts, e) {
7599
7600
  }
7600
7601
 
7601
7602
  // src/constants/sdk-version.ts
7602
- var SDK_VERSION = "1.0.13";
7603
+ var SDK_VERSION = "1.0.15";
7603
7604
 
7604
7605
  // src/functions/register.ts
7605
7606
  var registry = {};
@@ -7798,10 +7799,6 @@ var subscribeToEditor = (model, callback, options) => {
7798
7799
 
7799
7800
  // src/components/content/components/enable-editor.tsx
7800
7801
  function EnableEditor(props) {
7801
- const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
7802
- createSignal(true);
7803
- createSignal(0);
7804
- const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
7805
7802
  const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
7806
7803
  const [httpReqsData, setHttpReqsData] = createSignal({});
7807
7804
  const [clicked, setClicked] = createSignal(false);
@@ -7857,7 +7854,6 @@ function EnableEditor(props) {
7857
7854
  breakpoints
7858
7855
  }
7859
7856
  });
7860
- setForceReRenderCount(forceReRenderCount() + 1);
7861
7857
  }
7862
7858
  },
7863
7859
  animation: (animation) => {
@@ -7865,7 +7861,6 @@ function EnableEditor(props) {
7865
7861
  },
7866
7862
  contentUpdate: (newContent) => {
7867
7863
  mergeNewContent(newContent);
7868
- setForceReRenderCount(forceReRenderCount() + 1);
7869
7864
  }
7870
7865
  }
7871
7866
  })(event);
@@ -7957,7 +7952,6 @@ function EnableEditor(props) {
7957
7952
  onMount(() => {
7958
7953
  if (isBrowser()) {
7959
7954
  if (isEditing()) {
7960
- setForceReRenderCount(forceReRenderCount() + 1);
7961
7955
  window.addEventListener("message", processMessage);
7962
7956
  registerInsertMenu();
7963
7957
  setupBrowserForEditing({
@@ -8024,41 +8018,37 @@ function EnableEditor(props) {
8024
8018
  }
8025
8019
  }
8026
8020
  createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
8027
- const onUpdateFn_1_shouldSendResetCookie__ = createMemo(() => shouldSendResetCookie());
8021
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
8028
8022
  function onUpdateFn_1() {
8029
- }
8030
- createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
8031
- const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
8032
- function onUpdateFn_2() {
8033
8023
  evaluateJsCode();
8034
8024
  }
8035
- createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__jsCode()], onUpdateFn_2));
8036
- const onUpdateFn_3_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
8037
- function onUpdateFn_3() {
8025
+ createEffect(on(() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()], onUpdateFn_1));
8026
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
8027
+ function onUpdateFn_2() {
8038
8028
  runHttpRequests();
8039
8029
  }
8040
- createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_3));
8041
- const onUpdateFn_4_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
8042
- function onUpdateFn_4() {
8030
+ createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_2));
8031
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
8032
+ function onUpdateFn_3() {
8043
8033
  emitStateUpdate();
8044
8034
  }
8045
- createEffect(on(() => [onUpdateFn_4_props_builderContextSignal_rootState()], onUpdateFn_4));
8046
- const onUpdateFn_5_props_data = createMemo(() => props.data);
8047
- function onUpdateFn_5() {
8035
+ createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_rootState()], onUpdateFn_3));
8036
+ const onUpdateFn_4_props_data = createMemo(() => props.data);
8037
+ function onUpdateFn_4() {
8048
8038
  if (props.data) {
8049
8039
  mergeNewRootState(props.data);
8050
8040
  }
8051
8041
  }
8052
- createEffect(on(() => [onUpdateFn_5_props_data()], onUpdateFn_5));
8053
- const onUpdateFn_6_props_locale = createMemo(() => props.locale);
8054
- function onUpdateFn_6() {
8042
+ createEffect(on(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
8043
+ const onUpdateFn_5_props_locale = createMemo(() => props.locale);
8044
+ function onUpdateFn_5() {
8055
8045
  if (props.locale) {
8056
8046
  mergeNewRootState({
8057
8047
  locale: props.locale
8058
8048
  });
8059
8049
  }
8060
8050
  }
8061
- createEffect(on(() => [onUpdateFn_6_props_locale()], onUpdateFn_6));
8051
+ createEffect(on(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
8062
8052
  return createComponent(builder_context_default.Provider, {
8063
8053
  get value() {
8064
8054
  return props.builderContextSignal;
@@ -8074,9 +8064,6 @@ function EnableEditor(props) {
8074
8064
  return `variant-${props.content?.testVariationId || props.content?.id}`;
8075
8065
  }
8076
8066
  }, {}, {
8077
- get key() {
8078
- return forceReRenderCount();
8079
- },
8080
8067
  ref(r$) {
8081
8068
  const _ref$ = elementRef;
8082
8069
  typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;