@builder.io/sdk-solid 4.0.10 → 4.1.1

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.
@@ -5098,8 +5098,18 @@ var componentInfo19 = {
5098
5098
  noWrap: true,
5099
5099
  static: true
5100
5100
  };
5101
- var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
5101
+ var _tmpl$20 = /* @__PURE__ */ template(`<img loading=lazy>`);
5102
5102
  function ImgComponent(props) {
5103
+ const srcSetToUse = createMemo(() => {
5104
+ const url = props.imgSrc || props.image;
5105
+ if (!url || typeof url !== "string") {
5106
+ return void 0;
5107
+ }
5108
+ if (!url.match(/builder\.io/)) {
5109
+ return void 0;
5110
+ }
5111
+ return getSrcSet(url);
5112
+ });
5103
5113
  return (() => {
5104
5114
  const _el$ = _tmpl$20();
5105
5115
  spread(_el$, mergeProps({
@@ -5117,6 +5127,9 @@ function ImgComponent(props) {
5117
5127
  },
5118
5128
  get src() {
5119
5129
  return props.imgSrc || props.image;
5130
+ },
5131
+ get srcSet() {
5132
+ return srcSetToUse();
5120
5133
  }
5121
5134
  }, {}, () => props.attributes), false, false);
5122
5135
  return _el$;
@@ -5488,7 +5501,7 @@ function getPreviewContent(_searchParams) {
5488
5501
  }
5489
5502
 
5490
5503
  // src/constants/sdk-version.ts
5491
- var SDK_VERSION = "4.0.10";
5504
+ var SDK_VERSION = "4.1.1";
5492
5505
 
5493
5506
  // src/helpers/sdk-headers.ts
5494
5507
  var getSdkHeaders = () => ({
@@ -1982,10 +1982,10 @@ function SectionComponent(props) {
1982
1982
  var section_default = SectionComponent;
1983
1983
 
1984
1984
  // src/blocks/symbol/symbol.tsx
1985
- import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
1985
+ import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
1986
1986
 
1987
1987
  // src/components/content-variants/content-variants.tsx
1988
- import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
1988
+ import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
1989
1989
 
1990
1990
  // src/blocks/personalization-container/helpers/inlined-fns.ts
1991
1991
  function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
@@ -2408,7 +2408,7 @@ var getDefaultCanTrack = (canTrack) => {
2408
2408
  };
2409
2409
 
2410
2410
  // src/components/content/content.tsx
2411
- import { Show as Show15, createSignal as createSignal18 } from "solid-js";
2411
+ import { Show as Show15, createSignal as createSignal19 } from "solid-js";
2412
2412
 
2413
2413
  // src/blocks/accordion/component-info.ts
2414
2414
  var defaultTitle = {
@@ -4604,8 +4604,20 @@ var componentInfo19 = {
4604
4604
  };
4605
4605
 
4606
4606
  // src/blocks/img/img.tsx
4607
+ import { createMemo as createMemo15 } from "solid-js";
4607
4608
  function ImgComponent(props) {
4609
+ const srcSetToUse = createMemo15(() => {
4610
+ const url = props.imgSrc || props.image;
4611
+ if (!url || typeof url !== "string") {
4612
+ return void 0;
4613
+ }
4614
+ if (!url.match(/builder\.io/)) {
4615
+ return void 0;
4616
+ }
4617
+ return getSrcSet(url);
4618
+ });
4608
4619
  return <><img
4620
+ loading="lazy"
4609
4621
  style={{
4610
4622
  "object-fit": props.backgroundSize || "cover",
4611
4623
  "object-position": props.backgroundPosition || "center"
@@ -4613,6 +4625,7 @@ function ImgComponent(props) {
4613
4625
  key={isEditing() && props.imgSrc || "default-key"}
4614
4626
  alt={props.altText}
4615
4627
  src={props.imgSrc || props.image}
4628
+ srcSet={srcSetToUse()}
4616
4629
  {...{}}
4617
4630
  {...props.attributes}
4618
4631
  /></>;
@@ -4707,10 +4720,10 @@ var componentInfo20 = {
4707
4720
  };
4708
4721
 
4709
4722
  // src/blocks/video/video.tsx
4710
- import { Show as Show13, onMount as onMount7, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
4723
+ import { Show as Show13, onMount as onMount7, createSignal as createSignal16, createMemo as createMemo16 } from "solid-js";
4711
4724
  function Video(props) {
4712
- const [lazyVideoObserver, setLazyVideoObserver] = createSignal15(void 0);
4713
- const videoProps = createMemo15(() => {
4725
+ const [lazyVideoObserver, setLazyVideoObserver] = createSignal16(void 0);
4726
+ const videoProps = createMemo16(() => {
4714
4727
  return {
4715
4728
  ...props.autoPlay === true ? {
4716
4729
  autoPlay: true
@@ -4729,7 +4742,7 @@ function Video(props) {
4729
4742
  } : {}
4730
4743
  };
4731
4744
  });
4732
- const spreadProps = createMemo15(() => {
4745
+ const spreadProps = createMemo16(() => {
4733
4746
  return {
4734
4747
  ...videoProps()
4735
4748
  };
@@ -4969,8 +4982,8 @@ import {
4969
4982
  onMount as onMount8,
4970
4983
  on as on8,
4971
4984
  createEffect as createEffect8,
4972
- createMemo as createMemo16,
4973
- createSignal as createSignal16
4985
+ createMemo as createMemo17,
4986
+ createSignal as createSignal17
4974
4987
  } from "solid-js";
4975
4988
  import { Dynamic as Dynamic5 } from "solid-js/web";
4976
4989
 
@@ -4980,7 +4993,7 @@ function getPreviewContent(_searchParams) {
4980
4993
  }
4981
4994
 
4982
4995
  // src/constants/sdk-version.ts
4983
- var SDK_VERSION = "4.0.10";
4996
+ var SDK_VERSION = "4.1.1";
4984
4997
 
4985
4998
  // src/helpers/sdk-headers.ts
4986
4999
  var getSdkHeaders = () => ({
@@ -5841,13 +5854,13 @@ var getWrapperClassName = (variationId) => {
5841
5854
 
5842
5855
  // src/components/content/components/enable-editor.tsx
5843
5856
  function EnableEditor(props) {
5844
- const [hasExecuted, setHasExecuted] = createSignal16(false);
5845
- const [ContentWrapper, setContentWrapper] = createSignal16(
5857
+ const [hasExecuted, setHasExecuted] = createSignal17(false);
5858
+ const [ContentWrapper, setContentWrapper] = createSignal17(
5846
5859
  props.contentWrapper || "div"
5847
5860
  );
5848
- const [httpReqsData, setHttpReqsData] = createSignal16({});
5849
- const [httpReqsPending, setHttpReqsPending] = createSignal16({});
5850
- const [clicked, setClicked] = createSignal16(false);
5861
+ const [httpReqsData, setHttpReqsData] = createSignal17({});
5862
+ const [httpReqsPending, setHttpReqsPending] = createSignal17({});
5863
+ const [clicked, setClicked] = createSignal17(false);
5851
5864
  function mergeNewRootState(newData) {
5852
5865
  const combinedState = {
5853
5866
  ...props.builderContextSignal.rootState,
@@ -5881,7 +5894,7 @@ function EnableEditor(props) {
5881
5894
  content: newContentValue
5882
5895
  }));
5883
5896
  }
5884
- const showContentProps = createMemo16(() => {
5897
+ const showContentProps = createMemo17(() => {
5885
5898
  return props.showContent ? {} : {
5886
5899
  hidden: true,
5887
5900
  "aria-hidden": true
@@ -6066,14 +6079,14 @@ function EnableEditor(props) {
6066
6079
  }
6067
6080
  }
6068
6081
  });
6069
- const onUpdateFn_0_props_content = createMemo16(() => props.content);
6082
+ const onUpdateFn_0_props_content = createMemo17(() => props.content);
6070
6083
  function onUpdateFn_0() {
6071
6084
  if (props.content) {
6072
6085
  mergeNewContent(props.content);
6073
6086
  }
6074
6087
  }
6075
6088
  createEffect8(on8(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
6076
- const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
6089
+ const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
6077
6090
  () => props.builderContextSignal.rootState
6078
6091
  );
6079
6092
  function onUpdateFn_1() {
@@ -6085,14 +6098,14 @@ function EnableEditor(props) {
6085
6098
  onUpdateFn_1
6086
6099
  )
6087
6100
  );
6088
- const onUpdateFn_2_props_data = createMemo16(() => props.data);
6101
+ const onUpdateFn_2_props_data = createMemo17(() => props.data);
6089
6102
  function onUpdateFn_2() {
6090
6103
  if (props.data) {
6091
6104
  mergeNewRootState(props.data);
6092
6105
  }
6093
6106
  }
6094
6107
  createEffect8(on8(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
6095
- const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
6108
+ const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
6096
6109
  function onUpdateFn_3() {
6097
6110
  if (props.locale) {
6098
6111
  mergeNewRootState({
@@ -6124,9 +6137,9 @@ function EnableEditor(props) {
6124
6137
  var Enable_editor_default = EnableEditor;
6125
6138
 
6126
6139
  // src/components/content/components/styles.tsx
6127
- import { createSignal as createSignal17 } from "solid-js";
6140
+ import { createSignal as createSignal18 } from "solid-js";
6128
6141
  function ContentStyles(props) {
6129
- const [injectedStyles, setInjectedStyles] = createSignal17(
6142
+ const [injectedStyles, setInjectedStyles] = createSignal18(
6130
6143
  `
6131
6144
  ${getCss({
6132
6145
  cssCode: props.cssCode,
@@ -6184,7 +6197,7 @@ var getContentInitialValue = ({
6184
6197
 
6185
6198
  // src/components/content/content.tsx
6186
6199
  function ContentComponent(props) {
6187
- const [scriptStr, setScriptStr] = createSignal18(
6200
+ const [scriptStr, setScriptStr] = createSignal19(
6188
6201
  getUpdateVariantVisibilityScript({
6189
6202
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
6190
6203
  variationId: props.content?.testVariationId,
@@ -6192,7 +6205,7 @@ function ContentComponent(props) {
6192
6205
  contentId: props.content?.id
6193
6206
  })
6194
6207
  );
6195
- const [registeredComponents, setRegisteredComponents] = createSignal18(
6208
+ const [registeredComponents, setRegisteredComponents] = createSignal19(
6196
6209
  [
6197
6210
  ...getDefaultRegisteredComponents(),
6198
6211
  ...props.customComponents || []
@@ -6207,7 +6220,7 @@ function ContentComponent(props) {
6207
6220
  {}
6208
6221
  )
6209
6222
  );
6210
- const [builderContextSignal, setBuilderContextSignal] = createSignal18({
6223
+ const [builderContextSignal, setBuilderContextSignal] = createSignal19({
6211
6224
  content: getContentInitialValue({
6212
6225
  content: props.content,
6213
6226
  data: props.data
@@ -6315,13 +6328,13 @@ var Content_default = ContentComponent;
6315
6328
 
6316
6329
  // src/components/content-variants/content-variants.tsx
6317
6330
  function ContentVariants(props) {
6318
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
6331
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal20(
6319
6332
  checkShouldRenderVariants2({
6320
6333
  canTrack: getDefaultCanTrack(props.canTrack),
6321
6334
  content: props.content
6322
6335
  })
6323
6336
  );
6324
- const updateCookieAndStylesScriptStr = createMemo19(() => {
6337
+ const updateCookieAndStylesScriptStr = createMemo20(() => {
6325
6338
  return getUpdateCookieAndStylesScript(
6326
6339
  getVariants(props.content).map((value) => ({
6327
6340
  id: value.testVariationId,
@@ -6330,10 +6343,10 @@ function ContentVariants(props) {
6330
6343
  props.content?.id || ""
6331
6344
  );
6332
6345
  });
6333
- const hideVariantsStyleString = createMemo19(() => {
6346
+ const hideVariantsStyleString = createMemo20(() => {
6334
6347
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
6335
6348
  });
6336
- const defaultContent = createMemo19(() => {
6349
+ const defaultContent = createMemo20(() => {
6337
6350
  return shouldRenderVariants() ? {
6338
6351
  ...props.content,
6339
6352
  testVariationId: props.content?.id
@@ -6452,15 +6465,15 @@ var fetchSymbolContent = async ({
6452
6465
 
6453
6466
  // src/blocks/symbol/symbol.tsx
6454
6467
  function Symbol(props) {
6455
- const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
6456
- const [symbolEntry, setSymbolEntry] = createSignal20(props.symbol?.entry);
6457
- const blocksWrapper = createMemo20(() => {
6468
+ const [contentToUse, setContentToUse] = createSignal21(props.symbol?.content);
6469
+ const [symbolEntry, setSymbolEntry] = createSignal21(props.symbol?.entry);
6470
+ const blocksWrapper = createMemo21(() => {
6458
6471
  return "div";
6459
6472
  });
6460
- const contentWrapper = createMemo20(() => {
6473
+ const contentWrapper = createMemo21(() => {
6461
6474
  return "div";
6462
6475
  });
6463
- const className = createMemo20(() => {
6476
+ const className = createMemo21(() => {
6464
6477
  return [
6465
6478
  ...[props.attributes[getClassPropName()]],
6466
6479
  "builder-symbol",
@@ -6483,7 +6496,7 @@ function Symbol(props) {
6483
6496
  }
6484
6497
  onMount10(() => {
6485
6498
  });
6486
- const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
6499
+ const onUpdateFn_0_props_symbol = createMemo21(() => props.symbol);
6487
6500
  function onUpdateFn_0() {
6488
6501
  setContent();
6489
6502
  }
@@ -5086,8 +5086,18 @@ var componentInfo19 = {
5086
5086
  noWrap: true,
5087
5087
  static: true
5088
5088
  };
5089
- var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
5089
+ var _tmpl$20 = /* @__PURE__ */ template(`<img loading=lazy>`);
5090
5090
  function ImgComponent(props) {
5091
+ const srcSetToUse = createMemo(() => {
5092
+ const url = props.imgSrc || props.image;
5093
+ if (!url || typeof url !== "string") {
5094
+ return void 0;
5095
+ }
5096
+ if (!url.match(/builder\.io/)) {
5097
+ return void 0;
5098
+ }
5099
+ return getSrcSet(url);
5100
+ });
5091
5101
  return (() => {
5092
5102
  const _el$ = _tmpl$20();
5093
5103
  spread(_el$, mergeProps({
@@ -5105,6 +5115,9 @@ function ImgComponent(props) {
5105
5115
  },
5106
5116
  get src() {
5107
5117
  return props.imgSrc || props.image;
5118
+ },
5119
+ get srcSet() {
5120
+ return srcSetToUse();
5108
5121
  }
5109
5122
  }, {}, () => props.attributes), false, false);
5110
5123
  return _el$;
@@ -5475,7 +5488,7 @@ function getPreviewContent(_searchParams) {
5475
5488
  }
5476
5489
 
5477
5490
  // src/constants/sdk-version.ts
5478
- var SDK_VERSION = "4.0.10";
5491
+ var SDK_VERSION = "4.1.1";
5479
5492
 
5480
5493
  // src/helpers/sdk-headers.ts
5481
5494
  var getSdkHeaders = () => ({
@@ -1974,10 +1974,10 @@ function SectionComponent(props) {
1974
1974
  var section_default = SectionComponent;
1975
1975
 
1976
1976
  // src/blocks/symbol/symbol.tsx
1977
- import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
1977
+ import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
1978
1978
 
1979
1979
  // src/components/content-variants/content-variants.tsx
1980
- import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
1980
+ import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
1981
1981
 
1982
1982
  // src/blocks/personalization-container/helpers/inlined-fns.ts
1983
1983
  function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
@@ -2400,7 +2400,7 @@ var getDefaultCanTrack = (canTrack) => {
2400
2400
  };
2401
2401
 
2402
2402
  // src/components/content/content.tsx
2403
- import { Show as Show15, createSignal as createSignal18 } from "solid-js";
2403
+ import { Show as Show15, createSignal as createSignal19 } from "solid-js";
2404
2404
 
2405
2405
  // src/blocks/accordion/component-info.ts
2406
2406
  var defaultTitle = {
@@ -4594,8 +4594,20 @@ var componentInfo19 = {
4594
4594
  };
4595
4595
 
4596
4596
  // src/blocks/img/img.tsx
4597
+ import { createMemo as createMemo15 } from "solid-js";
4597
4598
  function ImgComponent(props) {
4599
+ const srcSetToUse = createMemo15(() => {
4600
+ const url = props.imgSrc || props.image;
4601
+ if (!url || typeof url !== "string") {
4602
+ return void 0;
4603
+ }
4604
+ if (!url.match(/builder\.io/)) {
4605
+ return void 0;
4606
+ }
4607
+ return getSrcSet(url);
4608
+ });
4598
4609
  return <><img
4610
+ loading="lazy"
4599
4611
  style={{
4600
4612
  "object-fit": props.backgroundSize || "cover",
4601
4613
  "object-position": props.backgroundPosition || "center"
@@ -4603,6 +4615,7 @@ function ImgComponent(props) {
4603
4615
  key={isEditing() && props.imgSrc || "default-key"}
4604
4616
  alt={props.altText}
4605
4617
  src={props.imgSrc || props.image}
4618
+ srcSet={srcSetToUse()}
4606
4619
  {...{}}
4607
4620
  {...props.attributes}
4608
4621
  /></>;
@@ -4697,10 +4710,10 @@ var componentInfo20 = {
4697
4710
  };
4698
4711
 
4699
4712
  // src/blocks/video/video.tsx
4700
- import { Show as Show13, onMount as onMount7, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
4713
+ import { Show as Show13, onMount as onMount7, createSignal as createSignal16, createMemo as createMemo16 } from "solid-js";
4701
4714
  function Video(props) {
4702
- const [lazyVideoObserver, setLazyVideoObserver] = createSignal15(void 0);
4703
- const videoProps = createMemo15(() => {
4715
+ const [lazyVideoObserver, setLazyVideoObserver] = createSignal16(void 0);
4716
+ const videoProps = createMemo16(() => {
4704
4717
  return {
4705
4718
  ...props.autoPlay === true ? {
4706
4719
  autoPlay: true
@@ -4719,7 +4732,7 @@ function Video(props) {
4719
4732
  } : {}
4720
4733
  };
4721
4734
  });
4722
- const spreadProps = createMemo15(() => {
4735
+ const spreadProps = createMemo16(() => {
4723
4736
  return {
4724
4737
  ...videoProps()
4725
4738
  };
@@ -4958,8 +4971,8 @@ import {
4958
4971
  onMount as onMount8,
4959
4972
  on as on8,
4960
4973
  createEffect as createEffect8,
4961
- createMemo as createMemo16,
4962
- createSignal as createSignal16
4974
+ createMemo as createMemo17,
4975
+ createSignal as createSignal17
4963
4976
  } from "solid-js";
4964
4977
  import { Dynamic as Dynamic5 } from "solid-js/web";
4965
4978
 
@@ -4969,7 +4982,7 @@ function getPreviewContent(_searchParams) {
4969
4982
  }
4970
4983
 
4971
4984
  // src/constants/sdk-version.ts
4972
- var SDK_VERSION = "4.0.10";
4985
+ var SDK_VERSION = "4.1.1";
4973
4986
 
4974
4987
  // src/helpers/sdk-headers.ts
4975
4988
  var getSdkHeaders = () => ({
@@ -5824,13 +5837,13 @@ var getWrapperClassName = (variationId) => {
5824
5837
 
5825
5838
  // src/components/content/components/enable-editor.tsx
5826
5839
  function EnableEditor(props) {
5827
- const [hasExecuted, setHasExecuted] = createSignal16(false);
5828
- const [ContentWrapper, setContentWrapper] = createSignal16(
5840
+ const [hasExecuted, setHasExecuted] = createSignal17(false);
5841
+ const [ContentWrapper, setContentWrapper] = createSignal17(
5829
5842
  props.contentWrapper || "div"
5830
5843
  );
5831
- const [httpReqsData, setHttpReqsData] = createSignal16({});
5832
- const [httpReqsPending, setHttpReqsPending] = createSignal16({});
5833
- const [clicked, setClicked] = createSignal16(false);
5844
+ const [httpReqsData, setHttpReqsData] = createSignal17({});
5845
+ const [httpReqsPending, setHttpReqsPending] = createSignal17({});
5846
+ const [clicked, setClicked] = createSignal17(false);
5834
5847
  function mergeNewRootState(newData) {
5835
5848
  const combinedState = {
5836
5849
  ...props.builderContextSignal.rootState,
@@ -5864,7 +5877,7 @@ function EnableEditor(props) {
5864
5877
  content: newContentValue
5865
5878
  }));
5866
5879
  }
5867
- const showContentProps = createMemo16(() => {
5880
+ const showContentProps = createMemo17(() => {
5868
5881
  return props.showContent ? {} : {
5869
5882
  hidden: true,
5870
5883
  "aria-hidden": true
@@ -6048,14 +6061,14 @@ function EnableEditor(props) {
6048
6061
  }
6049
6062
  }
6050
6063
  });
6051
- const onUpdateFn_0_props_content = createMemo16(() => props.content);
6064
+ const onUpdateFn_0_props_content = createMemo17(() => props.content);
6052
6065
  function onUpdateFn_0() {
6053
6066
  if (props.content) {
6054
6067
  mergeNewContent(props.content);
6055
6068
  }
6056
6069
  }
6057
6070
  createEffect8(on8(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
6058
- const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
6071
+ const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
6059
6072
  () => props.builderContextSignal.rootState
6060
6073
  );
6061
6074
  function onUpdateFn_1() {
@@ -6067,14 +6080,14 @@ function EnableEditor(props) {
6067
6080
  onUpdateFn_1
6068
6081
  )
6069
6082
  );
6070
- const onUpdateFn_2_props_data = createMemo16(() => props.data);
6083
+ const onUpdateFn_2_props_data = createMemo17(() => props.data);
6071
6084
  function onUpdateFn_2() {
6072
6085
  if (props.data) {
6073
6086
  mergeNewRootState(props.data);
6074
6087
  }
6075
6088
  }
6076
6089
  createEffect8(on8(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
6077
- const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
6090
+ const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
6078
6091
  function onUpdateFn_3() {
6079
6092
  if (props.locale) {
6080
6093
  mergeNewRootState({
@@ -6106,9 +6119,9 @@ function EnableEditor(props) {
6106
6119
  var Enable_editor_default = EnableEditor;
6107
6120
 
6108
6121
  // src/components/content/components/styles.tsx
6109
- import { createSignal as createSignal17 } from "solid-js";
6122
+ import { createSignal as createSignal18 } from "solid-js";
6110
6123
  function ContentStyles(props) {
6111
- const [injectedStyles, setInjectedStyles] = createSignal17(
6124
+ const [injectedStyles, setInjectedStyles] = createSignal18(
6112
6125
  `
6113
6126
  ${getCss({
6114
6127
  cssCode: props.cssCode,
@@ -6166,7 +6179,7 @@ var getContentInitialValue = ({
6166
6179
 
6167
6180
  // src/components/content/content.tsx
6168
6181
  function ContentComponent(props) {
6169
- const [scriptStr, setScriptStr] = createSignal18(
6182
+ const [scriptStr, setScriptStr] = createSignal19(
6170
6183
  getUpdateVariantVisibilityScript({
6171
6184
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
6172
6185
  variationId: props.content?.testVariationId,
@@ -6174,7 +6187,7 @@ function ContentComponent(props) {
6174
6187
  contentId: props.content?.id
6175
6188
  })
6176
6189
  );
6177
- const [registeredComponents, setRegisteredComponents] = createSignal18(
6190
+ const [registeredComponents, setRegisteredComponents] = createSignal19(
6178
6191
  [
6179
6192
  ...getDefaultRegisteredComponents(),
6180
6193
  ...props.customComponents || []
@@ -6189,7 +6202,7 @@ function ContentComponent(props) {
6189
6202
  {}
6190
6203
  )
6191
6204
  );
6192
- const [builderContextSignal, setBuilderContextSignal] = createSignal18({
6205
+ const [builderContextSignal, setBuilderContextSignal] = createSignal19({
6193
6206
  content: getContentInitialValue({
6194
6207
  content: props.content,
6195
6208
  data: props.data
@@ -6297,13 +6310,13 @@ var Content_default = ContentComponent;
6297
6310
 
6298
6311
  // src/components/content-variants/content-variants.tsx
6299
6312
  function ContentVariants(props) {
6300
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
6313
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal20(
6301
6314
  checkShouldRenderVariants2({
6302
6315
  canTrack: getDefaultCanTrack(props.canTrack),
6303
6316
  content: props.content
6304
6317
  })
6305
6318
  );
6306
- const updateCookieAndStylesScriptStr = createMemo19(() => {
6319
+ const updateCookieAndStylesScriptStr = createMemo20(() => {
6307
6320
  return getUpdateCookieAndStylesScript(
6308
6321
  getVariants(props.content).map((value) => ({
6309
6322
  id: value.testVariationId,
@@ -6312,10 +6325,10 @@ function ContentVariants(props) {
6312
6325
  props.content?.id || ""
6313
6326
  );
6314
6327
  });
6315
- const hideVariantsStyleString = createMemo19(() => {
6328
+ const hideVariantsStyleString = createMemo20(() => {
6316
6329
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
6317
6330
  });
6318
- const defaultContent = createMemo19(() => {
6331
+ const defaultContent = createMemo20(() => {
6319
6332
  return shouldRenderVariants() ? {
6320
6333
  ...props.content,
6321
6334
  testVariationId: props.content?.id
@@ -6434,15 +6447,15 @@ var fetchSymbolContent = async ({
6434
6447
 
6435
6448
  // src/blocks/symbol/symbol.tsx
6436
6449
  function Symbol(props) {
6437
- const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
6438
- const [symbolEntry, setSymbolEntry] = createSignal20(props.symbol?.entry);
6439
- const blocksWrapper = createMemo20(() => {
6450
+ const [contentToUse, setContentToUse] = createSignal21(props.symbol?.content);
6451
+ const [symbolEntry, setSymbolEntry] = createSignal21(props.symbol?.entry);
6452
+ const blocksWrapper = createMemo21(() => {
6440
6453
  return "div";
6441
6454
  });
6442
- const contentWrapper = createMemo20(() => {
6455
+ const contentWrapper = createMemo21(() => {
6443
6456
  return "div";
6444
6457
  });
6445
- const className = createMemo20(() => {
6458
+ const className = createMemo21(() => {
6446
6459
  return [
6447
6460
  ...[props.attributes[getClassPropName()]],
6448
6461
  "builder-symbol",
@@ -6465,7 +6478,7 @@ function Symbol(props) {
6465
6478
  }
6466
6479
  onMount10(() => {
6467
6480
  });
6468
- const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
6481
+ const onUpdateFn_0_props_symbol = createMemo21(() => props.symbol);
6469
6482
  function onUpdateFn_0() {
6470
6483
  setContent();
6471
6484
  }
package/lib/edge/dev.js CHANGED
@@ -8279,8 +8279,18 @@ var componentInfo19 = {
8279
8279
  noWrap: true,
8280
8280
  static: true
8281
8281
  };
8282
- var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
8282
+ var _tmpl$20 = /* @__PURE__ */ template(`<img loading=lazy>`);
8283
8283
  function ImgComponent(props) {
8284
+ const srcSetToUse = createMemo(() => {
8285
+ const url = props.imgSrc || props.image;
8286
+ if (!url || typeof url !== "string") {
8287
+ return void 0;
8288
+ }
8289
+ if (!url.match(/builder\.io/)) {
8290
+ return void 0;
8291
+ }
8292
+ return getSrcSet(url);
8293
+ });
8284
8294
  return (() => {
8285
8295
  const _el$ = _tmpl$20();
8286
8296
  spread(_el$, mergeProps({
@@ -8298,6 +8308,9 @@ function ImgComponent(props) {
8298
8308
  },
8299
8309
  get src() {
8300
8310
  return props.imgSrc || props.image;
8311
+ },
8312
+ get srcSet() {
8313
+ return srcSetToUse();
8301
8314
  }
8302
8315
  }, {}, () => props.attributes), false, false);
8303
8316
  return _el$;
@@ -8669,7 +8682,7 @@ function getPreviewContent(_searchParams) {
8669
8682
  }
8670
8683
 
8671
8684
  // src/constants/sdk-version.ts
8672
- var SDK_VERSION = "4.0.10";
8685
+ var SDK_VERSION = "4.1.1";
8673
8686
 
8674
8687
  // src/helpers/sdk-headers.ts
8675
8688
  var getSdkHeaders = () => ({