voodoojs 0.12.5 → 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 (39) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-D45ZEXUO.js → chunk-2LGAXVD7.js} +4 -4
  3. package/dist/{chunk-L3JNHLTI.js → chunk-4IJE5BWY.js} +5 -5
  4. package/dist/{chunk-PPT7RDKJ.js → chunk-FMDHZ5GI.js} +139 -9
  5. package/dist/{chunk-JB72AX7G.js → chunk-GE4JWATC.js} +5 -5
  6. package/dist/{chunk-TUXGS7XW.js → chunk-H2NGDLMD.js} +363 -76
  7. package/dist/{chunk-YH3IDF6L.js → chunk-IBIZ6OUI.js} +4 -4
  8. package/dist/{chunk-PO6REBDJ.js → chunk-IJQ2PFXU.js} +3 -3
  9. package/dist/{chunk-6QFKV444.js → chunk-JBUNTP7F.js} +7 -7
  10. package/dist/{chunk-IWHK6Y32.js → chunk-MV73OSCS.js} +4 -4
  11. package/dist/{chunk-X3FZPWI6.js → chunk-OIH4BR2H.js} +6 -6
  12. package/dist/{chunk-OH6FIDTW.js → chunk-TEVCUTTC.js} +3 -3
  13. package/dist/essential.cjs +496 -74
  14. package/dist/essential.js +10 -10
  15. package/dist/gpu.cjs +1 -1
  16. package/dist/gpu.js +10 -10
  17. package/dist/http.cjs +1 -1
  18. package/dist/http.js +5 -5
  19. package/dist/index.cjs +544 -122
  20. package/dist/index.js +20 -20
  21. package/dist/reactivity.cjs +138 -5
  22. package/dist/reactivity.d.cts +32 -1
  23. package/dist/reactivity.d.ts +32 -1
  24. package/dist/reactivity.js +2 -2
  25. package/dist/socket.cjs +115 -5
  26. package/dist/socket.d.cts +1 -1
  27. package/dist/socket.d.ts +1 -1
  28. package/dist/socket.js +9 -9
  29. package/dist/style-E22XVZ33.js +5 -0
  30. package/dist/utils.cjs +1 -1
  31. package/dist/utils.js +2 -2
  32. package/dist/voodoo.core.js +560 -72
  33. package/dist/voodoo.core.min.js +17 -17
  34. package/dist/voodoo.full.js +609 -121
  35. package/dist/voodoo.full.min.js +62 -62
  36. package/dist/voodoo.js +563 -75
  37. package/dist/voodoo.min.js +26 -26
  38. package/package.json +1 -1
  39. package/dist/style-YWBYOE6T.js +0 -5
@@ -1,14 +1,14 @@
1
- import { http, HttpError, request } from './chunk-X3FZPWI6.js';
2
- import { stringify, markInitialized, markSkipChildren, destroy, walk, removeQuietly, evaluateIn, addCleanup, markNodeScope, setComponentMounter, closestDirective, magic, readAttr, hasAttr, componentAliases, Scope, hook, queryDirective, parse, evaluate, parseAttribute, originalAttributes, hasDirective, currentHookHost, findScope, VoodooRuntimeError, VoodooSyntaxError, allowedGlobals, clearParseCache, tokenize, getScope, stopObserving, refresh, start, magics, rootScope, isInitialized, restoreAttributes, hasDirectives } from './chunk-6QFKV444.js';
3
- import { ref, reactive, handleError, nextTick, queuePostFlush, warn, watch, EffectScope, computed, effect, toRaw, markRaw, stop, flushSync, effectScope, unref, watchEffect, shallowRef, setErrorHandler } from './chunk-PPT7RDKJ.js';
4
- import { warnDuplicateKey, warn as warn$1, describeElement, warnUnknownComponent, warnAlias, warnRequiredProp } from './chunk-YH3IDF6L.js';
5
- import { parseDuration, debounce, utils_exports, throttle, uid, device, escapeHtml } from './chunk-D45ZEXUO.js';
6
- import { injectStyle, ensureTokens } from './chunk-IWHK6Y32.js';
7
- import { defineDirective, config, PRIORITY, directives, normalizeComponentName, components, usePlugin } from './chunk-OH6FIDTW.js';
8
- import { __publicField } from './chunk-PO6REBDJ.js';
1
+ import { http, HttpError, request } from './chunk-OIH4BR2H.js';
2
+ import { stringify, markInitialized, markSkipChildren, destroy, walk, removeQuietly, evaluateIn, addCleanup, markNodeScope, setComponentMounter, closestDirective, magic, readAttr, hasAttr, componentAliases, Scope, hook, queryDirective, parse, evaluate, parseAttribute, originalAttributes, hasDirective, currentHookHost, findScope, VoodooRuntimeError, VoodooSyntaxError, allowedGlobals, clearParseCache, tokenize, getScope, stopObserving, refresh, start, magics, rootScope, isInitialized, restoreAttributes, hasDirectives } from './chunk-JBUNTP7F.js';
3
+ import { ref, reactive, handleError, toRaw, track, ITERATE_KEY, arrayVersion, nextTick, queuePostFlush, warn, watch, mutationsSince, EffectScope, computed, effect, markRaw, stop, flushSync, effectScope, unref, watchEffect, shallowRef, setErrorHandler } from './chunk-FMDHZ5GI.js';
4
+ import { warn as warn$1, describeElement, warnUnknownComponent, warnAlias, warnRequiredProp, warnDuplicateKey } from './chunk-IBIZ6OUI.js';
5
+ import { parseDuration, debounce, utils_exports, throttle, uid, device, escapeHtml } from './chunk-2LGAXVD7.js';
6
+ import { injectStyle, ensureTokens } from './chunk-MV73OSCS.js';
7
+ import { defineDirective, config, PRIORITY, directives, normalizeComponentName, components, usePlugin } from './chunk-TEVCUTTC.js';
8
+ import { __publicField } from './chunk-IJQ2PFXU.js';
9
9
 
10
10
  /**
11
- * Voodoo.js v0.12.5
11
+ * Voodoo.js v0.13.0
12
12
  * JavaScript feels like magic.
13
13
  * (c) 2026 Voodoo.js contributors. MIT License.
14
14
  */
@@ -1852,7 +1852,7 @@ defineDirective(
1852
1852
  },
1853
1853
  { priority: PRIORITY.IF, terminal: true }
1854
1854
  );
1855
- function renderTemplate(source, anchor, scope, batch) {
1855
+ function renderTemplate(source, anchor, scope) {
1856
1856
  const parent = anchor.parentNode;
1857
1857
  if (!parent) return [];
1858
1858
  const nodes = [];
@@ -1871,19 +1871,61 @@ function renderTemplate(source, anchor, scope, batch) {
1871
1871
  const clone = source.cloneNode(true);
1872
1872
  nodes.push(clone);
1873
1873
  markNodeScope(clone, scope);
1874
- if (batch) {
1875
- batch.fragment.appendChild(clone);
1876
- batch.pending.push([clone, scope]);
1877
- } else {
1878
- parent.insertBefore(clone, anchor);
1879
- walk(clone, scope);
1880
- }
1874
+ parent.insertBefore(clone, anchor);
1875
+ walk(clone, scope);
1881
1876
  }
1882
1877
  return nodes;
1883
1878
  }
1884
1879
  defineDirective("else-if", () => void 0, { priority: PRIORITY.IF, terminal: true });
1885
1880
  defineDirective("else", () => void 0, { priority: PRIORITY.IF, terminal: true });
1886
1881
  var FOR_PATTERN = /^\s*\(?\s*([^)]*?)\s*\)?\s+(?:in|of)\s+(.+?)\s*$/;
1882
+ var KEY_PATH = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/;
1883
+ var NO_BLOCKS = [];
1884
+ function sameStored(stored, incoming) {
1885
+ if (stored === incoming) return true;
1886
+ return incoming !== null && typeof incoming === "object" && stored === toRaw(incoming);
1887
+ }
1888
+ function sameKey(a, b) {
1889
+ return a === b || a !== a && b !== b;
1890
+ }
1891
+ function longestIncreasing(arr) {
1892
+ const length = arr.length;
1893
+ const previous = new Int32Array(length);
1894
+ const tails = [];
1895
+ for (let i = 0; i < length; i++) {
1896
+ const value = arr[i];
1897
+ if (value === 0) continue;
1898
+ if (tails.length === 0) {
1899
+ tails.push(i);
1900
+ continue;
1901
+ }
1902
+ const last = tails[tails.length - 1];
1903
+ if (arr[last] < value) {
1904
+ previous[i] = last;
1905
+ tails.push(i);
1906
+ continue;
1907
+ }
1908
+ let low = 0;
1909
+ let high = tails.length - 1;
1910
+ while (low < high) {
1911
+ const mid = low + high >> 1;
1912
+ if (arr[tails[mid]] < value) low = mid + 1;
1913
+ else high = mid;
1914
+ }
1915
+ if (value < arr[tails[low]]) {
1916
+ if (low > 0) previous[i] = tails[low - 1];
1917
+ tails[low] = i;
1918
+ }
1919
+ }
1920
+ let cursor = tails.length;
1921
+ const out = new Int32Array(cursor);
1922
+ let node = tails[cursor - 1];
1923
+ while (cursor-- > 0) {
1924
+ out[cursor] = node;
1925
+ node = previous[node];
1926
+ }
1927
+ return out;
1928
+ }
1887
1929
  defineDirective(
1888
1930
  "for",
1889
1931
  ({ el, scope, expression, effect: effect2 }) => {
@@ -1908,77 +1950,322 @@ defineDirective(
1908
1950
  template.removeAttribute(`${p2}bind:key`);
1909
1951
  template.removeAttribute(`${p2}key`);
1910
1952
  removeQuietly(el);
1953
+ const isTemplateRow = template.tagName === "TEMPLATE";
1954
+ let keyIsItem = false;
1955
+ let keyIsIndex = false;
1956
+ let keyProp = null;
1957
+ let keyPath = null;
1958
+ if (keyExpression && KEY_PATH.test(keyExpression)) {
1959
+ const parts = keyExpression.split(".");
1960
+ if (parts[0] === itemAlias) {
1961
+ if (parts.length === 1) keyIsItem = true;
1962
+ else if (parts.length === 2) keyProp = parts[1];
1963
+ else keyPath = parts.slice(1);
1964
+ } else if (indexAlias && parts.length === 1 && parts[0] === indexAlias) {
1965
+ keyIsIndex = true;
1966
+ }
1967
+ }
1911
1968
  let blocks = [];
1912
- const clearAll = () => {
1913
- for (const block2 of blocks) {
1914
- for (const node of block2.nodes) {
1915
- destroy(node);
1916
- node.remove();
1969
+ let rows = [];
1970
+ let entries = null;
1971
+ let count = 0;
1972
+ let keyScope = null;
1973
+ let lastSource = null;
1974
+ let lastVersion = 0;
1975
+ const pending = [];
1976
+ const pendingRuns = [];
1977
+ const varsAt = (i) => {
1978
+ if (entries) return entries[i];
1979
+ const vars = { [itemAlias]: rows[i] };
1980
+ if (indexAlias) vars[indexAlias] = i;
1981
+ return vars;
1982
+ };
1983
+ const keyAt = (i) => {
1984
+ if (keyIsIndex) return i;
1985
+ if (!keyExpression) {
1986
+ return i;
1987
+ }
1988
+ const item = entries ? entries[i][itemAlias] : rows[i];
1989
+ if (keyIsItem) return item;
1990
+ if (keyProp !== null) return item == null ? void 0 : item[keyProp];
1991
+ if (keyPath !== null) {
1992
+ let value = item;
1993
+ for (let d = 0; d < keyPath.length; d++) {
1994
+ if (value == null) return void 0;
1995
+ value = value[keyPath[d]];
1917
1996
  }
1997
+ return value;
1998
+ }
1999
+ if (!keyScope) keyScope = scope.child({});
2000
+ keyScope.data = varsAt(i);
2001
+ return evaluateIn(keyExpression, keyScope, ":key");
2002
+ };
2003
+ const syncData = (block2, i) => {
2004
+ const raw = toRaw(block2.data);
2005
+ if (entries) {
2006
+ const vars = entries[i];
2007
+ for (const name in vars) {
2008
+ if (!sameStored(raw[name], vars[name])) {
2009
+ block2.data[name] = vars[name];
2010
+ }
2011
+ }
2012
+ return;
2013
+ }
2014
+ const item = rows[i];
2015
+ if (!sameStored(raw[itemAlias], item)) {
2016
+ block2.data[itemAlias] = item;
2017
+ }
2018
+ if (indexAlias !== void 0 && raw[indexAlias] !== i) {
2019
+ block2.data[indexAlias] = i;
2020
+ }
2021
+ };
2022
+ const buildRange = (from, to, before, out) => {
2023
+ if (from >= to) return;
2024
+ const parent = anchor.parentNode;
2025
+ if (!parent) return;
2026
+ pendingRuns.push(pending.length);
2027
+ if (isTemplateRow) {
2028
+ for (let i = from; i < to; i++) {
2029
+ const childScope = scope.reactiveChild(varsAt(i));
2030
+ const nodes = renderTemplate(template, before, childScope);
2031
+ out.push({ key: keyAt(i), scope: childScope, nodes, data: childScope.data });
2032
+ }
2033
+ return;
2034
+ }
2035
+ const fragment = document.createDocumentFragment();
2036
+ for (let i = from; i < to; i++) {
2037
+ const childScope = scope.reactiveChild(varsAt(i));
2038
+ const clone = template.cloneNode(true);
2039
+ markNodeScope(clone, childScope);
2040
+ fragment.appendChild(clone);
2041
+ pending.push([clone, childScope]);
2042
+ out.push({ key: keyAt(i), scope: childScope, nodes: [clone], data: childScope.data });
2043
+ }
2044
+ parent.insertBefore(fragment, before);
2045
+ };
2046
+ const destroyBlock = (block2) => {
2047
+ const nodes = block2.nodes;
2048
+ for (let j = 0; j < nodes.length; j++) {
2049
+ destroy(nodes[j]);
2050
+ nodes[j].remove();
2051
+ }
2052
+ };
2053
+ const moveBlock = (block2, before) => {
2054
+ const parent = anchor.parentNode;
2055
+ if (!parent) return;
2056
+ const nodes = block2.nodes;
2057
+ if (nodes[nodes.length - 1].nextSibling === before) return;
2058
+ for (let j = 0; j < nodes.length; j++) {
2059
+ parent.insertBefore(nodes[j], before);
2060
+ }
2061
+ };
2062
+ const nodeAfter = (oldIndex) => oldIndex < blocks.length ? blocks[oldIndex].nodes[0] : anchor;
2063
+ const spliceBlocks = (index, remove, added) => {
2064
+ const addCount = added.length;
2065
+ if (remove === 0 && addCount === 0) return;
2066
+ if (blocks.length === 0) {
2067
+ blocks = added;
2068
+ return;
2069
+ }
2070
+ if (addCount === 0) {
2071
+ blocks.splice(index, remove);
2072
+ return;
2073
+ }
2074
+ if (addCount <= 1024) {
2075
+ blocks.splice(index, remove, ...added);
2076
+ return;
1918
2077
  }
2078
+ const out = new Array(blocks.length - remove + addCount);
2079
+ let w = 0;
2080
+ for (let k = 0; k < index; k++) out[w++] = blocks[k];
2081
+ for (let k = 0; k < addCount; k++) out[w++] = added[k];
2082
+ for (let k = index + remove; k < blocks.length; k++) out[w++] = blocks[k];
2083
+ blocks = out;
2084
+ };
2085
+ const flushPending = () => {
2086
+ for (let r = pendingRuns.length - 1; r >= 0; r--) {
2087
+ const start2 = pendingRuns[r];
2088
+ const end = r + 1 < pendingRuns.length ? pendingRuns[r + 1] : pending.length;
2089
+ for (let k = start2; k < end; k++) walk(pending[k][0], pending[k][1]);
2090
+ }
2091
+ pending.length = 0;
2092
+ pendingRuns.length = 0;
2093
+ };
2094
+ let lo = 0;
2095
+ let oldHi = 0;
2096
+ let newHi = 0;
2097
+ const regionFromMutations = (source) => {
2098
+ const ops = mutationsSince(source, lastVersion);
2099
+ if (!ops) return false;
2100
+ const oldLen = blocks.length;
2101
+ lo = 0;
2102
+ oldHi = 0;
2103
+ newHi = 0;
2104
+ let current2 = oldLen;
2105
+ for (let k = 0; k < ops.length; k++) {
2106
+ const op = ops[k];
2107
+ const index = op.index;
2108
+ const removed = op.type === 2 /* SET */ ? 1 : op.removed;
2109
+ const added = op.type === 2 /* SET */ ? 1 : op.added;
2110
+ const end = index + removed;
2111
+ if (k === 0) {
2112
+ lo = index;
2113
+ oldHi = end;
2114
+ newHi = index + added;
2115
+ } else if (end <= newHi) {
2116
+ if (index < lo) lo = index;
2117
+ newHi += added - removed;
2118
+ } else {
2119
+ if (index < lo) lo = index;
2120
+ oldHi = end - newHi + oldHi;
2121
+ newHi = index + added;
2122
+ }
2123
+ if (oldHi < lo) oldHi = lo;
2124
+ if (newHi < lo) newHi = lo;
2125
+ current2 += added - removed;
2126
+ }
2127
+ if (current2 !== count) return false;
2128
+ if (lo > oldHi || lo > newHi) return false;
2129
+ if (oldHi > oldLen || newHi > count) return false;
2130
+ if (indexAlias !== void 0 && oldHi - newHi !== 0) {
2131
+ for (let i = newHi; i < count; i++) syncData(blocks[i - newHi + oldHi], i);
2132
+ }
2133
+ return true;
2134
+ };
2135
+ const regionFromScan = () => {
2136
+ const oldLen = blocks.length;
2137
+ const newLen = count;
2138
+ let i = 0;
2139
+ const shared = oldLen < newLen ? oldLen : newLen;
2140
+ while (i < shared) {
2141
+ const block2 = blocks[i];
2142
+ if (!sameKey(block2.key, keyAt(i))) break;
2143
+ syncData(block2, i);
2144
+ i++;
2145
+ }
2146
+ let oe = oldLen - 1;
2147
+ let ne = newLen - 1;
2148
+ while (oe >= i && ne >= i) {
2149
+ const block2 = blocks[oe];
2150
+ if (!sameKey(block2.key, keyAt(ne))) break;
2151
+ syncData(block2, ne);
2152
+ oe--;
2153
+ ne--;
2154
+ }
2155
+ lo = i;
2156
+ oldHi = oe + 1;
2157
+ newHi = ne + 1;
2158
+ };
2159
+ const reconcileRegion = () => {
2160
+ const toPatch = newHi - lo;
2161
+ if (lo >= oldHi) {
2162
+ if (toPatch > 0) {
2163
+ const created = [];
2164
+ buildRange(lo, newHi, nodeAfter(lo), created);
2165
+ spliceBlocks(lo, 0, created);
2166
+ }
2167
+ return;
2168
+ }
2169
+ if (toPatch === 0) {
2170
+ for (let j = lo; j < oldHi; j++) destroyBlock(blocks[j]);
2171
+ spliceBlocks(lo, oldHi - lo, NO_BLOCKS);
2172
+ return;
2173
+ }
2174
+ const keyToNew = /* @__PURE__ */ new Map();
2175
+ for (let n = lo; n < newHi; n++) {
2176
+ const key = keyAt(n);
2177
+ if (keyExpression && keyToNew.has(key)) warnDuplicateKey(el, key, expression);
2178
+ keyToNew.set(key, n);
2179
+ }
2180
+ const oldOfNew = new Int32Array(toPatch);
2181
+ const reused = new Array(toPatch);
2182
+ let matched = 0;
2183
+ let moved = false;
2184
+ let highestSoFar = 0;
2185
+ for (let o = lo; o < oldHi; o++) {
2186
+ const block2 = blocks[o];
2187
+ const target = matched >= toPatch ? void 0 : keyToNew.get(block2.key);
2188
+ if (target === void 0 || reused[target - lo] !== void 0) {
2189
+ destroyBlock(block2);
2190
+ continue;
2191
+ }
2192
+ oldOfNew[target - lo] = o + 1;
2193
+ reused[target - lo] = block2;
2194
+ if (target >= highestSoFar) highestSoFar = target;
2195
+ else moved = true;
2196
+ syncData(block2, target);
2197
+ matched++;
2198
+ }
2199
+ const stay = moved ? longestIncreasing(oldOfNew) : null;
2200
+ let s = stay ? stay.length - 1 : -1;
2201
+ const region = new Array(toPatch);
2202
+ let before = nodeAfter(oldHi);
2203
+ let runEnd = -1;
2204
+ for (let n = toPatch - 1; n >= 0; n--) {
2205
+ const newIndex = lo + n;
2206
+ const block2 = reused[n];
2207
+ if (block2 === void 0) {
2208
+ if (runEnd < 0) runEnd = newIndex + 1;
2209
+ continue;
2210
+ }
2211
+ if (runEnd >= 0) {
2212
+ const created = [];
2213
+ buildRange(newIndex + 1, runEnd, before, created);
2214
+ for (let c = 0; c < created.length; c++) region[n + 1 + c] = created[c];
2215
+ if (created.length) before = created[0].nodes[0];
2216
+ runEnd = -1;
2217
+ }
2218
+ region[n] = block2;
2219
+ if (moved && (s < 0 || n !== stay[s])) moveBlock(block2, before);
2220
+ else if (moved) s--;
2221
+ before = block2.nodes[0];
2222
+ }
2223
+ if (runEnd >= 0) {
2224
+ const created = [];
2225
+ buildRange(lo, runEnd, before, created);
2226
+ for (let c = 0; c < created.length; c++) region[c] = created[c];
2227
+ }
2228
+ spliceBlocks(lo, oldHi - lo, region);
2229
+ };
2230
+ const clearAll = () => {
2231
+ for (const block2 of blocks) destroyBlock(block2);
1919
2232
  blocks = [];
2233
+ lastSource = null;
2234
+ lastVersion = 0;
1920
2235
  };
1921
2236
  addCleanup(anchor, clearAll);
1922
2237
  effect2(() => {
1923
2238
  const source = evaluateIn(sourceExpression, scope, "v-for");
1924
- const entries = normalizeSource(source, itemAlias, indexAlias, thirdAlias);
1925
- const previous = /* @__PURE__ */ new Map();
1926
- for (const block2 of blocks) previous.set(block2.key, block2);
1927
- const next = [];
1928
- const used = /* @__PURE__ */ new Set();
1929
- const batch = {
1930
- fragment: document.createDocumentFragment(),
1931
- pending: []
1932
- };
1933
- entries.forEach((vars, index) => {
1934
- const key = keyExpression ? evaluateIn(keyExpression, scope.child(vars), ":key") : `__index_${index}`;
1935
- if (keyExpression && used.has(key)) warnDuplicateKey(el, key, expression);
1936
- const existing = previous.get(key);
1937
- if (existing && !used.has(key)) {
1938
- used.add(key);
1939
- for (const [name, value] of Object.entries(vars)) existing.data[name] = value;
1940
- next.push(existing);
1941
- return;
2239
+ const raw = toRaw(source);
2240
+ let fromMutations = false;
2241
+ if (Array.isArray(raw)) {
2242
+ track(raw, "length");
2243
+ track(raw, ITERATE_KEY);
2244
+ rows = raw;
2245
+ entries = null;
2246
+ count = raw.length;
2247
+ const version3 = arrayVersion(raw);
2248
+ if (raw === lastSource && keyExpression && !keyIsIndex) {
2249
+ fromMutations = regionFromMutations(raw);
1942
2250
  }
1943
- const childScope = scope.reactiveChild(vars);
1944
- const nodes = renderTemplate(template, anchor, childScope, batch);
1945
- used.add(key);
1946
- next.push({ key, scope: childScope, nodes, data: childScope.data });
1947
- });
1948
- if (batch.fragment.firstChild) anchor.parentNode?.insertBefore(batch.fragment, anchor);
1949
- for (const [node, rowScope] of batch.pending) walk(node, rowScope);
1950
- const reused = new Set(next);
1951
- for (const block2 of blocks) {
1952
- if (used.has(block2.key) && reused.has(block2)) continue;
1953
- for (const node of block2.nodes) {
1954
- destroy(node);
1955
- node.remove();
1956
- }
1957
- }
1958
- let cursor = anchor;
1959
- for (let i = next.length - 1; i >= 0; i--) {
1960
- const block2 = next[i];
1961
- const last = block2.nodes[block2.nodes.length - 1];
1962
- if (last && last.nextSibling !== cursor) {
1963
- for (const node of block2.nodes) anchor.parentNode?.insertBefore(node, cursor);
1964
- }
1965
- cursor = block2.nodes[0] ?? cursor;
2251
+ lastSource = raw;
2252
+ lastVersion = version3;
2253
+ } else {
2254
+ entries = normalizeSource(source, itemAlias, indexAlias, thirdAlias);
2255
+ rows = entries;
2256
+ count = entries.length;
2257
+ lastSource = null;
2258
+ lastVersion = 0;
1966
2259
  }
1967
- blocks = next;
2260
+ if (!fromMutations) regionFromScan();
2261
+ reconcileRegion();
2262
+ flushPending();
1968
2263
  });
1969
2264
  },
1970
2265
  { priority: PRIORITY.FOR, terminal: true }
1971
2266
  );
1972
2267
  function normalizeSource(source, itemAlias, indexAlias, thirdAlias) {
1973
2268
  const out = [];
1974
- if (Array.isArray(source)) {
1975
- source.forEach((item, index) => {
1976
- const vars = { [itemAlias]: item };
1977
- if (indexAlias) vars[indexAlias] = index;
1978
- out.push(vars);
1979
- });
1980
- return out;
1981
- }
1982
2269
  if (typeof source === "number") {
1983
2270
  for (let i = 1; i <= source; i++) {
1984
2271
  const vars = { [itemAlias]: i };
@@ -2811,7 +3098,7 @@ var jsonStylesInjected = false;
2811
3098
  function injectJSONStyles() {
2812
3099
  if (jsonStylesInjected) return;
2813
3100
  jsonStylesInjected = true;
2814
- void import('./style-YWBYOE6T.js').then(({ injectStyle: injectStyle2 }) => {
3101
+ void import('./style-E22XVZ33.js').then(({ injectStyle: injectStyle2 }) => {
2815
3102
  injectStyle2(
2816
3103
  "json-render",
2817
3104
  `
@@ -3099,7 +3386,7 @@ function data(values) {
3099
3386
  Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
3100
3387
  return rootScope.data;
3101
3388
  }
3102
- var version2 = "0.12.5";
3389
+ var version2 = "0.13.0";
3103
3390
  var core = {
3104
3391
  // Utilities first: Voodoo's own names can override.
3105
3392
  ...utils_exports,
@@ -10444,5 +10731,5 @@ defineDirective(
10444
10731
  );
10445
10732
 
10446
10733
  export { VoodooCollection, alert, allStores, applyMask, cache, clearErrors, clipboard, confirm, cookie, core, createApp, createResource, defineComponent, dialog, efeitos, ensurePalette, enter, fadeIn, fadeOut, fromHtml, hotkey, installHooks, instances, leave, mask, masks, messages, modal, mountComponent, network, palette, prompt, query, ready, ready2, registerMask, removeStore, screen, serializeForm, session, showFieldError, showFormErrors, slideDown, slideUp, sound, storage, store, storeNames, theme, toast, unmask, url, useContext, useEffect, useMemo, useRef, useState, validate, validator, viewTransition, whenElement, whenReady };
10447
- //# sourceMappingURL=chunk-TUXGS7XW.js.map
10448
- //# sourceMappingURL=chunk-TUXGS7XW.js.map
10734
+ //# sourceMappingURL=chunk-H2NGDLMD.js.map
10735
+ //# sourceMappingURL=chunk-H2NGDLMD.js.map
@@ -1,7 +1,7 @@
1
- import { config } from './chunk-OH6FIDTW.js';
1
+ import { config } from './chunk-TEVCUTTC.js';
2
2
 
3
3
  /**
4
- * Voodoo.js v0.12.5
4
+ * Voodoo.js v0.13.0
5
5
  * JavaScript feels like magic.
6
6
  * (c) 2026 Voodoo.js contributors. MIT License.
7
7
  */
@@ -78,5 +78,5 @@ function warnAlias(alias, canonical) {
78
78
  }
79
79
 
80
80
  export { describeElement, inDevelopment, warn, warnAlias, warnDuplicateKey, warnInvalidExpression, warnOnce, warnRequiredProp, warnUnknownComponent, warnUnknownDirective };
81
- //# sourceMappingURL=chunk-YH3IDF6L.js.map
82
- //# sourceMappingURL=chunk-YH3IDF6L.js.map
81
+ //# sourceMappingURL=chunk-IBIZ6OUI.js.map
82
+ //# sourceMappingURL=chunk-IBIZ6OUI.js.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Voodoo.js v0.12.5
2
+ * Voodoo.js v0.13.0
3
3
  * JavaScript feels like magic.
4
4
  * (c) 2026 Voodoo.js contributors. MIT License.
5
5
  */
@@ -12,5 +12,5 @@ var __export = (target, all) => {
12
12
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
13
13
 
14
14
  export { __export, __publicField };
15
- //# sourceMappingURL=chunk-PO6REBDJ.js.map
16
- //# sourceMappingURL=chunk-PO6REBDJ.js.map
15
+ //# sourceMappingURL=chunk-IJQ2PFXU.js.map
16
+ //# sourceMappingURL=chunk-IJQ2PFXU.js.map
@@ -1,10 +1,10 @@
1
- import { reactive, handleError, EffectScope, effect } from './chunk-PPT7RDKJ.js';
2
- import { inDevelopment, warnInvalidExpression, warnUnknownDirective } from './chunk-YH3IDF6L.js';
3
- import { config, directives, components } from './chunk-OH6FIDTW.js';
4
- import { __publicField } from './chunk-PO6REBDJ.js';
1
+ import { reactive, handleError, EffectScope, effect } from './chunk-FMDHZ5GI.js';
2
+ import { inDevelopment, warnInvalidExpression, warnUnknownDirective } from './chunk-IBIZ6OUI.js';
3
+ import { config, directives, components } from './chunk-TEVCUTTC.js';
4
+ import { __publicField } from './chunk-IJQ2PFXU.js';
5
5
 
6
6
  /**
7
- * Voodoo.js v0.12.5
7
+ * Voodoo.js v0.13.0
8
8
  * JavaScript feels like magic.
9
9
  * (c) 2026 Voodoo.js contributors. MIT License.
10
10
  */
@@ -2214,5 +2214,5 @@ function refresh(root) {
2214
2214
  }
2215
2215
 
2216
2216
  export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, closestDirective, collectDirectives, componentAliases, currentHookHost, destroy, evaluate, evaluateIn, findScope, getEffectScopes, getScope, hadDirectives, hasAttr, hasDirective, hasDirectives, hook, hooks, isInitialized, magic, magics, markInitialized, markNodeScope, markSkipChildren, onStart, originalAttributes, parse, parseAttribute, queryDirective, readAttr, refresh, removeQuietly, restoreAttributes, rootScope, setComponentMounter, start, stopObserving, stringify, tokenize, unwrap, walk };
2217
- //# sourceMappingURL=chunk-6QFKV444.js.map
2218
- //# sourceMappingURL=chunk-6QFKV444.js.map
2217
+ //# sourceMappingURL=chunk-JBUNTP7F.js.map
2218
+ //# sourceMappingURL=chunk-JBUNTP7F.js.map
@@ -1,7 +1,7 @@
1
- import { config } from './chunk-OH6FIDTW.js';
1
+ import { config } from './chunk-TEVCUTTC.js';
2
2
 
3
3
  /**
4
- * Voodoo.js v0.12.5
4
+ * Voodoo.js v0.13.0
5
5
  * JavaScript feels like magic.
6
6
  * (c) 2026 Voodoo.js contributors. MIT License.
7
7
  */
@@ -68,5 +68,5 @@ function ensureTokens() {
68
68
  }
69
69
 
70
70
  export { BASE_TOKENS, ensureTokens, injectStyle };
71
- //# sourceMappingURL=chunk-IWHK6Y32.js.map
72
- //# sourceMappingURL=chunk-IWHK6Y32.js.map
71
+ //# sourceMappingURL=chunk-MV73OSCS.js.map
72
+ //# sourceMappingURL=chunk-MV73OSCS.js.map
@@ -1,9 +1,9 @@
1
- import { warnOnce } from './chunk-YH3IDF6L.js';
2
- import { parseDuration } from './chunk-D45ZEXUO.js';
3
- import { __publicField } from './chunk-PO6REBDJ.js';
1
+ import { warnOnce } from './chunk-IBIZ6OUI.js';
2
+ import { parseDuration } from './chunk-2LGAXVD7.js';
3
+ import { __publicField } from './chunk-IJQ2PFXU.js';
4
4
 
5
5
  /**
6
- * Voodoo.js v0.12.5
6
+ * Voodoo.js v0.13.0
7
7
  * JavaScript feels like magic.
8
8
  * (c) 2026 Voodoo.js contributors. MIT License.
9
9
  */
@@ -444,5 +444,5 @@ var http = {
444
444
  };
445
445
 
446
446
  export { HttpError, clearCache, flushOfflineQueue, http, request };
447
- //# sourceMappingURL=chunk-X3FZPWI6.js.map
448
- //# sourceMappingURL=chunk-X3FZPWI6.js.map
447
+ //# sourceMappingURL=chunk-OIH4BR2H.js.map
448
+ //# sourceMappingURL=chunk-OIH4BR2H.js.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Voodoo.js v0.12.5
2
+ * Voodoo.js v0.13.0
3
3
  * JavaScript feels like magic.
4
4
  * (c) 2026 Voodoo.js contributors. MIT License.
5
5
  */
@@ -61,5 +61,5 @@ function usePlugin(V, plugin, options) {
61
61
  }
62
62
 
63
63
  export { PRIORITY, components, config, defineDirective, directives, normalizeComponentName, usePlugin };
64
- //# sourceMappingURL=chunk-OH6FIDTW.js.map
65
- //# sourceMappingURL=chunk-OH6FIDTW.js.map
64
+ //# sourceMappingURL=chunk-TEVCUTTC.js.map
65
+ //# sourceMappingURL=chunk-TEVCUTTC.js.map