voodoojs 0.11.2 → 0.12.1
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.
- package/README.md +1 -1
- package/dist/{chunk-H2ZUEQWV.js → chunk-4M4ZXHNY.js} +84 -19
- package/dist/{chunk-UV5PMS7P.js → chunk-72PMUUMT.js} +4 -4
- package/dist/{chunk-KQYSJHZR.js → chunk-AFMCDNYS.js} +5 -5
- package/dist/{chunk-DJJB35SR.js → chunk-D7675IJG.js} +6 -6
- package/dist/{chunk-IS3DR2KY.js → chunk-GXPNWCGE.js} +3 -3
- package/dist/{chunk-DCE5WIGA.js → chunk-HNM3CTBD.js} +5 -5
- package/dist/{chunk-IGZSDZKU.js → chunk-KN7NAKBL.js} +4 -4
- package/dist/{chunk-WJP3YGUI.js → chunk-LLNDLLKV.js} +4 -4
- package/dist/{chunk-V3O3WOZH.js → chunk-NP66JM2P.js} +4 -4
- package/dist/{chunk-AH2VXDZD.js → chunk-RDHYPGH6.js} +187 -18
- package/dist/{chunk-NFDXVIII.js → chunk-T5ION5NG.js} +3 -3
- package/dist/essential.cjs +263 -25
- package/dist/essential.d.cts +1 -1
- package/dist/essential.d.ts +1 -1
- package/dist/essential.js +10 -10
- package/dist/gpu.cjs +1 -1
- package/dist/gpu.js +10 -10
- package/dist/http.cjs +1 -1
- package/dist/http.js +5 -5
- package/dist/index.cjs +273 -27
- package/dist/index.d.cts +88 -4
- package/dist/index.d.ts +88 -4
- package/dist/index.js +20 -20
- package/dist/{query-Cf-7iibE.d.ts → query-DzHfm8Kg.d.ts} +40 -29
- package/dist/{query-DiQAS73Q.d.cts → query-XooOh4vB.d.cts} +40 -29
- package/dist/reactivity.cjs +1 -1
- package/dist/reactivity.js +2 -2
- package/dist/socket.cjs +1 -1
- package/dist/socket.js +9 -9
- package/dist/style-GR4X6O7I.js +5 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +2 -2
- package/dist/voodoo.core.js +242 -24
- package/dist/voodoo.core.min.js +17 -17
- package/dist/voodoo.full.js +266 -27
- package/dist/voodoo.full.min.js +57 -53
- package/dist/voodoo.js +264 -25
- package/dist/voodoo.min.js +29 -25
- package/package.json +1 -1
- package/dist/style-4X62SABN.js +0 -5
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ npm install voodoojs
|
|
|
22
22
|
Or drop it into a page, with nothing else:
|
|
23
23
|
|
|
24
24
|
```html
|
|
25
|
-
<script src="https://cdn.jsdelivr.net/npm/voodoojs@0.
|
|
25
|
+
<script src="https://cdn.jsdelivr.net/npm/voodoojs@0.12.1/dist/voodoo.full.min.js" defer></script>
|
|
26
26
|
|
|
27
27
|
<div v-data="{ count: 0 }">
|
|
28
28
|
<button @click="count++">Clicked { count } times</button>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { reactive, handleError, EffectScope, effect } from './chunk-
|
|
2
|
-
import { inDevelopment, warnInvalidExpression, warnUnknownDirective } from './chunk-
|
|
3
|
-
import { config, directives, components } from './chunk-
|
|
4
|
-
import { __publicField } from './chunk-
|
|
1
|
+
import { reactive, handleError, EffectScope, effect } from './chunk-LLNDLLKV.js';
|
|
2
|
+
import { inDevelopment, warnInvalidExpression, warnUnknownDirective } from './chunk-72PMUUMT.js';
|
|
3
|
+
import { config, directives, components } from './chunk-T5ION5NG.js';
|
|
4
|
+
import { __publicField } from './chunk-GXPNWCGE.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Voodoo.js v0.
|
|
7
|
+
* Voodoo.js v0.12.1
|
|
8
8
|
* JavaScript feels like magic.
|
|
9
9
|
* (c) 2026 Voodoo.js contributors. MIT License.
|
|
10
10
|
*/
|
|
@@ -1417,6 +1417,10 @@ var magics = /* @__PURE__ */ new Map();
|
|
|
1417
1417
|
function magic(name, getter) {
|
|
1418
1418
|
magics.set(name.startsWith("$") ? name : `$${name}`, getter);
|
|
1419
1419
|
}
|
|
1420
|
+
var hooks = /* @__PURE__ */ new Map();
|
|
1421
|
+
function hook(name, getter) {
|
|
1422
|
+
hooks.set(name, getter);
|
|
1423
|
+
}
|
|
1420
1424
|
var Scope = class _Scope {
|
|
1421
1425
|
// Assignment order matches the order the fields were declared in before, so
|
|
1422
1426
|
// the properties are created in the same sequence they always were.
|
|
@@ -1472,7 +1476,10 @@ var Scope = class _Scope {
|
|
|
1472
1476
|
s = s.parent;
|
|
1473
1477
|
}
|
|
1474
1478
|
if (name.charCodeAt(0) === 36 && magics.has(name)) {
|
|
1475
|
-
return this.magicContainer(name);
|
|
1479
|
+
return this.magicContainer(name, magics);
|
|
1480
|
+
}
|
|
1481
|
+
if (hooks.has(name)) {
|
|
1482
|
+
return this.magicContainer(name, hooks);
|
|
1476
1483
|
}
|
|
1477
1484
|
return void 0;
|
|
1478
1485
|
}
|
|
@@ -1501,11 +1508,11 @@ var Scope = class _Scope {
|
|
|
1501
1508
|
reactiveChild(vars, el = null) {
|
|
1502
1509
|
return new _Scope(reactive(vars), this, el ?? this.el);
|
|
1503
1510
|
}
|
|
1504
|
-
magicContainer(name) {
|
|
1511
|
+
magicContainer(name, registry) {
|
|
1505
1512
|
if (!this.magicCache) this.magicCache = /* @__PURE__ */ new Map();
|
|
1506
1513
|
const cached = this.magicCache.get(name);
|
|
1507
1514
|
if (cached) return cached;
|
|
1508
|
-
const getter =
|
|
1515
|
+
const getter = registry.get(name);
|
|
1509
1516
|
const scope = this;
|
|
1510
1517
|
const container = {};
|
|
1511
1518
|
Object.defineProperty(container, name, {
|
|
@@ -1826,7 +1833,16 @@ function runDirective(el, attr, scope) {
|
|
|
1826
1833
|
},
|
|
1827
1834
|
effect(fn) {
|
|
1828
1835
|
const owner = ownerScope();
|
|
1829
|
-
|
|
1836
|
+
const hosted = () => {
|
|
1837
|
+
const previous = hookHost;
|
|
1838
|
+
hookHost = el;
|
|
1839
|
+
try {
|
|
1840
|
+
fn();
|
|
1841
|
+
} finally {
|
|
1842
|
+
hookHost = previous;
|
|
1843
|
+
}
|
|
1844
|
+
};
|
|
1845
|
+
owner.run(() => effect(hosted, { scope: owner }));
|
|
1830
1846
|
},
|
|
1831
1847
|
cleanup(fn) {
|
|
1832
1848
|
addCleanup(el, fn);
|
|
@@ -1874,6 +1890,56 @@ function walk(node, scope) {
|
|
|
1874
1890
|
return;
|
|
1875
1891
|
}
|
|
1876
1892
|
initialized.add(el);
|
|
1893
|
+
const previousHost = hookHost;
|
|
1894
|
+
hookHost = el;
|
|
1895
|
+
try {
|
|
1896
|
+
walkElementDirectives(el, attrs, tagComponent, current);
|
|
1897
|
+
} finally {
|
|
1898
|
+
hookHost = previousHost;
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
var hookHost = null;
|
|
1902
|
+
function currentHookHost() {
|
|
1903
|
+
return hookHost;
|
|
1904
|
+
}
|
|
1905
|
+
function createDataScope(expression, parent, el) {
|
|
1906
|
+
let ast = null;
|
|
1907
|
+
try {
|
|
1908
|
+
ast = parse(expression);
|
|
1909
|
+
} catch {
|
|
1910
|
+
ast = null;
|
|
1911
|
+
}
|
|
1912
|
+
const plain = ast && ast.t === "obj" && ast.props.every(
|
|
1913
|
+
(p) => !p.spread && !p.keyExpr
|
|
1914
|
+
);
|
|
1915
|
+
if (!plain) {
|
|
1916
|
+
const raw = evaluateIn(expression, parent, "v-data");
|
|
1917
|
+
return parent.reactiveChild(raw && typeof raw === "object" ? raw : {}, el);
|
|
1918
|
+
}
|
|
1919
|
+
const scope = parent.reactiveChild({}, el);
|
|
1920
|
+
const props = ast.props;
|
|
1921
|
+
for (const prop of props) {
|
|
1922
|
+
if (prop.key === null) continue;
|
|
1923
|
+
try {
|
|
1924
|
+
if (prop.getter) {
|
|
1925
|
+
const compute = evaluate(prop.value, scope);
|
|
1926
|
+
Object.defineProperty(scope.data, prop.key, {
|
|
1927
|
+
enumerable: true,
|
|
1928
|
+
configurable: true,
|
|
1929
|
+
get: () => compute.call(scope.data)
|
|
1930
|
+
});
|
|
1931
|
+
} else {
|
|
1932
|
+
scope.data[prop.key] = evaluate(prop.value, scope);
|
|
1933
|
+
}
|
|
1934
|
+
} catch (err) {
|
|
1935
|
+
if (inDevelopment()) warnInvalidExpression(el, expression, expression, err);
|
|
1936
|
+
else handleError(err, "v-data");
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
return scope;
|
|
1940
|
+
}
|
|
1941
|
+
function walkElementDirectives(el, attrs, tagComponent, scope) {
|
|
1942
|
+
let current = scope;
|
|
1877
1943
|
for (const attr of attrs) {
|
|
1878
1944
|
const def = directives.get(attr.name);
|
|
1879
1945
|
if (def?.terminal) {
|
|
@@ -1893,11 +1959,10 @@ function walk(node, scope) {
|
|
|
1893
1959
|
nodeScopes.set(el, current);
|
|
1894
1960
|
}
|
|
1895
1961
|
} else if (dataAttr || componentAttr) {
|
|
1896
|
-
|
|
1897
|
-
current = current.reactiveChild(raw && typeof raw === "object" ? raw : {}, el);
|
|
1962
|
+
current = createDataScope(dataAttr ? dataAttr.expression || "{}" : "{}", current, el);
|
|
1898
1963
|
nodeScopes.set(el, current);
|
|
1899
1964
|
}
|
|
1900
|
-
const attributeScope = mountedComponent ?
|
|
1965
|
+
const attributeScope = mountedComponent ? scope : current;
|
|
1901
1966
|
for (const attr of attrs) {
|
|
1902
1967
|
if (attr.name === "data" || attr.name === "component") continue;
|
|
1903
1968
|
runDirective(el, attr, attributeScope);
|
|
@@ -2052,13 +2117,13 @@ var componentAliases = /* @__PURE__ */ new Map();
|
|
|
2052
2117
|
var started = false;
|
|
2053
2118
|
var observer = null;
|
|
2054
2119
|
var startHooks = [];
|
|
2055
|
-
function onStart(
|
|
2056
|
-
startHooks.push(
|
|
2120
|
+
function onStart(hook2) {
|
|
2121
|
+
startHooks.push(hook2);
|
|
2057
2122
|
}
|
|
2058
2123
|
function runPhase(target, after) {
|
|
2059
|
-
for (const
|
|
2124
|
+
for (const hook2 of startHooks) {
|
|
2060
2125
|
try {
|
|
2061
|
-
|
|
2126
|
+
hook2(target, after);
|
|
2062
2127
|
} catch (error) {
|
|
2063
2128
|
console.error("[Voodoo] a start hook failed", error);
|
|
2064
2129
|
}
|
|
@@ -2109,6 +2174,6 @@ function refresh(root) {
|
|
|
2109
2174
|
walk(root ?? document.body, root ? findScope(root.parentNode) : rootScope);
|
|
2110
2175
|
}
|
|
2111
2176
|
|
|
2112
|
-
export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, closestDirective, collectDirectives, componentAliases, destroy, evaluate, evaluateIn, findScope, getEffectScopes, getScope, hadDirectives, hasAttr, hasDirective, hasDirectives, isInitialized, magic, magics, markInitialized, markNodeScope, markSkipChildren, onStart, originalAttributes, parse, parseAttribute, queryDirective, readAttr, refresh, removeQuietly, restoreAttributes, rootScope, setComponentMounter, start, stopObserving, stringify, tokenize, unwrap, walk };
|
|
2113
|
-
//# sourceMappingURL=chunk-
|
|
2114
|
-
//# sourceMappingURL=chunk-
|
|
2177
|
+
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 };
|
|
2178
|
+
//# sourceMappingURL=chunk-4M4ZXHNY.js.map
|
|
2179
|
+
//# sourceMappingURL=chunk-4M4ZXHNY.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { config } from './chunk-
|
|
1
|
+
import { config } from './chunk-T5ION5NG.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Voodoo.js v0.
|
|
4
|
+
* Voodoo.js v0.12.1
|
|
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-
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-72PMUUMT.js.map
|
|
82
|
+
//# sourceMappingURL=chunk-72PMUUMT.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { handleError } from './chunk-
|
|
2
|
-
import { warn } from './chunk-
|
|
1
|
+
import { handleError } from './chunk-LLNDLLKV.js';
|
|
2
|
+
import { warn } from './chunk-72PMUUMT.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Voodoo.js v0.
|
|
5
|
+
* Voodoo.js v0.12.1
|
|
6
6
|
* JavaScript feels like magic.
|
|
7
7
|
* (c) 2026 Voodoo.js contributors. MIT License.
|
|
8
8
|
*/
|
|
@@ -1192,5 +1192,5 @@ var gpu = {
|
|
|
1192
1192
|
};
|
|
1193
1193
|
|
|
1194
1194
|
export { clock, compute, describeWgslType, destroy, effect, findEntry, flattenValue, frame, frameLoop, gpu, inferStruct, init, packStruct, reflectBindings, reflectEntries, reflectStructs, reflectWgsl, resetShared, shared, splitTopLevel, stripWgslComments, supported, surface, target, uniforms, writeField, writeStruct };
|
|
1195
|
-
//# sourceMappingURL=chunk-
|
|
1196
|
-
//# sourceMappingURL=chunk-
|
|
1195
|
+
//# sourceMappingURL=chunk-AFMCDNYS.js.map
|
|
1196
|
+
//# sourceMappingURL=chunk-AFMCDNYS.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { warnOnce } from './chunk-
|
|
2
|
-
import { parseDuration } from './chunk-
|
|
3
|
-
import { __publicField } from './chunk-
|
|
1
|
+
import { warnOnce } from './chunk-72PMUUMT.js';
|
|
2
|
+
import { parseDuration } from './chunk-KN7NAKBL.js';
|
|
3
|
+
import { __publicField } from './chunk-GXPNWCGE.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Voodoo.js v0.
|
|
6
|
+
* Voodoo.js v0.12.1
|
|
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-
|
|
448
|
-
//# sourceMappingURL=chunk-
|
|
447
|
+
//# sourceMappingURL=chunk-D7675IJG.js.map
|
|
448
|
+
//# sourceMappingURL=chunk-D7675IJG.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Voodoo.js v0.
|
|
2
|
+
* Voodoo.js v0.12.1
|
|
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-
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-GXPNWCGE.js.map
|
|
16
|
+
//# sourceMappingURL=chunk-GXPNWCGE.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { reactive } from './chunk-
|
|
2
|
-
import { warnOnce } from './chunk-
|
|
1
|
+
import { reactive } from './chunk-LLNDLLKV.js';
|
|
2
|
+
import { warnOnce } from './chunk-72PMUUMT.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Voodoo.js v0.
|
|
5
|
+
* Voodoo.js v0.12.1
|
|
6
6
|
* JavaScript feels like magic.
|
|
7
7
|
* (c) 2026 Voodoo.js contributors. MIT License.
|
|
8
8
|
*/
|
|
@@ -942,5 +942,5 @@ Object.defineProperty(factory, "open", {
|
|
|
942
942
|
var socket = factory;
|
|
943
943
|
|
|
944
944
|
export { ENGINE, SIO, createSocket, decodeEngine, decodeSocketIo, devtoolsBus, encodeSocketIo, engineURL, resolveSocketURL, socket, socketSupported };
|
|
945
|
-
//# sourceMappingURL=chunk-
|
|
946
|
-
//# sourceMappingURL=chunk-
|
|
945
|
+
//# sourceMappingURL=chunk-HNM3CTBD.js.map
|
|
946
|
+
//# sourceMappingURL=chunk-HNM3CTBD.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __export } from './chunk-
|
|
1
|
+
import { __export } from './chunk-GXPNWCGE.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Voodoo.js v0.
|
|
4
|
+
* Voodoo.js v0.12.1
|
|
5
5
|
* JavaScript feels like magic.
|
|
6
6
|
* (c) 2026 Voodoo.js contributors. MIT License.
|
|
7
7
|
*/
|
|
@@ -397,5 +397,5 @@ var device = {
|
|
|
397
397
|
};
|
|
398
398
|
|
|
399
399
|
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, utils_exports, uuid };
|
|
400
|
-
//# sourceMappingURL=chunk-
|
|
401
|
-
//# sourceMappingURL=chunk-
|
|
400
|
+
//# sourceMappingURL=chunk-KN7NAKBL.js.map
|
|
401
|
+
//# sourceMappingURL=chunk-KN7NAKBL.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __publicField } from './chunk-
|
|
1
|
+
import { __publicField } from './chunk-GXPNWCGE.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Voodoo.js v0.
|
|
4
|
+
* Voodoo.js v0.12.1
|
|
5
5
|
* JavaScript feels like magic.
|
|
6
6
|
* (c) 2026 Voodoo.js contributors. MIT License.
|
|
7
7
|
*/
|
|
@@ -637,5 +637,5 @@ function traverse(value, seen = /* @__PURE__ */ new Set()) {
|
|
|
637
637
|
}
|
|
638
638
|
|
|
639
639
|
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 };
|
|
640
|
-
//# sourceMappingURL=chunk-
|
|
641
|
-
//# sourceMappingURL=chunk-
|
|
640
|
+
//# sourceMappingURL=chunk-LLNDLLKV.js.map
|
|
641
|
+
//# sourceMappingURL=chunk-LLNDLLKV.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { config } from './chunk-
|
|
1
|
+
import { config } from './chunk-T5ION5NG.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Voodoo.js v0.
|
|
4
|
+
* Voodoo.js v0.12.1
|
|
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-
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMappingURL=chunk-NP66JM2P.js.map
|
|
72
|
+
//# sourceMappingURL=chunk-NP66JM2P.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { http, HttpError, request } from './chunk-
|
|
2
|
-
import { stringify, markInitialized, markSkipChildren, destroy, walk, removeQuietly, evaluateIn, addCleanup, markNodeScope, setComponentMounter, closestDirective, magic, readAttr, hasAttr, componentAliases, Scope, queryDirective, parse, evaluate, parseAttribute, originalAttributes, hasDirective, findScope, VoodooRuntimeError, VoodooSyntaxError, allowedGlobals, clearParseCache, tokenize, getScope, stopObserving, refresh, start, magics, rootScope, isInitialized, restoreAttributes, hasDirectives } from './chunk-
|
|
3
|
-
import { ref, reactive, handleError, nextTick, queuePostFlush, warn, watch, EffectScope, computed, effect, toRaw,
|
|
4
|
-
import { warnDuplicateKey, warn as warn$1, describeElement, warnUnknownComponent, warnAlias, warnRequiredProp } from './chunk-
|
|
5
|
-
import { parseDuration, debounce, utils_exports, throttle, uid, device, escapeHtml } from './chunk-
|
|
6
|
-
import { injectStyle, ensureTokens } from './chunk-
|
|
7
|
-
import { defineDirective, config, PRIORITY, directives, normalizeComponentName, components, usePlugin } from './chunk-
|
|
8
|
-
import { __publicField } from './chunk-
|
|
1
|
+
import { http, HttpError, request } from './chunk-D7675IJG.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-4M4ZXHNY.js';
|
|
3
|
+
import { ref, reactive, handleError, nextTick, queuePostFlush, warn, watch, EffectScope, computed, effect, toRaw, markRaw, stop, flushSync, effectScope, unref, watchEffect, shallowRef, setErrorHandler } from './chunk-LLNDLLKV.js';
|
|
4
|
+
import { warnDuplicateKey, warn as warn$1, describeElement, warnUnknownComponent, warnAlias, warnRequiredProp } from './chunk-72PMUUMT.js';
|
|
5
|
+
import { parseDuration, debounce, utils_exports, throttle, uid, device, escapeHtml } from './chunk-KN7NAKBL.js';
|
|
6
|
+
import { injectStyle, ensureTokens } from './chunk-NP66JM2P.js';
|
|
7
|
+
import { defineDirective, config, PRIORITY, directives, normalizeComponentName, components, usePlugin } from './chunk-T5ION5NG.js';
|
|
8
|
+
import { __publicField } from './chunk-GXPNWCGE.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Voodoo.js v0.
|
|
11
|
+
* Voodoo.js v0.12.1
|
|
12
12
|
* JavaScript feels like magic.
|
|
13
13
|
* (c) 2026 Voodoo.js contributors. MIT License.
|
|
14
14
|
*/
|
|
@@ -338,10 +338,10 @@ var LIFECYCLE = /* @__PURE__ */ new Set([
|
|
|
338
338
|
"destroyed"
|
|
339
339
|
]);
|
|
340
340
|
function callHook(def, instance, name) {
|
|
341
|
-
const
|
|
342
|
-
if (typeof
|
|
341
|
+
const hook2 = def[name];
|
|
342
|
+
if (typeof hook2 !== "function") return;
|
|
343
343
|
try {
|
|
344
|
-
|
|
344
|
+
hook2.call(instance);
|
|
345
345
|
} catch (err) {
|
|
346
346
|
handleError(err, `hook ${name}`);
|
|
347
347
|
}
|
|
@@ -1116,21 +1116,28 @@ var cache = {
|
|
|
1116
1116
|
};
|
|
1117
1117
|
var THEME_KEY = "voodoo:theme";
|
|
1118
1118
|
var picked = null;
|
|
1119
|
+
var revision = ref(0);
|
|
1119
1120
|
var theme = {
|
|
1120
1121
|
/** Theme chosen by the user, or `system` when never set. */
|
|
1121
1122
|
get current() {
|
|
1123
|
+
void revision.value;
|
|
1122
1124
|
return storage.get(THEME_KEY) ?? picked ?? "system";
|
|
1123
1125
|
},
|
|
1124
1126
|
/** Theme effectively applied, resolving `system`. */
|
|
1125
1127
|
get resolved() {
|
|
1126
1128
|
const value = this.current;
|
|
1127
1129
|
if (value !== "system") return value;
|
|
1130
|
+
if (typeof document !== "undefined") {
|
|
1131
|
+
const authored = document.documentElement.getAttribute("data-theme");
|
|
1132
|
+
if (authored === "light" || authored === "dark") return authored;
|
|
1133
|
+
}
|
|
1128
1134
|
if (typeof matchMedia === "undefined") return "light";
|
|
1129
1135
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
1130
1136
|
},
|
|
1131
1137
|
set(value) {
|
|
1132
1138
|
picked = value;
|
|
1133
1139
|
storage.set(THEME_KEY, value);
|
|
1140
|
+
revision.value++;
|
|
1134
1141
|
this.apply();
|
|
1135
1142
|
},
|
|
1136
1143
|
toggle() {
|
|
@@ -1164,8 +1171,17 @@ var theme = {
|
|
|
1164
1171
|
init() {
|
|
1165
1172
|
if (typeof document === "undefined") return;
|
|
1166
1173
|
this.apply();
|
|
1174
|
+
if (typeof MutationObserver !== "undefined") {
|
|
1175
|
+
new MutationObserver(() => {
|
|
1176
|
+
revision.value++;
|
|
1177
|
+
}).observe(document.documentElement, {
|
|
1178
|
+
attributes: true,
|
|
1179
|
+
attributeFilter: ["data-theme"]
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1167
1182
|
if (typeof matchMedia === "undefined") return;
|
|
1168
1183
|
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
1184
|
+
revision.value++;
|
|
1169
1185
|
if (this.current === "system") this.apply();
|
|
1170
1186
|
});
|
|
1171
1187
|
}
|
|
@@ -1298,6 +1314,139 @@ function installMagics() {
|
|
|
1298
1314
|
);
|
|
1299
1315
|
}
|
|
1300
1316
|
|
|
1317
|
+
// src/hooks/index.ts
|
|
1318
|
+
var tables = /* @__PURE__ */ new WeakMap();
|
|
1319
|
+
function tableFor(scope) {
|
|
1320
|
+
const host = currentHookHost() ?? scope.el ?? scope;
|
|
1321
|
+
let table = tables.get(host);
|
|
1322
|
+
if (!table) {
|
|
1323
|
+
table = { slots: [], index: 0, scheduled: false, bound: false };
|
|
1324
|
+
tables.set(host, table);
|
|
1325
|
+
}
|
|
1326
|
+
const el = currentHookHost() ?? scope.el;
|
|
1327
|
+
if (!table.bound && el) {
|
|
1328
|
+
table.bound = true;
|
|
1329
|
+
const owned = table;
|
|
1330
|
+
addCleanup(el, () => {
|
|
1331
|
+
for (const slot of owned.slots) {
|
|
1332
|
+
if (slot.dispose) slot.dispose();
|
|
1333
|
+
if (slot.runner) stop(slot.runner);
|
|
1334
|
+
}
|
|
1335
|
+
owned.slots.length = 0;
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
if (!table.scheduled) {
|
|
1339
|
+
table.scheduled = true;
|
|
1340
|
+
const pending = table;
|
|
1341
|
+
queueMicrotask(() => {
|
|
1342
|
+
pending.index = 0;
|
|
1343
|
+
pending.scheduled = false;
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
return table;
|
|
1347
|
+
}
|
|
1348
|
+
function nextSlot(scope, kind) {
|
|
1349
|
+
const table = tableFor(scope);
|
|
1350
|
+
const at = table.index++;
|
|
1351
|
+
let slot = table.slots[at];
|
|
1352
|
+
if (!slot || slot.kind !== kind) {
|
|
1353
|
+
if (slot) {
|
|
1354
|
+
if (slot.dispose) slot.dispose();
|
|
1355
|
+
if (slot.runner) stop(slot.runner);
|
|
1356
|
+
}
|
|
1357
|
+
slot = { kind, deps: null, value: void 0 };
|
|
1358
|
+
table.slots[at] = slot;
|
|
1359
|
+
}
|
|
1360
|
+
return slot;
|
|
1361
|
+
}
|
|
1362
|
+
function depsChanged(previous, next) {
|
|
1363
|
+
if (!previous || !next) return true;
|
|
1364
|
+
if (previous.length !== next.length) return true;
|
|
1365
|
+
for (let i = 0; i < next.length; i++) {
|
|
1366
|
+
if (!Object.is(previous[i], next[i])) return true;
|
|
1367
|
+
}
|
|
1368
|
+
return false;
|
|
1369
|
+
}
|
|
1370
|
+
function normalizeDeps(deps) {
|
|
1371
|
+
return Array.isArray(deps) ? deps.slice() : null;
|
|
1372
|
+
}
|
|
1373
|
+
function useState(scope, initial) {
|
|
1374
|
+
const slot = nextSlot(scope, "state");
|
|
1375
|
+
if (slot.value === void 0) slot.value = ref(initial);
|
|
1376
|
+
return slot.value;
|
|
1377
|
+
}
|
|
1378
|
+
function useEffect(scope, fn, deps) {
|
|
1379
|
+
const slot = nextSlot(scope, "effect");
|
|
1380
|
+
const next = normalizeDeps(deps);
|
|
1381
|
+
const runCleanup = () => {
|
|
1382
|
+
if (slot.dispose) {
|
|
1383
|
+
const dispose = slot.dispose;
|
|
1384
|
+
slot.dispose = void 0;
|
|
1385
|
+
dispose();
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
if (next) {
|
|
1389
|
+
const first = slot.deps === null && !slot.runner;
|
|
1390
|
+
if (first || depsChanged(slot.deps, next)) {
|
|
1391
|
+
slot.deps = next;
|
|
1392
|
+
runCleanup();
|
|
1393
|
+
const result = fn();
|
|
1394
|
+
if (typeof result === "function") slot.dispose = result;
|
|
1395
|
+
}
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
if (slot.runner) return;
|
|
1399
|
+
slot.deps = null;
|
|
1400
|
+
slot.runner = effect(() => {
|
|
1401
|
+
runCleanup();
|
|
1402
|
+
const result = fn();
|
|
1403
|
+
if (typeof result === "function") slot.dispose = result;
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
function useMemo(scope, fn, deps) {
|
|
1407
|
+
const slot = nextSlot(scope, "memo");
|
|
1408
|
+
const next = normalizeDeps(deps);
|
|
1409
|
+
if (!next) {
|
|
1410
|
+
if (!slot.value) slot.value = computed(fn);
|
|
1411
|
+
return slot.value;
|
|
1412
|
+
}
|
|
1413
|
+
if (!slot.value) {
|
|
1414
|
+
slot.value = ref(fn());
|
|
1415
|
+
slot.deps = next;
|
|
1416
|
+
} else if (depsChanged(slot.deps, next)) {
|
|
1417
|
+
slot.deps = next;
|
|
1418
|
+
slot.value.value = fn();
|
|
1419
|
+
}
|
|
1420
|
+
return slot.value;
|
|
1421
|
+
}
|
|
1422
|
+
function useRef(scope, initial) {
|
|
1423
|
+
const slot = nextSlot(scope, "ref");
|
|
1424
|
+
if (!slot.value) slot.value = markRaw({ current: initial });
|
|
1425
|
+
return slot.value;
|
|
1426
|
+
}
|
|
1427
|
+
function useContext(name, initial) {
|
|
1428
|
+
if (initial !== void 0 && !(name in allStores)) {
|
|
1429
|
+
store(name, initial);
|
|
1430
|
+
}
|
|
1431
|
+
return allStores[name];
|
|
1432
|
+
}
|
|
1433
|
+
function installHooks() {
|
|
1434
|
+
hook("useState", (scope) => (initial) => useState(scope, initial));
|
|
1435
|
+
hook(
|
|
1436
|
+
"useEffect",
|
|
1437
|
+
(scope) => (fn, deps) => useEffect(scope, fn, deps)
|
|
1438
|
+
);
|
|
1439
|
+
hook(
|
|
1440
|
+
"useMemo",
|
|
1441
|
+
(scope) => (fn, deps) => useMemo(scope, fn, deps)
|
|
1442
|
+
);
|
|
1443
|
+
hook("useRef", (scope) => (initial) => useRef(scope, initial));
|
|
1444
|
+
hook(
|
|
1445
|
+
"useContext",
|
|
1446
|
+
() => (name, initial) => useContext(name, initial)
|
|
1447
|
+
);
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1301
1450
|
// src/http/resource.ts
|
|
1302
1451
|
function pick(value, path) {
|
|
1303
1452
|
if (!path) return value;
|
|
@@ -2662,7 +2811,7 @@ var jsonStylesInjected = false;
|
|
|
2662
2811
|
function injectJSONStyles() {
|
|
2663
2812
|
if (jsonStylesInjected) return;
|
|
2664
2813
|
jsonStylesInjected = true;
|
|
2665
|
-
void import('./style-
|
|
2814
|
+
void import('./style-GR4X6O7I.js').then(({ injectStyle: injectStyle2 }) => {
|
|
2666
2815
|
injectStyle2(
|
|
2667
2816
|
"json-render",
|
|
2668
2817
|
`
|
|
@@ -2871,6 +3020,7 @@ setComponentMounter(mountComponent);
|
|
|
2871
3020
|
setScopeMarker(markNodeScope);
|
|
2872
3021
|
setDirectiveRegistrar(directive);
|
|
2873
3022
|
installMagics();
|
|
3023
|
+
installHooks();
|
|
2874
3024
|
var eventBus = /* @__PURE__ */ new Map();
|
|
2875
3025
|
function on(name, handler) {
|
|
2876
3026
|
let set = eventBus.get(name);
|
|
@@ -2949,7 +3099,7 @@ function data(values) {
|
|
|
2949
3099
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
2950
3100
|
return rootScope.data;
|
|
2951
3101
|
}
|
|
2952
|
-
var version2 = "0.
|
|
3102
|
+
var version2 = "0.12.1";
|
|
2953
3103
|
var core = {
|
|
2954
3104
|
// Utilities first: Voodoo's own names can override.
|
|
2955
3105
|
...utils_exports,
|
|
@@ -8367,6 +8517,7 @@ var isMuted = false;
|
|
|
8367
8517
|
var hasLoadedPreference = false;
|
|
8368
8518
|
var VOLUME_KEY = "voodoo:sound:volume";
|
|
8369
8519
|
var MUTE_KEY = "voodoo:sound:muted";
|
|
8520
|
+
var muteRevision = ref(0);
|
|
8370
8521
|
function loadPreference() {
|
|
8371
8522
|
if (hasLoadedPreference) return;
|
|
8372
8523
|
hasLoadedPreference = true;
|
|
@@ -8678,6 +8829,7 @@ var sound = {
|
|
|
8678
8829
|
loadPreference();
|
|
8679
8830
|
isMuted = value;
|
|
8680
8831
|
storage.set(MUTE_KEY, isMuted);
|
|
8832
|
+
muteRevision.value++;
|
|
8681
8833
|
},
|
|
8682
8834
|
/** Unmutes sound. */
|
|
8683
8835
|
unmute() {
|
|
@@ -8689,8 +8841,18 @@ var sound = {
|
|
|
8689
8841
|
this.mute(!isMuted);
|
|
8690
8842
|
return isMuted;
|
|
8691
8843
|
},
|
|
8692
|
-
/**
|
|
8844
|
+
/**
|
|
8845
|
+
* `true` when muted.
|
|
8846
|
+
*
|
|
8847
|
+
* Reads a revision ref first, so that an expression asking whether sound is
|
|
8848
|
+
* muted actually re-runs when it changes. The state lives in a module
|
|
8849
|
+
* variable and in localStorage, both invisible to the Proxy, so
|
|
8850
|
+
* `v-show="$sound.muted"` used to render once and then never move: a page had
|
|
8851
|
+
* no way to show whether it was muted, which made the mute button look like
|
|
8852
|
+
* it did nothing at all.
|
|
8853
|
+
*/
|
|
8693
8854
|
get muted() {
|
|
8855
|
+
void muteRevision.value;
|
|
8694
8856
|
loadPreference();
|
|
8695
8857
|
return isMuted;
|
|
8696
8858
|
},
|
|
@@ -8740,11 +8902,18 @@ defineDirective("sound", ({ el, arg, expression, modifiers, scope, cleanup, eval
|
|
|
8740
8902
|
el.addEventListener(event, play);
|
|
8741
8903
|
cleanup(() => el.removeEventListener(event, play));
|
|
8742
8904
|
});
|
|
8905
|
+
var MUTE_CSS = `
|
|
8906
|
+
.v-muted{opacity:.55}
|
|
8907
|
+
.v-muted::after{content:" \\1F507";font-size:.9em}
|
|
8908
|
+
.v-mute-on::after{content:" \\1F50A";font-size:.9em}
|
|
8909
|
+
`;
|
|
8743
8910
|
defineDirective("mute", ({ el, cleanup }) => {
|
|
8911
|
+
injectStyle("mute", MUTE_CSS);
|
|
8744
8912
|
const sync = () => {
|
|
8745
8913
|
const isMuted2 = sound.muted;
|
|
8746
8914
|
el.setAttribute("aria-pressed", String(isMuted2));
|
|
8747
8915
|
el.classList.toggle("v-muted", isMuted2);
|
|
8916
|
+
el.classList.toggle("v-mute-on", !isMuted2);
|
|
8748
8917
|
};
|
|
8749
8918
|
const toggle = () => {
|
|
8750
8919
|
sound.toggle();
|
|
@@ -10270,6 +10439,6 @@ defineDirective(
|
|
|
10270
10439
|
{ priority: PRIORITY.MODEL + 5 }
|
|
10271
10440
|
);
|
|
10272
10441
|
|
|
10273
|
-
export { VoodooCollection, alert, allStores, applyMask, cache, clearErrors, clipboard, confirm, cookie, core, createApp, createResource, defineComponent, dialog, efeitos, ensurePalette, enter, fadeIn, fadeOut, fromHtml, hotkey, 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, validate, validator, viewTransition, whenElement, whenReady };
|
|
10274
|
-
//# sourceMappingURL=chunk-
|
|
10275
|
-
//# sourceMappingURL=chunk-
|
|
10442
|
+
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 };
|
|
10443
|
+
//# sourceMappingURL=chunk-RDHYPGH6.js.map
|
|
10444
|
+
//# sourceMappingURL=chunk-RDHYPGH6.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Voodoo.js v0.
|
|
2
|
+
* Voodoo.js v0.12.1
|
|
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-
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-T5ION5NG.js.map
|
|
65
|
+
//# sourceMappingURL=chunk-T5ION5NG.js.map
|