voodoojs 0.5.0 → 0.6.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/dist/{chunk-RJUNPXQF.js → chunk-4LR3IFPX.js} +2 -2
- package/dist/{chunk-ABRZI32G.js → chunk-CNHNFTPC.js} +72 -69
- package/dist/{chunk-34CGORMO.js → chunk-PHMBDPWH.js} +3 -3
- package/dist/essential.cjs +69 -66
- package/dist/essential.d.cts +1 -1
- package/dist/essential.d.ts +1 -1
- package/dist/essential.js +2 -2
- package/dist/gpu.cjs +18 -18
- package/dist/gpu.js +20 -20
- package/dist/index.cjs +304 -277
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +231 -207
- package/dist/{query-BeYufh-f.d.ts → query-CC-_z7v0.d.ts} +5 -5
- package/dist/{query-Bja83lRJ.d.cts → query-sEJXe_cO.d.cts} +5 -5
- package/dist/socket.d.cts +4 -4
- package/dist/socket.d.ts +4 -4
- package/dist/socket.js +3 -3
- package/dist/voodoo.core.js +38 -35
- package/dist/voodoo.core.min.js +15 -15
- package/dist/voodoo.full.js +299 -272
- package/dist/voodoo.full.min.js +74 -74
- package/dist/voodoo.js +70 -67
- package/dist/voodoo.min.js +22 -22
- package/package.json +1 -1
package/dist/gpu.cjs
CHANGED
|
@@ -1722,24 +1722,24 @@ var gpu = {
|
|
|
1722
1722
|
|
|
1723
1723
|
// src/directives/gpu.ts
|
|
1724
1724
|
function classifyShaderSource(text) {
|
|
1725
|
-
const
|
|
1726
|
-
if (!
|
|
1727
|
-
if (
|
|
1728
|
-
if (/@(?:vertex|fragment|compute)\b/.test(
|
|
1729
|
-
if (/\bfn\s+[A-Za-z_]/.test(
|
|
1730
|
-
if (
|
|
1725
|
+
const value = text.trim();
|
|
1726
|
+
if (!value) return "empty";
|
|
1727
|
+
if (value.startsWith("#")) return "selector";
|
|
1728
|
+
if (/@(?:vertex|fragment|compute)\b/.test(value)) return "inline";
|
|
1729
|
+
if (/\bfn\s+[A-Za-z_]/.test(value)) return "inline";
|
|
1730
|
+
if (value.includes("{") || value.includes("\n")) return "inline";
|
|
1731
1731
|
return "url";
|
|
1732
1732
|
}
|
|
1733
1733
|
async function resolveShaderSource(text) {
|
|
1734
|
-
const
|
|
1735
|
-
const kind = classifyShaderSource(
|
|
1734
|
+
const value = text.trim();
|
|
1735
|
+
const kind = classifyShaderSource(value);
|
|
1736
1736
|
if (kind === "empty") return "";
|
|
1737
|
-
if (kind === "inline") return
|
|
1737
|
+
if (kind === "inline") return value;
|
|
1738
1738
|
if (kind === "selector") {
|
|
1739
1739
|
if (typeof document === "undefined") return "";
|
|
1740
1740
|
let target3 = null;
|
|
1741
1741
|
try {
|
|
1742
|
-
target3 = document.querySelector(
|
|
1742
|
+
target3 = document.querySelector(value);
|
|
1743
1743
|
} catch {
|
|
1744
1744
|
target3 = null;
|
|
1745
1745
|
}
|
|
@@ -1749,10 +1749,10 @@ async function resolveShaderSource(text) {
|
|
|
1749
1749
|
return target3.textContent ?? "";
|
|
1750
1750
|
}
|
|
1751
1751
|
try {
|
|
1752
|
-
const response = await http.get(
|
|
1752
|
+
const response = await http.get(value, { responseType: "text" });
|
|
1753
1753
|
return typeof response === "string" ? response : "";
|
|
1754
1754
|
} catch (err) {
|
|
1755
|
-
handleError(err, `v-shader when fetching "${
|
|
1755
|
+
handleError(err, `v-shader when fetching "${value}"`);
|
|
1756
1756
|
return "";
|
|
1757
1757
|
}
|
|
1758
1758
|
}
|
|
@@ -1784,13 +1784,13 @@ function noSupport(el, reason, mount) {
|
|
|
1784
1784
|
return revealFallback(el, mount);
|
|
1785
1785
|
}
|
|
1786
1786
|
function expressionOfSet(el) {
|
|
1787
|
-
const
|
|
1788
|
-
for (const
|
|
1789
|
-
const
|
|
1790
|
-
if (
|
|
1787
|
+
const attributes = originalAttributes(el);
|
|
1788
|
+
for (const name of [":set", "v-bind:set", "data-v-bind:set"]) {
|
|
1789
|
+
const value = attributes.get(name);
|
|
1790
|
+
if (value) return value;
|
|
1791
1791
|
}
|
|
1792
|
-
const
|
|
1793
|
-
return
|
|
1792
|
+
const own = el.getAttribute("v-shader-set") ?? el.getAttribute("data-v-shader-set");
|
|
1793
|
+
return own || null;
|
|
1794
1794
|
}
|
|
1795
1795
|
function dprRange(el) {
|
|
1796
1796
|
const raw = el.getAttribute("v-shader-dpr") ?? el.getAttribute("data-v-shader-dpr");
|
package/dist/gpu.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { supported, clock, shared, gpu, surface, effect, frameLoop, frame } from './chunk-JZIYRIY6.js';
|
|
2
2
|
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 } from './chunk-JZIYRIY6.js';
|
|
3
3
|
import { http } from './chunk-PQZEVFVZ.js';
|
|
4
|
-
import { originalAttributes, destroy } from './chunk-
|
|
4
|
+
import { originalAttributes, destroy } from './chunk-PHMBDPWH.js';
|
|
5
5
|
import { handleError } from './chunk-NNU6WOOU.js';
|
|
6
6
|
import { warn, describeElement } from './chunk-A2UOVQBP.js';
|
|
7
7
|
import './chunk-234ZLC6W.js';
|
|
@@ -16,38 +16,38 @@ import './chunk-E27NRARW.js';
|
|
|
16
16
|
|
|
17
17
|
// src/directives/gpu.ts
|
|
18
18
|
function classifyShaderSource(text) {
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
21
|
-
if (
|
|
22
|
-
if (/@(?:vertex|fragment|compute)\b/.test(
|
|
23
|
-
if (/\bfn\s+[A-Za-z_]/.test(
|
|
24
|
-
if (
|
|
19
|
+
const value = text.trim();
|
|
20
|
+
if (!value) return "empty";
|
|
21
|
+
if (value.startsWith("#")) return "selector";
|
|
22
|
+
if (/@(?:vertex|fragment|compute)\b/.test(value)) return "inline";
|
|
23
|
+
if (/\bfn\s+[A-Za-z_]/.test(value)) return "inline";
|
|
24
|
+
if (value.includes("{") || value.includes("\n")) return "inline";
|
|
25
25
|
return "url";
|
|
26
26
|
}
|
|
27
27
|
async function resolveShaderSource(text) {
|
|
28
|
-
const
|
|
29
|
-
const kind = classifyShaderSource(
|
|
28
|
+
const value = text.trim();
|
|
29
|
+
const kind = classifyShaderSource(value);
|
|
30
30
|
if (kind === "empty") return "";
|
|
31
|
-
if (kind === "inline") return
|
|
31
|
+
if (kind === "inline") return value;
|
|
32
32
|
if (kind === "selector") {
|
|
33
33
|
if (typeof document === "undefined") return "";
|
|
34
34
|
let target3 = null;
|
|
35
35
|
try {
|
|
36
|
-
target3 = document.querySelector(
|
|
36
|
+
target3 = document.querySelector(value);
|
|
37
37
|
} catch {
|
|
38
38
|
target3 = null;
|
|
39
39
|
}
|
|
40
40
|
if (!target3) {
|
|
41
|
-
warn(`v-shader did not find the element "${
|
|
41
|
+
warn(`v-shader did not find the element "${value}" with the shader source.`);
|
|
42
42
|
return "";
|
|
43
43
|
}
|
|
44
44
|
return target3.textContent ?? "";
|
|
45
45
|
}
|
|
46
46
|
try {
|
|
47
|
-
const response = await http.get(
|
|
47
|
+
const response = await http.get(value, { responseType: "text" });
|
|
48
48
|
return typeof response === "string" ? response : "";
|
|
49
49
|
} catch (err) {
|
|
50
|
-
handleError(err, `v-shader when fetching "${
|
|
50
|
+
handleError(err, `v-shader when fetching "${value}"`);
|
|
51
51
|
return "";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -79,13 +79,13 @@ function noSupport(el, reason, mount) {
|
|
|
79
79
|
return revealFallback(el, mount);
|
|
80
80
|
}
|
|
81
81
|
function expressionOfSet(el) {
|
|
82
|
-
const
|
|
83
|
-
for (const
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
82
|
+
const attributes = originalAttributes(el);
|
|
83
|
+
for (const name of [":set", "v-bind:set", "data-v-bind:set"]) {
|
|
84
|
+
const value = attributes.get(name);
|
|
85
|
+
if (value) return value;
|
|
86
86
|
}
|
|
87
|
-
const
|
|
88
|
-
return
|
|
87
|
+
const own = el.getAttribute("v-shader-set") ?? el.getAttribute("data-v-shader-set");
|
|
88
|
+
return own || null;
|
|
89
89
|
}
|
|
90
90
|
function dprRange(el) {
|
|
91
91
|
const raw = el.getAttribute("v-shader-dpr") ?? el.getAttribute("data-v-shader-dpr");
|