sibujs 3.3.2 → 3.3.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.
Files changed (73) hide show
  1. package/dist/browser.cjs +21 -4
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +10 -3
  4. package/dist/build.js +11 -11
  5. package/dist/cdn.global.js +7 -7
  6. package/dist/{chunk-N5TQVEKE.js → chunk-23VT3KZB.js} +1 -1
  7. package/dist/{chunk-IQJ36UTJ.js → chunk-25LY5SRH.js} +31 -24
  8. package/dist/{chunk-6TCOWMGY.js → chunk-5K6RVA2S.js} +1 -1
  9. package/dist/{chunk-YUBEOWII.js → chunk-5Y34FWED.js} +16 -5
  10. package/dist/chunk-7ZHH77QA.js +9 -0
  11. package/dist/{chunk-G6N3LMO2.js → chunk-F3HO2MP7.js} +1 -1
  12. package/dist/{chunk-FJIRS3FM.js → chunk-F7HW2NI5.js} +1 -3
  13. package/dist/{chunk-AEOLHSSQ.js → chunk-IEYFHN5V.js} +72 -25
  14. package/dist/{chunk-FJO2ZL4Q.js → chunk-IQN5W7GE.js} +73 -16
  15. package/dist/{chunk-JCQG2I2G.js → chunk-IWFE4AHO.js} +1 -1
  16. package/dist/{chunk-2ARSB7NG.js → chunk-MYXEBADX.js} +27 -20
  17. package/dist/{chunk-A7CZH3GN.js → chunk-QCQQ2N5H.js} +41 -20
  18. package/dist/{chunk-Q46YIQYW.js → chunk-QTOOBABV.js} +22 -5
  19. package/dist/{chunk-ZEUP4TUD.js → chunk-RZKGMHH4.js} +6 -6
  20. package/dist/{chunk-QCFBIVIQ.js → chunk-SBPUXWCE.js} +1 -1
  21. package/dist/{chunk-RLTFJYDN.js → chunk-TBDTU7UO.js} +1 -1
  22. package/dist/{chunk-P7C7SEJV.js → chunk-TVCCXPU2.js} +5 -5
  23. package/dist/{chunk-4NJEAPLI.js → chunk-UOMYIAG6.js} +1 -1
  24. package/dist/{chunk-655B7MMR.js → chunk-WFUUT6TG.js} +15 -8
  25. package/dist/{chunk-YUR5SX7F.js → chunk-WTFMV2RU.js} +70 -59
  26. package/dist/{chunk-3JHCYHWN.js → chunk-WWV3SJ3L.js} +19 -13
  27. package/dist/{chunk-62V653X2.js → chunk-Y35NQNLG.js} +79 -44
  28. package/dist/{chunk-5VH3GIDX.js → chunk-ZXCZWMZT.js} +1 -1
  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.js +10 -9
  37. package/dist/extras.cjs +454 -250
  38. package/dist/extras.d.cts +1 -1
  39. package/dist/extras.d.ts +1 -1
  40. package/dist/extras.js +26 -22
  41. package/dist/index.cjs +10 -3
  42. package/dist/index.d.cts +4 -1
  43. package/dist/index.d.ts +4 -1
  44. package/dist/index.js +19 -19
  45. package/dist/motion.cjs +223 -204
  46. package/dist/motion.d.cts +8 -1
  47. package/dist/motion.d.ts +8 -1
  48. package/dist/motion.js +6 -3
  49. package/dist/patterns.cjs +13 -6
  50. package/dist/patterns.d.cts +4 -1
  51. package/dist/patterns.d.ts +4 -1
  52. package/dist/patterns.js +5 -5
  53. package/dist/performance.cjs +70 -56
  54. package/dist/performance.js +6 -5
  55. package/dist/plugins.cjs +98 -42
  56. package/dist/plugins.d.cts +2 -1
  57. package/dist/plugins.d.ts +2 -1
  58. package/dist/plugins.js +90 -37
  59. package/dist/ssr.cjs +112 -91
  60. package/dist/ssr.d.cts +8 -1
  61. package/dist/ssr.d.ts +8 -1
  62. package/dist/ssr.js +9 -8
  63. package/dist/testing.cjs +18 -4
  64. package/dist/testing.js +18 -7
  65. package/dist/ui.cjs +322 -281
  66. package/dist/ui.d.cts +0 -20
  67. package/dist/ui.d.ts +0 -20
  68. package/dist/ui.js +28 -22
  69. package/dist/widgets.cjs +75 -13
  70. package/dist/widgets.d.cts +6 -1
  71. package/dist/widgets.d.ts +6 -1
  72. package/dist/widgets.js +7 -6
  73. package/package.json +1 -1
package/dist/testing.cjs CHANGED
@@ -140,6 +140,12 @@ function dispose(node) {
140
140
  }
141
141
  }
142
142
 
143
+ // src/utils/globalSingleton.ts
144
+ function globalSingleton(key, create) {
145
+ const g = globalThis;
146
+ return g[key] ?? (g[key] = create());
147
+ }
148
+
143
149
  // src/testing/a11y.ts
144
150
  function escSel(value) {
145
151
  return value.replace(/["\\]/g, "\\$&");
@@ -641,7 +647,7 @@ function checkAriaAttributes(root) {
641
647
  if (attr.name === "aria-checked" || attr.name === "aria-pressed") {
642
648
  validValues.push("mixed");
643
649
  }
644
- if (!validValues.includes(attr.value) && attr.value !== "undefined") {
650
+ if (!validValues.includes(attr.value)) {
645
651
  violations.push({
646
652
  rule: "aria-valid-attr-value",
647
653
  level: "error",
@@ -1297,7 +1303,15 @@ function createHttpMock(routes = [], options = {}) {
1297
1303
  const mockFetch = async (input, init) => {
1298
1304
  const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
1299
1305
  const method = init?.method || "GET";
1300
- const body = init?.body ? JSON.parse(String(init.body)) : void 0;
1306
+ let body;
1307
+ if (init?.body != null) {
1308
+ const raw = String(init.body);
1309
+ try {
1310
+ body = JSON.parse(raw);
1311
+ } catch {
1312
+ body = raw;
1313
+ }
1314
+ }
1301
1315
  requestLog.push({ url, method, body, timestamp: Date.now() });
1302
1316
  const route = matchRoute(url, method);
1303
1317
  if (!route) {
@@ -1980,7 +1994,7 @@ function forEachSubscriber(signal, visit) {
1980
1994
 
1981
1995
  // src/reactivity/track.ts
1982
1996
  var _isDev4 = isDev();
1983
- var _runtimeVersion = true ? "3.3.2" : "dev";
1997
+ var _runtimeVersion = true ? "3.3.3" : "dev";
1984
1998
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
1985
1999
  function resolveReactiveApi() {
1986
2000
  const g = globalThis;
@@ -2654,7 +2668,7 @@ function escapeSelector(value) {
2654
2668
  if (g.CSS && typeof g.CSS.escape === "function") return g.CSS.escape(value);
2655
2669
  return value.replace(/[^\w-]/g, (m) => `\\${m.charCodeAt(0).toString(16)} `);
2656
2670
  }
2657
- var _renderedContainers = /* @__PURE__ */ new Set();
2671
+ var _renderedContainers = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.testing.containers.v1"), () => /* @__PURE__ */ new Set());
2658
2672
  function unmountAll() {
2659
2673
  for (const container of _renderedContainers) {
2660
2674
  for (const child of Array.from(container.childNodes)) dispose(child);
package/dist/testing.js CHANGED
@@ -1,11 +1,14 @@
1
1
  import {
2
- dispose
3
- } from "./chunk-5VGSK6D2.js";
2
+ globalSingleton
3
+ } from "./chunk-7ZHH77QA.js";
4
4
  import {
5
5
  effect
6
- } from "./chunk-N5TQVEKE.js";
6
+ } from "./chunk-23VT3KZB.js";
7
7
  import "./chunk-S3NFJO6L.js";
8
- import "./chunk-4NJEAPLI.js";
8
+ import {
9
+ dispose
10
+ } from "./chunk-5VGSK6D2.js";
11
+ import "./chunk-UOMYIAG6.js";
9
12
  import "./chunk-COY6PUD2.js";
10
13
 
11
14
  // src/testing/a11y.ts
@@ -509,7 +512,7 @@ function checkAriaAttributes(root) {
509
512
  if (attr.name === "aria-checked" || attr.name === "aria-pressed") {
510
513
  validValues.push("mixed");
511
514
  }
512
- if (!validValues.includes(attr.value) && attr.value !== "undefined") {
515
+ if (!validValues.includes(attr.value)) {
513
516
  violations.push({
514
517
  rule: "aria-valid-attr-value",
515
518
  level: "error",
@@ -1165,7 +1168,15 @@ function createHttpMock(routes = [], options = {}) {
1165
1168
  const mockFetch = async (input, init) => {
1166
1169
  const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
1167
1170
  const method = init?.method || "GET";
1168
- const body = init?.body ? JSON.parse(String(init.body)) : void 0;
1171
+ let body;
1172
+ if (init?.body != null) {
1173
+ const raw = String(init.body);
1174
+ try {
1175
+ body = JSON.parse(raw);
1176
+ } catch {
1177
+ body = raw;
1178
+ }
1179
+ }
1169
1180
  requestLog.push({ url, method, body, timestamp: Date.now() });
1170
1181
  const route = matchRoute(url, method);
1171
1182
  if (!route) {
@@ -1894,7 +1905,7 @@ function escapeSelector(value) {
1894
1905
  if (g.CSS && typeof g.CSS.escape === "function") return g.CSS.escape(value);
1895
1906
  return value.replace(/[^\w-]/g, (m) => `\\${m.charCodeAt(0).toString(16)} `);
1896
1907
  }
1897
- var _renderedContainers = /* @__PURE__ */ new Set();
1908
+ var _renderedContainers = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.testing.containers.v1"), () => /* @__PURE__ */ new Set());
1898
1909
  function unmountAll() {
1899
1910
  for (const container of _renderedContainers) {
1900
1911
  for (const child of Array.from(container.childNodes)) dispose(child);