voodoojs 0.4.6 → 0.6.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.
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 valor = text.trim();
1726
- if (!valor) return "empty";
1727
- if (valor.startsWith("#")) return "selector";
1728
- if (/@(?:vertex|fragment|compute)\b/.test(valor)) return "inline";
1729
- if (/\bfn\s+[A-Za-z_]/.test(valor)) return "inline";
1730
- if (valor.includes("{") || valor.includes("\n")) return "inline";
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 valor = text.trim();
1735
- const kind = classifyShaderSource(valor);
1734
+ const value = text.trim();
1735
+ const kind = classifyShaderSource(value);
1736
1736
  if (kind === "empty") return "";
1737
- if (kind === "inline") return valor;
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(valor);
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(valor, { responseType: "text" });
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 "${valor}"`);
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 atributos = originalAttributes(el);
1788
- for (const nome of [":set", "v-bind:set", "data-v-bind:set"]) {
1789
- const valor = atributos.get(nome);
1790
- if (valor) return valor;
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 proprio = el.getAttribute("v-shader-set") ?? el.getAttribute("data-v-shader-set");
1793
- return proprio || null;
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-5CKGDARU.js';
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 valor = text.trim();
20
- if (!valor) return "empty";
21
- if (valor.startsWith("#")) return "selector";
22
- if (/@(?:vertex|fragment|compute)\b/.test(valor)) return "inline";
23
- if (/\bfn\s+[A-Za-z_]/.test(valor)) return "inline";
24
- if (valor.includes("{") || valor.includes("\n")) return "inline";
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 valor = text.trim();
29
- const kind = classifyShaderSource(valor);
28
+ const value = text.trim();
29
+ const kind = classifyShaderSource(value);
30
30
  if (kind === "empty") return "";
31
- if (kind === "inline") return valor;
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(valor);
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 "${valor}" with the shader source.`);
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(valor, { responseType: "text" });
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 "${valor}"`);
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 atributos = originalAttributes(el);
83
- for (const nome of [":set", "v-bind:set", "data-v-bind:set"]) {
84
- const valor = atributos.get(nome);
85
- if (valor) return valor;
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 proprio = el.getAttribute("v-shader-set") ?? el.getAttribute("data-v-shader-set");
88
- return proprio || null;
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");