q5 3.8.1 → 3.8.2
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/defs/q5-c2d-es.d.ts +74 -81
- package/defs/q5-c2d.d.ts +16 -1
- package/defs/q5-es.d.ts +99 -82
- package/deno.json +1 -1
- package/package.json +1 -1
- package/q5.d.ts +16 -1
- package/q5.js +60 -36
- package/q5.min.js +1 -1
package/q5.js
CHANGED
|
@@ -8503,9 +8503,11 @@ Q5.WebGPU = async function (scope, parent) {
|
|
|
8503
8503
|
await q.ready;
|
|
8504
8504
|
return q;
|
|
8505
8505
|
};
|
|
8506
|
+
const supportedLangs = ['es'];
|
|
8507
|
+
|
|
8506
8508
|
const libLangs = `
|
|
8507
8509
|
# core
|
|
8508
|
-
createCanvas -> es:crearLienzo
|
|
8510
|
+
createCanvas -> es:crearLienzo
|
|
8509
8511
|
log -> es:log
|
|
8510
8512
|
|
|
8511
8513
|
# color
|
|
@@ -8803,6 +8805,18 @@ mouseWheel -> es:ruedaRatón
|
|
|
8803
8805
|
`;
|
|
8804
8806
|
|
|
8805
8807
|
const classLangs = {
|
|
8808
|
+
Q5: `
|
|
8809
|
+
Image -> es:Imagen
|
|
8810
|
+
version -> es:versión
|
|
8811
|
+
disableFriendlyErrors -> es:deshabilitarErroresAmigables
|
|
8812
|
+
errorTolerant -> es:toleranteErrores
|
|
8813
|
+
supportsHDR -> es:soportaHDR
|
|
8814
|
+
canvasOptions -> es:opcionesLienzo
|
|
8815
|
+
MAX_ELLIPSES -> es:MAX_ELIPSES
|
|
8816
|
+
MAX_TRANSFORMS -> es:MAX_TRANSFORMACIONES
|
|
8817
|
+
MAX_CHARS -> es:MAX_CARACTERES
|
|
8818
|
+
MAX_TEXTS -> es:MAX_TEXTOS
|
|
8819
|
+
`,
|
|
8806
8820
|
Vector: `
|
|
8807
8821
|
add -> es:sumar
|
|
8808
8822
|
sub -> es:restar
|
|
@@ -8866,31 +8880,14 @@ Object.defineProperty(Q5, 'lang', {
|
|
|
8866
8880
|
return;
|
|
8867
8881
|
}
|
|
8868
8882
|
|
|
8869
|
-
let m = parseLangs(libLangs, val);
|
|
8870
|
-
|
|
8871
|
-
if (typeof window == 'object') {
|
|
8872
|
-
window[m.createCanvas] = createCanvas;
|
|
8873
|
-
}
|
|
8874
|
-
|
|
8875
|
-
let userFnsMap = parseLangs(userLangs, val);
|
|
8876
|
-
|
|
8877
|
-
for (let name in userFnsMap) {
|
|
8878
|
-
let translatedName = userFnsMap[name];
|
|
8879
|
-
if (Q5.hasOwnProperty(translatedName)) continue;
|
|
8880
|
-
Object.defineProperty(Q5, translatedName, {
|
|
8881
|
-
get: () => Q5[name],
|
|
8882
|
-
set: (fn) => (Q5[name] = fn)
|
|
8883
|
-
});
|
|
8884
|
-
}
|
|
8885
|
-
|
|
8886
8883
|
for (let className in classLangs) {
|
|
8887
|
-
|
|
8884
|
+
let target = className == 'Q5' ? Q5 : Q5[className] ? Q5[className].prototype : null;
|
|
8885
|
+
if (target) {
|
|
8888
8886
|
let map = parseLangs(classLangs[className], val);
|
|
8889
|
-
let proto = Q5[className].prototype;
|
|
8890
8887
|
for (let name in map) {
|
|
8891
8888
|
let translatedName = map[name];
|
|
8892
|
-
if (
|
|
8893
|
-
Object.defineProperty(
|
|
8889
|
+
if (target.hasOwnProperty(translatedName)) continue;
|
|
8890
|
+
Object.defineProperty(target, translatedName, {
|
|
8894
8891
|
get: function () {
|
|
8895
8892
|
return this[name];
|
|
8896
8893
|
},
|
|
@@ -8902,14 +8899,38 @@ Object.defineProperty(Q5, 'lang', {
|
|
|
8902
8899
|
}
|
|
8903
8900
|
}
|
|
8904
8901
|
|
|
8905
|
-
Q5._libMap =
|
|
8906
|
-
Q5._userFnsMap =
|
|
8907
|
-
Q5._userFns.push(...Object.values(
|
|
8902
|
+
Q5._libMap = parseLangs(libLangs, val);
|
|
8903
|
+
Q5._userFnsMap = parseLangs(userLangs, val);
|
|
8904
|
+
Q5._userFns.push(...Object.values(Q5._userFnsMap));
|
|
8908
8905
|
}
|
|
8909
8906
|
});
|
|
8910
8907
|
|
|
8911
8908
|
Q5.lang = 'en';
|
|
8912
8909
|
|
|
8910
|
+
for (let l of supportedLangs) {
|
|
8911
|
+
if (typeof window == 'object') {
|
|
8912
|
+
let m = parseLangs(libLangs.slice(0, libLangs.indexOf('\n', 8)), l);
|
|
8913
|
+
window[m.createCanvas] = function () {
|
|
8914
|
+
Q5.lang = l;
|
|
8915
|
+
return createCanvas(...arguments);
|
|
8916
|
+
};
|
|
8917
|
+
}
|
|
8918
|
+
|
|
8919
|
+
let userFnsMap = parseLangs(userLangs, l);
|
|
8920
|
+
|
|
8921
|
+
for (let name in userFnsMap) {
|
|
8922
|
+
let translatedName = userFnsMap[name];
|
|
8923
|
+
if (Q5.hasOwnProperty(translatedName)) continue;
|
|
8924
|
+
Object.defineProperty(Q5, translatedName, {
|
|
8925
|
+
get: () => Q5[name],
|
|
8926
|
+
set: (fn) => {
|
|
8927
|
+
Q5.lang = l;
|
|
8928
|
+
Q5[name] = fn;
|
|
8929
|
+
}
|
|
8930
|
+
});
|
|
8931
|
+
}
|
|
8932
|
+
}
|
|
8933
|
+
|
|
8913
8934
|
Q5.modules.lang = ($) => {
|
|
8914
8935
|
let userFnsMap = Q5._userFnsMap;
|
|
8915
8936
|
|
|
@@ -8942,15 +8963,18 @@ Q5.addHook('predraw', (q) => {
|
|
|
8942
8963
|
|
|
8943
8964
|
if (!m.mouseX) return;
|
|
8944
8965
|
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8966
|
+
let props = [
|
|
8967
|
+
'frameCount',
|
|
8968
|
+
'mouseX',
|
|
8969
|
+
'mouseY',
|
|
8970
|
+
'mouseIsPressed',
|
|
8971
|
+
'mouseButton',
|
|
8972
|
+
'key',
|
|
8973
|
+
'keyIsPressed',
|
|
8974
|
+
'touches',
|
|
8975
|
+
'pointers'
|
|
8976
|
+
];
|
|
8977
|
+
|
|
8978
|
+
// sync properties
|
|
8979
|
+
for (let p of props) q[m[p]] = q[p];
|
|
8956
8980
|
});
|