voodoojs 0.12.1 → 0.12.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/README.md +1 -1
  2. package/dist/{chunk-KN7NAKBL.js → chunk-7AKBELZA.js} +4 -4
  3. package/dist/{chunk-NP66JM2P.js → chunk-AVXQPDQH.js} +4 -4
  4. package/dist/{chunk-RDHYPGH6.js → chunk-K2U3O36M.js} +19 -15
  5. package/dist/{chunk-GXPNWCGE.js → chunk-MEE2ZAKJ.js} +3 -3
  6. package/dist/{chunk-D7675IJG.js → chunk-NVANUFWZ.js} +6 -6
  7. package/dist/{chunk-4M4ZXHNY.js → chunk-OWCQV42D.js} +35 -8
  8. package/dist/{chunk-AFMCDNYS.js → chunk-RTZEIVNA.js} +5 -5
  9. package/dist/{chunk-T5ION5NG.js → chunk-RXOLGHSU.js} +3 -3
  10. package/dist/{chunk-LLNDLLKV.js → chunk-S4BXAGAW.js} +4 -4
  11. package/dist/{chunk-HNM3CTBD.js → chunk-UGLD36KV.js} +5 -5
  12. package/dist/{chunk-72PMUUMT.js → chunk-YV4I45SK.js} +4 -4
  13. package/dist/essential.cjs +36 -5
  14. package/dist/essential.d.cts +1 -1
  15. package/dist/essential.d.ts +1 -1
  16. package/dist/essential.js +10 -10
  17. package/dist/gpu.cjs +1 -1
  18. package/dist/gpu.js +10 -10
  19. package/dist/http.cjs +1 -1
  20. package/dist/http.js +5 -5
  21. package/dist/index.cjs +54 -9
  22. package/dist/index.d.cts +2 -2
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +38 -24
  25. package/dist/reactivity.cjs +1 -1
  26. package/dist/reactivity.js +2 -2
  27. package/dist/socket.cjs +29 -2
  28. package/dist/socket.js +9 -9
  29. package/dist/style-GWGXWHB4.js +5 -0
  30. package/dist/utils.cjs +1 -1
  31. package/dist/utils.js +2 -2
  32. package/dist/voodoo.core.js +37 -5
  33. package/dist/voodoo.core.min.js +16 -16
  34. package/dist/voodoo.full.js +61 -11
  35. package/dist/voodoo.full.min.js +46 -46
  36. package/dist/voodoo.js +43 -7
  37. package/dist/voodoo.min.js +25 -25
  38. package/package.json +1 -1
  39. package/dist/style-GR4X6O7I.js +0 -5
  40. package/dist/{query-XooOh4vB.d.cts → query-D_BGQw8m.d.cts} +28 -28
  41. package/dist/{query-DzHfm8Kg.d.ts → query-Dl6Urlwd.d.ts} +28 -28
package/dist/voodoo.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Voodoo.js v0.12.1
2
+ * Voodoo.js v0.12.2
3
3
  * JavaScript feels like magic.
4
4
  * (c) 2026 Voodoo.js contributors. MIT License.
5
5
  */
@@ -1798,6 +1798,23 @@ ${pointer}`);
1798
1798
  "SharedWorker",
1799
1799
  "ServiceWorker"
1800
1800
  ]);
1801
+ function guardedTimer(name) {
1802
+ return function(handler, timeout, ...rest) {
1803
+ if (typeof handler !== "function") {
1804
+ throw new VoodooRuntimeError(
1805
+ `${name} needs a function. Passing a string would compile it, which this library never does.`
1806
+ );
1807
+ }
1808
+ const timer = globalThis[name];
1809
+ return timer(handler, timeout, ...rest);
1810
+ };
1811
+ }
1812
+ function forwardGlobal(name) {
1813
+ return function(...args) {
1814
+ const fn = globalThis[name];
1815
+ return fn(...args);
1816
+ };
1817
+ }
1801
1818
  var allowedGlobals = {
1802
1819
  Math,
1803
1820
  JSON,
@@ -1816,7 +1833,17 @@ ${pointer}`);
1816
1833
  isFinite,
1817
1834
  encodeURIComponent,
1818
1835
  decodeURIComponent,
1819
- console
1836
+ console,
1837
+ ...typeof setTimeout !== "undefined" ? {
1838
+ setTimeout: guardedTimer("setTimeout"),
1839
+ setInterval: guardedTimer("setInterval"),
1840
+ clearTimeout: forwardGlobal("clearTimeout"),
1841
+ clearInterval: forwardGlobal("clearInterval")
1842
+ } : {},
1843
+ ...typeof requestAnimationFrame !== "undefined" ? {
1844
+ requestAnimationFrame: forwardGlobal("requestAnimationFrame"),
1845
+ cancelAnimationFrame: forwardGlobal("cancelAnimationFrame")
1846
+ } : {}
1820
1847
  };
1821
1848
  var VoodooRuntimeError = class extends Error {
1822
1849
  constructor(message, expression) {
@@ -7097,7 +7124,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
7097
7124
  Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
7098
7125
  return rootScope.data;
7099
7126
  }
7100
- var version2 = "0.12.1";
7127
+ var version2 = "0.12.2";
7101
7128
  var core = {
7102
7129
  // Utilities first: Voodoo's own names can override.
7103
7130
  ...utils_exports,
@@ -9316,6 +9343,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
9316
9343
  ensureUi();
9317
9344
  collapseOf(el);
9318
9345
  });
9346
+ var selfToggling = /* @__PURE__ */ new WeakSet();
9319
9347
  defineDirective("collapse-toggle", ({ el, expression, cleanup }) => {
9320
9348
  ensureUi();
9321
9349
  const target = resolveTarget(el, expression);
@@ -9324,6 +9352,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
9324
9352
  controller.triggers.add(el);
9325
9353
  controller.sync();
9326
9354
  makeInteractive(el, cleanup);
9355
+ selfToggling.add(el);
9356
+ cleanup(() => selfToggling.delete(el));
9327
9357
  const onClick = (event) => {
9328
9358
  event.preventDefault();
9329
9359
  controller.toggle();
@@ -9738,10 +9768,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
9738
9768
  if (index === -1) return;
9739
9769
  event.preventDefault();
9740
9770
  const controller = controllers2[index];
9741
- if (single && !controller.open) {
9771
+ const ownToggle = selfToggling.has(header);
9772
+ if (single && (ownToggle ? controller.open : !controller.open)) {
9742
9773
  for (const other of controllers2) if (other !== controller) other.hide();
9743
9774
  }
9744
- controller.toggle();
9775
+ if (!ownToggle) controller.toggle();
9745
9776
  };
9746
9777
  const onKeyDown = (event) => {
9747
9778
  var _a2;
@@ -14680,9 +14711,14 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
14680
14711
  allowedGlobals.V = V2;
14681
14712
  allowedGlobals.Voodoo = V2;
14682
14713
  if (config.baseURL && ((_a2 = V2.http) == null ? void 0 : _a2.setBaseURL)) V2.http.setBaseURL(config.baseURL);
14683
- if (options.manual || !config.autoStart) return;
14714
+ theme.init();
14715
+ if (options.manual || !config.autoStart) {
14716
+ whenReady(() => {
14717
+ applySavedPalette();
14718
+ });
14719
+ return;
14720
+ }
14684
14721
  const boot = () => {
14685
- theme.init();
14686
14722
  applySavedPalette();
14687
14723
  V2.start();
14688
14724
  if (typeof V2.enableXrayShortcut === "function") V2.enableXrayShortcut();