@builder.io/sdk-qwik 0.24.1 → 0.25.2

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.
Files changed (41) hide show
  1. package/lib/browser/blocks/symbol/symbol.helpers.qwik.cjs +1 -1
  2. package/lib/browser/blocks/symbol/symbol.helpers.qwik.mjs +1 -1
  3. package/lib/browser/blocks/symbol/symbol.qwik.cjs +7 -3
  4. package/lib/browser/blocks/symbol/symbol.qwik.mjs +7 -3
  5. package/lib/browser/components/block/components/component-ref/component-ref.qwik.cjs +8 -2
  6. package/lib/browser/components/block/components/component-ref/component-ref.qwik.mjs +9 -3
  7. package/lib/browser/components/content-variants/content-variants.qwik.cjs +37 -41
  8. package/lib/browser/components/content-variants/content-variants.qwik.mjs +38 -42
  9. package/lib/browser/components/content-variants/helpers.qwik.cjs +32 -0
  10. package/lib/browser/components/content-variants/helpers.qwik.mjs +33 -1
  11. package/lib/browser/constants/sdk-version.qwik.cjs +1 -1
  12. package/lib/browser/constants/sdk-version.qwik.mjs +1 -1
  13. package/lib/edge/blocks/symbol/symbol.helpers.qwik.cjs +1 -1
  14. package/lib/edge/blocks/symbol/symbol.helpers.qwik.mjs +1 -1
  15. package/lib/edge/blocks/symbol/symbol.qwik.cjs +7 -3
  16. package/lib/edge/blocks/symbol/symbol.qwik.mjs +7 -3
  17. package/lib/edge/components/block/components/component-ref/component-ref.qwik.cjs +8 -2
  18. package/lib/edge/components/block/components/component-ref/component-ref.qwik.mjs +9 -3
  19. package/lib/edge/components/content-variants/content-variants.qwik.cjs +37 -41
  20. package/lib/edge/components/content-variants/content-variants.qwik.mjs +38 -42
  21. package/lib/edge/components/content-variants/helpers.qwik.cjs +32 -0
  22. package/lib/edge/components/content-variants/helpers.qwik.mjs +33 -1
  23. package/lib/edge/constants/sdk-version.qwik.cjs +1 -1
  24. package/lib/edge/constants/sdk-version.qwik.mjs +1 -1
  25. package/lib/node/blocks/symbol/symbol.helpers.qwik.cjs +1 -1
  26. package/lib/node/blocks/symbol/symbol.helpers.qwik.mjs +1 -1
  27. package/lib/node/blocks/symbol/symbol.qwik.cjs +7 -3
  28. package/lib/node/blocks/symbol/symbol.qwik.mjs +7 -3
  29. package/lib/node/components/block/components/component-ref/component-ref.qwik.cjs +8 -2
  30. package/lib/node/components/block/components/component-ref/component-ref.qwik.mjs +9 -3
  31. package/lib/node/components/content-variants/content-variants.qwik.cjs +37 -41
  32. package/lib/node/components/content-variants/content-variants.qwik.mjs +38 -42
  33. package/lib/node/components/content-variants/helpers.qwik.cjs +32 -0
  34. package/lib/node/components/content-variants/helpers.qwik.mjs +33 -1
  35. package/lib/node/constants/sdk-version.qwik.cjs +1 -1
  36. package/lib/node/constants/sdk-version.qwik.mjs +1 -1
  37. package/package.json +1 -1
  38. package/types/src/blocks/symbol/symbol.helpers.d.ts +2 -0
  39. package/types/src/blocks/symbol/symbol.types.d.ts +2 -0
  40. package/types/src/components/content-variants/helpers.d.ts +1 -0
  41. package/types/src/constants/sdk-version.d.ts +1 -1
@@ -7,7 +7,7 @@ const fetchSymbolContent = async ({ builderContextValue, symbol }) => {
7
7
  (builderContextValue == null ? void 0 : builderContextValue.apiKey))
8
8
  return index.fetchOneEntry({
9
9
  model: symbol.model,
10
- apiKey: builderContextValue.apiKey,
10
+ apiKey: symbol.global && symbol.ownerId ? symbol.ownerId : builderContextValue.apiKey,
11
11
  apiVersion: builderContextValue.apiVersion,
12
12
  ...(symbol == null ? void 0 : symbol.entry) && {
13
13
  query: {
@@ -5,7 +5,7 @@ const fetchSymbolContent = async ({ builderContextValue, symbol }) => {
5
5
  (builderContextValue == null ? void 0 : builderContextValue.apiKey))
6
6
  return fetchOneEntry({
7
7
  model: symbol.model,
8
- apiKey: builderContextValue.apiKey,
8
+ apiKey: symbol.global && symbol.ownerId ? symbol.ownerId : builderContextValue.apiKey,
9
9
  apiVersion: builderContextValue.apiVersion,
10
10
  ...(symbol == null ? void 0 : symbol.entry) && {
11
11
  query: {
@@ -72,7 +72,8 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
72
72
  return props.builderContext.apiVersion;
73
73
  },
74
74
  get apiKey() {
75
- return props.builderContext.apiKey;
75
+ var _a2, _b2;
76
+ return ((_a2 = props.symbol) == null ? void 0 : _a2.global) && ((_b2 = props.symbol) == null ? void 0 : _b2.ownerId) ? props.symbol.ownerId : props.builderContext.apiKey;
76
77
  },
77
78
  get context() {
78
79
  var _a2;
@@ -112,9 +113,12 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
112
113
  return contentWrapper.value;
113
114
  },
114
115
  [qwik._IMMUTABLE]: {
115
- apiKey: qwik._fnSignal((p0) => p0.builderContext.apiKey, [
116
+ apiKey: qwik._fnSignal((p0) => {
117
+ var _a2, _b2;
118
+ return ((_a2 = p0.symbol) == null ? void 0 : _a2.global) && ((_b2 = p0.symbol) == null ? void 0 : _b2.ownerId) ? p0.symbol.ownerId : p0.builderContext.apiKey;
119
+ }, [
116
120
  props
117
- ], "p0.builderContext.apiKey"),
121
+ ], "p0.symbol?.global&&p0.symbol?.ownerId?p0.symbol.ownerId:p0.builderContext.apiKey"),
118
122
  apiVersion: qwik._fnSignal((p0) => p0.builderContext.apiVersion, [
119
123
  props
120
124
  ], "p0.builderContext.apiVersion"),
@@ -70,7 +70,8 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
70
70
  return props.builderContext.apiVersion;
71
71
  },
72
72
  get apiKey() {
73
- return props.builderContext.apiKey;
73
+ var _a2, _b2;
74
+ return ((_a2 = props.symbol) == null ? void 0 : _a2.global) && ((_b2 = props.symbol) == null ? void 0 : _b2.ownerId) ? props.symbol.ownerId : props.builderContext.apiKey;
74
75
  },
75
76
  get context() {
76
77
  var _a2;
@@ -110,9 +111,12 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
110
111
  return contentWrapper.value;
111
112
  },
112
113
  [_IMMUTABLE]: {
113
- apiKey: _fnSignal((p0) => p0.builderContext.apiKey, [
114
+ apiKey: _fnSignal((p0) => {
115
+ var _a2, _b2;
116
+ return ((_a2 = p0.symbol) == null ? void 0 : _a2.global) && ((_b2 = p0.symbol) == null ? void 0 : _b2.ownerId) ? p0.symbol.ownerId : p0.builderContext.apiKey;
117
+ }, [
114
118
  props
115
- ], "p0.builderContext.apiKey"),
119
+ ], "p0.symbol?.global&&p0.symbol?.ownerId?p0.symbol.ownerId:p0.builderContext.apiKey"),
116
120
  apiVersion: _fnSignal((p0) => p0.builderContext.apiVersion, [
117
121
  props
118
122
  ], "p0.builderContext.apiVersion"),
@@ -6,6 +6,12 @@ const block = require("../../block.qwik.cjs");
6
6
  const interactiveElement = require("../interactive-element.qwik.cjs");
7
7
  const componentRef_helpers = require("./component-ref.helpers.qwik.cjs");
8
8
  const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
9
+ const blockChildrenToRender = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
10
+ const [props2] = qwik.useLexicalScope();
11
+ return props2.componentRef ? props2.blockChildren : [];
12
+ }, "ComponentRef_component_blockChildrenToRender_useComputed_HF18bwDAU0c", [
13
+ props
14
+ ]));
9
15
  const state = qwik.useStore({
10
16
  Wrapper: props.isInteractive ? interactiveElement.InteractiveElement : props.componentRef,
11
17
  shouldUpdate: false
@@ -22,7 +28,7 @@ const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
22
28
  isInteractive: props.isInteractive,
23
29
  contextValue: props.context
24
30
  }),
25
- children: props.componentRef ? (props.blockChildren || []).map((child) => {
31
+ children: (blockChildrenToRender.value || []).map((child) => {
26
32
  return /* @__PURE__ */ qwik._jsxC(block.Block, {
27
33
  block: child,
28
34
  get context() {
@@ -46,7 +52,7 @@ const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
46
52
  ], "p0.registeredComponents")
47
53
  }
48
54
  }, 3, child.id);
49
- }) : null
55
+ })
50
56
  }, 0, "z6_0") : null
51
57
  }, 1, "z6_1");
52
58
  }, "ComponentRef_component_tFQoBV6UFdc"));
@@ -1,9 +1,15 @@
1
- import { componentQrl, inlinedQrl, useStore, _jsxC, _IMMUTABLE, _fnSignal } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, useComputedQrl, useLexicalScope, useStore, _jsxC, _IMMUTABLE, _fnSignal } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  import { Block } from "../../block.qwik.mjs";
4
4
  import { InteractiveElement } from "../interactive-element.qwik.mjs";
5
5
  import { getWrapperProps } from "./component-ref.helpers.qwik.mjs";
6
6
  const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
7
+ const blockChildrenToRender = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
8
+ const [props2] = useLexicalScope();
9
+ return props2.componentRef ? props2.blockChildren : [];
10
+ }, "ComponentRef_component_blockChildrenToRender_useComputed_HF18bwDAU0c", [
11
+ props
12
+ ]));
7
13
  const state = useStore({
8
14
  Wrapper: props.isInteractive ? InteractiveElement : props.componentRef,
9
15
  shouldUpdate: false
@@ -20,7 +26,7 @@ const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
20
26
  isInteractive: props.isInteractive,
21
27
  contextValue: props.context
22
28
  }),
23
- children: props.componentRef ? (props.blockChildren || []).map((child) => {
29
+ children: (blockChildrenToRender.value || []).map((child) => {
24
30
  return /* @__PURE__ */ _jsxC(Block, {
25
31
  block: child,
26
32
  get context() {
@@ -44,7 +50,7 @@ const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
44
50
  ], "p0.registeredComponents")
45
51
  }
46
52
  }, 3, child.id);
47
- }) : null
53
+ })
48
54
  }, 0, "z6_0") : null
49
55
  }, 1, "z6_1");
50
56
  }, "ComponentRef_component_tFQoBV6UFdc"));
@@ -50,42 +50,38 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
50
50
  ]));
51
51
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
52
52
  children: [
53
- !props.isNestedRender && target.TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
54
- children: [
55
- /* @__PURE__ */ qwik._jsxC(inlinedScript.InlinedScript, {
56
- id: "builderio-init-variants-fns",
57
- get scriptStr() {
58
- return helpers.getInitVariantsFnsScriptString();
59
- },
60
- get nonce() {
61
- return props.nonce || "";
62
- },
63
- [qwik._IMMUTABLE]: {
64
- id: qwik._IMMUTABLE,
65
- nonce: qwik._fnSignal((p0) => p0.nonce || "", [
66
- props
67
- ], 'p0.nonce||""'),
68
- scriptStr: qwik._IMMUTABLE
69
- }
70
- }, 3, "XM_0"),
71
- helpers$1.SDKS_SUPPORTING_PERSONALIZATION.includes(target.TARGET) ? /* @__PURE__ */ qwik._jsxC(inlinedScript.InlinedScript, {
72
- id: "builderio-init-personalization-variants-fns",
73
- get nonce() {
74
- return props.nonce || "";
75
- },
76
- get scriptStr() {
77
- return helpers$1.getInitPersonalizationVariantsFnsScriptString();
78
- },
79
- [qwik._IMMUTABLE]: {
80
- id: qwik._IMMUTABLE,
81
- nonce: qwik._fnSignal((p0) => p0.nonce || "", [
82
- props
83
- ], 'p0.nonce||""'),
84
- scriptStr: qwik._IMMUTABLE
85
- }
86
- }, 3, "XM_1") : null
87
- ]
88
- }, 1, "XM_2") : null,
53
+ !props.isNestedRender && target.TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(inlinedScript.InlinedScript, {
54
+ id: "builderio-init-variants-fns",
55
+ get scriptStr() {
56
+ return helpers.removeDuplicateScript("builderio-init-variants-fns", helpers.getInitVariantsFnsScriptString());
57
+ },
58
+ get nonce() {
59
+ return props.nonce || "";
60
+ },
61
+ [qwik._IMMUTABLE]: {
62
+ id: qwik._IMMUTABLE,
63
+ nonce: qwik._fnSignal((p0) => p0.nonce || "", [
64
+ props
65
+ ], 'p0.nonce||""'),
66
+ scriptStr: qwik._IMMUTABLE
67
+ }
68
+ }, 3, "XM_0") : null,
69
+ !props.isNestedRender && target.TARGET !== "reactNative" && helpers$1.SDKS_SUPPORTING_PERSONALIZATION.includes(target.TARGET) ? /* @__PURE__ */ qwik._jsxC(inlinedScript.InlinedScript, {
70
+ id: "builderio-init-personalization-variants-fns",
71
+ get nonce() {
72
+ return props.nonce || "";
73
+ },
74
+ get scriptStr() {
75
+ return helpers.removeDuplicateScript("builderio-init-personalization-variants-fns", helpers$1.getInitPersonalizationVariantsFnsScriptString());
76
+ },
77
+ [qwik._IMMUTABLE]: {
78
+ id: qwik._IMMUTABLE,
79
+ nonce: qwik._fnSignal((p0) => p0.nonce || "", [
80
+ props
81
+ ], 'p0.nonce||""'),
82
+ scriptStr: qwik._IMMUTABLE
83
+ }
84
+ }, 3, "XM_1") : null,
89
85
  state.shouldRenderVariants ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
90
86
  children: [
91
87
  /* @__PURE__ */ qwik._jsxC(inlinedStyles.InlinedStyles, {
@@ -105,7 +101,7 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
105
101
  hideVariantsStyleString
106
102
  ], "p0.value")
107
103
  }
108
- }, 3, "XM_3"),
104
+ }, 3, "XM_2"),
109
105
  /* @__PURE__ */ qwik._jsxC(inlinedScript.InlinedScript, {
110
106
  id: "builderio-variants-visibility",
111
107
  get scriptStr() {
@@ -123,7 +119,7 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
123
119
  updateCookieAndStylesScriptStr
124
120
  ], "p0.value")
125
121
  }
126
- }, 3, "XM_4"),
122
+ }, 3, "XM_3"),
127
123
  (helpers.getVariants(props.content) || []).map((variant) => {
128
124
  return /* @__PURE__ */ qwik._jsxC(content.ContentComponent, {
129
125
  get apiHost() {
@@ -248,7 +244,7 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
248
244
  }, 3, variant.testVariationId);
249
245
  })
250
246
  ]
251
- }, 1, "XM_5") : null,
247
+ }, 1, "XM_4") : null,
252
248
  /* @__PURE__ */ qwik._jsxC(content.ContentComponent, {
253
249
  get apiHost() {
254
250
  return props.apiHost;
@@ -374,9 +370,9 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
374
370
  props
375
371
  ], "p0.trustedHosts")
376
372
  }
377
- }, 3, "XM_6")
373
+ }, 3, "XM_5")
378
374
  ]
379
- }, 1, "XM_7");
375
+ }, 1, "XM_6");
380
376
  }, "ContentVariants_component_4tFRiQMMEfM"));
381
377
  exports.ContentVariants = ContentVariants;
382
378
  exports.default = ContentVariants;
@@ -7,7 +7,7 @@ import { getDefaultCanTrack } from "../../helpers/canTrack.qwik.mjs";
7
7
  import { ContentComponent } from "../content/content.qwik.mjs";
8
8
  import { InlinedScript } from "../inlined-script.qwik.mjs";
9
9
  import { InlinedStyles } from "../inlined-styles.qwik.mjs";
10
- import { checkShouldRenderVariants, getUpdateCookieAndStylesScript, getVariants, getInitVariantsFnsScriptString } from "./helpers.qwik.mjs";
10
+ import { checkShouldRenderVariants, getUpdateCookieAndStylesScript, getVariants, removeDuplicateScript, getInitVariantsFnsScriptString } from "./helpers.qwik.mjs";
11
11
  const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
12
12
  _jsxBranch();
13
13
  const state = useStore({
@@ -48,42 +48,38 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
48
48
  ]));
49
49
  return /* @__PURE__ */ _jsxC(Fragment, {
50
50
  children: [
51
- !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(Fragment$1, {
52
- children: [
53
- /* @__PURE__ */ _jsxC(InlinedScript, {
54
- id: "builderio-init-variants-fns",
55
- get scriptStr() {
56
- return getInitVariantsFnsScriptString();
57
- },
58
- get nonce() {
59
- return props.nonce || "";
60
- },
61
- [_IMMUTABLE]: {
62
- id: _IMMUTABLE,
63
- nonce: _fnSignal((p0) => p0.nonce || "", [
64
- props
65
- ], 'p0.nonce||""'),
66
- scriptStr: _IMMUTABLE
67
- }
68
- }, 3, "XM_0"),
69
- SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET) ? /* @__PURE__ */ _jsxC(InlinedScript, {
70
- id: "builderio-init-personalization-variants-fns",
71
- get nonce() {
72
- return props.nonce || "";
73
- },
74
- get scriptStr() {
75
- return getInitPersonalizationVariantsFnsScriptString();
76
- },
77
- [_IMMUTABLE]: {
78
- id: _IMMUTABLE,
79
- nonce: _fnSignal((p0) => p0.nonce || "", [
80
- props
81
- ], 'p0.nonce||""'),
82
- scriptStr: _IMMUTABLE
83
- }
84
- }, 3, "XM_1") : null
85
- ]
86
- }, 1, "XM_2") : null,
51
+ !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
52
+ id: "builderio-init-variants-fns",
53
+ get scriptStr() {
54
+ return removeDuplicateScript("builderio-init-variants-fns", getInitVariantsFnsScriptString());
55
+ },
56
+ get nonce() {
57
+ return props.nonce || "";
58
+ },
59
+ [_IMMUTABLE]: {
60
+ id: _IMMUTABLE,
61
+ nonce: _fnSignal((p0) => p0.nonce || "", [
62
+ props
63
+ ], 'p0.nonce||""'),
64
+ scriptStr: _IMMUTABLE
65
+ }
66
+ }, 3, "XM_0") : null,
67
+ !props.isNestedRender && TARGET !== "reactNative" && SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET) ? /* @__PURE__ */ _jsxC(InlinedScript, {
68
+ id: "builderio-init-personalization-variants-fns",
69
+ get nonce() {
70
+ return props.nonce || "";
71
+ },
72
+ get scriptStr() {
73
+ return removeDuplicateScript("builderio-init-personalization-variants-fns", getInitPersonalizationVariantsFnsScriptString());
74
+ },
75
+ [_IMMUTABLE]: {
76
+ id: _IMMUTABLE,
77
+ nonce: _fnSignal((p0) => p0.nonce || "", [
78
+ props
79
+ ], 'p0.nonce||""'),
80
+ scriptStr: _IMMUTABLE
81
+ }
82
+ }, 3, "XM_1") : null,
87
83
  state.shouldRenderVariants ? /* @__PURE__ */ _jsxC(Fragment$1, {
88
84
  children: [
89
85
  /* @__PURE__ */ _jsxC(InlinedStyles, {
@@ -103,7 +99,7 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
103
99
  hideVariantsStyleString
104
100
  ], "p0.value")
105
101
  }
106
- }, 3, "XM_3"),
102
+ }, 3, "XM_2"),
107
103
  /* @__PURE__ */ _jsxC(InlinedScript, {
108
104
  id: "builderio-variants-visibility",
109
105
  get scriptStr() {
@@ -121,7 +117,7 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
121
117
  updateCookieAndStylesScriptStr
122
118
  ], "p0.value")
123
119
  }
124
- }, 3, "XM_4"),
120
+ }, 3, "XM_3"),
125
121
  (getVariants(props.content) || []).map((variant) => {
126
122
  return /* @__PURE__ */ _jsxC(ContentComponent, {
127
123
  get apiHost() {
@@ -246,7 +242,7 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
246
242
  }, 3, variant.testVariationId);
247
243
  })
248
244
  ]
249
- }, 1, "XM_5") : null,
245
+ }, 1, "XM_4") : null,
250
246
  /* @__PURE__ */ _jsxC(ContentComponent, {
251
247
  get apiHost() {
252
248
  return props.apiHost;
@@ -372,9 +368,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
372
368
  props
373
369
  ], "p0.trustedHosts")
374
370
  }
375
- }, 3, "XM_6")
371
+ }, 3, "XM_5")
376
372
  ]
377
- }, 1, "XM_7");
373
+ }, 1, "XM_6");
378
374
  }, "ContentVariants_component_4tFRiQMMEfM"));
379
375
  export {
380
376
  ContentVariants,
@@ -23,6 +23,37 @@ const checkShouldRenderVariants = ({ canTrack, content }) => {
23
23
  const getIsHydrationTarget = (target2) => target2 === "react" || target2 === "reactNative";
24
24
  const isAngularSDK = target.TARGET === "angular";
25
25
  const isHydrationTarget = getIsHydrationTarget(target.TARGET);
26
+ const removeDuplicateScript = (id, scriptStr) => `
27
+ (function() {
28
+ var selector = 'script[data-id="${id}"]';
29
+ var scriptKey = '__builderioScriptInitialized_${id}';
30
+ var observerKey = '__builderioScriptObserver_${id}';
31
+
32
+ // Synchronously remove any duplicates already in the DOM
33
+ var existing = document.querySelectorAll(selector);
34
+ existing.forEach(function(script, index) {
35
+ if (index > 0) {
36
+ script.parentNode && script.parentNode.removeChild(script);
37
+ }
38
+ });
39
+
40
+ // Watch for duplicates added later (e.g. RSC streaming chunks)
41
+ if (!window[observerKey] && typeof MutationObserver !== 'undefined') {
42
+ window[observerKey] = new MutationObserver(function() {
43
+ var all = document.querySelectorAll(selector);
44
+ for (var i = 1; i < all.length; i++) {
45
+ all[i].parentNode && all[i].parentNode.removeChild(all[i]);
46
+ }
47
+ });
48
+ window[observerKey].observe(document.documentElement, { childList: true, subtree: true });
49
+ }
50
+
51
+ if (!window[scriptKey]) {
52
+ window[scriptKey] = true;
53
+ ${scriptStr}
54
+ }
55
+ })();
56
+ `;
26
57
  const getInitVariantsFnsScriptString = () => `
27
58
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${inlinedFns.UPDATE_COOKIES_AND_STYLES_SCRIPT}
28
59
  window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${inlinedFns.UPDATE_VARIANT_VISIBILITY_SCRIPT}
@@ -39,3 +70,4 @@ exports.getInitVariantsFnsScriptString = getInitVariantsFnsScriptString;
39
70
  exports.getUpdateCookieAndStylesScript = getUpdateCookieAndStylesScript;
40
71
  exports.getUpdateVariantVisibilityScript = getUpdateVariantVisibilityScript;
41
72
  exports.getVariants = getVariants;
73
+ exports.removeDuplicateScript = removeDuplicateScript;
@@ -21,6 +21,37 @@ const checkShouldRenderVariants = ({ canTrack, content }) => {
21
21
  const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
22
22
  const isAngularSDK = TARGET === "angular";
23
23
  const isHydrationTarget = getIsHydrationTarget(TARGET);
24
+ const removeDuplicateScript = (id, scriptStr) => `
25
+ (function() {
26
+ var selector = 'script[data-id="${id}"]';
27
+ var scriptKey = '__builderioScriptInitialized_${id}';
28
+ var observerKey = '__builderioScriptObserver_${id}';
29
+
30
+ // Synchronously remove any duplicates already in the DOM
31
+ var existing = document.querySelectorAll(selector);
32
+ existing.forEach(function(script, index) {
33
+ if (index > 0) {
34
+ script.parentNode && script.parentNode.removeChild(script);
35
+ }
36
+ });
37
+
38
+ // Watch for duplicates added later (e.g. RSC streaming chunks)
39
+ if (!window[observerKey] && typeof MutationObserver !== 'undefined') {
40
+ window[observerKey] = new MutationObserver(function() {
41
+ var all = document.querySelectorAll(selector);
42
+ for (var i = 1; i < all.length; i++) {
43
+ all[i].parentNode && all[i].parentNode.removeChild(all[i]);
44
+ }
45
+ });
46
+ window[observerKey].observe(document.documentElement, { childList: true, subtree: true });
47
+ }
48
+
49
+ if (!window[scriptKey]) {
50
+ window[scriptKey] = true;
51
+ ${scriptStr}
52
+ }
53
+ })();
54
+ `;
24
55
  const getInitVariantsFnsScriptString = () => `
25
56
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
26
57
  window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
@@ -37,5 +68,6 @@ export {
37
68
  getInitVariantsFnsScriptString,
38
69
  getUpdateCookieAndStylesScript,
39
70
  getUpdateVariantVisibilityScript,
40
- getVariants
71
+ getVariants,
72
+ removeDuplicateScript
41
73
  };
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SDK_VERSION = "0.24.1";
3
+ const SDK_VERSION = "0.25.2";
4
4
  exports.SDK_VERSION = SDK_VERSION;
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = "0.24.1";
1
+ const SDK_VERSION = "0.25.2";
2
2
  export {
3
3
  SDK_VERSION
4
4
  };
@@ -7,7 +7,7 @@ const fetchSymbolContent = async ({ builderContextValue, symbol }) => {
7
7
  (builderContextValue == null ? void 0 : builderContextValue.apiKey))
8
8
  return index.fetchOneEntry({
9
9
  model: symbol.model,
10
- apiKey: builderContextValue.apiKey,
10
+ apiKey: symbol.global && symbol.ownerId ? symbol.ownerId : builderContextValue.apiKey,
11
11
  apiVersion: builderContextValue.apiVersion,
12
12
  ...(symbol == null ? void 0 : symbol.entry) && {
13
13
  query: {
@@ -5,7 +5,7 @@ const fetchSymbolContent = async ({ builderContextValue, symbol }) => {
5
5
  (builderContextValue == null ? void 0 : builderContextValue.apiKey))
6
6
  return fetchOneEntry({
7
7
  model: symbol.model,
8
- apiKey: builderContextValue.apiKey,
8
+ apiKey: symbol.global && symbol.ownerId ? symbol.ownerId : builderContextValue.apiKey,
9
9
  apiVersion: builderContextValue.apiVersion,
10
10
  ...(symbol == null ? void 0 : symbol.entry) && {
11
11
  query: {
@@ -72,7 +72,8 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
72
72
  return props.builderContext.apiVersion;
73
73
  },
74
74
  get apiKey() {
75
- return props.builderContext.apiKey;
75
+ var _a2, _b2;
76
+ return ((_a2 = props.symbol) == null ? void 0 : _a2.global) && ((_b2 = props.symbol) == null ? void 0 : _b2.ownerId) ? props.symbol.ownerId : props.builderContext.apiKey;
76
77
  },
77
78
  get context() {
78
79
  var _a2;
@@ -112,9 +113,12 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
112
113
  return contentWrapper.value;
113
114
  },
114
115
  [qwik._IMMUTABLE]: {
115
- apiKey: qwik._fnSignal((p0) => p0.builderContext.apiKey, [
116
+ apiKey: qwik._fnSignal((p0) => {
117
+ var _a2, _b2;
118
+ return ((_a2 = p0.symbol) == null ? void 0 : _a2.global) && ((_b2 = p0.symbol) == null ? void 0 : _b2.ownerId) ? p0.symbol.ownerId : p0.builderContext.apiKey;
119
+ }, [
116
120
  props
117
- ], "p0.builderContext.apiKey"),
121
+ ], "p0.symbol?.global&&p0.symbol?.ownerId?p0.symbol.ownerId:p0.builderContext.apiKey"),
118
122
  apiVersion: qwik._fnSignal((p0) => p0.builderContext.apiVersion, [
119
123
  props
120
124
  ], "p0.builderContext.apiVersion"),
@@ -70,7 +70,8 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
70
70
  return props.builderContext.apiVersion;
71
71
  },
72
72
  get apiKey() {
73
- return props.builderContext.apiKey;
73
+ var _a2, _b2;
74
+ return ((_a2 = props.symbol) == null ? void 0 : _a2.global) && ((_b2 = props.symbol) == null ? void 0 : _b2.ownerId) ? props.symbol.ownerId : props.builderContext.apiKey;
74
75
  },
75
76
  get context() {
76
77
  var _a2;
@@ -110,9 +111,12 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
110
111
  return contentWrapper.value;
111
112
  },
112
113
  [_IMMUTABLE]: {
113
- apiKey: _fnSignal((p0) => p0.builderContext.apiKey, [
114
+ apiKey: _fnSignal((p0) => {
115
+ var _a2, _b2;
116
+ return ((_a2 = p0.symbol) == null ? void 0 : _a2.global) && ((_b2 = p0.symbol) == null ? void 0 : _b2.ownerId) ? p0.symbol.ownerId : p0.builderContext.apiKey;
117
+ }, [
114
118
  props
115
- ], "p0.builderContext.apiKey"),
119
+ ], "p0.symbol?.global&&p0.symbol?.ownerId?p0.symbol.ownerId:p0.builderContext.apiKey"),
116
120
  apiVersion: _fnSignal((p0) => p0.builderContext.apiVersion, [
117
121
  props
118
122
  ], "p0.builderContext.apiVersion"),
@@ -6,6 +6,12 @@ const block = require("../../block.qwik.cjs");
6
6
  const interactiveElement = require("../interactive-element.qwik.cjs");
7
7
  const componentRef_helpers = require("./component-ref.helpers.qwik.cjs");
8
8
  const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
9
+ const blockChildrenToRender = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
10
+ const [props2] = qwik.useLexicalScope();
11
+ return props2.componentRef ? props2.blockChildren : [];
12
+ }, "ComponentRef_component_blockChildrenToRender_useComputed_HF18bwDAU0c", [
13
+ props
14
+ ]));
9
15
  const state = qwik.useStore({
10
16
  Wrapper: props.isInteractive ? interactiveElement.InteractiveElement : props.componentRef,
11
17
  shouldUpdate: false
@@ -22,7 +28,7 @@ const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
22
28
  isInteractive: props.isInteractive,
23
29
  contextValue: props.context
24
30
  }),
25
- children: props.componentRef ? (props.blockChildren || []).map((child) => {
31
+ children: (blockChildrenToRender.value || []).map((child) => {
26
32
  return /* @__PURE__ */ qwik._jsxC(block.Block, {
27
33
  block: child,
28
34
  get context() {
@@ -46,7 +52,7 @@ const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
46
52
  ], "p0.registeredComponents")
47
53
  }
48
54
  }, 3, child.id);
49
- }) : null
55
+ })
50
56
  }, 0, "z6_0") : null
51
57
  }, 1, "z6_1");
52
58
  }, "ComponentRef_component_tFQoBV6UFdc"));
@@ -1,9 +1,15 @@
1
- import { componentQrl, inlinedQrl, useStore, _jsxC, _IMMUTABLE, _fnSignal } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, useComputedQrl, useLexicalScope, useStore, _jsxC, _IMMUTABLE, _fnSignal } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  import { Block } from "../../block.qwik.mjs";
4
4
  import { InteractiveElement } from "../interactive-element.qwik.mjs";
5
5
  import { getWrapperProps } from "./component-ref.helpers.qwik.mjs";
6
6
  const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
7
+ const blockChildrenToRender = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
8
+ const [props2] = useLexicalScope();
9
+ return props2.componentRef ? props2.blockChildren : [];
10
+ }, "ComponentRef_component_blockChildrenToRender_useComputed_HF18bwDAU0c", [
11
+ props
12
+ ]));
7
13
  const state = useStore({
8
14
  Wrapper: props.isInteractive ? InteractiveElement : props.componentRef,
9
15
  shouldUpdate: false
@@ -20,7 +26,7 @@ const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
20
26
  isInteractive: props.isInteractive,
21
27
  contextValue: props.context
22
28
  }),
23
- children: props.componentRef ? (props.blockChildren || []).map((child) => {
29
+ children: (blockChildrenToRender.value || []).map((child) => {
24
30
  return /* @__PURE__ */ _jsxC(Block, {
25
31
  block: child,
26
32
  get context() {
@@ -44,7 +50,7 @@ const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
44
50
  ], "p0.registeredComponents")
45
51
  }
46
52
  }, 3, child.id);
47
- }) : null
53
+ })
48
54
  }, 0, "z6_0") : null
49
55
  }, 1, "z6_1");
50
56
  }, "ComponentRef_component_tFQoBV6UFdc"));