@builder.io/sdk-qwik 0.14.10 → 0.14.12

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.
@@ -704,7 +704,7 @@ const InlinedStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
704
704
  dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.styles, [
705
705
  props
706
706
  ], "p0.styles"),
707
- id: qwik._fnSignal((p0) => p0.id, [
707
+ "data-id": qwik._fnSignal((p0) => p0.id, [
708
708
  props
709
709
  ], "p0.id")
710
710
  }, null, 3, "NG_0");
@@ -773,10 +773,12 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
773
773
  ]));
774
774
  return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
775
775
  children: css.value && canShowBlock.value ? /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
776
+ id: "builderio-block",
776
777
  get styles() {
777
778
  return css.value;
778
779
  },
779
780
  [qwik._IMMUTABLE]: {
781
+ id: qwik._IMMUTABLE,
780
782
  styles: qwik._fnSignal((p0) => p0.value, [
781
783
  css
782
784
  ], "p0.value")
@@ -1623,10 +1625,12 @@ const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQr
1623
1625
  ], "p0.value")
1624
1626
  }, [
1625
1627
  /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
1628
+ id: "builderio-columns",
1626
1629
  get styles() {
1627
1630
  return columnsStyles.value;
1628
1631
  },
1629
1632
  [qwik._IMMUTABLE]: {
1633
+ id: qwik._IMMUTABLE,
1630
1634
  styles: qwik._fnSignal((p0) => p0.value, [
1631
1635
  columnsStyles
1632
1636
  ], "p0.value")
@@ -3989,7 +3993,7 @@ const checkShouldRenderVariants = ({ canTrack, content }) => {
3989
3993
  };
3990
3994
  const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
3991
3995
  const isHydrationTarget = getIsHydrationTarget(TARGET);
3992
- const getScriptString = () => `
3996
+ const getInitVariantsFnsScriptString = () => `
3993
3997
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
3994
3998
  window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
3995
3999
  `;
@@ -4005,9 +4009,9 @@ const InlinedScript = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
4005
4009
  dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.scriptStr, [
4006
4010
  props
4007
4011
  ], "p0.scriptStr"),
4008
- id: qwik._fnSignal((p0) => p0.id || "", [
4012
+ "data-id": qwik._fnSignal((p0) => p0.id, [
4009
4013
  props
4010
- ], 'p0.id||""')
4014
+ ], "p0.id")
4011
4015
  }, null, 3, "WO_0");
4012
4016
  }, "InlinedScript_component_hwThBdhA8rw"));
4013
4017
  function getGlobalThis() {
@@ -4395,7 +4399,7 @@ function isFromTrustedHost(trustedHosts, e) {
4395
4399
  const url = new URL(e.origin), hostname = url.hostname;
4396
4400
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4397
4401
  }
4398
- const SDK_VERSION = "0.14.10";
4402
+ const SDK_VERSION = "0.14.12";
4399
4403
  const registry = {};
4400
4404
  function register(type, info) {
4401
4405
  let typeList = registry[type];
@@ -4666,40 +4670,35 @@ const onClick = function onClick22(props, state, elementRef, event) {
4666
4670
  if (!state.clicked)
4667
4671
  state.clicked = true;
4668
4672
  };
4669
- const evalExpression = function evalExpression2(props, state, elementRef, expression) {
4670
- return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
4671
- code: group,
4672
- context: props.context || {},
4673
- localState: void 0,
4674
- rootState: props.builderContextSignal.rootState,
4675
- rootSetState: props.builderContextSignal.rootSetState,
4676
- enableCache: true
4677
- })));
4678
- };
4679
- const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
4680
- fetch$1(url).then((response) => response.json()).then((json) => {
4681
- var _a, _b;
4682
- const newState = {
4683
- ...props.builderContextSignal.rootState,
4684
- [key]: json
4685
- };
4686
- (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, newState);
4687
- state.httpReqsData[key] = true;
4688
- }).catch((err) => {
4689
- console.error("error fetching dynamic data", url, err);
4690
- });
4691
- };
4692
4673
  const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
4693
4674
  var _a, _b;
4694
4675
  const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
4695
4676
  Object.entries(requests).forEach(([key, url]) => {
4696
- if (url && (!state.httpReqsData[key] || isEditing())) {
4697
- const evaluatedUrl = evalExpression(props, state, elementRef, url);
4698
- handleRequest(props, state, elementRef, {
4699
- url: evaluatedUrl,
4700
- key
4677
+ if (!url)
4678
+ return;
4679
+ if (state.httpReqsPending[key])
4680
+ return;
4681
+ if (state.httpReqsData[key] && !isEditing())
4682
+ return;
4683
+ state.httpReqsPending[key] = true;
4684
+ const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
4685
+ code: group,
4686
+ context: props.context || {},
4687
+ localState: void 0,
4688
+ rootState: props.builderContextSignal.rootState,
4689
+ rootSetState: props.builderContextSignal.rootSetState,
4690
+ enableCache: true
4691
+ })));
4692
+ fetch$1(evaluatedUrl).then((response) => response.json()).then((json) => {
4693
+ mergeNewRootState(props, state, elementRef, {
4694
+ [key]: json
4701
4695
  });
4702
- }
4696
+ state.httpReqsData[key] = true;
4697
+ }).catch((err) => {
4698
+ console.error("error fetching dynamic data", url, err);
4699
+ }).finally(() => {
4700
+ state.httpReqsPending[key] = false;
4701
+ });
4703
4702
  });
4704
4703
  };
4705
4704
  const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
@@ -4719,7 +4718,8 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4719
4718
  const state = qwik.useStore({
4720
4719
  ContentWrapper: props.contentWrapper || "div",
4721
4720
  clicked: false,
4722
- httpReqsData: {}
4721
+ httpReqsData: {},
4722
+ httpReqsPending: {}
4723
4723
  }, {
4724
4724
  deep: true
4725
4725
  });
@@ -5028,10 +5028,12 @@ ${getDefaultStyles(props.isNestedRender)}
5028
5028
  `.trim()
5029
5029
  });
5030
5030
  return /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
5031
+ id: "builderio-content",
5031
5032
  get styles() {
5032
5033
  return state.injectedStyles;
5033
5034
  },
5034
5035
  [qwik._IMMUTABLE]: {
5036
+ id: qwik._IMMUTABLE,
5035
5037
  styles: qwik._fnSignal((p0) => p0.injectedStyles, [
5036
5038
  state
5037
5039
  ], "p0.injectedStyles")
@@ -5162,10 +5164,12 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
5162
5164
  },
5163
5165
  children: [
5164
5166
  props.isSsrAbTest ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
5167
+ id: "builderio-variant-visibility",
5165
5168
  get scriptStr() {
5166
5169
  return state.scriptStr;
5167
5170
  },
5168
5171
  [qwik._IMMUTABLE]: {
5172
+ id: qwik._IMMUTABLE,
5169
5173
  scriptStr: qwik._fnSignal((p0) => p0.scriptStr, [
5170
5174
  state
5171
5175
  ], "p0.scriptStr")
@@ -5331,40 +5335,36 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
5331
5335
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
5332
5336
  children: [
5333
5337
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
5338
+ id: "builderio-init-variants-fns",
5334
5339
  get scriptStr() {
5335
- return getScriptString();
5340
+ return getInitVariantsFnsScriptString();
5336
5341
  },
5337
5342
  [qwik._IMMUTABLE]: {
5343
+ id: qwik._IMMUTABLE,
5338
5344
  scriptStr: qwik._IMMUTABLE
5339
5345
  }
5340
5346
  }, 3, "XM_0") : null,
5341
5347
  state.shouldRenderVariants ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
5342
5348
  children: [
5343
5349
  /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
5344
- get id() {
5345
- var _a;
5346
- return `variants-styles-${(_a = props.content) == null ? void 0 : _a.id}`;
5347
- },
5350
+ id: "builderio-variants",
5348
5351
  get styles() {
5349
5352
  return hideVariantsStyleString.value;
5350
5353
  },
5351
5354
  [qwik._IMMUTABLE]: {
5352
- id: qwik._fnSignal((p0) => {
5353
- var _a;
5354
- return `variants-styles-${(_a = p0.content) == null ? void 0 : _a.id}`;
5355
- }, [
5356
- props
5357
- ], "`variants-styles-${p0.content?.id}`"),
5355
+ id: qwik._IMMUTABLE,
5358
5356
  styles: qwik._fnSignal((p0) => p0.value, [
5359
5357
  hideVariantsStyleString
5360
5358
  ], "p0.value")
5361
5359
  }
5362
5360
  }, 3, "XM_1"),
5363
5361
  /* @__PURE__ */ qwik._jsxC(InlinedScript, {
5362
+ id: "builderio-variants-visibility",
5364
5363
  get scriptStr() {
5365
5364
  return updateCookieAndStylesScriptStr.value;
5366
5365
  },
5367
5366
  [qwik._IMMUTABLE]: {
5367
+ id: qwik._IMMUTABLE,
5368
5368
  scriptStr: qwik._fnSignal((p0) => p0.value, [
5369
5369
  updateCookieAndStylesScriptStr
5370
5370
  ], "p0.value")
@@ -702,7 +702,7 @@ const InlinedStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
702
702
  dangerouslySetInnerHTML: _fnSignal((p0) => p0.styles, [
703
703
  props
704
704
  ], "p0.styles"),
705
- id: _fnSignal((p0) => p0.id, [
705
+ "data-id": _fnSignal((p0) => p0.id, [
706
706
  props
707
707
  ], "p0.id")
708
708
  }, null, 3, "NG_0");
@@ -771,10 +771,12 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
771
771
  ]));
772
772
  return /* @__PURE__ */ _jsxC(Fragment, {
773
773
  children: css.value && canShowBlock.value ? /* @__PURE__ */ _jsxC(InlinedStyles, {
774
+ id: "builderio-block",
774
775
  get styles() {
775
776
  return css.value;
776
777
  },
777
778
  [_IMMUTABLE]: {
779
+ id: _IMMUTABLE,
778
780
  styles: _fnSignal((p0) => p0.value, [
779
781
  css
780
782
  ], "p0.value")
@@ -1621,10 +1623,12 @@ const Columns = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
1621
1623
  ], "p0.value")
1622
1624
  }, [
1623
1625
  /* @__PURE__ */ _jsxC(InlinedStyles, {
1626
+ id: "builderio-columns",
1624
1627
  get styles() {
1625
1628
  return columnsStyles.value;
1626
1629
  },
1627
1630
  [_IMMUTABLE]: {
1631
+ id: _IMMUTABLE,
1628
1632
  styles: _fnSignal((p0) => p0.value, [
1629
1633
  columnsStyles
1630
1634
  ], "p0.value")
@@ -3987,7 +3991,7 @@ const checkShouldRenderVariants = ({ canTrack, content }) => {
3987
3991
  };
3988
3992
  const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
3989
3993
  const isHydrationTarget = getIsHydrationTarget(TARGET);
3990
- const getScriptString = () => `
3994
+ const getInitVariantsFnsScriptString = () => `
3991
3995
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
3992
3996
  window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
3993
3997
  `;
@@ -4003,9 +4007,9 @@ const InlinedScript = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
4003
4007
  dangerouslySetInnerHTML: _fnSignal((p0) => p0.scriptStr, [
4004
4008
  props
4005
4009
  ], "p0.scriptStr"),
4006
- id: _fnSignal((p0) => p0.id || "", [
4010
+ "data-id": _fnSignal((p0) => p0.id, [
4007
4011
  props
4008
- ], 'p0.id||""')
4012
+ ], "p0.id")
4009
4013
  }, null, 3, "WO_0");
4010
4014
  }, "InlinedScript_component_hwThBdhA8rw"));
4011
4015
  function getGlobalThis() {
@@ -4393,7 +4397,7 @@ function isFromTrustedHost(trustedHosts, e) {
4393
4397
  const url = new URL(e.origin), hostname = url.hostname;
4394
4398
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4395
4399
  }
4396
- const SDK_VERSION = "0.14.10";
4400
+ const SDK_VERSION = "0.14.12";
4397
4401
  const registry = {};
4398
4402
  function register(type, info) {
4399
4403
  let typeList = registry[type];
@@ -4664,40 +4668,35 @@ const onClick = function onClick22(props, state, elementRef, event) {
4664
4668
  if (!state.clicked)
4665
4669
  state.clicked = true;
4666
4670
  };
4667
- const evalExpression = function evalExpression2(props, state, elementRef, expression) {
4668
- return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
4669
- code: group,
4670
- context: props.context || {},
4671
- localState: void 0,
4672
- rootState: props.builderContextSignal.rootState,
4673
- rootSetState: props.builderContextSignal.rootSetState,
4674
- enableCache: true
4675
- })));
4676
- };
4677
- const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
4678
- fetch$1(url).then((response) => response.json()).then((json) => {
4679
- var _a, _b;
4680
- const newState = {
4681
- ...props.builderContextSignal.rootState,
4682
- [key]: json
4683
- };
4684
- (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, newState);
4685
- state.httpReqsData[key] = true;
4686
- }).catch((err) => {
4687
- console.error("error fetching dynamic data", url, err);
4688
- });
4689
- };
4690
4671
  const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
4691
4672
  var _a, _b;
4692
4673
  const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
4693
4674
  Object.entries(requests).forEach(([key, url]) => {
4694
- if (url && (!state.httpReqsData[key] || isEditing())) {
4695
- const evaluatedUrl = evalExpression(props, state, elementRef, url);
4696
- handleRequest(props, state, elementRef, {
4697
- url: evaluatedUrl,
4698
- key
4675
+ if (!url)
4676
+ return;
4677
+ if (state.httpReqsPending[key])
4678
+ return;
4679
+ if (state.httpReqsData[key] && !isEditing())
4680
+ return;
4681
+ state.httpReqsPending[key] = true;
4682
+ const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
4683
+ code: group,
4684
+ context: props.context || {},
4685
+ localState: void 0,
4686
+ rootState: props.builderContextSignal.rootState,
4687
+ rootSetState: props.builderContextSignal.rootSetState,
4688
+ enableCache: true
4689
+ })));
4690
+ fetch$1(evaluatedUrl).then((response) => response.json()).then((json) => {
4691
+ mergeNewRootState(props, state, elementRef, {
4692
+ [key]: json
4699
4693
  });
4700
- }
4694
+ state.httpReqsData[key] = true;
4695
+ }).catch((err) => {
4696
+ console.error("error fetching dynamic data", url, err);
4697
+ }).finally(() => {
4698
+ state.httpReqsPending[key] = false;
4699
+ });
4701
4700
  });
4702
4701
  };
4703
4702
  const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
@@ -4717,7 +4716,8 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
4717
4716
  const state = useStore({
4718
4717
  ContentWrapper: props.contentWrapper || "div",
4719
4718
  clicked: false,
4720
- httpReqsData: {}
4719
+ httpReqsData: {},
4720
+ httpReqsPending: {}
4721
4721
  }, {
4722
4722
  deep: true
4723
4723
  });
@@ -5026,10 +5026,12 @@ ${getDefaultStyles(props.isNestedRender)}
5026
5026
  `.trim()
5027
5027
  });
5028
5028
  return /* @__PURE__ */ _jsxC(InlinedStyles, {
5029
+ id: "builderio-content",
5029
5030
  get styles() {
5030
5031
  return state.injectedStyles;
5031
5032
  },
5032
5033
  [_IMMUTABLE]: {
5034
+ id: _IMMUTABLE,
5033
5035
  styles: _fnSignal((p0) => p0.injectedStyles, [
5034
5036
  state
5035
5037
  ], "p0.injectedStyles")
@@ -5160,10 +5162,12 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
5160
5162
  },
5161
5163
  children: [
5162
5164
  props.isSsrAbTest ? /* @__PURE__ */ _jsxC(InlinedScript, {
5165
+ id: "builderio-variant-visibility",
5163
5166
  get scriptStr() {
5164
5167
  return state.scriptStr;
5165
5168
  },
5166
5169
  [_IMMUTABLE]: {
5170
+ id: _IMMUTABLE,
5167
5171
  scriptStr: _fnSignal((p0) => p0.scriptStr, [
5168
5172
  state
5169
5173
  ], "p0.scriptStr")
@@ -5329,40 +5333,36 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
5329
5333
  return /* @__PURE__ */ _jsxC(Fragment$1, {
5330
5334
  children: [
5331
5335
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
5336
+ id: "builderio-init-variants-fns",
5332
5337
  get scriptStr() {
5333
- return getScriptString();
5338
+ return getInitVariantsFnsScriptString();
5334
5339
  },
5335
5340
  [_IMMUTABLE]: {
5341
+ id: _IMMUTABLE,
5336
5342
  scriptStr: _IMMUTABLE
5337
5343
  }
5338
5344
  }, 3, "XM_0") : null,
5339
5345
  state.shouldRenderVariants ? /* @__PURE__ */ _jsxC(Fragment, {
5340
5346
  children: [
5341
5347
  /* @__PURE__ */ _jsxC(InlinedStyles, {
5342
- get id() {
5343
- var _a;
5344
- return `variants-styles-${(_a = props.content) == null ? void 0 : _a.id}`;
5345
- },
5348
+ id: "builderio-variants",
5346
5349
  get styles() {
5347
5350
  return hideVariantsStyleString.value;
5348
5351
  },
5349
5352
  [_IMMUTABLE]: {
5350
- id: _fnSignal((p0) => {
5351
- var _a;
5352
- return `variants-styles-${(_a = p0.content) == null ? void 0 : _a.id}`;
5353
- }, [
5354
- props
5355
- ], "`variants-styles-${p0.content?.id}`"),
5353
+ id: _IMMUTABLE,
5356
5354
  styles: _fnSignal((p0) => p0.value, [
5357
5355
  hideVariantsStyleString
5358
5356
  ], "p0.value")
5359
5357
  }
5360
5358
  }, 3, "XM_1"),
5361
5359
  /* @__PURE__ */ _jsxC(InlinedScript, {
5360
+ id: "builderio-variants-visibility",
5362
5361
  get scriptStr() {
5363
5362
  return updateCookieAndStylesScriptStr.value;
5364
5363
  },
5365
5364
  [_IMMUTABLE]: {
5365
+ id: _IMMUTABLE,
5366
5366
  scriptStr: _fnSignal((p0) => p0.value, [
5367
5367
  updateCookieAndStylesScriptStr
5368
5368
  ], "p0.value")
@@ -3935,7 +3935,7 @@ const InlinedStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
3935
3935
  dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.styles, [
3936
3936
  props
3937
3937
  ], "p0.styles"),
3938
- id: qwik._fnSignal((p0) => p0.id, [
3938
+ "data-id": qwik._fnSignal((p0) => p0.id, [
3939
3939
  props
3940
3940
  ], "p0.id")
3941
3941
  }, null, 3, "NG_0");
@@ -4004,10 +4004,12 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
4004
4004
  ]));
4005
4005
  return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
4006
4006
  children: css.value && canShowBlock.value ? /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
4007
+ id: "builderio-block",
4007
4008
  get styles() {
4008
4009
  return css.value;
4009
4010
  },
4010
4011
  [qwik._IMMUTABLE]: {
4012
+ id: qwik._IMMUTABLE,
4011
4013
  styles: qwik._fnSignal((p0) => p0.value, [
4012
4014
  css
4013
4015
  ], "p0.value")
@@ -4854,10 +4856,12 @@ const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQr
4854
4856
  ], "p0.value")
4855
4857
  }, [
4856
4858
  /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
4859
+ id: "builderio-columns",
4857
4860
  get styles() {
4858
4861
  return columnsStyles.value;
4859
4862
  },
4860
4863
  [qwik._IMMUTABLE]: {
4864
+ id: qwik._IMMUTABLE,
4861
4865
  styles: qwik._fnSignal((p0) => p0.value, [
4862
4866
  columnsStyles
4863
4867
  ], "p0.value")
@@ -7220,7 +7224,7 @@ const checkShouldRenderVariants = ({ canTrack, content }) => {
7220
7224
  };
7221
7225
  const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
7222
7226
  const isHydrationTarget = getIsHydrationTarget(TARGET);
7223
- const getScriptString = () => `
7227
+ const getInitVariantsFnsScriptString = () => `
7224
7228
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
7225
7229
  window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
7226
7230
  `;
@@ -7236,9 +7240,9 @@ const InlinedScript = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
7236
7240
  dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.scriptStr, [
7237
7241
  props
7238
7242
  ], "p0.scriptStr"),
7239
- id: qwik._fnSignal((p0) => p0.id || "", [
7243
+ "data-id": qwik._fnSignal((p0) => p0.id, [
7240
7244
  props
7241
- ], 'p0.id||""')
7245
+ ], "p0.id")
7242
7246
  }, null, 3, "WO_0");
7243
7247
  }, "InlinedScript_component_hwThBdhA8rw"));
7244
7248
  function getGlobalThis() {
@@ -7626,7 +7630,7 @@ function isFromTrustedHost(trustedHosts, e) {
7626
7630
  const url = new URL(e.origin), hostname = url.hostname;
7627
7631
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
7628
7632
  }
7629
- const SDK_VERSION = "0.14.10";
7633
+ const SDK_VERSION = "0.14.12";
7630
7634
  const registry = {};
7631
7635
  function register(type, info) {
7632
7636
  let typeList = registry[type];
@@ -7897,40 +7901,35 @@ const onClick = function onClick22(props, state, elementRef, event) {
7897
7901
  if (!state.clicked)
7898
7902
  state.clicked = true;
7899
7903
  };
7900
- const evalExpression = function evalExpression2(props, state, elementRef, expression) {
7901
- return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
7902
- code: group,
7903
- context: props.context || {},
7904
- localState: void 0,
7905
- rootState: props.builderContextSignal.rootState,
7906
- rootSetState: props.builderContextSignal.rootSetState,
7907
- enableCache: true
7908
- })));
7909
- };
7910
- const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
7911
- fetch$1(url).then((response) => response.json()).then((json) => {
7912
- var _a, _b;
7913
- const newState = {
7914
- ...props.builderContextSignal.rootState,
7915
- [key]: json
7916
- };
7917
- (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, newState);
7918
- state.httpReqsData[key] = true;
7919
- }).catch((err) => {
7920
- console.error("error fetching dynamic data", url, err);
7921
- });
7922
- };
7923
7904
  const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
7924
7905
  var _a, _b;
7925
7906
  const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
7926
7907
  Object.entries(requests).forEach(([key, url]) => {
7927
- if (url && (!state.httpReqsData[key] || isEditing())) {
7928
- const evaluatedUrl = evalExpression(props, state, elementRef, url);
7929
- handleRequest(props, state, elementRef, {
7930
- url: evaluatedUrl,
7931
- key
7908
+ if (!url)
7909
+ return;
7910
+ if (state.httpReqsPending[key])
7911
+ return;
7912
+ if (state.httpReqsData[key] && !isEditing())
7913
+ return;
7914
+ state.httpReqsPending[key] = true;
7915
+ const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
7916
+ code: group,
7917
+ context: props.context || {},
7918
+ localState: void 0,
7919
+ rootState: props.builderContextSignal.rootState,
7920
+ rootSetState: props.builderContextSignal.rootSetState,
7921
+ enableCache: true
7922
+ })));
7923
+ fetch$1(evaluatedUrl).then((response) => response.json()).then((json) => {
7924
+ mergeNewRootState(props, state, elementRef, {
7925
+ [key]: json
7932
7926
  });
7933
- }
7927
+ state.httpReqsData[key] = true;
7928
+ }).catch((err) => {
7929
+ console.error("error fetching dynamic data", url, err);
7930
+ }).finally(() => {
7931
+ state.httpReqsPending[key] = false;
7932
+ });
7934
7933
  });
7935
7934
  };
7936
7935
  const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
@@ -7950,7 +7949,8 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
7950
7949
  const state = qwik.useStore({
7951
7950
  ContentWrapper: props.contentWrapper || "div",
7952
7951
  clicked: false,
7953
- httpReqsData: {}
7952
+ httpReqsData: {},
7953
+ httpReqsPending: {}
7954
7954
  }, {
7955
7955
  deep: true
7956
7956
  });
@@ -8259,10 +8259,12 @@ ${getDefaultStyles(props.isNestedRender)}
8259
8259
  `.trim()
8260
8260
  });
8261
8261
  return /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
8262
+ id: "builderio-content",
8262
8263
  get styles() {
8263
8264
  return state.injectedStyles;
8264
8265
  },
8265
8266
  [qwik._IMMUTABLE]: {
8267
+ id: qwik._IMMUTABLE,
8266
8268
  styles: qwik._fnSignal((p0) => p0.injectedStyles, [
8267
8269
  state
8268
8270
  ], "p0.injectedStyles")
@@ -8393,10 +8395,12 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
8393
8395
  },
8394
8396
  children: [
8395
8397
  props.isSsrAbTest ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
8398
+ id: "builderio-variant-visibility",
8396
8399
  get scriptStr() {
8397
8400
  return state.scriptStr;
8398
8401
  },
8399
8402
  [qwik._IMMUTABLE]: {
8403
+ id: qwik._IMMUTABLE,
8400
8404
  scriptStr: qwik._fnSignal((p0) => p0.scriptStr, [
8401
8405
  state
8402
8406
  ], "p0.scriptStr")
@@ -8562,40 +8566,36 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
8562
8566
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
8563
8567
  children: [
8564
8568
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
8569
+ id: "builderio-init-variants-fns",
8565
8570
  get scriptStr() {
8566
- return getScriptString();
8571
+ return getInitVariantsFnsScriptString();
8567
8572
  },
8568
8573
  [qwik._IMMUTABLE]: {
8574
+ id: qwik._IMMUTABLE,
8569
8575
  scriptStr: qwik._IMMUTABLE
8570
8576
  }
8571
8577
  }, 3, "XM_0") : null,
8572
8578
  state.shouldRenderVariants ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
8573
8579
  children: [
8574
8580
  /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
8575
- get id() {
8576
- var _a;
8577
- return `variants-styles-${(_a = props.content) == null ? void 0 : _a.id}`;
8578
- },
8581
+ id: "builderio-variants",
8579
8582
  get styles() {
8580
8583
  return hideVariantsStyleString.value;
8581
8584
  },
8582
8585
  [qwik._IMMUTABLE]: {
8583
- id: qwik._fnSignal((p0) => {
8584
- var _a;
8585
- return `variants-styles-${(_a = p0.content) == null ? void 0 : _a.id}`;
8586
- }, [
8587
- props
8588
- ], "`variants-styles-${p0.content?.id}`"),
8586
+ id: qwik._IMMUTABLE,
8589
8587
  styles: qwik._fnSignal((p0) => p0.value, [
8590
8588
  hideVariantsStyleString
8591
8589
  ], "p0.value")
8592
8590
  }
8593
8591
  }, 3, "XM_1"),
8594
8592
  /* @__PURE__ */ qwik._jsxC(InlinedScript, {
8593
+ id: "builderio-variants-visibility",
8595
8594
  get scriptStr() {
8596
8595
  return updateCookieAndStylesScriptStr.value;
8597
8596
  },
8598
8597
  [qwik._IMMUTABLE]: {
8598
+ id: qwik._IMMUTABLE,
8599
8599
  scriptStr: qwik._fnSignal((p0) => p0.value, [
8600
8600
  updateCookieAndStylesScriptStr
8601
8601
  ], "p0.value")
@@ -3933,7 +3933,7 @@ const InlinedStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
3933
3933
  dangerouslySetInnerHTML: _fnSignal((p0) => p0.styles, [
3934
3934
  props
3935
3935
  ], "p0.styles"),
3936
- id: _fnSignal((p0) => p0.id, [
3936
+ "data-id": _fnSignal((p0) => p0.id, [
3937
3937
  props
3938
3938
  ], "p0.id")
3939
3939
  }, null, 3, "NG_0");
@@ -4002,10 +4002,12 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
4002
4002
  ]));
4003
4003
  return /* @__PURE__ */ _jsxC(Fragment, {
4004
4004
  children: css.value && canShowBlock.value ? /* @__PURE__ */ _jsxC(InlinedStyles, {
4005
+ id: "builderio-block",
4005
4006
  get styles() {
4006
4007
  return css.value;
4007
4008
  },
4008
4009
  [_IMMUTABLE]: {
4010
+ id: _IMMUTABLE,
4009
4011
  styles: _fnSignal((p0) => p0.value, [
4010
4012
  css
4011
4013
  ], "p0.value")
@@ -4852,10 +4854,12 @@ const Columns = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
4852
4854
  ], "p0.value")
4853
4855
  }, [
4854
4856
  /* @__PURE__ */ _jsxC(InlinedStyles, {
4857
+ id: "builderio-columns",
4855
4858
  get styles() {
4856
4859
  return columnsStyles.value;
4857
4860
  },
4858
4861
  [_IMMUTABLE]: {
4862
+ id: _IMMUTABLE,
4859
4863
  styles: _fnSignal((p0) => p0.value, [
4860
4864
  columnsStyles
4861
4865
  ], "p0.value")
@@ -7218,7 +7222,7 @@ const checkShouldRenderVariants = ({ canTrack, content }) => {
7218
7222
  };
7219
7223
  const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
7220
7224
  const isHydrationTarget = getIsHydrationTarget(TARGET);
7221
- const getScriptString = () => `
7225
+ const getInitVariantsFnsScriptString = () => `
7222
7226
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
7223
7227
  window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
7224
7228
  `;
@@ -7234,9 +7238,9 @@ const InlinedScript = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
7234
7238
  dangerouslySetInnerHTML: _fnSignal((p0) => p0.scriptStr, [
7235
7239
  props
7236
7240
  ], "p0.scriptStr"),
7237
- id: _fnSignal((p0) => p0.id || "", [
7241
+ "data-id": _fnSignal((p0) => p0.id, [
7238
7242
  props
7239
- ], 'p0.id||""')
7243
+ ], "p0.id")
7240
7244
  }, null, 3, "WO_0");
7241
7245
  }, "InlinedScript_component_hwThBdhA8rw"));
7242
7246
  function getGlobalThis() {
@@ -7624,7 +7628,7 @@ function isFromTrustedHost(trustedHosts, e) {
7624
7628
  const url = new URL(e.origin), hostname = url.hostname;
7625
7629
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
7626
7630
  }
7627
- const SDK_VERSION = "0.14.10";
7631
+ const SDK_VERSION = "0.14.12";
7628
7632
  const registry = {};
7629
7633
  function register(type, info) {
7630
7634
  let typeList = registry[type];
@@ -7895,40 +7899,35 @@ const onClick = function onClick22(props, state, elementRef, event) {
7895
7899
  if (!state.clicked)
7896
7900
  state.clicked = true;
7897
7901
  };
7898
- const evalExpression = function evalExpression2(props, state, elementRef, expression) {
7899
- return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
7900
- code: group,
7901
- context: props.context || {},
7902
- localState: void 0,
7903
- rootState: props.builderContextSignal.rootState,
7904
- rootSetState: props.builderContextSignal.rootSetState,
7905
- enableCache: true
7906
- })));
7907
- };
7908
- const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
7909
- fetch$1(url).then((response) => response.json()).then((json) => {
7910
- var _a, _b;
7911
- const newState = {
7912
- ...props.builderContextSignal.rootState,
7913
- [key]: json
7914
- };
7915
- (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, newState);
7916
- state.httpReqsData[key] = true;
7917
- }).catch((err) => {
7918
- console.error("error fetching dynamic data", url, err);
7919
- });
7920
- };
7921
7902
  const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
7922
7903
  var _a, _b;
7923
7904
  const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
7924
7905
  Object.entries(requests).forEach(([key, url]) => {
7925
- if (url && (!state.httpReqsData[key] || isEditing())) {
7926
- const evaluatedUrl = evalExpression(props, state, elementRef, url);
7927
- handleRequest(props, state, elementRef, {
7928
- url: evaluatedUrl,
7929
- key
7906
+ if (!url)
7907
+ return;
7908
+ if (state.httpReqsPending[key])
7909
+ return;
7910
+ if (state.httpReqsData[key] && !isEditing())
7911
+ return;
7912
+ state.httpReqsPending[key] = true;
7913
+ const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
7914
+ code: group,
7915
+ context: props.context || {},
7916
+ localState: void 0,
7917
+ rootState: props.builderContextSignal.rootState,
7918
+ rootSetState: props.builderContextSignal.rootSetState,
7919
+ enableCache: true
7920
+ })));
7921
+ fetch$1(evaluatedUrl).then((response) => response.json()).then((json) => {
7922
+ mergeNewRootState(props, state, elementRef, {
7923
+ [key]: json
7930
7924
  });
7931
- }
7925
+ state.httpReqsData[key] = true;
7926
+ }).catch((err) => {
7927
+ console.error("error fetching dynamic data", url, err);
7928
+ }).finally(() => {
7929
+ state.httpReqsPending[key] = false;
7930
+ });
7932
7931
  });
7933
7932
  };
7934
7933
  const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
@@ -7948,7 +7947,8 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
7948
7947
  const state = useStore({
7949
7948
  ContentWrapper: props.contentWrapper || "div",
7950
7949
  clicked: false,
7951
- httpReqsData: {}
7950
+ httpReqsData: {},
7951
+ httpReqsPending: {}
7952
7952
  }, {
7953
7953
  deep: true
7954
7954
  });
@@ -8257,10 +8257,12 @@ ${getDefaultStyles(props.isNestedRender)}
8257
8257
  `.trim()
8258
8258
  });
8259
8259
  return /* @__PURE__ */ _jsxC(InlinedStyles, {
8260
+ id: "builderio-content",
8260
8261
  get styles() {
8261
8262
  return state.injectedStyles;
8262
8263
  },
8263
8264
  [_IMMUTABLE]: {
8265
+ id: _IMMUTABLE,
8264
8266
  styles: _fnSignal((p0) => p0.injectedStyles, [
8265
8267
  state
8266
8268
  ], "p0.injectedStyles")
@@ -8391,10 +8393,12 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
8391
8393
  },
8392
8394
  children: [
8393
8395
  props.isSsrAbTest ? /* @__PURE__ */ _jsxC(InlinedScript, {
8396
+ id: "builderio-variant-visibility",
8394
8397
  get scriptStr() {
8395
8398
  return state.scriptStr;
8396
8399
  },
8397
8400
  [_IMMUTABLE]: {
8401
+ id: _IMMUTABLE,
8398
8402
  scriptStr: _fnSignal((p0) => p0.scriptStr, [
8399
8403
  state
8400
8404
  ], "p0.scriptStr")
@@ -8560,40 +8564,36 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
8560
8564
  return /* @__PURE__ */ _jsxC(Fragment$1, {
8561
8565
  children: [
8562
8566
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
8567
+ id: "builderio-init-variants-fns",
8563
8568
  get scriptStr() {
8564
- return getScriptString();
8569
+ return getInitVariantsFnsScriptString();
8565
8570
  },
8566
8571
  [_IMMUTABLE]: {
8572
+ id: _IMMUTABLE,
8567
8573
  scriptStr: _IMMUTABLE
8568
8574
  }
8569
8575
  }, 3, "XM_0") : null,
8570
8576
  state.shouldRenderVariants ? /* @__PURE__ */ _jsxC(Fragment, {
8571
8577
  children: [
8572
8578
  /* @__PURE__ */ _jsxC(InlinedStyles, {
8573
- get id() {
8574
- var _a;
8575
- return `variants-styles-${(_a = props.content) == null ? void 0 : _a.id}`;
8576
- },
8579
+ id: "builderio-variants",
8577
8580
  get styles() {
8578
8581
  return hideVariantsStyleString.value;
8579
8582
  },
8580
8583
  [_IMMUTABLE]: {
8581
- id: _fnSignal((p0) => {
8582
- var _a;
8583
- return `variants-styles-${(_a = p0.content) == null ? void 0 : _a.id}`;
8584
- }, [
8585
- props
8586
- ], "`variants-styles-${p0.content?.id}`"),
8584
+ id: _IMMUTABLE,
8587
8585
  styles: _fnSignal((p0) => p0.value, [
8588
8586
  hideVariantsStyleString
8589
8587
  ], "p0.value")
8590
8588
  }
8591
8589
  }, 3, "XM_1"),
8592
8590
  /* @__PURE__ */ _jsxC(InlinedScript, {
8591
+ id: "builderio-variants-visibility",
8593
8592
  get scriptStr() {
8594
8593
  return updateCookieAndStylesScriptStr.value;
8595
8594
  },
8596
8595
  [_IMMUTABLE]: {
8596
+ id: _IMMUTABLE,
8597
8597
  scriptStr: _fnSignal((p0) => p0.value, [
8598
8598
  updateCookieAndStylesScriptStr
8599
8599
  ], "p0.value")
@@ -806,7 +806,7 @@ const InlinedStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
806
806
  dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.styles, [
807
807
  props
808
808
  ], "p0.styles"),
809
- id: qwik._fnSignal((p0) => p0.id, [
809
+ "data-id": qwik._fnSignal((p0) => p0.id, [
810
810
  props
811
811
  ], "p0.id")
812
812
  }, null, 3, "NG_0");
@@ -875,10 +875,12 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
875
875
  ]));
876
876
  return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
877
877
  children: css.value && canShowBlock.value ? /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
878
+ id: "builderio-block",
878
879
  get styles() {
879
880
  return css.value;
880
881
  },
881
882
  [qwik._IMMUTABLE]: {
883
+ id: qwik._IMMUTABLE,
882
884
  styles: qwik._fnSignal((p0) => p0.value, [
883
885
  css
884
886
  ], "p0.value")
@@ -1725,10 +1727,12 @@ const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQr
1725
1727
  ], "p0.value")
1726
1728
  }, [
1727
1729
  /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
1730
+ id: "builderio-columns",
1728
1731
  get styles() {
1729
1732
  return columnsStyles.value;
1730
1733
  },
1731
1734
  [qwik._IMMUTABLE]: {
1735
+ id: qwik._IMMUTABLE,
1732
1736
  styles: qwik._fnSignal((p0) => p0.value, [
1733
1737
  columnsStyles
1734
1738
  ], "p0.value")
@@ -4091,7 +4095,7 @@ const checkShouldRenderVariants = ({ canTrack, content }) => {
4091
4095
  };
4092
4096
  const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
4093
4097
  const isHydrationTarget = getIsHydrationTarget(TARGET);
4094
- const getScriptString = () => `
4098
+ const getInitVariantsFnsScriptString = () => `
4095
4099
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
4096
4100
  window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
4097
4101
  `;
@@ -4107,9 +4111,9 @@ const InlinedScript = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
4107
4111
  dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.scriptStr, [
4108
4112
  props
4109
4113
  ], "p0.scriptStr"),
4110
- id: qwik._fnSignal((p0) => p0.id || "", [
4114
+ "data-id": qwik._fnSignal((p0) => p0.id, [
4111
4115
  props
4112
- ], 'p0.id||""')
4116
+ ], "p0.id")
4113
4117
  }, null, 3, "WO_0");
4114
4118
  }, "InlinedScript_component_hwThBdhA8rw"));
4115
4119
  function getGlobalThis() {
@@ -4497,7 +4501,7 @@ function isFromTrustedHost(trustedHosts, e) {
4497
4501
  const url = new URL(e.origin), hostname = url.hostname;
4498
4502
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4499
4503
  }
4500
- const SDK_VERSION = "0.14.10";
4504
+ const SDK_VERSION = "0.14.12";
4501
4505
  const registry = {};
4502
4506
  function register(type, info) {
4503
4507
  let typeList = registry[type];
@@ -4768,40 +4772,35 @@ const onClick = function onClick22(props, state, elementRef, event) {
4768
4772
  if (!state.clicked)
4769
4773
  state.clicked = true;
4770
4774
  };
4771
- const evalExpression = function evalExpression2(props, state, elementRef, expression) {
4772
- return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
4773
- code: group,
4774
- context: props.context || {},
4775
- localState: void 0,
4776
- rootState: props.builderContextSignal.rootState,
4777
- rootSetState: props.builderContextSignal.rootSetState,
4778
- enableCache: true
4779
- })));
4780
- };
4781
- const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
4782
- fetch$1(url).then((response) => response.json()).then((json) => {
4783
- var _a, _b;
4784
- const newState = {
4785
- ...props.builderContextSignal.rootState,
4786
- [key]: json
4787
- };
4788
- (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, newState);
4789
- state.httpReqsData[key] = true;
4790
- }).catch((err) => {
4791
- console.error("error fetching dynamic data", url, err);
4792
- });
4793
- };
4794
4775
  const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
4795
4776
  var _a, _b;
4796
4777
  const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
4797
4778
  Object.entries(requests).forEach(([key, url]) => {
4798
- if (url && (!state.httpReqsData[key] || isEditing())) {
4799
- const evaluatedUrl = evalExpression(props, state, elementRef, url);
4800
- handleRequest(props, state, elementRef, {
4801
- url: evaluatedUrl,
4802
- key
4779
+ if (!url)
4780
+ return;
4781
+ if (state.httpReqsPending[key])
4782
+ return;
4783
+ if (state.httpReqsData[key] && !isEditing())
4784
+ return;
4785
+ state.httpReqsPending[key] = true;
4786
+ const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
4787
+ code: group,
4788
+ context: props.context || {},
4789
+ localState: void 0,
4790
+ rootState: props.builderContextSignal.rootState,
4791
+ rootSetState: props.builderContextSignal.rootSetState,
4792
+ enableCache: true
4793
+ })));
4794
+ fetch$1(evaluatedUrl).then((response) => response.json()).then((json) => {
4795
+ mergeNewRootState(props, state, elementRef, {
4796
+ [key]: json
4803
4797
  });
4804
- }
4798
+ state.httpReqsData[key] = true;
4799
+ }).catch((err) => {
4800
+ console.error("error fetching dynamic data", url, err);
4801
+ }).finally(() => {
4802
+ state.httpReqsPending[key] = false;
4803
+ });
4805
4804
  });
4806
4805
  };
4807
4806
  const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
@@ -4821,7 +4820,8 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4821
4820
  const state = qwik.useStore({
4822
4821
  ContentWrapper: props.contentWrapper || "div",
4823
4822
  clicked: false,
4824
- httpReqsData: {}
4823
+ httpReqsData: {},
4824
+ httpReqsPending: {}
4825
4825
  }, {
4826
4826
  deep: true
4827
4827
  });
@@ -5130,10 +5130,12 @@ ${getDefaultStyles(props.isNestedRender)}
5130
5130
  `.trim()
5131
5131
  });
5132
5132
  return /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
5133
+ id: "builderio-content",
5133
5134
  get styles() {
5134
5135
  return state.injectedStyles;
5135
5136
  },
5136
5137
  [qwik._IMMUTABLE]: {
5138
+ id: qwik._IMMUTABLE,
5137
5139
  styles: qwik._fnSignal((p0) => p0.injectedStyles, [
5138
5140
  state
5139
5141
  ], "p0.injectedStyles")
@@ -5264,10 +5266,12 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
5264
5266
  },
5265
5267
  children: [
5266
5268
  props.isSsrAbTest ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
5269
+ id: "builderio-variant-visibility",
5267
5270
  get scriptStr() {
5268
5271
  return state.scriptStr;
5269
5272
  },
5270
5273
  [qwik._IMMUTABLE]: {
5274
+ id: qwik._IMMUTABLE,
5271
5275
  scriptStr: qwik._fnSignal((p0) => p0.scriptStr, [
5272
5276
  state
5273
5277
  ], "p0.scriptStr")
@@ -5433,40 +5437,36 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
5433
5437
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
5434
5438
  children: [
5435
5439
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
5440
+ id: "builderio-init-variants-fns",
5436
5441
  get scriptStr() {
5437
- return getScriptString();
5442
+ return getInitVariantsFnsScriptString();
5438
5443
  },
5439
5444
  [qwik._IMMUTABLE]: {
5445
+ id: qwik._IMMUTABLE,
5440
5446
  scriptStr: qwik._IMMUTABLE
5441
5447
  }
5442
5448
  }, 3, "XM_0") : null,
5443
5449
  state.shouldRenderVariants ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
5444
5450
  children: [
5445
5451
  /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
5446
- get id() {
5447
- var _a;
5448
- return `variants-styles-${(_a = props.content) == null ? void 0 : _a.id}`;
5449
- },
5452
+ id: "builderio-variants",
5450
5453
  get styles() {
5451
5454
  return hideVariantsStyleString.value;
5452
5455
  },
5453
5456
  [qwik._IMMUTABLE]: {
5454
- id: qwik._fnSignal((p0) => {
5455
- var _a;
5456
- return `variants-styles-${(_a = p0.content) == null ? void 0 : _a.id}`;
5457
- }, [
5458
- props
5459
- ], "`variants-styles-${p0.content?.id}`"),
5457
+ id: qwik._IMMUTABLE,
5460
5458
  styles: qwik._fnSignal((p0) => p0.value, [
5461
5459
  hideVariantsStyleString
5462
5460
  ], "p0.value")
5463
5461
  }
5464
5462
  }, 3, "XM_1"),
5465
5463
  /* @__PURE__ */ qwik._jsxC(InlinedScript, {
5464
+ id: "builderio-variants-visibility",
5466
5465
  get scriptStr() {
5467
5466
  return updateCookieAndStylesScriptStr.value;
5468
5467
  },
5469
5468
  [qwik._IMMUTABLE]: {
5469
+ id: qwik._IMMUTABLE,
5470
5470
  scriptStr: qwik._fnSignal((p0) => p0.value, [
5471
5471
  updateCookieAndStylesScriptStr
5472
5472
  ], "p0.value")
@@ -804,7 +804,7 @@ const InlinedStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
804
804
  dangerouslySetInnerHTML: _fnSignal((p0) => p0.styles, [
805
805
  props
806
806
  ], "p0.styles"),
807
- id: _fnSignal((p0) => p0.id, [
807
+ "data-id": _fnSignal((p0) => p0.id, [
808
808
  props
809
809
  ], "p0.id")
810
810
  }, null, 3, "NG_0");
@@ -873,10 +873,12 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
873
873
  ]));
874
874
  return /* @__PURE__ */ _jsxC(Fragment, {
875
875
  children: css.value && canShowBlock.value ? /* @__PURE__ */ _jsxC(InlinedStyles, {
876
+ id: "builderio-block",
876
877
  get styles() {
877
878
  return css.value;
878
879
  },
879
880
  [_IMMUTABLE]: {
881
+ id: _IMMUTABLE,
880
882
  styles: _fnSignal((p0) => p0.value, [
881
883
  css
882
884
  ], "p0.value")
@@ -1723,10 +1725,12 @@ const Columns = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
1723
1725
  ], "p0.value")
1724
1726
  }, [
1725
1727
  /* @__PURE__ */ _jsxC(InlinedStyles, {
1728
+ id: "builderio-columns",
1726
1729
  get styles() {
1727
1730
  return columnsStyles.value;
1728
1731
  },
1729
1732
  [_IMMUTABLE]: {
1733
+ id: _IMMUTABLE,
1730
1734
  styles: _fnSignal((p0) => p0.value, [
1731
1735
  columnsStyles
1732
1736
  ], "p0.value")
@@ -4089,7 +4093,7 @@ const checkShouldRenderVariants = ({ canTrack, content }) => {
4089
4093
  };
4090
4094
  const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
4091
4095
  const isHydrationTarget = getIsHydrationTarget(TARGET);
4092
- const getScriptString = () => `
4096
+ const getInitVariantsFnsScriptString = () => `
4093
4097
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
4094
4098
  window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
4095
4099
  `;
@@ -4105,9 +4109,9 @@ const InlinedScript = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
4105
4109
  dangerouslySetInnerHTML: _fnSignal((p0) => p0.scriptStr, [
4106
4110
  props
4107
4111
  ], "p0.scriptStr"),
4108
- id: _fnSignal((p0) => p0.id || "", [
4112
+ "data-id": _fnSignal((p0) => p0.id, [
4109
4113
  props
4110
- ], 'p0.id||""')
4114
+ ], "p0.id")
4111
4115
  }, null, 3, "WO_0");
4112
4116
  }, "InlinedScript_component_hwThBdhA8rw"));
4113
4117
  function getGlobalThis() {
@@ -4495,7 +4499,7 @@ function isFromTrustedHost(trustedHosts, e) {
4495
4499
  const url = new URL(e.origin), hostname = url.hostname;
4496
4500
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4497
4501
  }
4498
- const SDK_VERSION = "0.14.10";
4502
+ const SDK_VERSION = "0.14.12";
4499
4503
  const registry = {};
4500
4504
  function register(type, info) {
4501
4505
  let typeList = registry[type];
@@ -4766,40 +4770,35 @@ const onClick = function onClick22(props, state, elementRef, event) {
4766
4770
  if (!state.clicked)
4767
4771
  state.clicked = true;
4768
4772
  };
4769
- const evalExpression = function evalExpression2(props, state, elementRef, expression) {
4770
- return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
4771
- code: group,
4772
- context: props.context || {},
4773
- localState: void 0,
4774
- rootState: props.builderContextSignal.rootState,
4775
- rootSetState: props.builderContextSignal.rootSetState,
4776
- enableCache: true
4777
- })));
4778
- };
4779
- const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
4780
- fetch$1(url).then((response) => response.json()).then((json) => {
4781
- var _a, _b;
4782
- const newState = {
4783
- ...props.builderContextSignal.rootState,
4784
- [key]: json
4785
- };
4786
- (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, newState);
4787
- state.httpReqsData[key] = true;
4788
- }).catch((err) => {
4789
- console.error("error fetching dynamic data", url, err);
4790
- });
4791
- };
4792
4773
  const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
4793
4774
  var _a, _b;
4794
4775
  const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
4795
4776
  Object.entries(requests).forEach(([key, url]) => {
4796
- if (url && (!state.httpReqsData[key] || isEditing())) {
4797
- const evaluatedUrl = evalExpression(props, state, elementRef, url);
4798
- handleRequest(props, state, elementRef, {
4799
- url: evaluatedUrl,
4800
- key
4777
+ if (!url)
4778
+ return;
4779
+ if (state.httpReqsPending[key])
4780
+ return;
4781
+ if (state.httpReqsData[key] && !isEditing())
4782
+ return;
4783
+ state.httpReqsPending[key] = true;
4784
+ const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
4785
+ code: group,
4786
+ context: props.context || {},
4787
+ localState: void 0,
4788
+ rootState: props.builderContextSignal.rootState,
4789
+ rootSetState: props.builderContextSignal.rootSetState,
4790
+ enableCache: true
4791
+ })));
4792
+ fetch$1(evaluatedUrl).then((response) => response.json()).then((json) => {
4793
+ mergeNewRootState(props, state, elementRef, {
4794
+ [key]: json
4801
4795
  });
4802
- }
4796
+ state.httpReqsData[key] = true;
4797
+ }).catch((err) => {
4798
+ console.error("error fetching dynamic data", url, err);
4799
+ }).finally(() => {
4800
+ state.httpReqsPending[key] = false;
4801
+ });
4803
4802
  });
4804
4803
  };
4805
4804
  const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
@@ -4819,7 +4818,8 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
4819
4818
  const state = useStore({
4820
4819
  ContentWrapper: props.contentWrapper || "div",
4821
4820
  clicked: false,
4822
- httpReqsData: {}
4821
+ httpReqsData: {},
4822
+ httpReqsPending: {}
4823
4823
  }, {
4824
4824
  deep: true
4825
4825
  });
@@ -5128,10 +5128,12 @@ ${getDefaultStyles(props.isNestedRender)}
5128
5128
  `.trim()
5129
5129
  });
5130
5130
  return /* @__PURE__ */ _jsxC(InlinedStyles, {
5131
+ id: "builderio-content",
5131
5132
  get styles() {
5132
5133
  return state.injectedStyles;
5133
5134
  },
5134
5135
  [_IMMUTABLE]: {
5136
+ id: _IMMUTABLE,
5135
5137
  styles: _fnSignal((p0) => p0.injectedStyles, [
5136
5138
  state
5137
5139
  ], "p0.injectedStyles")
@@ -5262,10 +5264,12 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
5262
5264
  },
5263
5265
  children: [
5264
5266
  props.isSsrAbTest ? /* @__PURE__ */ _jsxC(InlinedScript, {
5267
+ id: "builderio-variant-visibility",
5265
5268
  get scriptStr() {
5266
5269
  return state.scriptStr;
5267
5270
  },
5268
5271
  [_IMMUTABLE]: {
5272
+ id: _IMMUTABLE,
5269
5273
  scriptStr: _fnSignal((p0) => p0.scriptStr, [
5270
5274
  state
5271
5275
  ], "p0.scriptStr")
@@ -5431,40 +5435,36 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
5431
5435
  return /* @__PURE__ */ _jsxC(Fragment$1, {
5432
5436
  children: [
5433
5437
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
5438
+ id: "builderio-init-variants-fns",
5434
5439
  get scriptStr() {
5435
- return getScriptString();
5440
+ return getInitVariantsFnsScriptString();
5436
5441
  },
5437
5442
  [_IMMUTABLE]: {
5443
+ id: _IMMUTABLE,
5438
5444
  scriptStr: _IMMUTABLE
5439
5445
  }
5440
5446
  }, 3, "XM_0") : null,
5441
5447
  state.shouldRenderVariants ? /* @__PURE__ */ _jsxC(Fragment, {
5442
5448
  children: [
5443
5449
  /* @__PURE__ */ _jsxC(InlinedStyles, {
5444
- get id() {
5445
- var _a;
5446
- return `variants-styles-${(_a = props.content) == null ? void 0 : _a.id}`;
5447
- },
5450
+ id: "builderio-variants",
5448
5451
  get styles() {
5449
5452
  return hideVariantsStyleString.value;
5450
5453
  },
5451
5454
  [_IMMUTABLE]: {
5452
- id: _fnSignal((p0) => {
5453
- var _a;
5454
- return `variants-styles-${(_a = p0.content) == null ? void 0 : _a.id}`;
5455
- }, [
5456
- props
5457
- ], "`variants-styles-${p0.content?.id}`"),
5455
+ id: _IMMUTABLE,
5458
5456
  styles: _fnSignal((p0) => p0.value, [
5459
5457
  hideVariantsStyleString
5460
5458
  ], "p0.value")
5461
5459
  }
5462
5460
  }, 3, "XM_1"),
5463
5461
  /* @__PURE__ */ _jsxC(InlinedScript, {
5462
+ id: "builderio-variants-visibility",
5464
5463
  get scriptStr() {
5465
5464
  return updateCookieAndStylesScriptStr.value;
5466
5465
  },
5467
5466
  [_IMMUTABLE]: {
5467
+ id: _IMMUTABLE,
5468
5468
  scriptStr: _fnSignal((p0) => p0.value, [
5469
5469
  updateCookieAndStylesScriptStr
5470
5470
  ], "p0.value")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.14.10",
3
+ "version": "0.14.12",
4
4
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/qwik",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,11 +12,6 @@ export declare const mergeNewContent: (props: any, state: any, elementRef: any,
12
12
  export declare const processMessage: (props: any, state: any, elementRef: any, event: MessageEvent) => void;
13
13
  export declare const evaluateJsCode: (props: any, state: any, elementRef: any) => void;
14
14
  export declare const onClick: (props: any, state: any, elementRef: any, event: any) => void;
15
- export declare const evalExpression: (props: any, state: any, elementRef: any, expression: string) => string;
16
- export declare const handleRequest: (props: any, state: any, elementRef: any, { url, key, }: {
17
- key: string;
18
- url: string;
19
- }) => void;
20
15
  export declare const runHttpRequests: (props: any, state: any, elementRef: any) => void;
21
16
  export declare const emitStateUpdate: (props: any, state: any, elementRef: any) => void;
22
17
  export declare const EnableEditor: import("@builder.io/qwik").Component<BuilderEditorProps>;
@@ -32,7 +32,7 @@ type VariantData = {
32
32
  id: string;
33
33
  testRatio?: number;
34
34
  };
35
- export declare const getScriptString: () => string;
35
+ export declare const getInitVariantsFnsScriptString: () => string;
36
36
  export declare const getUpdateCookieAndStylesScript: (variants: VariantData[], contentId: string) => string;
37
37
  export declare const getUpdateVariantVisibilityScript: ({ contentId, variationId }: {
38
38
  variationId: string;
@@ -1,6 +1,6 @@
1
1
  interface Props {
2
2
  scriptStr: string;
3
- id?: string;
3
+ id: string;
4
4
  }
5
5
  export declare const InlinedScript: import("@builder.io/qwik").Component<Props>;
6
6
  export default InlinedScript;
@@ -1,6 +1,6 @@
1
1
  interface Props {
2
2
  styles: string;
3
- id?: string;
3
+ id: string;
4
4
  }
5
5
  export declare const InlinedStyles: import("@builder.io/qwik").Component<Props>;
6
6
  export default InlinedStyles;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.14.10";
1
+ export declare const SDK_VERSION = "0.14.12";