sibujs 3.3.2 → 3.4.0

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 (77) hide show
  1. package/dist/browser.cjs +21 -4
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +3343 -3009
  4. package/dist/build.js +12 -11
  5. package/dist/cdn.global.js +7 -7
  6. package/dist/{chunk-AEOLHSSQ.js → chunk-3DVGCW7O.js} +72 -25
  7. package/dist/{chunk-6TCOWMGY.js → chunk-3Z2NGWQI.js} +1 -1
  8. package/dist/chunk-7ZHH77QA.js +9 -0
  9. package/dist/{chunk-2ARSB7NG.js → chunk-APFRCIRI.js} +2906 -2569
  10. package/dist/{chunk-62V653X2.js → chunk-AXFWGY32.js} +79 -44
  11. package/dist/{chunk-N5TQVEKE.js → chunk-BUKYCWHX.js} +1 -1
  12. package/dist/{chunk-655B7MMR.js → chunk-CEBWDD63.js} +15 -8
  13. package/dist/{chunk-YUBEOWII.js → chunk-ELXMRSVN.js} +16 -5
  14. package/dist/{chunk-FJIRS3FM.js → chunk-F7HW2NI5.js} +1 -3
  15. package/dist/{chunk-P7C7SEJV.js → chunk-FKQG7FTY.js} +5 -5
  16. package/dist/{chunk-RLTFJYDN.js → chunk-H5FI5WDP.js} +1 -1
  17. package/dist/{chunk-G6N3LMO2.js → chunk-ITWCTZYH.js} +1 -1
  18. package/dist/{chunk-YUR5SX7F.js → chunk-JCO7AHNU.js} +70 -59
  19. package/dist/{chunk-ZEUP4TUD.js → chunk-JNGGM2XE.js} +6 -6
  20. package/dist/{chunk-QCFBIVIQ.js → chunk-K35BAR4P.js} +1 -1
  21. package/dist/{chunk-JCQG2I2G.js → chunk-KZBEVFXZ.js} +1 -1
  22. package/dist/{chunk-FJO2ZL4Q.js → chunk-OAVXAFAY.js} +73 -16
  23. package/dist/{chunk-A7CZH3GN.js → chunk-ODXVQ3CS.js} +41 -20
  24. package/dist/{chunk-4NJEAPLI.js → chunk-OOUQUCNN.js} +1 -1
  25. package/dist/{chunk-5VH3GIDX.js → chunk-RT3IYFN2.js} +1 -1
  26. package/dist/{chunk-Q46YIQYW.js → chunk-S3V6ZXPI.js} +22 -5
  27. package/dist/{chunk-IQJ36UTJ.js → chunk-WSGLJYFI.js} +31 -24
  28. package/dist/{chunk-3JHCYHWN.js → chunk-WWV3SJ3L.js} +19 -13
  29. package/dist/data.cjs +16 -2
  30. package/dist/data.js +7 -6
  31. package/dist/devtools.cjs +71 -21
  32. package/dist/devtools.d.cts +12 -5
  33. package/dist/devtools.d.ts +12 -5
  34. package/dist/devtools.js +6 -5
  35. package/dist/ecosystem.cjs +11 -2
  36. package/dist/ecosystem.d.cts +1 -1
  37. package/dist/ecosystem.d.ts +1 -1
  38. package/dist/ecosystem.js +10 -9
  39. package/dist/extras.cjs +454 -250
  40. package/dist/extras.d.cts +2 -2
  41. package/dist/extras.d.ts +2 -2
  42. package/dist/extras.js +26 -22
  43. package/dist/index.cjs +3385 -3045
  44. package/dist/index.d.cts +1179 -1057
  45. package/dist/index.d.ts +1179 -1057
  46. package/dist/index.js +32 -19
  47. package/dist/motion.cjs +223 -204
  48. package/dist/motion.d.cts +8 -1
  49. package/dist/motion.d.ts +8 -1
  50. package/dist/motion.js +6 -3
  51. package/dist/patterns.cjs +13 -6
  52. package/dist/patterns.d.cts +4 -1
  53. package/dist/patterns.d.ts +4 -1
  54. package/dist/patterns.js +5 -5
  55. package/dist/performance.cjs +70 -56
  56. package/dist/performance.js +6 -5
  57. package/dist/plugins.cjs +98 -42
  58. package/dist/plugins.d.cts +2 -1
  59. package/dist/plugins.d.ts +2 -1
  60. package/dist/plugins.js +89 -36
  61. package/dist/ssr.cjs +112 -91
  62. package/dist/ssr.d.cts +8 -1
  63. package/dist/ssr.d.ts +8 -1
  64. package/dist/ssr.js +9 -8
  65. package/dist/{tagFactory-S17H2qxu.d.ts → tagFactory-Bzupt4Pj.d.cts} +1 -1
  66. package/dist/{tagFactory-S17H2qxu.d.cts → tagFactory-Bzupt4Pj.d.ts} +1 -1
  67. package/dist/testing.cjs +18 -4
  68. package/dist/testing.js +18 -7
  69. package/dist/ui.cjs +322 -281
  70. package/dist/ui.d.cts +0 -20
  71. package/dist/ui.d.ts +0 -20
  72. package/dist/ui.js +27 -21
  73. package/dist/widgets.cjs +75 -13
  74. package/dist/widgets.d.cts +6 -1
  75. package/dist/widgets.d.ts +6 -1
  76. package/dist/widgets.js +7 -6
  77. package/package.json +4 -1
package/dist/browser.cjs CHANGED
@@ -497,7 +497,7 @@ function forEachSubscriber(signal2, visit) {
497
497
 
498
498
  // src/reactivity/track.ts
499
499
  var _isDev3 = isDev();
500
- var _runtimeVersion = true ? "3.3.2" : "dev";
500
+ var _runtimeVersion = true ? "3.4.0" : "dev";
501
501
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
502
502
  function resolveReactiveApi() {
503
503
  const g = globalThis;
@@ -1013,7 +1013,7 @@ function battery() {
1013
1013
  let disposed = false;
1014
1014
  if (typeof navigator !== "undefined" && "getBattery" in navigator) {
1015
1015
  setSupported(true);
1016
- navigator.getBattery().then((bm) => {
1016
+ const batteryPromise = navigator.getBattery().then((bm) => {
1017
1017
  if (disposed) return;
1018
1018
  battery2 = bm;
1019
1019
  batch(() => {
@@ -1031,6 +1031,9 @@ function battery() {
1031
1031
  bm.addEventListener("chargingtimechange", onChargingTimeChange);
1032
1032
  bm.addEventListener("dischargingtimechange", onDischargingTimeChange);
1033
1033
  });
1034
+ batteryPromise.catch(() => {
1035
+ if (!disposed) setSupported(false);
1036
+ });
1034
1037
  }
1035
1038
  function dispose() {
1036
1039
  disposed = true;
@@ -1588,9 +1591,17 @@ function wakeLock() {
1588
1591
  }
1589
1592
  const api = navigator.wakeLock;
1590
1593
  let sentinel = null;
1594
+ let disposed = false;
1591
1595
  async function request() {
1596
+ if (disposed) return;
1592
1597
  try {
1593
- sentinel = await api.request("screen");
1598
+ const s = await api.request("screen");
1599
+ if (disposed) {
1600
+ s.release().catch(() => {
1601
+ });
1602
+ return;
1603
+ }
1604
+ sentinel = s;
1594
1605
  setActive(true);
1595
1606
  sentinel.addEventListener("release", () => {
1596
1607
  setActive(false);
@@ -1617,6 +1628,7 @@ function wakeLock() {
1617
1628
  };
1618
1629
  document.addEventListener("visibilitychange", onVisibility);
1619
1630
  function dispose() {
1631
+ disposed = true;
1620
1632
  document.removeEventListener("visibilitychange", onVisibility);
1621
1633
  release().catch((err) => {
1622
1634
  if (typeof console !== "undefined") {
@@ -1648,6 +1660,7 @@ function animationFrame(options = {}) {
1648
1660
  let id = null;
1649
1661
  let prev = -1;
1650
1662
  let start = -1;
1663
+ let disposed = false;
1651
1664
  const minFrameMs = options.fpsLimit ? 1e3 / options.fpsLimit : 0;
1652
1665
  const step = (now) => {
1653
1666
  if (start < 0) start = now;
@@ -1661,7 +1674,7 @@ function animationFrame(options = {}) {
1661
1674
  id = requestAnimationFrame(step);
1662
1675
  };
1663
1676
  function resume() {
1664
- if (id !== null) return;
1677
+ if (disposed || id !== null) return;
1665
1678
  setRunning(true);
1666
1679
  id = requestAnimationFrame(step);
1667
1680
  }
@@ -1675,6 +1688,7 @@ function animationFrame(options = {}) {
1675
1688
  start = -1;
1676
1689
  }
1677
1690
  function dispose() {
1691
+ disposed = true;
1678
1692
  pause();
1679
1693
  }
1680
1694
  if (options.immediate !== false) resume();
@@ -1733,7 +1747,9 @@ function bounds(target) {
1733
1747
  }
1734
1748
  };
1735
1749
  }
1750
+ let disposed = false;
1736
1751
  function refresh() {
1752
+ if (disposed) return;
1737
1753
  setRect(readRect(target));
1738
1754
  }
1739
1755
  refresh();
@@ -1745,6 +1761,7 @@ function bounds(target) {
1745
1761
  const onScroll = () => refresh();
1746
1762
  window.addEventListener("scroll", onScroll, { passive: true, capture: true });
1747
1763
  function dispose() {
1764
+ disposed = true;
1748
1765
  resizeObserver?.disconnect();
1749
1766
  window.removeEventListener("scroll", onScroll, { capture: true });
1750
1767
  }
package/dist/browser.js CHANGED
@@ -35,12 +35,12 @@ import {
35
35
  visibility,
36
36
  wakeLock,
37
37
  windowSize
38
- } from "./chunk-Q46YIQYW.js";
38
+ } from "./chunk-S3V6ZXPI.js";
39
39
  import "./chunk-H3SRKIYX.js";
40
- import "./chunk-N5TQVEKE.js";
40
+ import "./chunk-BUKYCWHX.js";
41
41
  import "./chunk-S3NFJO6L.js";
42
- import "./chunk-JCQG2I2G.js";
43
- import "./chunk-4NJEAPLI.js";
42
+ import "./chunk-KZBEVFXZ.js";
43
+ import "./chunk-OOUQUCNN.js";
44
44
  import "./chunk-COY6PUD2.js";
45
45
  export {
46
46
  animationFrame,