voodoojs 0.12.4 → 0.13.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 (45) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-XGZ7SXD3.js → chunk-2LGAXVD7.js} +4 -4
  3. package/dist/{chunk-XIMSOXWF.js → chunk-4IJE5BWY.js} +5 -5
  4. package/dist/{chunk-FAWOJTRM.js → chunk-FMDHZ5GI.js} +139 -9
  5. package/dist/{chunk-OHISQWSW.js → chunk-GE4JWATC.js} +5 -5
  6. package/dist/{chunk-2GSZT3CX.js → chunk-H2NGDLMD.js} +363 -76
  7. package/dist/{chunk-AR6WDY7K.js → chunk-IBIZ6OUI.js} +4 -4
  8. package/dist/{chunk-7XRFOONN.js → chunk-IJQ2PFXU.js} +3 -3
  9. package/dist/{chunk-ELIX2DRQ.js → chunk-JBUNTP7F.js} +19 -7
  10. package/dist/{chunk-NKQGUWVF.js → chunk-MV73OSCS.js} +4 -4
  11. package/dist/{chunk-3MPIJH5X.js → chunk-OIH4BR2H.js} +6 -6
  12. package/dist/{chunk-FNTYILLW.js → chunk-TEVCUTTC.js} +3 -3
  13. package/dist/essential.cjs +508 -74
  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 +7 -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 +556 -122
  22. package/dist/index.d.cts +2 -2
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +20 -20
  25. package/dist/reactivity.cjs +138 -5
  26. package/dist/reactivity.d.cts +32 -1
  27. package/dist/reactivity.d.ts +32 -1
  28. package/dist/reactivity.js +2 -2
  29. package/dist/socket.cjs +115 -5
  30. package/dist/socket.d.cts +1 -1
  31. package/dist/socket.d.ts +1 -1
  32. package/dist/socket.js +9 -9
  33. package/dist/style-E22XVZ33.js +5 -0
  34. package/dist/utils.cjs +1 -1
  35. package/dist/utils.js +2 -2
  36. package/dist/voodoo.core.js +572 -72
  37. package/dist/voodoo.core.min.js +17 -17
  38. package/dist/voodoo.full.js +621 -121
  39. package/dist/voodoo.full.min.js +62 -62
  40. package/dist/voodoo.js +575 -75
  41. package/dist/voodoo.min.js +26 -26
  42. package/package.json +1 -1
  43. package/dist/style-DA6RFLKO.js +0 -5
  44. package/dist/{query-XooOh4vB.d.cts → query-D_BGQw8m.d.cts} +28 -28
  45. package/dist/{query-DzHfm8Kg.d.ts → query-Dl6Urlwd.d.ts} +28 -28
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as Scope, c as core, V as VoodooCollection } from './query-XooOh4vB.cjs';
2
- export { A as App, a as AppOptions, C as ComponentDefinition, D as DirectiveBinding, b as DirectiveHooks, P as PRIORITY, R as Resource, d as ResourceOptions, e as VoodooConfig, f as VoodooPlugin, g as VoodooRuntimeError, h as VoodooSyntaxError, i as addCleanup, j as allStores, k as allowedGlobals, l as cache, m as clearParseCache, n as config, o as cookie, p as createApp, q as createResource, r as defineComponent, s as defineDirective, t as destroy, u as documentReady, v as ensureTokens, w as enter, x as evaluate, y as fadeIn, z as fadeOut, B as findScope, E as fromHtml, F as getScope, G as hook, H as hooks, I as injectStyle, J as instances, K as leave, L as magic, M as magics, N as mountComponent, O as parse, Q as query, T as ready, U as refresh, W as removeStore, q as resource, X as rootScope, Y as session, Z as slideDown, _ as slideUp, $ as start, a0 as storage, a1 as store, a2 as storeNames, a3 as stringify, a4 as theme, a5 as toast, a6 as tokenize, a7 as url, a8 as viewTransition, a9 as walk, aa as whenElement, ab as whenReady } from './query-XooOh4vB.cjs';
1
+ import { S as Scope, c as core, V as VoodooCollection } from './query-D_BGQw8m.cjs';
2
+ export { A as App, a as AppOptions, C as ComponentDefinition, D as DirectiveBinding, b as DirectiveHooks, P as PRIORITY, R as Resource, d as ResourceOptions, e as VoodooConfig, f as VoodooPlugin, g as VoodooRuntimeError, h as VoodooSyntaxError, i as addCleanup, j as allStores, k as allowedGlobals, l as cache, m as clearParseCache, n as config, o as cookie, p as createApp, q as createResource, r as defineComponent, s as defineDirective, t as destroy, u as documentReady, v as ensureTokens, w as enter, x as evaluate, y as fadeIn, z as fadeOut, B as findScope, E as fromHtml, F as getScope, G as hook, H as hooks, I as injectStyle, J as instances, K as leave, L as magic, M as magics, N as mountComponent, O as parse, Q as query, T as ready, U as refresh, W as removeStore, q as resource, X as rootScope, Y as session, Z as slideDown, _ as slideUp, $ as start, a0 as storage, a1 as store, a2 as storeNames, a3 as stringify, a4 as theme, a5 as toast, a6 as tokenize, a7 as url, a8 as viewTransition, a9 as walk, aa as whenElement, ab as whenReady } from './query-D_BGQw8m.cjs';
3
3
  import { Ref } from './reactivity.cjs';
4
4
  export { EffectScope, computed, effect, effectScope, flushSync, isReactive, markRaw, nextTick, reactive, ref, shallowRef, stop, toRaw, unref, watch, watchEffect } from './reactivity.cjs';
5
5
  export { HttpError, HttpMethod, HttpResponse, RequestConfig, http, request } from './http.cjs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as Scope, c as core, V as VoodooCollection } from './query-DzHfm8Kg.js';
2
- export { A as App, a as AppOptions, C as ComponentDefinition, D as DirectiveBinding, b as DirectiveHooks, P as PRIORITY, R as Resource, d as ResourceOptions, e as VoodooConfig, f as VoodooPlugin, g as VoodooRuntimeError, h as VoodooSyntaxError, i as addCleanup, j as allStores, k as allowedGlobals, l as cache, m as clearParseCache, n as config, o as cookie, p as createApp, q as createResource, r as defineComponent, s as defineDirective, t as destroy, u as documentReady, v as ensureTokens, w as enter, x as evaluate, y as fadeIn, z as fadeOut, B as findScope, E as fromHtml, F as getScope, G as hook, H as hooks, I as injectStyle, J as instances, K as leave, L as magic, M as magics, N as mountComponent, O as parse, Q as query, T as ready, U as refresh, W as removeStore, q as resource, X as rootScope, Y as session, Z as slideDown, _ as slideUp, $ as start, a0 as storage, a1 as store, a2 as storeNames, a3 as stringify, a4 as theme, a5 as toast, a6 as tokenize, a7 as url, a8 as viewTransition, a9 as walk, aa as whenElement, ab as whenReady } from './query-DzHfm8Kg.js';
1
+ import { S as Scope, c as core, V as VoodooCollection } from './query-Dl6Urlwd.js';
2
+ export { A as App, a as AppOptions, C as ComponentDefinition, D as DirectiveBinding, b as DirectiveHooks, P as PRIORITY, R as Resource, d as ResourceOptions, e as VoodooConfig, f as VoodooPlugin, g as VoodooRuntimeError, h as VoodooSyntaxError, i as addCleanup, j as allStores, k as allowedGlobals, l as cache, m as clearParseCache, n as config, o as cookie, p as createApp, q as createResource, r as defineComponent, s as defineDirective, t as destroy, u as documentReady, v as ensureTokens, w as enter, x as evaluate, y as fadeIn, z as fadeOut, B as findScope, E as fromHtml, F as getScope, G as hook, H as hooks, I as injectStyle, J as instances, K as leave, L as magic, M as magics, N as mountComponent, O as parse, Q as query, T as ready, U as refresh, W as removeStore, q as resource, X as rootScope, Y as session, Z as slideDown, _ as slideUp, $ as start, a0 as storage, a1 as store, a2 as storeNames, a3 as stringify, a4 as theme, a5 as toast, a6 as tokenize, a7 as url, a8 as viewTransition, a9 as walk, aa as whenElement, ab as whenReady } from './query-Dl6Urlwd.js';
3
3
  import { Ref } from './reactivity.js';
4
4
  export { EffectScope, computed, effect, effectScope, flushSync, isReactive, markRaw, nextTick, reactive, ref, shallowRef, stop, toRaw, unref, watch, watchEffect } from './reactivity.js';
5
5
  export { HttpError, HttpMethod, HttpResponse, RequestConfig, http, request } from './http.js';
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
- import { core, sound, hotkey, palette, registerMask, unmask, applyMask, masks, mask, clearErrors, showFieldError, showFormErrors, messages, serializeForm, validate, validator, dialog, prompt, confirm, alert, modal, VoodooCollection, fromHtml, ready2, query, viewTransition, defineComponent, storage, ensurePalette, instances, storeNames, allStores } from './chunk-2GSZT3CX.js';
2
- export { VoodooCollection, alert, allStores, applyMask, cache, clearErrors, clipboard, confirm, cookie, createApp, createResource, defineComponent, dialog, ready as documentReady, enter, fadeIn, fadeOut, fromHtml, hotkey, installHooks, instances, leave, mask, masks, modal, mountComponent, network, palette, prompt, query, ready2 as ready, registerMask, removeStore, createResource as resource, screen, serializeForm, session, showFormErrors, slideDown, slideUp, sound, efeitos as soundEffects, storage, store, storeNames, theme, toast, unmask, url, useContext, useEffect, useMemo, useRef, useState, validate, validator, viewTransition, whenElement, whenReady } from './chunk-2GSZT3CX.js';
3
- export { gpu, reflectWgsl } from './chunk-OHISQWSW.js';
4
- import { http } from './chunk-3MPIJH5X.js';
5
- export { HttpError, http, request } from './chunk-3MPIJH5X.js';
6
- import { devtoolsBus } from './chunk-XIMSOXWF.js';
7
- export { createSocket, devtoolsBus, socket, socketSupported } from './chunk-XIMSOXWF.js';
8
- import { magic, markSkipChildren, onStart, rootScope, findScope, destroy, readAttr, evaluate, parse, Scope, getScope, walk, unwrap, addCleanup, hadDirectives, collectDirectives, getEffectScopes, evaluateIn } from './chunk-ELIX2DRQ.js';
9
- export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, destroy, evaluate, findScope, getScope, hook, hooks, magic, magics, parse, refresh, rootScope, start, stringify, tokenize, walk } from './chunk-ELIX2DRQ.js';
10
- import { reactive, warn, handleError, effect, queuePostFlush, nextTick } from './chunk-FAWOJTRM.js';
11
- export { EffectScope, computed, effect, effectScope, flushSync, isReactive, markRaw, nextTick, reactive, ref, shallowRef, stop, toRaw, unref, watch, watchEffect } from './chunk-FAWOJTRM.js';
12
- import { warnAlias } from './chunk-AR6WDY7K.js';
13
- import { parseDuration, formatNumber, formatCurrency, formatDate, relativeTime, device, setFormatDefaults, uid, merge, escapeHtml, truncate, get, titleCase } from './chunk-XGZ7SXD3.js';
14
- export { capitalize, chunk, clone, debounce, device, escapeHtml, formatCurrency, formatDate, formatFileSize, formatNumber, formatPercent, get, groupBy, isBrowser, matchesMedia, memoize, merge, once, parseDuration, random, relativeTime, sample, set, setFormatDefaults, sleep, slugify, sortBy, stripTags, throttle, titleCase, truncate, uid, unique, uuid } from './chunk-XGZ7SXD3.js';
15
- import { ensureTokens, injectStyle } from './chunk-NKQGUWVF.js';
16
- export { ensureTokens, injectStyle } from './chunk-NKQGUWVF.js';
17
- import { defineDirective, PRIORITY, config } from './chunk-FNTYILLW.js';
18
- export { PRIORITY, config, defineDirective } from './chunk-FNTYILLW.js';
19
- import './chunk-7XRFOONN.js';
1
+ import { core, sound, hotkey, palette, registerMask, unmask, applyMask, masks, mask, clearErrors, showFieldError, showFormErrors, messages, serializeForm, validate, validator, dialog, prompt, confirm, alert, modal, VoodooCollection, fromHtml, ready2, query, viewTransition, defineComponent, storage, ensurePalette, instances, storeNames, allStores } from './chunk-H2NGDLMD.js';
2
+ export { VoodooCollection, alert, allStores, applyMask, cache, clearErrors, clipboard, confirm, cookie, createApp, createResource, defineComponent, dialog, ready as documentReady, enter, fadeIn, fadeOut, fromHtml, hotkey, installHooks, instances, leave, mask, masks, modal, mountComponent, network, palette, prompt, query, ready2 as ready, registerMask, removeStore, createResource as resource, screen, serializeForm, session, showFormErrors, slideDown, slideUp, sound, efeitos as soundEffects, storage, store, storeNames, theme, toast, unmask, url, useContext, useEffect, useMemo, useRef, useState, validate, validator, viewTransition, whenElement, whenReady } from './chunk-H2NGDLMD.js';
3
+ export { gpu, reflectWgsl } from './chunk-GE4JWATC.js';
4
+ import { http } from './chunk-OIH4BR2H.js';
5
+ export { HttpError, http, request } from './chunk-OIH4BR2H.js';
6
+ import { devtoolsBus } from './chunk-4IJE5BWY.js';
7
+ export { createSocket, devtoolsBus, socket, socketSupported } from './chunk-4IJE5BWY.js';
8
+ import { magic, markSkipChildren, onStart, rootScope, findScope, destroy, readAttr, evaluate, parse, Scope, getScope, walk, unwrap, addCleanup, hadDirectives, collectDirectives, getEffectScopes, evaluateIn } from './chunk-JBUNTP7F.js';
9
+ export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, destroy, evaluate, findScope, getScope, hook, hooks, magic, magics, parse, refresh, rootScope, start, stringify, tokenize, walk } from './chunk-JBUNTP7F.js';
10
+ import { reactive, warn, handleError, effect, queuePostFlush, nextTick } from './chunk-FMDHZ5GI.js';
11
+ export { EffectScope, computed, effect, effectScope, flushSync, isReactive, markRaw, nextTick, reactive, ref, shallowRef, stop, toRaw, unref, watch, watchEffect } from './chunk-FMDHZ5GI.js';
12
+ import { warnAlias } from './chunk-IBIZ6OUI.js';
13
+ import { parseDuration, formatNumber, formatCurrency, formatDate, relativeTime, device, setFormatDefaults, uid, merge, escapeHtml, truncate, get, titleCase } from './chunk-2LGAXVD7.js';
14
+ export { capitalize, chunk, clone, debounce, device, escapeHtml, formatCurrency, formatDate, formatFileSize, formatNumber, formatPercent, get, groupBy, isBrowser, matchesMedia, memoize, merge, once, parseDuration, random, relativeTime, sample, set, setFormatDefaults, sleep, slugify, sortBy, stripTags, throttle, titleCase, truncate, uid, unique, uuid } from './chunk-2LGAXVD7.js';
15
+ import { ensureTokens, injectStyle } from './chunk-MV73OSCS.js';
16
+ export { ensureTokens, injectStyle } from './chunk-MV73OSCS.js';
17
+ import { defineDirective, PRIORITY, config } from './chunk-TEVCUTTC.js';
18
+ export { PRIORITY, config, defineDirective } from './chunk-TEVCUTTC.js';
19
+ import './chunk-IJQ2PFXU.js';
20
20
 
21
21
  /**
22
- * Voodoo.js v0.12.4
22
+ * Voodoo.js v0.13.0
23
23
  * JavaScript feels like magic.
24
24
  * (c) 2026 Voodoo.js contributors. MIT License.
25
25
  */
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  /**
4
- * Voodoo.js v0.12.4
4
+ * Voodoo.js v0.13.0
5
5
  * JavaScript feels like magic.
6
6
  * (c) 2026 Voodoo.js contributors. MIT License.
7
7
  */
@@ -280,7 +280,9 @@ function trigger(target, type, key, _newValue) {
280
280
  if (!isArr) add(depsMap.get(ITERATE_KEY));
281
281
  else if (isIntegerKey(key)) add(depsMap.get("length"));
282
282
  } else if (type === "delete" /* DELETE */) {
283
- if (!isArr) add(depsMap.get(ITERATE_KEY));
283
+ add(depsMap.get(ITERATE_KEY));
284
+ } else if (isArr && isIntegerKey(key)) {
285
+ add(depsMap.get(ITERATE_KEY));
284
286
  } else if (isArr && key === "length") {
285
287
  const newLen = Number(_newValue);
286
288
  depsMap.forEach((dep, k) => {
@@ -293,6 +295,59 @@ function trigger(target, type, key, _newValue) {
293
295
  else queueJob(e);
294
296
  }
295
297
  }
298
+ function triggerArrayRange(target, from) {
299
+ const depsMap = targetMap.get(target);
300
+ if (!depsMap) return;
301
+ const effects = /* @__PURE__ */ new Set();
302
+ const add = (dep) => {
303
+ if (!dep) return;
304
+ for (const e of dep) if (e !== activeEffect) effects.add(e);
305
+ };
306
+ add(depsMap.get("length"));
307
+ add(depsMap.get(ITERATE_KEY));
308
+ if (from >= 0) {
309
+ depsMap.forEach((dep, k) => {
310
+ if (typeof k === "string" && isIntegerKey(k) && Number(k) >= from) add(dep);
311
+ });
312
+ }
313
+ for (const e of effects) {
314
+ if (e.scheduler) e.scheduler();
315
+ else queueJob(e);
316
+ }
317
+ }
318
+ var ArrayOp = /* @__PURE__ */ ((ArrayOp2) => {
319
+ ArrayOp2[ArrayOp2["SPLICE"] = 1] = "SPLICE";
320
+ ArrayOp2[ArrayOp2["SET"] = 2] = "SET";
321
+ ArrayOp2[ArrayOp2["RESET"] = 3] = "RESET";
322
+ return ArrayOp2;
323
+ })(ArrayOp || {});
324
+ var LOG_LIMIT = 32;
325
+ var mutationLogs = /* @__PURE__ */ new WeakMap();
326
+ function record(target, type, index, removed, added) {
327
+ let log = mutationLogs.get(target);
328
+ if (!log) mutationLogs.set(target, log = { version: 0, ops: [] });
329
+ log.version++;
330
+ if (type === 3 /* RESET */) {
331
+ log.ops.length = 0;
332
+ return;
333
+ }
334
+ log.ops.push({ type, index, removed, added });
335
+ if (log.ops.length > LOG_LIMIT) log.ops.shift();
336
+ }
337
+ var NO_MUTATIONS = [];
338
+ function arrayVersion(target) {
339
+ const log = mutationLogs.get(target);
340
+ return log ? log.version : 0;
341
+ }
342
+ function mutationsSince(target, since) {
343
+ const log = mutationLogs.get(target);
344
+ if (!log) return since === 0 ? NO_MUTATIONS : null;
345
+ if (since > log.version) return null;
346
+ const missing = log.version - since;
347
+ if (missing === 0) return NO_MUTATIONS;
348
+ if (missing > log.ops.length) return null;
349
+ return log.ops.slice(log.ops.length - missing);
350
+ }
296
351
  function isIntegerKey(key) {
297
352
  return typeof key === "string" && key !== "NaN" && key[0] !== "-" && String(parseInt(key, 10)) === key;
298
353
  }
@@ -313,14 +368,61 @@ var arrayInstrumentations = /* @__PURE__ */ (() => {
313
368
  return res;
314
369
  };
315
370
  }
316
- for (const key of ["push", "pop", "shift", "unshift", "splice"]) {
371
+ for (const key of ["push", "pop", "shift", "unshift", "splice", "reverse", "sort"]) {
317
372
  inst[key] = function(...args) {
373
+ const raw = toRaw(this);
374
+ const before = raw.length;
375
+ for (let i = 0; i < args.length; i++) args[i] = toRaw(args[i]);
318
376
  pauseTracking();
377
+ let result;
319
378
  try {
320
- return toRaw(this)[key].apply(this, args);
379
+ result = raw[key].apply(raw, args);
321
380
  } finally {
322
381
  resetTracking();
323
382
  }
383
+ const after = raw.length;
384
+ let from = -1;
385
+ if (key === "push") {
386
+ if (args.length) {
387
+ record(raw, 1 /* SPLICE */, before, 0, args.length);
388
+ from = before;
389
+ }
390
+ } else if (key === "unshift") {
391
+ if (args.length) {
392
+ record(raw, 1 /* SPLICE */, 0, 0, args.length);
393
+ from = 0;
394
+ }
395
+ } else if (key === "pop") {
396
+ if (before > 0) {
397
+ record(raw, 1 /* SPLICE */, after, 1, 0);
398
+ from = after;
399
+ }
400
+ } else if (key === "shift") {
401
+ if (before > 0) {
402
+ record(raw, 1 /* SPLICE */, 0, 1, 0);
403
+ from = 0;
404
+ }
405
+ } else if (key === "splice") {
406
+ const removed = result.length;
407
+ const added = args.length > 2 ? args.length - 2 : 0;
408
+ if (removed || added) {
409
+ record(raw, 1 /* SPLICE */, spliceStart(args[0], before), removed, added);
410
+ from = spliceStart(args[0], before);
411
+ }
412
+ } else {
413
+ if (before > 1) {
414
+ record(raw, 3 /* RESET */, 0, before, after);
415
+ from = 0;
416
+ }
417
+ }
418
+ if (from >= 0) triggerArrayRange(raw, from);
419
+ if (key === "pop" || key === "shift") return isObject(result) ? reactive(result) : result;
420
+ if (key === "splice") {
421
+ const out = result;
422
+ for (let i = 0; i < out.length; i++) if (isObject(out[i])) out[i] = reactive(out[i]);
423
+ return out;
424
+ }
425
+ return key === "reverse" || key === "sort" ? this : result;
324
426
  };
325
427
  }
326
428
  return inst;
@@ -328,6 +430,11 @@ var arrayInstrumentations = /* @__PURE__ */ (() => {
328
430
  function isObject(val) {
329
431
  return val !== null && typeof val === "object";
330
432
  }
433
+ function spliceStart(raw, length) {
434
+ const n = Math.trunc(Number(raw)) || 0;
435
+ if (n < 0) return Math.max(length + n, 0);
436
+ return Math.min(n, length);
437
+ }
331
438
  var NON_REACTIVE = /* @__PURE__ */ new Set([
332
439
  "Date",
333
440
  "RegExp",
@@ -351,6 +458,23 @@ function canObserve(value) {
351
458
  if (NON_REACTIVE.has(tag)) return false;
352
459
  return tag === "Object" || tag === "Array" || tag === "Map" || tag === "Set";
353
460
  }
461
+ function recordDirectWrite(target, key, lengthBefore, hadKey, oldValue, value) {
462
+ if (key === "length") {
463
+ const next = target.length;
464
+ if (next < lengthBefore) record(target, 1 /* SPLICE */, next, lengthBefore - next, 0);
465
+ else if (next > lengthBefore) record(target, 3 /* RESET */, 0, 0, 0);
466
+ return;
467
+ }
468
+ if (!isIntegerKey(key)) return;
469
+ const index = Number(key);
470
+ if (hadKey) {
471
+ if (hasChanged(value, oldValue)) record(target, 2 /* SET */, index, 1, 1);
472
+ } else if (index === lengthBefore) {
473
+ record(target, 1 /* SPLICE */, index, 0, 1);
474
+ } else {
475
+ record(target, 3 /* RESET */, 0, 0, 0);
476
+ }
477
+ }
354
478
  function markRaw(value) {
355
479
  Object.defineProperty(value, SKIP, { value: true, enumerable: false, configurable: true });
356
480
  return value;
@@ -399,8 +523,11 @@ var baseHandlers = {
399
523
  return true;
400
524
  }
401
525
  const hadKey = Array.isArray(target) && isIntegerKey(key) ? Number(key) < target.length : Object.prototype.hasOwnProperty.call(target, key);
526
+ const isArr = Array.isArray(target);
527
+ const arrayLength = isArr ? target.length : 0;
402
528
  const result = Reflect.set(target, key, value, receiver);
403
529
  if (target === toRaw(receiver)) {
530
+ if (isArr) recordDirectWrite(target, key, arrayLength, hadKey, oldValue, value);
404
531
  if (!hadKey) trigger(target, "add" /* ADD */, key, value);
405
532
  else if (hasChanged(value, oldValue)) trigger(target, "set" /* SET */, key, value);
406
533
  }
@@ -409,7 +536,10 @@ var baseHandlers = {
409
536
  deleteProperty(target, key) {
410
537
  const hadKey = Object.prototype.hasOwnProperty.call(target, key);
411
538
  const result = Reflect.deleteProperty(target, key);
412
- if (result && hadKey) trigger(target, "delete" /* DELETE */, key);
539
+ if (result && hadKey) {
540
+ if (Array.isArray(target)) record(target, 3 /* RESET */, 0, 0, 0);
541
+ trigger(target, "delete" /* DELETE */, key);
542
+ }
413
543
  return result;
414
544
  },
415
545
  has(target, key) {
@@ -639,10 +769,12 @@ function traverse(value, seen = /* @__PURE__ */ new Set()) {
639
769
  return value;
640
770
  }
641
771
 
772
+ exports.ArrayOp = ArrayOp;
642
773
  exports.EffectScope = EffectScope;
643
774
  exports.ITERATE_KEY = ITERATE_KEY;
644
775
  exports.ReactiveEffect = ReactiveEffect;
645
776
  exports.TriggerType = TriggerType;
777
+ exports.arrayVersion = arrayVersion;
646
778
  exports.computed = computed;
647
779
  exports.effect = effect;
648
780
  exports.effectScope = effectScope;
@@ -655,6 +787,7 @@ exports.hasChanged = hasChanged;
655
787
  exports.isReactive = isReactive;
656
788
  exports.isRef = isRef;
657
789
  exports.markRaw = markRaw;
790
+ exports.mutationsSince = mutationsSince;
658
791
  exports.nextTick = nextTick;
659
792
  exports.pauseTracking = pauseTracking;
660
793
  exports.queueJob = queueJob;
@@ -131,6 +131,37 @@ declare const enum TriggerType {
131
131
  CLEAR = "clear"
132
132
  }
133
133
  declare function trigger(target: object, type: TriggerType, key?: PropertyKey, _newValue?: unknown): void;
134
+ /**
135
+ * What happened to an array, in the words of the call that did it.
136
+ *
137
+ * A reconciler handed a new array has to work out what changed by comparing it
138
+ * against the old one, which costs one key read per row however clever it is.
139
+ * A reconciler told "one row was removed at 5000" does not: the mutation
140
+ * already carries the answer. This log is how the caller's knowledge survives
141
+ * the trip to the effect that re-renders the list.
142
+ */
143
+ declare const enum ArrayOp {
144
+ /** `removed` elements at `index` gave way to `added` new ones. */
145
+ SPLICE = 1,
146
+ /** The element at `index` was replaced, without shifting anything. */
147
+ SET = 2,
148
+ /** Something happened that no range can describe. History is unusable. */
149
+ RESET = 3
150
+ }
151
+ interface ArrayMutation {
152
+ type: ArrayOp;
153
+ index: number;
154
+ removed: number;
155
+ added: number;
156
+ }
157
+ /** Mutations recorded for an array so far. `0` when it has never been mutated. */
158
+ declare function arrayVersion(target: object): number;
159
+ /**
160
+ * What happened to `target` since version `since`, oldest first, or `null`
161
+ * when the log cannot answer — the history was truncated, or something
162
+ * unrepresentable happened. `null` means "compare the lists yourself".
163
+ */
164
+ declare function mutationsSince(target: object, since: number): ArrayMutation[] | null;
134
165
  /** Marks an object so it is never turned into a reactive proxy. */
135
166
  declare function markRaw<T extends object>(value: T): T;
136
167
  /** Returns the original object behind a reactive proxy. */
@@ -185,4 +216,4 @@ declare function watch<T>(source: WatchSource<T>, cb: WatchCallback<T>, options?
185
216
  /** Executes the effect immediately and re-executes when dependencies change. */
186
217
  declare function watchEffect(fn: (onInvalidate: (c: () => void) => void) => void): WatchStopHandle;
187
218
 
188
- export { type ComputedRef, type Dep, type EffectOptions, type EffectRunner, type EffectScheduler, EffectScope, ITERATE_KEY, ReactiveEffect, type Ref, TriggerType, type WatchCallback, type WatchOptions, type WatchSource, type WatchStopHandle, computed, effect, effectScope, enableTracking, flushSync, getActiveEffect, getActiveScope, handleError, hasChanged, isReactive, isRef, markRaw, nextTick, pauseTracking, queueJob, queuePostFlush, reactive, ref, resetTracking, setErrorHandler, shallowRef, stop, toRaw, track, trigger, unref, warn, watch, watchEffect };
219
+ export { type ArrayMutation, ArrayOp, type ComputedRef, type Dep, type EffectOptions, type EffectRunner, type EffectScheduler, EffectScope, ITERATE_KEY, ReactiveEffect, type Ref, TriggerType, type WatchCallback, type WatchOptions, type WatchSource, type WatchStopHandle, arrayVersion, computed, effect, effectScope, enableTracking, flushSync, getActiveEffect, getActiveScope, handleError, hasChanged, isReactive, isRef, markRaw, mutationsSince, nextTick, pauseTracking, queueJob, queuePostFlush, reactive, ref, resetTracking, setErrorHandler, shallowRef, stop, toRaw, track, trigger, unref, warn, watch, watchEffect };
@@ -131,6 +131,37 @@ declare const enum TriggerType {
131
131
  CLEAR = "clear"
132
132
  }
133
133
  declare function trigger(target: object, type: TriggerType, key?: PropertyKey, _newValue?: unknown): void;
134
+ /**
135
+ * What happened to an array, in the words of the call that did it.
136
+ *
137
+ * A reconciler handed a new array has to work out what changed by comparing it
138
+ * against the old one, which costs one key read per row however clever it is.
139
+ * A reconciler told "one row was removed at 5000" does not: the mutation
140
+ * already carries the answer. This log is how the caller's knowledge survives
141
+ * the trip to the effect that re-renders the list.
142
+ */
143
+ declare const enum ArrayOp {
144
+ /** `removed` elements at `index` gave way to `added` new ones. */
145
+ SPLICE = 1,
146
+ /** The element at `index` was replaced, without shifting anything. */
147
+ SET = 2,
148
+ /** Something happened that no range can describe. History is unusable. */
149
+ RESET = 3
150
+ }
151
+ interface ArrayMutation {
152
+ type: ArrayOp;
153
+ index: number;
154
+ removed: number;
155
+ added: number;
156
+ }
157
+ /** Mutations recorded for an array so far. `0` when it has never been mutated. */
158
+ declare function arrayVersion(target: object): number;
159
+ /**
160
+ * What happened to `target` since version `since`, oldest first, or `null`
161
+ * when the log cannot answer — the history was truncated, or something
162
+ * unrepresentable happened. `null` means "compare the lists yourself".
163
+ */
164
+ declare function mutationsSince(target: object, since: number): ArrayMutation[] | null;
134
165
  /** Marks an object so it is never turned into a reactive proxy. */
135
166
  declare function markRaw<T extends object>(value: T): T;
136
167
  /** Returns the original object behind a reactive proxy. */
@@ -185,4 +216,4 @@ declare function watch<T>(source: WatchSource<T>, cb: WatchCallback<T>, options?
185
216
  /** Executes the effect immediately and re-executes when dependencies change. */
186
217
  declare function watchEffect(fn: (onInvalidate: (c: () => void) => void) => void): WatchStopHandle;
187
218
 
188
- export { type ComputedRef, type Dep, type EffectOptions, type EffectRunner, type EffectScheduler, EffectScope, ITERATE_KEY, ReactiveEffect, type Ref, TriggerType, type WatchCallback, type WatchOptions, type WatchSource, type WatchStopHandle, computed, effect, effectScope, enableTracking, flushSync, getActiveEffect, getActiveScope, handleError, hasChanged, isReactive, isRef, markRaw, nextTick, pauseTracking, queueJob, queuePostFlush, reactive, ref, resetTracking, setErrorHandler, shallowRef, stop, toRaw, track, trigger, unref, warn, watch, watchEffect };
219
+ export { type ArrayMutation, ArrayOp, type ComputedRef, type Dep, type EffectOptions, type EffectRunner, type EffectScheduler, EffectScope, ITERATE_KEY, ReactiveEffect, type Ref, TriggerType, type WatchCallback, type WatchOptions, type WatchSource, type WatchStopHandle, arrayVersion, computed, effect, effectScope, enableTracking, flushSync, getActiveEffect, getActiveScope, handleError, hasChanged, isReactive, isRef, markRaw, mutationsSince, nextTick, pauseTracking, queueJob, queuePostFlush, reactive, ref, resetTracking, setErrorHandler, shallowRef, stop, toRaw, track, trigger, unref, warn, watch, watchEffect };
@@ -1,4 +1,4 @@
1
- export { EffectScope, ITERATE_KEY, ReactiveEffect, TriggerType, computed, effect, effectScope, enableTracking, flushSync, getActiveEffect, getActiveScope, handleError, hasChanged, isReactive, isRef, markRaw, nextTick, pauseTracking, queueJob, queuePostFlush, reactive, ref, resetTracking, setErrorHandler, shallowRef, stop, toRaw, track, trigger, unref, warn, watch, watchEffect } from './chunk-FAWOJTRM.js';
2
- import './chunk-7XRFOONN.js';
1
+ export { ArrayOp, EffectScope, ITERATE_KEY, ReactiveEffect, TriggerType, arrayVersion, computed, effect, effectScope, enableTracking, flushSync, getActiveEffect, getActiveScope, handleError, hasChanged, isReactive, isRef, markRaw, mutationsSince, nextTick, pauseTracking, queueJob, queuePostFlush, reactive, ref, resetTracking, setErrorHandler, shallowRef, stop, toRaw, track, trigger, unref, warn, watch, watchEffect } from './chunk-FMDHZ5GI.js';
2
+ import './chunk-IJQ2PFXU.js';
3
3
  //# sourceMappingURL=reactivity.js.map
4
4
  //# sourceMappingURL=reactivity.js.map
package/dist/socket.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  /**
6
- * Voodoo.js v0.12.4
6
+ * Voodoo.js v0.13.0
7
7
  * JavaScript feels like magic.
8
8
  * (c) 2026 Voodoo.js contributors. MIT License.
9
9
  */
@@ -137,7 +137,9 @@ function trigger(target2, type, key, _newValue) {
137
137
  if (!isArr) add(depsMap.get(ITERATE_KEY));
138
138
  else if (isIntegerKey(key)) add(depsMap.get("length"));
139
139
  } else if (type === "delete" /* DELETE */) {
140
- if (!isArr) add(depsMap.get(ITERATE_KEY));
140
+ add(depsMap.get(ITERATE_KEY));
141
+ } else if (isArr && isIntegerKey(key)) {
142
+ add(depsMap.get(ITERATE_KEY));
141
143
  } else if (isArr && key === "length") {
142
144
  const newLen = Number(_newValue);
143
145
  depsMap.forEach((dep, k) => {
@@ -150,6 +152,39 @@ function trigger(target2, type, key, _newValue) {
150
152
  else queueJob(e);
151
153
  }
152
154
  }
155
+ function triggerArrayRange(target2, from) {
156
+ const depsMap = targetMap.get(target2);
157
+ if (!depsMap) return;
158
+ const effects = /* @__PURE__ */ new Set();
159
+ const add = (dep) => {
160
+ if (!dep) return;
161
+ for (const e of dep) if (e !== activeEffect) effects.add(e);
162
+ };
163
+ add(depsMap.get("length"));
164
+ add(depsMap.get(ITERATE_KEY));
165
+ if (from >= 0) {
166
+ depsMap.forEach((dep, k) => {
167
+ if (typeof k === "string" && isIntegerKey(k) && Number(k) >= from) add(dep);
168
+ });
169
+ }
170
+ for (const e of effects) {
171
+ if (e.scheduler) e.scheduler();
172
+ else queueJob(e);
173
+ }
174
+ }
175
+ var LOG_LIMIT = 32;
176
+ var mutationLogs = /* @__PURE__ */ new WeakMap();
177
+ function record(target2, type, index, removed, added) {
178
+ let log = mutationLogs.get(target2);
179
+ if (!log) mutationLogs.set(target2, log = { version: 0, ops: [] });
180
+ log.version++;
181
+ if (type === 3 /* RESET */) {
182
+ log.ops.length = 0;
183
+ return;
184
+ }
185
+ log.ops.push({ type, index, removed, added });
186
+ if (log.ops.length > LOG_LIMIT) log.ops.shift();
187
+ }
153
188
  function isIntegerKey(key) {
154
189
  return typeof key === "string" && key !== "NaN" && key[0] !== "-" && String(parseInt(key, 10)) === key;
155
190
  }
@@ -170,14 +205,61 @@ var arrayInstrumentations = /* @__PURE__ */ (() => {
170
205
  return res;
171
206
  };
172
207
  }
173
- for (const key of ["push", "pop", "shift", "unshift", "splice"]) {
208
+ for (const key of ["push", "pop", "shift", "unshift", "splice", "reverse", "sort"]) {
174
209
  inst[key] = function(...args) {
210
+ const raw = toRaw(this);
211
+ const before = raw.length;
212
+ for (let i = 0; i < args.length; i++) args[i] = toRaw(args[i]);
175
213
  pauseTracking();
214
+ let result;
176
215
  try {
177
- return toRaw(this)[key].apply(this, args);
216
+ result = raw[key].apply(raw, args);
178
217
  } finally {
179
218
  resetTracking();
180
219
  }
220
+ const after = raw.length;
221
+ let from = -1;
222
+ if (key === "push") {
223
+ if (args.length) {
224
+ record(raw, 1 /* SPLICE */, before, 0, args.length);
225
+ from = before;
226
+ }
227
+ } else if (key === "unshift") {
228
+ if (args.length) {
229
+ record(raw, 1 /* SPLICE */, 0, 0, args.length);
230
+ from = 0;
231
+ }
232
+ } else if (key === "pop") {
233
+ if (before > 0) {
234
+ record(raw, 1 /* SPLICE */, after, 1, 0);
235
+ from = after;
236
+ }
237
+ } else if (key === "shift") {
238
+ if (before > 0) {
239
+ record(raw, 1 /* SPLICE */, 0, 1, 0);
240
+ from = 0;
241
+ }
242
+ } else if (key === "splice") {
243
+ const removed = result.length;
244
+ const added = args.length > 2 ? args.length - 2 : 0;
245
+ if (removed || added) {
246
+ record(raw, 1 /* SPLICE */, spliceStart(args[0], before), removed, added);
247
+ from = spliceStart(args[0], before);
248
+ }
249
+ } else {
250
+ if (before > 1) {
251
+ record(raw, 3 /* RESET */, 0, before, after);
252
+ from = 0;
253
+ }
254
+ }
255
+ if (from >= 0) triggerArrayRange(raw, from);
256
+ if (key === "pop" || key === "shift") return isObject(result) ? reactive(result) : result;
257
+ if (key === "splice") {
258
+ const out = result;
259
+ for (let i = 0; i < out.length; i++) if (isObject(out[i])) out[i] = reactive(out[i]);
260
+ return out;
261
+ }
262
+ return key === "reverse" || key === "sort" ? this : result;
181
263
  };
182
264
  }
183
265
  return inst;
@@ -185,6 +267,11 @@ var arrayInstrumentations = /* @__PURE__ */ (() => {
185
267
  function isObject(val) {
186
268
  return val !== null && typeof val === "object";
187
269
  }
270
+ function spliceStart(raw, length) {
271
+ const n = Math.trunc(Number(raw)) || 0;
272
+ if (n < 0) return Math.max(length + n, 0);
273
+ return Math.min(n, length);
274
+ }
188
275
  var NON_REACTIVE = /* @__PURE__ */ new Set([
189
276
  "Date",
190
277
  "RegExp",
@@ -208,6 +295,23 @@ function canObserve(value) {
208
295
  if (NON_REACTIVE.has(tag)) return false;
209
296
  return tag === "Object" || tag === "Array" || tag === "Map" || tag === "Set";
210
297
  }
298
+ function recordDirectWrite(target2, key, lengthBefore, hadKey, oldValue, value) {
299
+ if (key === "length") {
300
+ const next = target2.length;
301
+ if (next < lengthBefore) record(target2, 1 /* SPLICE */, next, lengthBefore - next, 0);
302
+ else if (next > lengthBefore) record(target2, 3 /* RESET */, 0, 0, 0);
303
+ return;
304
+ }
305
+ if (!isIntegerKey(key)) return;
306
+ const index = Number(key);
307
+ if (hadKey) {
308
+ if (hasChanged(value, oldValue)) record(target2, 2 /* SET */, index, 1, 1);
309
+ } else if (index === lengthBefore) {
310
+ record(target2, 1 /* SPLICE */, index, 0, 1);
311
+ } else {
312
+ record(target2, 3 /* RESET */, 0, 0, 0);
313
+ }
314
+ }
211
315
  function toRaw(observed) {
212
316
  const raw = observed && observed[RAW];
213
317
  return raw ? toRaw(raw) : observed;
@@ -252,8 +356,11 @@ var baseHandlers = {
252
356
  return true;
253
357
  }
254
358
  const hadKey = Array.isArray(target2) && isIntegerKey(key) ? Number(key) < target2.length : Object.prototype.hasOwnProperty.call(target2, key);
359
+ const isArr = Array.isArray(target2);
360
+ const arrayLength = isArr ? target2.length : 0;
255
361
  const result = Reflect.set(target2, key, value, receiver);
256
362
  if (target2 === toRaw(receiver)) {
363
+ if (isArr) recordDirectWrite(target2, key, arrayLength, hadKey, oldValue, value);
257
364
  if (!hadKey) trigger(target2, "add" /* ADD */, key, value);
258
365
  else if (hasChanged(value, oldValue)) trigger(target2, "set" /* SET */, key, value);
259
366
  }
@@ -262,7 +369,10 @@ var baseHandlers = {
262
369
  deleteProperty(target2, key) {
263
370
  const hadKey = Object.prototype.hasOwnProperty.call(target2, key);
264
371
  const result = Reflect.deleteProperty(target2, key);
265
- if (result && hadKey) trigger(target2, "delete" /* DELETE */, key);
372
+ if (result && hadKey) {
373
+ if (Array.isArray(target2)) record(target2, 3 /* RESET */, 0, 0, 0);
374
+ trigger(target2, "delete" /* DELETE */, key);
375
+ }
266
376
  return result;
267
377
  },
268
378
  has(target2, key) {
package/dist/socket.d.cts CHANGED
@@ -134,7 +134,7 @@ declare function engineURL(base: string, path?: string): string;
134
134
  * WebSocket pay for WebSocket; those not using it keep the file the same size as before.
135
135
  *
136
136
  * ```html
137
- * <script src="https://cdn.jsdelivr.net/npm/voodoojs/dist/voodoo.min.js" defer></script>
137
+ * <script src="https://cdn.jsdelivr.net/npm/voodoojs@0.12.5/dist/voodoo.full.min.js" defer></script>
138
138
  * <script type="module">
139
139
  * import 'https://cdn.jsdelivr.net/npm/voodoojs/dist/socket.js'
140
140
  * </script>
package/dist/socket.d.ts CHANGED
@@ -134,7 +134,7 @@ declare function engineURL(base: string, path?: string): string;
134
134
  * WebSocket pay for WebSocket; those not using it keep the file the same size as before.
135
135
  *
136
136
  * ```html
137
- * <script src="https://cdn.jsdelivr.net/npm/voodoojs/dist/voodoo.min.js" defer></script>
137
+ * <script src="https://cdn.jsdelivr.net/npm/voodoojs@0.12.5/dist/voodoo.full.min.js" defer></script>
138
138
  * <script type="module">
139
139
  * import 'https://cdn.jsdelivr.net/npm/voodoojs/dist/socket.js'
140
140
  * </script>
package/dist/socket.js CHANGED
@@ -1,14 +1,14 @@
1
- import { socketSupported, createSocket, socket } from './chunk-XIMSOXWF.js';
2
- export { ENGINE, SIO, createSocket, decodeEngine, decodeSocketIo, encodeSocketIo, engineURL, resolveSocketURL, socket, socketSupported } from './chunk-XIMSOXWF.js';
3
- import { evaluateIn, readAttr } from './chunk-ELIX2DRQ.js';
4
- import { reactive } from './chunk-FAWOJTRM.js';
5
- import { warnAlias } from './chunk-AR6WDY7K.js';
6
- import { parseDuration } from './chunk-XGZ7SXD3.js';
7
- import { defineDirective, PRIORITY, config } from './chunk-FNTYILLW.js';
8
- import './chunk-7XRFOONN.js';
1
+ import { socketSupported, createSocket, socket } from './chunk-4IJE5BWY.js';
2
+ export { ENGINE, SIO, createSocket, decodeEngine, decodeSocketIo, encodeSocketIo, engineURL, resolveSocketURL, socket, socketSupported } from './chunk-4IJE5BWY.js';
3
+ import { evaluateIn, readAttr } from './chunk-JBUNTP7F.js';
4
+ import { reactive } from './chunk-FMDHZ5GI.js';
5
+ import { warnAlias } from './chunk-IBIZ6OUI.js';
6
+ import { parseDuration } from './chunk-2LGAXVD7.js';
7
+ import { defineDirective, PRIORITY, config } from './chunk-TEVCUTTC.js';
8
+ import './chunk-IJQ2PFXU.js';
9
9
 
10
10
  /**
11
- * Voodoo.js v0.12.4
11
+ * Voodoo.js v0.13.0
12
12
  * JavaScript feels like magic.
13
13
  * (c) 2026 Voodoo.js contributors. MIT License.
14
14
  */
@@ -0,0 +1,5 @@
1
+ export { BASE_TOKENS, ensureTokens, injectStyle } from './chunk-MV73OSCS.js';
2
+ import './chunk-TEVCUTTC.js';
3
+ import './chunk-IJQ2PFXU.js';
4
+ //# sourceMappingURL=style-E22XVZ33.js.map
5
+ //# sourceMappingURL=style-E22XVZ33.js.map
package/dist/utils.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  /**
4
- * Voodoo.js v0.12.4
4
+ * Voodoo.js v0.13.0
5
5
  * JavaScript feels like magic.
6
6
  * (c) 2026 Voodoo.js contributors. MIT License.
7
7
  */
package/dist/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- export { capitalize, chunk, clone, debounce, device, escapeHtml, formatCurrency, formatDate, formatFileSize, formatNumber, formatPercent, get, groupBy, isBrowser, matchesMedia, memoize, merge, once, parseDuration, random, relativeTime, sample, set, setFormatDefaults, sleep, slugify, sortBy, stripTags, throttle, titleCase, truncate, uid, unique, uuid } from './chunk-XGZ7SXD3.js';
2
- import './chunk-7XRFOONN.js';
1
+ export { capitalize, chunk, clone, debounce, device, escapeHtml, formatCurrency, formatDate, formatFileSize, formatNumber, formatPercent, get, groupBy, isBrowser, matchesMedia, memoize, merge, once, parseDuration, random, relativeTime, sample, set, setFormatDefaults, sleep, slugify, sortBy, stripTags, throttle, titleCase, truncate, uid, unique, uuid } from './chunk-2LGAXVD7.js';
2
+ import './chunk-IJQ2PFXU.js';
3
3
  //# sourceMappingURL=utils.js.map
4
4
  //# sourceMappingURL=utils.js.map