@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/lib/node/index.js CHANGED
@@ -4247,7 +4247,8 @@ async function fetchOneEntry(options) {
4247
4247
  }
4248
4248
  var _fetchContent = async (options) => {
4249
4249
  const url = generateContentUrl(options);
4250
- const res = await fetch2(url.href);
4250
+ const _fetch = options.fetch ?? fetch2;
4251
+ const res = await _fetch(url.href, options.fetchOptions);
4251
4252
  const content = await res.json();
4252
4253
  return content;
4253
4254
  };
@@ -4555,7 +4556,7 @@ function isFromTrustedHost(trustedHosts, e) {
4555
4556
  }
4556
4557
 
4557
4558
  // src/constants/sdk-version.ts
4558
- var SDK_VERSION = "1.0.13";
4559
+ var SDK_VERSION = "1.0.15";
4559
4560
 
4560
4561
  // src/functions/register.ts
4561
4562
  var registry = {};
@@ -4753,10 +4754,6 @@ var subscribeToEditor = (model, callback, options) => {
4753
4754
 
4754
4755
  // src/components/content/components/enable-editor.tsx
4755
4756
  function EnableEditor(props) {
4756
- const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
4757
- createSignal(true);
4758
- createSignal(0);
4759
- const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
4760
4757
  const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
4761
4758
  const [httpReqsData, setHttpReqsData] = createSignal({});
4762
4759
  const [clicked, setClicked] = createSignal(false);
@@ -4812,7 +4809,6 @@ function EnableEditor(props) {
4812
4809
  breakpoints
4813
4810
  }
4814
4811
  });
4815
- setForceReRenderCount(forceReRenderCount() + 1);
4816
4812
  }
4817
4813
  },
4818
4814
  animation: (animation) => {
@@ -4820,7 +4816,6 @@ function EnableEditor(props) {
4820
4816
  },
4821
4817
  contentUpdate: (newContent) => {
4822
4818
  mergeNewContent(newContent);
4823
- setForceReRenderCount(forceReRenderCount() + 1);
4824
4819
  }
4825
4820
  }
4826
4821
  })(event);
@@ -4911,7 +4906,6 @@ function EnableEditor(props) {
4911
4906
  onMount(() => {
4912
4907
  if (isBrowser()) {
4913
4908
  if (isEditing()) {
4914
- setForceReRenderCount(forceReRenderCount() + 1);
4915
4909
  window.addEventListener("message", processMessage);
4916
4910
  registerInsertMenu();
4917
4911
  setupBrowserForEditing({
@@ -4978,41 +4972,37 @@ function EnableEditor(props) {
4978
4972
  }
4979
4973
  }
4980
4974
  createEffect(on(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4981
- const onUpdateFn_1_shouldSendResetCookie__ = createMemo(() => shouldSendResetCookie());
4975
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
4982
4976
  function onUpdateFn_1() {
4983
- }
4984
- createEffect(on(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1));
4985
- const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo(() => props.builderContextSignal.content?.data?.jsCode);
4986
- function onUpdateFn_2() {
4987
4977
  evaluateJsCode();
4988
4978
  }
4989
- createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__jsCode()], onUpdateFn_2));
4990
- const onUpdateFn_3_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
4991
- function onUpdateFn_3() {
4979
+ createEffect(on(() => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()], onUpdateFn_1));
4980
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo(() => props.builderContextSignal.content?.data?.httpRequests);
4981
+ function onUpdateFn_2() {
4992
4982
  runHttpRequests();
4993
4983
  }
4994
- createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_3));
4995
- const onUpdateFn_4_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
4996
- function onUpdateFn_4() {
4984
+ createEffect(on(() => [onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()], onUpdateFn_2));
4985
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo(() => props.builderContextSignal.rootState);
4986
+ function onUpdateFn_3() {
4997
4987
  emitStateUpdate();
4998
4988
  }
4999
- createEffect(on(() => [onUpdateFn_4_props_builderContextSignal_rootState()], onUpdateFn_4));
5000
- const onUpdateFn_5_props_data = createMemo(() => props.data);
5001
- function onUpdateFn_5() {
4989
+ createEffect(on(() => [onUpdateFn_3_props_builderContextSignal_rootState()], onUpdateFn_3));
4990
+ const onUpdateFn_4_props_data = createMemo(() => props.data);
4991
+ function onUpdateFn_4() {
5002
4992
  if (props.data) {
5003
4993
  mergeNewRootState(props.data);
5004
4994
  }
5005
4995
  }
5006
- createEffect(on(() => [onUpdateFn_5_props_data()], onUpdateFn_5));
5007
- const onUpdateFn_6_props_locale = createMemo(() => props.locale);
5008
- function onUpdateFn_6() {
4996
+ createEffect(on(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4997
+ const onUpdateFn_5_props_locale = createMemo(() => props.locale);
4998
+ function onUpdateFn_5() {
5009
4999
  if (props.locale) {
5010
5000
  mergeNewRootState({
5011
5001
  locale: props.locale
5012
5002
  });
5013
5003
  }
5014
5004
  }
5015
- createEffect(on(() => [onUpdateFn_6_props_locale()], onUpdateFn_6));
5005
+ createEffect(on(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
5016
5006
  return createComponent(builder_context_default.Provider, {
5017
5007
  get value() {
5018
5008
  return props.builderContextSignal;
@@ -5028,9 +5018,6 @@ function EnableEditor(props) {
5028
5018
  return `variant-${props.content?.testVariationId || props.content?.id}`;
5029
5019
  }
5030
5020
  }, {}, {
5031
- get key() {
5032
- return forceReRenderCount();
5033
- },
5034
5021
  ref(r$) {
5035
5022
  const _ref$ = elementRef;
5036
5023
  typeof _ref$ === "function" ? _ref$(r$) : elementRef = r$;
@@ -3832,7 +3832,8 @@ async function fetchOneEntry(options) {
3832
3832
  }
3833
3833
  var _fetchContent = async (options) => {
3834
3834
  const url = generateContentUrl(options);
3835
- const res = await fetch2(url.href);
3835
+ const _fetch = options.fetch ?? fetch2;
3836
+ const res = await _fetch(url.href, options.fetchOptions);
3836
3837
  const content = await res.json();
3837
3838
  return content;
3838
3839
  };
@@ -4140,7 +4141,7 @@ function isFromTrustedHost(trustedHosts, e) {
4140
4141
  }
4141
4142
 
4142
4143
  // src/constants/sdk-version.ts
4143
- var SDK_VERSION = "1.0.13";
4144
+ var SDK_VERSION = "1.0.15";
4144
4145
 
4145
4146
  // src/functions/register.ts
4146
4147
  var registry = {};
@@ -4338,10 +4339,6 @@ var subscribeToEditor = (model, callback, options) => {
4338
4339
 
4339
4340
  // src/components/content/components/enable-editor.tsx
4340
4341
  function EnableEditor(props) {
4341
- const [forceReRenderCount, setForceReRenderCount] = createSignal12(0);
4342
- const [firstRender, setFirstRender] = createSignal12(true);
4343
- const [lastUpdated, setLastUpdated] = createSignal12(0);
4344
- const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal12(false);
4345
4342
  const [ContentWrapper, setContentWrapper] = createSignal12(
4346
4343
  props.contentWrapper || "div"
4347
4344
  );
@@ -4396,7 +4393,6 @@ function EnableEditor(props) {
4396
4393
  breakpoints
4397
4394
  }
4398
4395
  });
4399
- setForceReRenderCount(forceReRenderCount() + 1);
4400
4396
  }
4401
4397
  },
4402
4398
  animation: (animation) => {
@@ -4404,7 +4400,6 @@ function EnableEditor(props) {
4404
4400
  },
4405
4401
  contentUpdate: (newContent) => {
4406
4402
  mergeNewContent(newContent);
4407
- setForceReRenderCount(forceReRenderCount() + 1);
4408
4403
  }
4409
4404
  }
4410
4405
  })(event);
@@ -4502,7 +4497,6 @@ function EnableEditor(props) {
4502
4497
  onMount3(() => {
4503
4498
  if (isBrowser()) {
4504
4499
  if (isEditing()) {
4505
- setForceReRenderCount(forceReRenderCount() + 1);
4506
4500
  window.addEventListener("message", processMessage);
4507
4501
  registerInsertMenu();
4508
4502
  setupBrowserForEditing({
@@ -4578,68 +4572,59 @@ function EnableEditor(props) {
4578
4572
  }
4579
4573
  }
4580
4574
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4581
- const onUpdateFn_1_shouldSendResetCookie__ = createMemo12(
4582
- () => shouldSendResetCookie()
4583
- );
4575
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4584
4576
  function onUpdateFn_1() {
4585
- }
4586
- createEffect2(
4587
- on2(() => [onUpdateFn_1_shouldSendResetCookie__()], onUpdateFn_1)
4588
- );
4589
- const onUpdateFn_2_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
4590
- function onUpdateFn_2() {
4591
4577
  evaluateJsCode();
4592
4578
  }
4593
4579
  createEffect2(
4594
4580
  on2(
4595
- () => [onUpdateFn_2_props_builderContextSignal_content__data__jsCode()],
4596
- onUpdateFn_2
4581
+ () => [onUpdateFn_1_props_builderContextSignal_content__data__jsCode()],
4582
+ onUpdateFn_1
4597
4583
  )
4598
4584
  );
4599
- const onUpdateFn_3_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4600
- function onUpdateFn_3() {
4585
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
4586
+ function onUpdateFn_2() {
4601
4587
  runHttpRequests();
4602
4588
  }
4603
4589
  createEffect2(
4604
4590
  on2(
4605
4591
  () => [
4606
- onUpdateFn_3_props_builderContextSignal_content__data__httpRequests()
4592
+ onUpdateFn_2_props_builderContextSignal_content__data__httpRequests()
4607
4593
  ],
4608
- onUpdateFn_3
4594
+ onUpdateFn_2
4609
4595
  )
4610
4596
  );
4611
- const onUpdateFn_4_props_builderContextSignal_rootState = createMemo12(
4597
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
4612
4598
  () => props.builderContextSignal.rootState
4613
4599
  );
4614
- function onUpdateFn_4() {
4600
+ function onUpdateFn_3() {
4615
4601
  emitStateUpdate();
4616
4602
  }
4617
4603
  createEffect2(
4618
4604
  on2(
4619
- () => [onUpdateFn_4_props_builderContextSignal_rootState()],
4620
- onUpdateFn_4
4605
+ () => [onUpdateFn_3_props_builderContextSignal_rootState()],
4606
+ onUpdateFn_3
4621
4607
  )
4622
4608
  );
4623
- const onUpdateFn_5_props_data = createMemo12(() => props.data);
4624
- function onUpdateFn_5() {
4609
+ const onUpdateFn_4_props_data = createMemo12(() => props.data);
4610
+ function onUpdateFn_4() {
4625
4611
  if (props.data) {
4626
4612
  mergeNewRootState(props.data);
4627
4613
  }
4628
4614
  }
4629
- createEffect2(on2(() => [onUpdateFn_5_props_data()], onUpdateFn_5));
4630
- const onUpdateFn_6_props_locale = createMemo12(() => props.locale);
4631
- function onUpdateFn_6() {
4615
+ createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4616
+ const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
4617
+ function onUpdateFn_5() {
4632
4618
  if (props.locale) {
4633
4619
  mergeNewRootState({
4634
4620
  locale: props.locale
4635
4621
  });
4636
4622
  }
4637
4623
  }
4638
- createEffect2(on2(() => [onUpdateFn_6_props_locale()], onUpdateFn_6));
4624
+ createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4639
4625
  return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
4640
4626
  class={`variant-${props.content?.testVariationId || props.content?.id}`}
4641
4627
  {...{}}
4642
- key={forceReRenderCount()}
4643
4628
  ref={elementRef}
4644
4629
  onClick={(event) => onClick(event)}
4645
4630
  builder-content-id={props.builderContextSignal.content?.id}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-solid",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",