@builder.io/sdk-qwik 0.14.7 → 0.14.9

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.
@@ -1802,7 +1802,7 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1802
1802
  children: [
1803
1803
  /* @__PURE__ */ qwik._jsxQ("picture", null, null, [
1804
1804
  webpSrcSet.value ? /* @__PURE__ */ qwik._jsxQ("source", null, {
1805
- srcSet: qwik._fnSignal((p0) => p0.value, [
1805
+ srcset: qwik._fnSignal((p0) => p0.value, [
1806
1806
  webpSrcSet
1807
1807
  ], "p0.value"),
1808
1808
  type: "image/webp"
@@ -1824,7 +1824,7 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1824
1824
  src: qwik._fnSignal((p0) => p0.image, [
1825
1825
  props
1826
1826
  ], "p0.image"),
1827
- srcSet: qwik._fnSignal((p0) => p0.value, [
1827
+ srcset: qwik._fnSignal((p0) => p0.value, [
1828
1828
  srcSetToUse
1829
1829
  ], "p0.value"),
1830
1830
  style: qwik._fnSignal((p0, p1) => ({
@@ -4394,7 +4394,7 @@ function isFromTrustedHost(trustedHosts, e) {
4394
4394
  const url = new URL(e.origin), hostname = url.hostname;
4395
4395
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4396
4396
  }
4397
- const SDK_VERSION = "0.14.7";
4397
+ const SDK_VERSION = "0.14.9";
4398
4398
  const registry = {};
4399
4399
  function register(type, info) {
4400
4400
  let typeList = registry[type];
@@ -4615,21 +4615,18 @@ const processMessage = function processMessage2(props, state, elementRef, event)
4615
4615
  const { breakpoints, contentId } = messageContent;
4616
4616
  if (!contentId || contentId !== ((_a = props.builderContextSignal.content) == null ? void 0 : _a.id))
4617
4617
  return;
4618
- if (breakpoints) {
4618
+ if (breakpoints)
4619
4619
  mergeNewContent(props, state, elementRef, {
4620
4620
  meta: {
4621
4621
  breakpoints
4622
4622
  }
4623
4623
  });
4624
- state.forceReRenderCount = state.forceReRenderCount + 1;
4625
- }
4626
4624
  },
4627
4625
  animation: (animation) => {
4628
4626
  triggerAnimation(animation);
4629
4627
  },
4630
4628
  contentUpdate: (newContent) => {
4631
4629
  mergeNewContent(props, state, elementRef, newContent);
4632
- state.forceReRenderCount = state.forceReRenderCount + 1;
4633
4630
  }
4634
4631
  }
4635
4632
  })(event);
@@ -4716,23 +4713,17 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
4716
4713
  }));
4717
4714
  };
4718
4715
  const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
4719
- var _a, _b, _c, _d, _e;
4720
4716
  qwik._jsxBranch();
4721
4717
  const elementRef = qwik.useSignal();
4722
4718
  const state = qwik.useStore({
4723
4719
  ContentWrapper: props.contentWrapper || "div",
4724
4720
  clicked: false,
4725
- firstRender: true,
4726
- forceReRenderCount: 0,
4727
- httpReqsData: {},
4728
- lastUpdated: 0,
4729
- shouldSendResetCookie: false
4721
+ httpReqsData: {}
4730
4722
  }, {
4731
4723
  deep: true
4732
4724
  });
4733
4725
  qwik.useOn("initeditingbldr", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
4734
4726
  const [elementRef2, props2, state2] = qwik.useLexicalScope();
4735
- state2.forceReRenderCount = state2.forceReRenderCount + 1;
4736
4727
  window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
4737
4728
  registerInsertMenu();
4738
4729
  setupBrowserForEditing({
@@ -4747,9 +4738,9 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4747
4738
  } : {}
4748
4739
  });
4749
4740
  Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
4750
- var _a2;
4741
+ var _a;
4751
4742
  const message = createRegisterComponentMessage(registeredComponent);
4752
- (_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
4743
+ (_a = window.parent) == null ? void 0 : _a.postMessage(message, "*");
4753
4744
  });
4754
4745
  window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
4755
4746
  }, "EnableEditor_component_useOn_Qs8c0yql2i0", [
@@ -4778,17 +4769,17 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4778
4769
  state
4779
4770
  ]));
4780
4771
  qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
4781
- var _a2, _b2, _c2, _d2;
4772
+ var _a, _b, _c, _d;
4782
4773
  if (isBrowser()) {
4783
4774
  if (isEditing()) {
4784
4775
  if (element)
4785
4776
  element.dispatchEvent(new CustomEvent("initeditingbldr"));
4786
4777
  }
4787
- const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
4778
+ const shouldTrackImpression = ((_a = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a.value) === "true";
4788
4779
  if (shouldTrackImpression) {
4789
- const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
4790
- const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
4791
- const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
4780
+ const variationId = (_b = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b.value;
4781
+ const contentId = (_c = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c.value;
4782
+ const apiKeyProp = (_d = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d.value;
4792
4783
  _track({
4793
4784
  type: "impression",
4794
4785
  canTrack: true,
@@ -4826,20 +4817,14 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4826
4817
  props,
4827
4818
  state
4828
4819
  ]));
4829
- qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
4830
- const [state2] = qwik.useLexicalScope();
4831
- track2(() => state2.shouldSendResetCookie);
4832
- }, "EnableEditor_component_useTask_2_xVyv0tDqZLs", [
4833
- state
4834
- ]));
4835
4820
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
4836
4821
  const [elementRef2, props2, state2] = qwik.useLexicalScope();
4837
4822
  track2(() => {
4838
- var _a2, _b2;
4839
- return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
4823
+ var _a, _b;
4824
+ return (_b = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.jsCode;
4840
4825
  });
4841
4826
  evaluateJsCode(props2);
4842
- }, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
4827
+ }, "EnableEditor_component_useTask_2_xVyv0tDqZLs", [
4843
4828
  elementRef,
4844
4829
  props,
4845
4830
  state
@@ -4847,11 +4832,11 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4847
4832
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
4848
4833
  const [elementRef2, props2, state2] = qwik.useLexicalScope();
4849
4834
  track2(() => {
4850
- var _a2, _b2;
4851
- return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.httpRequests;
4835
+ var _a, _b;
4836
+ return (_b = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests;
4852
4837
  });
4853
4838
  runHttpRequests(props2, state2, elementRef2);
4854
- }, "EnableEditor_component_useTask_4_moHYZG8uNVU", [
4839
+ }, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
4855
4840
  elementRef,
4856
4841
  props,
4857
4842
  state
@@ -4860,7 +4845,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4860
4845
  const [elementRef2, props2, state2] = qwik.useLexicalScope();
4861
4846
  track2(() => props2.builderContextSignal.rootState);
4862
4847
  emitStateUpdate(props2);
4863
- }, "EnableEditor_component_useTask_5_24QxS0r0KF8", [
4848
+ }, "EnableEditor_component_useTask_4_moHYZG8uNVU", [
4864
4849
  elementRef,
4865
4850
  props,
4866
4851
  state
@@ -4870,7 +4855,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4870
4855
  track2(() => props2.data);
4871
4856
  if (props2.data)
4872
4857
  mergeNewRootState(props2, state2, elementRef2, props2.data);
4873
- }, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
4858
+ }, "EnableEditor_component_useTask_5_24QxS0r0KF8", [
4874
4859
  elementRef,
4875
4860
  props,
4876
4861
  state
@@ -4882,37 +4867,86 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4882
4867
  mergeNewRootState(props2, state2, elementRef2, {
4883
4868
  locale: props2.locale
4884
4869
  });
4885
- }, "EnableEditor_component_useTask_7_Zh51H45HHnM", [
4870
+ }, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
4886
4871
  elementRef,
4887
4872
  props,
4888
4873
  state
4889
4874
  ]));
4890
4875
  return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
4891
- children: props.builderContextSignal.content ? /* @__PURE__ */ qwik.createElement(state.ContentWrapper, {
4892
- apiKey: props.apiKey,
4893
- contentId: (_a = props.builderContextSignal.content) == null ? void 0 : _a.id,
4894
- variationId: (_b = props.builderContextSignal.content) == null ? void 0 : _b.testVariationId,
4895
- shouldTrack: String(props.builderContextSignal.content && getDefaultCanTrack(props.canTrack)),
4896
- key: state.forceReRenderCount,
4897
- ref: elementRef,
4876
+ children: props.builderContextSignal.content ? /* @__PURE__ */ qwik._jsxC(state.ContentWrapper, {
4877
+ get apiKey() {
4878
+ return props.apiKey;
4879
+ },
4880
+ get contentId() {
4881
+ var _a;
4882
+ return (_a = props.builderContextSignal.content) == null ? void 0 : _a.id;
4883
+ },
4884
+ get variationId() {
4885
+ var _a;
4886
+ return (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
4887
+ },
4898
4888
  onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
4899
4889
  const [elementRef2, props2, state2] = qwik.useLexicalScope();
4900
4890
  return onClick(props2, state2, elementRef2, event);
4901
- }, "EnableEditor_component__Fragment__createElement_PT7eU9x80Lw", [
4891
+ }, "EnableEditor_component__Fragment_onClick_b4nYT3DrjEk", [
4902
4892
  elementRef,
4903
4893
  props,
4904
4894
  state
4905
4895
  ]),
4906
- "builder-content-id": (_c = props.builderContextSignal.content) == null ? void 0 : _c.id,
4907
- "builder-model": props.model,
4896
+ ref: elementRef,
4897
+ shouldTrack: String(props.builderContextSignal.content && getDefaultCanTrack(props.canTrack)),
4898
+ get "builder-content-id"() {
4899
+ var _a;
4900
+ return (_a = props.builderContextSignal.content) == null ? void 0 : _a.id;
4901
+ },
4902
+ get "builder-model"() {
4903
+ return props.model;
4904
+ },
4908
4905
  ...props.showContent ? {} : {
4909
4906
  hidden: true,
4910
4907
  "aria-hidden": true
4911
4908
  },
4912
4909
  ...props.contentWrapperProps,
4913
- class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
4914
- }, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0")) : null
4915
- }, 1, "06_1");
4910
+ get class() {
4911
+ var _a, _b;
4912
+ return `variant-${((_a = props.content) == null ? void 0 : _a.testVariationId) || ((_b = props.content) == null ? void 0 : _b.id)}`;
4913
+ },
4914
+ children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0"),
4915
+ [qwik._IMMUTABLE]: {
4916
+ apiKey: qwik._fnSignal((p0) => p0.apiKey, [
4917
+ props
4918
+ ], "p0.apiKey"),
4919
+ "builder-content-id": qwik._fnSignal((p0) => {
4920
+ var _a;
4921
+ return (_a = p0.builderContextSignal.content) == null ? void 0 : _a.id;
4922
+ }, [
4923
+ props
4924
+ ], "p0.builderContextSignal.content?.id"),
4925
+ "builder-model": qwik._fnSignal((p0) => p0.model, [
4926
+ props
4927
+ ], "p0.model"),
4928
+ class: qwik._fnSignal((p0) => {
4929
+ var _a, _b;
4930
+ return `variant-${((_a = p0.content) == null ? void 0 : _a.testVariationId) || ((_b = p0.content) == null ? void 0 : _b.id)}`;
4931
+ }, [
4932
+ props
4933
+ ], "`variant-${p0.content?.testVariationId||p0.content?.id}`"),
4934
+ contentId: qwik._fnSignal((p0) => {
4935
+ var _a;
4936
+ return (_a = p0.builderContextSignal.content) == null ? void 0 : _a.id;
4937
+ }, [
4938
+ props
4939
+ ], "p0.builderContextSignal.content?.id"),
4940
+ ref: qwik._IMMUTABLE,
4941
+ variationId: qwik._fnSignal((p0) => {
4942
+ var _a;
4943
+ return (_a = p0.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
4944
+ }, [
4945
+ props
4946
+ ], "p0.builderContextSignal.content?.testVariationId")
4947
+ }
4948
+ }, 0, "06_1") : null
4949
+ }, 1, "06_2");
4916
4950
  }, "EnableEditor_component_ko1mO8oaj8k"));
4917
4951
  const getCssFromFont = (font) => {
4918
4952
  var _a;
@@ -4958,17 +4992,7 @@ const getCss = ({ cssCode, contentId }) => {
4958
4992
  return cssCode;
4959
4993
  return (cssCode == null ? void 0 : cssCode.replace(/&/g, `div[builder-content-id="${contentId}"]`)) || "";
4960
4994
  };
4961
- const ContentStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
4962
- const state = qwik.useStore({
4963
- injectedStyles: `
4964
- ${getCss({
4965
- cssCode: props.cssCode,
4966
- contentId: props.contentId
4967
- })}
4968
- ${getFontCss({
4969
- customFonts: props.customFonts
4970
- })}
4971
-
4995
+ const DEFAULT_STYLES = `
4972
4996
  .builder-button {
4973
4997
  all: unset;
4974
4998
  }
@@ -4985,6 +5009,21 @@ ${getFontCss({
4985
5009
  text-align: inherit;
4986
5010
  font-family: inherit;
4987
5011
  }
5012
+ `;
5013
+ const getDefaultStyles = (isNested) => {
5014
+ return !isNested ? DEFAULT_STYLES : "";
5015
+ };
5016
+ const ContentStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
5017
+ const state = qwik.useStore({
5018
+ injectedStyles: `
5019
+ ${getCss({
5020
+ cssCode: props.cssCode,
5021
+ contentId: props.contentId
5022
+ })}
5023
+ ${getFontCss({
5024
+ customFonts: props.customFonts
5025
+ })}
5026
+ ${getDefaultStyles(props.isNestedRender)}
4988
5027
  `.trim()
4989
5028
  });
4990
5029
  return /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
@@ -5132,6 +5171,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
5132
5171
  }
5133
5172
  }, 3, "LQ_0") : null,
5134
5173
  /* @__PURE__ */ qwik._jsxC(ContentStyles, {
5174
+ get isNestedRender() {
5175
+ return props.isNestedRender;
5176
+ },
5135
5177
  get contentId() {
5136
5178
  var _a2;
5137
5179
  return (_a2 = state.builderContextSignal.content) == null ? void 0 : _a2.id;
@@ -5162,7 +5204,10 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
5162
5204
  return (_b2 = (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.customFonts;
5163
5205
  }, [
5164
5206
  state
5165
- ], "p0.builderContextSignal.content?.data?.customFonts")
5207
+ ], "p0.builderContextSignal.content?.data?.customFonts"),
5208
+ isNestedRender: qwik._fnSignal((p0) => p0.isNestedRender, [
5209
+ props
5210
+ ], "p0.isNestedRender")
5166
5211
  }
5167
5212
  }, 3, "LQ_1"),
5168
5213
  /* @__PURE__ */ qwik._jsxC(Blocks, {
@@ -5284,7 +5329,7 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
5284
5329
  ]));
5285
5330
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
5286
5331
  children: [
5287
- !props.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
5332
+ !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
5288
5333
  get scriptStr() {
5289
5334
  return getScriptString();
5290
5335
  },
@@ -5326,6 +5371,9 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
5326
5371
  }, 3, "XM_2"),
5327
5372
  (getVariants(props.content) || []).map((variant) => {
5328
5373
  return /* @__PURE__ */ qwik._jsxC(ContentComponent, {
5374
+ get isNestedRender() {
5375
+ return props.isNestedRender;
5376
+ },
5329
5377
  content: variant,
5330
5378
  showContent: false,
5331
5379
  get model() {
@@ -5410,6 +5458,9 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
5410
5458
  enrich: qwik._fnSignal((p0) => p0.enrich, [
5411
5459
  props
5412
5460
  ], "p0.enrich"),
5461
+ isNestedRender: qwik._fnSignal((p0) => p0.isNestedRender, [
5462
+ props
5463
+ ], "p0.isNestedRender"),
5413
5464
  isSsrAbTest: qwik._fnSignal((p0) => p0.shouldRenderVariants, [
5414
5465
  state
5415
5466
  ], "p0.shouldRenderVariants"),
@@ -5432,6 +5483,9 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
5432
5483
  ]
5433
5484
  }, 1, "XM_3") : null,
5434
5485
  /* @__PURE__ */ qwik._jsxC(ContentComponent, {
5486
+ get isNestedRender() {
5487
+ return props.isNestedRender;
5488
+ },
5435
5489
  get content() {
5436
5490
  return defaultContent.value;
5437
5491
  },
@@ -5521,6 +5575,9 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
5521
5575
  enrich: qwik._fnSignal((p0) => p0.enrich, [
5522
5576
  props
5523
5577
  ], "p0.enrich"),
5578
+ isNestedRender: qwik._fnSignal((p0) => p0.isNestedRender, [
5579
+ props
5580
+ ], "p0.isNestedRender"),
5524
5581
  isSsrAbTest: qwik._fnSignal((p0) => p0.shouldRenderVariants, [
5525
5582
  state
5526
5583
  ], "p0.shouldRenderVariants"),
@@ -5599,6 +5656,7 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
5599
5656
  return /* @__PURE__ */ qwik._jsxS("div", {
5600
5657
  ...props.attributes,
5601
5658
  children: /* @__PURE__ */ qwik._jsxC(ContentVariants, {
5659
+ isNestedRender: true,
5602
5660
  get apiVersion() {
5603
5661
  return props.builderContext.apiVersion;
5604
5662
  },
@@ -5670,6 +5728,7 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
5670
5728
  props,
5671
5729
  state
5672
5730
  ], "{...p0.symbol?.data,...p0.builderContext.localState,...p1.contentToUse?.data?.state}"),
5731
+ isNestedRender: qwik._IMMUTABLE,
5673
5732
  linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
5674
5733
  props
5675
5734
  ], "p0.builderLinkComponent"),