@builder.io/sdk-qwik 0.7.1-2 → 0.7.1-3

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.
@@ -2360,7 +2360,7 @@ const SCRIPT_MIME_TYPES = [
2360
2360
  "application/ecmascript"
2361
2361
  ];
2362
2362
  const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2363
- const findAndRunScripts$1 = function findAndRunScripts2(props, state, elem) {
2363
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
2364
2364
  if (!elem.value || !elem.value.getElementsByTagName)
2365
2365
  return;
2366
2366
  const scripts = elem.value.getElementsByTagName("script");
@@ -2394,7 +2394,7 @@ const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
2394
2394
  track2(() => state2.ranInitFn);
2395
2395
  if (elem2.value && !state2.ranInitFn) {
2396
2396
  state2.ranInitFn = true;
2397
- findAndRunScripts$1(props2, state2, elem2);
2397
+ findAndRunScripts(props2, state2, elem2);
2398
2398
  }
2399
2399
  }, "Embed_component_useTask_bg7ez0XUtiM", [
2400
2400
  elem,
@@ -2452,15 +2452,23 @@ const componentInfo$1 = {
2452
2452
  noWrap: true,
2453
2453
  static: true
2454
2454
  };
2455
- const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
2456
- if (elem.value && elem.value.getElementsByTagName && typeof window !== "undefined") {
2457
- const scripts = elem.value.getElementsByTagName("script");
2455
+ const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2456
+ const elementRef = qwik.useSignal();
2457
+ const state = qwik.useStore({
2458
+ scriptsInserted: [],
2459
+ scriptsRun: []
2460
+ });
2461
+ qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
2462
+ const [state2] = qwik.useLexicalScope();
2463
+ if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
2464
+ return;
2465
+ const scripts = element.getElementsByTagName("script");
2458
2466
  for (let i = 0; i < scripts.length; i++) {
2459
2467
  const script = scripts[i];
2460
2468
  if (script.src) {
2461
- if (state.scriptsInserted.includes(script.src))
2469
+ if (state2.scriptsInserted.includes(script.src))
2462
2470
  continue;
2463
- state.scriptsInserted.push(script.src);
2471
+ state2.scriptsInserted.push(script.src);
2464
2472
  const newScript = document.createElement("script");
2465
2473
  newScript.async = true;
2466
2474
  newScript.src = script.src;
@@ -2470,34 +2478,21 @@ const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
2470
2478
  "application/javascript",
2471
2479
  "application/ecmascript"
2472
2480
  ].includes(script.type)) {
2473
- if (state.scriptsRun.includes(script.innerText))
2481
+ if (state2.scriptsRun.includes(script.innerText))
2474
2482
  continue;
2475
2483
  try {
2476
- state.scriptsRun.push(script.innerText);
2484
+ state2.scriptsRun.push(script.innerText);
2477
2485
  new Function(script.innerText)();
2478
2486
  } catch (error) {
2479
2487
  console.warn("`CustomCode`: Error running script:", error);
2480
2488
  }
2481
2489
  }
2482
2490
  }
2483
- }
2484
- };
2485
- const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2486
- const elem = qwik.useSignal();
2487
- const state = qwik.useStore({
2488
- scriptsInserted: [],
2489
- scriptsRun: []
2490
- });
2491
- qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
2492
- const [elem2, props2, state2] = qwik.useLexicalScope();
2493
- findAndRunScripts(props2, state2, elem2);
2494
- }, "CustomCode_component_useVisibleTask_S5QgEQZj6YE", [
2495
- elem,
2496
- props,
2491
+ }, "CustomCode_component_useOn_zjAgBhFOiCs", [
2497
2492
  state
2498
2493
  ]));
2499
2494
  return /* @__PURE__ */ qwik._jsxQ("div", {
2500
- ref: elem
2495
+ ref: elementRef
2501
2496
  }, {
2502
2497
  class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
2503
2498
  props
@@ -3100,7 +3095,7 @@ const getInteractionPropertiesForEvent = (event) => {
3100
3095
  }
3101
3096
  };
3102
3097
  };
3103
- const SDK_VERSION = "0.7.1-2";
3098
+ const SDK_VERSION = "0.7.1-3";
3104
3099
  const registry = {};
3105
3100
  function register(type, info) {
3106
3101
  let typeList = registry[type];
@@ -3881,8 +3876,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
3881
3876
  props,
3882
3877
  state
3883
3878
  ]));
3884
- qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
3885
- }, "ContentVariants_component_useVisibleTask_10cWAqcJ45I"));
3886
3879
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
3887
3880
  children: [
3888
3881
  !props.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
@@ -1,4 +1,4 @@
1
- import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl, useOn } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useOn } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4
4
  useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
@@ -2358,7 +2358,7 @@ const SCRIPT_MIME_TYPES = [
2358
2358
  "application/ecmascript"
2359
2359
  ];
2360
2360
  const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2361
- const findAndRunScripts$1 = function findAndRunScripts2(props, state, elem) {
2361
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
2362
2362
  if (!elem.value || !elem.value.getElementsByTagName)
2363
2363
  return;
2364
2364
  const scripts = elem.value.getElementsByTagName("script");
@@ -2392,7 +2392,7 @@ const Embed = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
2392
2392
  track2(() => state2.ranInitFn);
2393
2393
  if (elem2.value && !state2.ranInitFn) {
2394
2394
  state2.ranInitFn = true;
2395
- findAndRunScripts$1(props2, state2, elem2);
2395
+ findAndRunScripts(props2, state2, elem2);
2396
2396
  }
2397
2397
  }, "Embed_component_useTask_bg7ez0XUtiM", [
2398
2398
  elem,
@@ -2450,15 +2450,23 @@ const componentInfo$1 = {
2450
2450
  noWrap: true,
2451
2451
  static: true
2452
2452
  };
2453
- const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
2454
- if (elem.value && elem.value.getElementsByTagName && typeof window !== "undefined") {
2455
- const scripts = elem.value.getElementsByTagName("script");
2453
+ const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
2454
+ const elementRef = useSignal();
2455
+ const state = useStore({
2456
+ scriptsInserted: [],
2457
+ scriptsRun: []
2458
+ });
2459
+ useOn("qvisible", /* @__PURE__ */ inlinedQrl((event, element) => {
2460
+ const [state2] = useLexicalScope();
2461
+ if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
2462
+ return;
2463
+ const scripts = element.getElementsByTagName("script");
2456
2464
  for (let i = 0; i < scripts.length; i++) {
2457
2465
  const script = scripts[i];
2458
2466
  if (script.src) {
2459
- if (state.scriptsInserted.includes(script.src))
2467
+ if (state2.scriptsInserted.includes(script.src))
2460
2468
  continue;
2461
- state.scriptsInserted.push(script.src);
2469
+ state2.scriptsInserted.push(script.src);
2462
2470
  const newScript = document.createElement("script");
2463
2471
  newScript.async = true;
2464
2472
  newScript.src = script.src;
@@ -2468,34 +2476,21 @@ const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
2468
2476
  "application/javascript",
2469
2477
  "application/ecmascript"
2470
2478
  ].includes(script.type)) {
2471
- if (state.scriptsRun.includes(script.innerText))
2479
+ if (state2.scriptsRun.includes(script.innerText))
2472
2480
  continue;
2473
2481
  try {
2474
- state.scriptsRun.push(script.innerText);
2482
+ state2.scriptsRun.push(script.innerText);
2475
2483
  new Function(script.innerText)();
2476
2484
  } catch (error) {
2477
2485
  console.warn("`CustomCode`: Error running script:", error);
2478
2486
  }
2479
2487
  }
2480
2488
  }
2481
- }
2482
- };
2483
- const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
2484
- const elem = useSignal();
2485
- const state = useStore({
2486
- scriptsInserted: [],
2487
- scriptsRun: []
2488
- });
2489
- useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
2490
- const [elem2, props2, state2] = useLexicalScope();
2491
- findAndRunScripts(props2, state2, elem2);
2492
- }, "CustomCode_component_useVisibleTask_S5QgEQZj6YE", [
2493
- elem,
2494
- props,
2489
+ }, "CustomCode_component_useOn_zjAgBhFOiCs", [
2495
2490
  state
2496
2491
  ]));
2497
2492
  return /* @__PURE__ */ _jsxQ("div", {
2498
- ref: elem
2493
+ ref: elementRef
2499
2494
  }, {
2500
2495
  class: _fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
2501
2496
  props
@@ -3098,7 +3093,7 @@ const getInteractionPropertiesForEvent = (event) => {
3098
3093
  }
3099
3094
  };
3100
3095
  };
3101
- const SDK_VERSION = "0.7.1-2";
3096
+ const SDK_VERSION = "0.7.1-3";
3102
3097
  const registry = {};
3103
3098
  function register(type, info) {
3104
3099
  let typeList = registry[type];
@@ -3879,8 +3874,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
3879
3874
  props,
3880
3875
  state
3881
3876
  ]));
3882
- useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
3883
- }, "ContentVariants_component_useVisibleTask_10cWAqcJ45I"));
3884
3877
  return /* @__PURE__ */ _jsxC(Fragment$1, {
3885
3878
  children: [
3886
3879
  !props.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
@@ -5564,7 +5564,7 @@ const SCRIPT_MIME_TYPES = [
5564
5564
  "application/ecmascript"
5565
5565
  ];
5566
5566
  const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
5567
- const findAndRunScripts$1 = function findAndRunScripts2(props, state, elem) {
5567
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
5568
5568
  if (!elem.value || !elem.value.getElementsByTagName)
5569
5569
  return;
5570
5570
  const scripts = elem.value.getElementsByTagName("script");
@@ -5598,7 +5598,7 @@ const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
5598
5598
  track2(() => state2.ranInitFn);
5599
5599
  if (elem2.value && !state2.ranInitFn) {
5600
5600
  state2.ranInitFn = true;
5601
- findAndRunScripts$1(props2, state2, elem2);
5601
+ findAndRunScripts(props2, state2, elem2);
5602
5602
  }
5603
5603
  }, "Embed_component_useTask_bg7ez0XUtiM", [
5604
5604
  elem,
@@ -5656,15 +5656,23 @@ const componentInfo$1 = {
5656
5656
  noWrap: true,
5657
5657
  static: true
5658
5658
  };
5659
- const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
5660
- if (elem.value && elem.value.getElementsByTagName && typeof window !== "undefined") {
5661
- const scripts = elem.value.getElementsByTagName("script");
5659
+ const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
5660
+ const elementRef = qwik.useSignal();
5661
+ const state = qwik.useStore({
5662
+ scriptsInserted: [],
5663
+ scriptsRun: []
5664
+ });
5665
+ qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
5666
+ const [state2] = qwik.useLexicalScope();
5667
+ if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
5668
+ return;
5669
+ const scripts = element.getElementsByTagName("script");
5662
5670
  for (let i = 0; i < scripts.length; i++) {
5663
5671
  const script = scripts[i];
5664
5672
  if (script.src) {
5665
- if (state.scriptsInserted.includes(script.src))
5673
+ if (state2.scriptsInserted.includes(script.src))
5666
5674
  continue;
5667
- state.scriptsInserted.push(script.src);
5675
+ state2.scriptsInserted.push(script.src);
5668
5676
  const newScript = document.createElement("script");
5669
5677
  newScript.async = true;
5670
5678
  newScript.src = script.src;
@@ -5674,34 +5682,21 @@ const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
5674
5682
  "application/javascript",
5675
5683
  "application/ecmascript"
5676
5684
  ].includes(script.type)) {
5677
- if (state.scriptsRun.includes(script.innerText))
5685
+ if (state2.scriptsRun.includes(script.innerText))
5678
5686
  continue;
5679
5687
  try {
5680
- state.scriptsRun.push(script.innerText);
5688
+ state2.scriptsRun.push(script.innerText);
5681
5689
  new Function(script.innerText)();
5682
5690
  } catch (error) {
5683
5691
  console.warn("`CustomCode`: Error running script:", error);
5684
5692
  }
5685
5693
  }
5686
5694
  }
5687
- }
5688
- };
5689
- const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
5690
- const elem = qwik.useSignal();
5691
- const state = qwik.useStore({
5692
- scriptsInserted: [],
5693
- scriptsRun: []
5694
- });
5695
- qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
5696
- const [elem2, props2, state2] = qwik.useLexicalScope();
5697
- findAndRunScripts(props2, state2, elem2);
5698
- }, "CustomCode_component_useVisibleTask_S5QgEQZj6YE", [
5699
- elem,
5700
- props,
5695
+ }, "CustomCode_component_useOn_zjAgBhFOiCs", [
5701
5696
  state
5702
5697
  ]));
5703
5698
  return /* @__PURE__ */ qwik._jsxQ("div", {
5704
- ref: elem
5699
+ ref: elementRef
5705
5700
  }, {
5706
5701
  class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
5707
5702
  props
@@ -6304,7 +6299,7 @@ const getInteractionPropertiesForEvent = (event) => {
6304
6299
  }
6305
6300
  };
6306
6301
  };
6307
- const SDK_VERSION = "0.7.1-2";
6302
+ const SDK_VERSION = "0.7.1-3";
6308
6303
  const registry = {};
6309
6304
  function register(type, info) {
6310
6305
  let typeList = registry[type];
@@ -7085,8 +7080,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
7085
7080
  props,
7086
7081
  state
7087
7082
  ]));
7088
- qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
7089
- }, "ContentVariants_component_useVisibleTask_10cWAqcJ45I"));
7090
7083
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
7091
7084
  children: [
7092
7085
  !props.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
@@ -1,4 +1,4 @@
1
- import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl, useOn } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useOn } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4
4
  useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
@@ -5562,7 +5562,7 @@ const SCRIPT_MIME_TYPES = [
5562
5562
  "application/ecmascript"
5563
5563
  ];
5564
5564
  const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
5565
- const findAndRunScripts$1 = function findAndRunScripts2(props, state, elem) {
5565
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
5566
5566
  if (!elem.value || !elem.value.getElementsByTagName)
5567
5567
  return;
5568
5568
  const scripts = elem.value.getElementsByTagName("script");
@@ -5596,7 +5596,7 @@ const Embed = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
5596
5596
  track2(() => state2.ranInitFn);
5597
5597
  if (elem2.value && !state2.ranInitFn) {
5598
5598
  state2.ranInitFn = true;
5599
- findAndRunScripts$1(props2, state2, elem2);
5599
+ findAndRunScripts(props2, state2, elem2);
5600
5600
  }
5601
5601
  }, "Embed_component_useTask_bg7ez0XUtiM", [
5602
5602
  elem,
@@ -5654,15 +5654,23 @@ const componentInfo$1 = {
5654
5654
  noWrap: true,
5655
5655
  static: true
5656
5656
  };
5657
- const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
5658
- if (elem.value && elem.value.getElementsByTagName && typeof window !== "undefined") {
5659
- const scripts = elem.value.getElementsByTagName("script");
5657
+ const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
5658
+ const elementRef = useSignal();
5659
+ const state = useStore({
5660
+ scriptsInserted: [],
5661
+ scriptsRun: []
5662
+ });
5663
+ useOn("qvisible", /* @__PURE__ */ inlinedQrl((event, element) => {
5664
+ const [state2] = useLexicalScope();
5665
+ if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
5666
+ return;
5667
+ const scripts = element.getElementsByTagName("script");
5660
5668
  for (let i = 0; i < scripts.length; i++) {
5661
5669
  const script = scripts[i];
5662
5670
  if (script.src) {
5663
- if (state.scriptsInserted.includes(script.src))
5671
+ if (state2.scriptsInserted.includes(script.src))
5664
5672
  continue;
5665
- state.scriptsInserted.push(script.src);
5673
+ state2.scriptsInserted.push(script.src);
5666
5674
  const newScript = document.createElement("script");
5667
5675
  newScript.async = true;
5668
5676
  newScript.src = script.src;
@@ -5672,34 +5680,21 @@ const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
5672
5680
  "application/javascript",
5673
5681
  "application/ecmascript"
5674
5682
  ].includes(script.type)) {
5675
- if (state.scriptsRun.includes(script.innerText))
5683
+ if (state2.scriptsRun.includes(script.innerText))
5676
5684
  continue;
5677
5685
  try {
5678
- state.scriptsRun.push(script.innerText);
5686
+ state2.scriptsRun.push(script.innerText);
5679
5687
  new Function(script.innerText)();
5680
5688
  } catch (error) {
5681
5689
  console.warn("`CustomCode`: Error running script:", error);
5682
5690
  }
5683
5691
  }
5684
5692
  }
5685
- }
5686
- };
5687
- const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
5688
- const elem = useSignal();
5689
- const state = useStore({
5690
- scriptsInserted: [],
5691
- scriptsRun: []
5692
- });
5693
- useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
5694
- const [elem2, props2, state2] = useLexicalScope();
5695
- findAndRunScripts(props2, state2, elem2);
5696
- }, "CustomCode_component_useVisibleTask_S5QgEQZj6YE", [
5697
- elem,
5698
- props,
5693
+ }, "CustomCode_component_useOn_zjAgBhFOiCs", [
5699
5694
  state
5700
5695
  ]));
5701
5696
  return /* @__PURE__ */ _jsxQ("div", {
5702
- ref: elem
5697
+ ref: elementRef
5703
5698
  }, {
5704
5699
  class: _fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
5705
5700
  props
@@ -6302,7 +6297,7 @@ const getInteractionPropertiesForEvent = (event) => {
6302
6297
  }
6303
6298
  };
6304
6299
  };
6305
- const SDK_VERSION = "0.7.1-2";
6300
+ const SDK_VERSION = "0.7.1-3";
6306
6301
  const registry = {};
6307
6302
  function register(type, info) {
6308
6303
  let typeList = registry[type];
@@ -7083,8 +7078,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7083
7078
  props,
7084
7079
  state
7085
7080
  ]));
7086
- useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
7087
- }, "ContentVariants_component_useVisibleTask_10cWAqcJ45I"));
7088
7081
  return /* @__PURE__ */ _jsxC(Fragment$1, {
7089
7082
  children: [
7090
7083
  !props.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
@@ -2360,7 +2360,7 @@ const SCRIPT_MIME_TYPES = [
2360
2360
  "application/ecmascript"
2361
2361
  ];
2362
2362
  const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2363
- const findAndRunScripts$1 = function findAndRunScripts2(props, state, elem) {
2363
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
2364
2364
  if (!elem.value || !elem.value.getElementsByTagName)
2365
2365
  return;
2366
2366
  const scripts = elem.value.getElementsByTagName("script");
@@ -2394,7 +2394,7 @@ const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
2394
2394
  track2(() => state2.ranInitFn);
2395
2395
  if (elem2.value && !state2.ranInitFn) {
2396
2396
  state2.ranInitFn = true;
2397
- findAndRunScripts$1(props2, state2, elem2);
2397
+ findAndRunScripts(props2, state2, elem2);
2398
2398
  }
2399
2399
  }, "Embed_component_useTask_bg7ez0XUtiM", [
2400
2400
  elem,
@@ -2452,15 +2452,23 @@ const componentInfo$1 = {
2452
2452
  noWrap: true,
2453
2453
  static: true
2454
2454
  };
2455
- const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
2456
- if (elem.value && elem.value.getElementsByTagName && typeof window !== "undefined") {
2457
- const scripts = elem.value.getElementsByTagName("script");
2455
+ const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2456
+ const elementRef = qwik.useSignal();
2457
+ const state = qwik.useStore({
2458
+ scriptsInserted: [],
2459
+ scriptsRun: []
2460
+ });
2461
+ qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
2462
+ const [state2] = qwik.useLexicalScope();
2463
+ if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
2464
+ return;
2465
+ const scripts = element.getElementsByTagName("script");
2458
2466
  for (let i = 0; i < scripts.length; i++) {
2459
2467
  const script = scripts[i];
2460
2468
  if (script.src) {
2461
- if (state.scriptsInserted.includes(script.src))
2469
+ if (state2.scriptsInserted.includes(script.src))
2462
2470
  continue;
2463
- state.scriptsInserted.push(script.src);
2471
+ state2.scriptsInserted.push(script.src);
2464
2472
  const newScript = document.createElement("script");
2465
2473
  newScript.async = true;
2466
2474
  newScript.src = script.src;
@@ -2470,34 +2478,21 @@ const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
2470
2478
  "application/javascript",
2471
2479
  "application/ecmascript"
2472
2480
  ].includes(script.type)) {
2473
- if (state.scriptsRun.includes(script.innerText))
2481
+ if (state2.scriptsRun.includes(script.innerText))
2474
2482
  continue;
2475
2483
  try {
2476
- state.scriptsRun.push(script.innerText);
2484
+ state2.scriptsRun.push(script.innerText);
2477
2485
  new Function(script.innerText)();
2478
2486
  } catch (error) {
2479
2487
  console.warn("`CustomCode`: Error running script:", error);
2480
2488
  }
2481
2489
  }
2482
2490
  }
2483
- }
2484
- };
2485
- const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2486
- const elem = qwik.useSignal();
2487
- const state = qwik.useStore({
2488
- scriptsInserted: [],
2489
- scriptsRun: []
2490
- });
2491
- qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
2492
- const [elem2, props2, state2] = qwik.useLexicalScope();
2493
- findAndRunScripts(props2, state2, elem2);
2494
- }, "CustomCode_component_useVisibleTask_S5QgEQZj6YE", [
2495
- elem,
2496
- props,
2491
+ }, "CustomCode_component_useOn_zjAgBhFOiCs", [
2497
2492
  state
2498
2493
  ]));
2499
2494
  return /* @__PURE__ */ qwik._jsxQ("div", {
2500
- ref: elem
2495
+ ref: elementRef
2501
2496
  }, {
2502
2497
  class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
2503
2498
  props
@@ -3100,7 +3095,7 @@ const getInteractionPropertiesForEvent = (event) => {
3100
3095
  }
3101
3096
  };
3102
3097
  };
3103
- const SDK_VERSION = "0.7.1-2";
3098
+ const SDK_VERSION = "0.7.1-3";
3104
3099
  const registry = {};
3105
3100
  function register(type, info) {
3106
3101
  let typeList = registry[type];
@@ -3881,8 +3876,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
3881
3876
  props,
3882
3877
  state
3883
3878
  ]));
3884
- qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
3885
- }, "ContentVariants_component_useVisibleTask_10cWAqcJ45I"));
3886
3879
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
3887
3880
  children: [
3888
3881
  !props.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
@@ -1,4 +1,4 @@
1
- import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl, useOn } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useOn } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4
4
  useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
@@ -2358,7 +2358,7 @@ const SCRIPT_MIME_TYPES = [
2358
2358
  "application/ecmascript"
2359
2359
  ];
2360
2360
  const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2361
- const findAndRunScripts$1 = function findAndRunScripts2(props, state, elem) {
2361
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
2362
2362
  if (!elem.value || !elem.value.getElementsByTagName)
2363
2363
  return;
2364
2364
  const scripts = elem.value.getElementsByTagName("script");
@@ -2392,7 +2392,7 @@ const Embed = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
2392
2392
  track2(() => state2.ranInitFn);
2393
2393
  if (elem2.value && !state2.ranInitFn) {
2394
2394
  state2.ranInitFn = true;
2395
- findAndRunScripts$1(props2, state2, elem2);
2395
+ findAndRunScripts(props2, state2, elem2);
2396
2396
  }
2397
2397
  }, "Embed_component_useTask_bg7ez0XUtiM", [
2398
2398
  elem,
@@ -2450,15 +2450,23 @@ const componentInfo$1 = {
2450
2450
  noWrap: true,
2451
2451
  static: true
2452
2452
  };
2453
- const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
2454
- if (elem.value && elem.value.getElementsByTagName && typeof window !== "undefined") {
2455
- const scripts = elem.value.getElementsByTagName("script");
2453
+ const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
2454
+ const elementRef = useSignal();
2455
+ const state = useStore({
2456
+ scriptsInserted: [],
2457
+ scriptsRun: []
2458
+ });
2459
+ useOn("qvisible", /* @__PURE__ */ inlinedQrl((event, element) => {
2460
+ const [state2] = useLexicalScope();
2461
+ if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
2462
+ return;
2463
+ const scripts = element.getElementsByTagName("script");
2456
2464
  for (let i = 0; i < scripts.length; i++) {
2457
2465
  const script = scripts[i];
2458
2466
  if (script.src) {
2459
- if (state.scriptsInserted.includes(script.src))
2467
+ if (state2.scriptsInserted.includes(script.src))
2460
2468
  continue;
2461
- state.scriptsInserted.push(script.src);
2469
+ state2.scriptsInserted.push(script.src);
2462
2470
  const newScript = document.createElement("script");
2463
2471
  newScript.async = true;
2464
2472
  newScript.src = script.src;
@@ -2468,34 +2476,21 @@ const findAndRunScripts = function findAndRunScripts22(props, state, elem) {
2468
2476
  "application/javascript",
2469
2477
  "application/ecmascript"
2470
2478
  ].includes(script.type)) {
2471
- if (state.scriptsRun.includes(script.innerText))
2479
+ if (state2.scriptsRun.includes(script.innerText))
2472
2480
  continue;
2473
2481
  try {
2474
- state.scriptsRun.push(script.innerText);
2482
+ state2.scriptsRun.push(script.innerText);
2475
2483
  new Function(script.innerText)();
2476
2484
  } catch (error) {
2477
2485
  console.warn("`CustomCode`: Error running script:", error);
2478
2486
  }
2479
2487
  }
2480
2488
  }
2481
- }
2482
- };
2483
- const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
2484
- const elem = useSignal();
2485
- const state = useStore({
2486
- scriptsInserted: [],
2487
- scriptsRun: []
2488
- });
2489
- useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
2490
- const [elem2, props2, state2] = useLexicalScope();
2491
- findAndRunScripts(props2, state2, elem2);
2492
- }, "CustomCode_component_useVisibleTask_S5QgEQZj6YE", [
2493
- elem,
2494
- props,
2489
+ }, "CustomCode_component_useOn_zjAgBhFOiCs", [
2495
2490
  state
2496
2491
  ]));
2497
2492
  return /* @__PURE__ */ _jsxQ("div", {
2498
- ref: elem
2493
+ ref: elementRef
2499
2494
  }, {
2500
2495
  class: _fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
2501
2496
  props
@@ -3098,7 +3093,7 @@ const getInteractionPropertiesForEvent = (event) => {
3098
3093
  }
3099
3094
  };
3100
3095
  };
3101
- const SDK_VERSION = "0.7.1-2";
3096
+ const SDK_VERSION = "0.7.1-3";
3102
3097
  const registry = {};
3103
3098
  function register(type, info) {
3104
3099
  let typeList = registry[type];
@@ -3879,8 +3874,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
3879
3874
  props,
3880
3875
  state
3881
3876
  ]));
3882
- useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
3883
- }, "ContentVariants_component_useVisibleTask_10cWAqcJ45I"));
3884
3877
  return /* @__PURE__ */ _jsxC(Fragment$1, {
3885
3878
  children: [
3886
3879
  !props.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.7.1-2",
3
+ "version": "0.7.1-3",
4
4
  "description": "Builder.io Qwik SDK",
5
5
  "type": "module",
6
6
  "main": "./lib/edge/index.qwik.cjs",
@@ -2,6 +2,5 @@ export interface CustomCodeProps {
2
2
  code: string;
3
3
  replaceNodes?: boolean;
4
4
  }
5
- export declare const findAndRunScripts: (props: any, state: any, elem: any) => void;
6
5
  export declare const CustomCode: import("@builder.io/qwik").Component<CustomCodeProps>;
7
6
  export default CustomCode;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.7.1-2";
1
+ export declare const SDK_VERSION = "0.7.1-3";