@designliquido/foles 0.3.1 → 0.3.3
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 +4 -4
- package/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +3 -0
- package/fontes/avaliador-sintatico/avaliador-sintatico.js +133 -23
- package/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -1
- package/fontes/foles.js +1 -1
- package/fontes/foles.js.map +1 -1
- package/fontes/lexador/lexador.d.ts +1 -0
- package/fontes/lexador/lexador.js +67 -27
- package/fontes/lexador/lexador.js.map +1 -1
- package/fontes/lexador/palavras-reservadas/foles.d.ts +17 -2
- package/fontes/lexador/palavras-reservadas/foles.js +23 -2
- package/fontes/lexador/palavras-reservadas/foles.js.map +1 -1
- package/fontes/modificadores/altura-maxima.js +2 -3
- package/fontes/modificadores/altura-maxima.js.map +1 -1
- package/fontes/modificadores/altura-minima.js +2 -3
- package/fontes/modificadores/altura-minima.js.map +1 -1
- package/fontes/modificadores/altura.js +2 -4
- package/fontes/modificadores/altura.js.map +1 -1
- package/fontes/modificadores/dicionario/dicionario-modificadores.d.ts +1 -2
- package/fontes/modificadores/dicionario/dicionario-modificadores.js.map +1 -1
- package/fontes/modificadores/grade.js +2 -2
- package/fontes/modificadores/grade.js.map +1 -1
- package/fontes/modificadores/imagem-fundo.d.ts +2 -1
- package/fontes/modificadores/imagem-fundo.js +8 -2
- package/fontes/modificadores/imagem-fundo.js.map +1 -1
- package/fontes/modificadores/largura-maxima.js +2 -4
- package/fontes/modificadores/largura-maxima.js.map +1 -1
- package/fontes/modificadores/largura-minima.js +2 -4
- package/fontes/modificadores/largura-minima.js.map +1 -1
- package/fontes/modificadores/largura.js +2 -4
- package/fontes/modificadores/largura.js.map +1 -1
- package/fontes/modificadores/superclasse/modificador.d.ts +2 -1
- package/fontes/modificadores/superclasse/modificador.js.map +1 -1
- package/fontes/modificadores/tamanho-colunas-em-grade.js +2 -4
- package/fontes/modificadores/tamanho-colunas-em-grade.js.map +1 -1
- package/fontes/modificadores/tamanho-em-linha.js +2 -4
- package/fontes/modificadores/tamanho-em-linha.js.map +1 -1
- package/fontes/modificadores/tamanho-linhas-em-grade.js +2 -3
- package/fontes/modificadores/tamanho-linhas-em-grade.js.map +1 -1
- package/fontes/modificadores/tamanho-maximo-em-bloco.js +2 -4
- package/fontes/modificadores/tamanho-maximo-em-bloco.js.map +1 -1
- package/fontes/modificadores/tamanho-maximo-em-linha.js +2 -4
- package/fontes/modificadores/tamanho-maximo-em-linha.js.map +1 -1
- package/fontes/modificadores/tamanho-minimo-em-bloco.js +2 -4
- package/fontes/modificadores/tamanho-minimo-em-bloco.js.map +1 -1
- package/fontes/modificadores/tamanho-minimo-em-linha.js +2 -4
- package/fontes/modificadores/tamanho-minimo-em-linha.js.map +1 -1
- package/fontes/modificadores/tempo-transicao.d.ts +0 -3
- package/fontes/modificadores/tempo-transicao.js +2 -11
- package/fontes/modificadores/tempo-transicao.js.map +1 -1
- package/fontes/modificadores/transicao.js +2 -1
- package/fontes/modificadores/transicao.js.map +1 -1
- package/fontes/modificadores/validacoes/comum.d.ts +1 -1
- package/fontes/modificadores/validacoes/comum.js +23 -4
- package/fontes/modificadores/validacoes/comum.js.map +1 -1
- package/fontes/modificadores/validacoes/cor.d.ts +2 -1
- package/fontes/modificadores/validacoes/cor.js +51 -53
- package/fontes/modificadores/validacoes/cor.js.map +1 -1
- package/fontes/modificadores/validacoes/numerica.d.ts +1 -3
- package/fontes/modificadores/validacoes/numerica.js +9 -12
- package/fontes/modificadores/validacoes/numerica.js.map +1 -1
- package/fontes/modificadores/velocidade-animacao.d.ts +0 -3
- package/fontes/modificadores/velocidade-animacao.js +3 -21
- package/fontes/modificadores/velocidade-animacao.js.map +1 -1
- package/fontes/tipos-de-simbolos/foles.d.ts +2 -0
- package/fontes/tipos-de-simbolos/foles.js +2 -0
- package/fontes/tipos-de-simbolos/foles.js.map +1 -1
- package/fontes/tradutor/tradutor.js +14 -18
- package/fontes/tradutor/tradutor.js.map +1 -1
- package/fontes/valores/dicionario-valores.js +18 -2
- package/fontes/valores/dicionario-valores.js.map +1 -1
- package/fontes/valores/metodos/curva-cubica.d.ts +11 -0
- package/fontes/valores/metodos/curva-cubica.js +19 -0
- package/fontes/valores/metodos/curva-cubica.js.map +1 -0
- package/fontes/valores/metodos/encaixar-conteudo.d.ts +8 -0
- package/fontes/valores/metodos/encaixar-conteudo.js +16 -0
- package/fontes/valores/metodos/encaixar-conteudo.js.map +1 -0
- package/fontes/valores/metodos/hex.d.ts +1 -1
- package/fontes/valores/metodos/hex.js +1 -1
- package/fontes/valores/metodos/hex.js.map +1 -1
- package/fontes/valores/metodos/hsl.d.ts +1 -1
- package/fontes/valores/metodos/hsl.js +1 -1
- package/fontes/valores/metodos/hsl.js.map +1 -1
- package/fontes/valores/metodos/hsla.d.ts +1 -1
- package/fontes/valores/metodos/hsla.js +1 -1
- package/fontes/valores/metodos/hsla.js.map +1 -1
- package/fontes/valores/metodos/limitar.d.ts +12 -0
- package/fontes/valores/metodos/limitar.js +20 -0
- package/fontes/valores/metodos/limitar.js.map +1 -0
- package/fontes/valores/metodos/linear.d.ts +9 -0
- package/fontes/valores/metodos/linear.js +17 -0
- package/fontes/valores/metodos/linear.js.map +1 -0
- package/fontes/valores/metodos/metodo.d.ts +1 -0
- package/fontes/valores/metodos/minmax.d.ts +14 -0
- package/fontes/valores/metodos/minmax.js +30 -0
- package/fontes/valores/metodos/minmax.js.map +1 -0
- package/fontes/valores/metodos/passos.d.ts +16 -0
- package/fontes/valores/metodos/passos.js +34 -0
- package/fontes/valores/metodos/passos.js.map +1 -0
- package/fontes/valores/metodos/rgb.d.ts +1 -1
- package/fontes/valores/metodos/rgb.js +1 -1
- package/fontes/valores/metodos/rgb.js.map +1 -1
- package/fontes/valores/metodos/rgba.d.ts +1 -1
- package/fontes/valores/metodos/rgba.js +1 -1
- package/fontes/valores/metodos/rgba.js.map +1 -1
- package/fontes/valores/metodos/url.d.ts +6 -0
- package/fontes/valores/metodos/url.js +15 -0
- package/fontes/valores/metodos/url.js.map +1 -0
- package/package.json +1 -1
- package/testes/listas/metodos.d.ts +6 -0
- package/testes/listas/metodos.js +51 -0
- package/testes/listas/metodos.js.map +1 -0
- package/testes/modificadores/cores.test.js +5 -5
- package/testes/modificadores/cores.test.js.map +1 -1
- package/testes/modificadores/metodos.test.d.ts +1 -0
- package/testes/modificadores/metodos.test.js +214 -0
- package/testes/modificadores/metodos.test.js.map +1 -0
|
@@ -23,7 +23,8 @@ class Transicao extends superclasse_1.Modificador {
|
|
|
23
23
|
"nenhuma": "none",
|
|
24
24
|
"todas": "all",
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const valoresExtra = ['linear'];
|
|
27
|
+
(0, numerica_1.validarValorNumerico)('transição', valor, this.valoresAceitos, valoresExtra);
|
|
27
28
|
this.valor = valor;
|
|
28
29
|
if (Number(parseInt(valor))) {
|
|
29
30
|
(0, quantificador_1.validarQuantificador)('transição', quantificador, quantificadores_1.valoresTemporais);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transicao.js","sourceRoot":"","sources":["../../../fontes/modificadores/transicao.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAC/D,+CAAgE;AAChE,oDAA6D;AAC7D,8DAAkE;AAElE,MAAa,SAAU,SAAQ,yBAAW;IAiBtC,YAAY,KAAa,EAAE,aAAsB,EAAE,OAA4B;QAC3E,KAAK,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,YAAY,CAAC,CAAC;QAjBpD,+CAA+C;QAC/C,iCAAiC;QACjC,mBAAc,GAAqC;YAC/C,mBAAmB,EAAE,MAAM;YAC3B,cAAc,EAAE,SAAS;YACzB,cAAc,EAAE,SAAS;YACzB,aAAa,EAAE,UAAU;YACzB,oBAAoB,EAAE,aAAa;YACnC,oBAAoB,EAAE,aAAa;YACnC,QAAQ,EAAE,QAAQ;YAClB,eAAe,EAAE,YAAY;YAC7B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|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validarValores = void 0;
|
|
4
4
|
const globais_1 = require("../atributos/globais");
|
|
5
|
-
function validarValores(nomePropriedade, valor, valoresAceitos) {
|
|
6
|
-
if (
|
|
7
|
-
!(valor in
|
|
8
|
-
|
|
5
|
+
function validarValores(nomePropriedade, valor, valoresAceitos, valoresExtra) {
|
|
6
|
+
if (valoresExtra === undefined) {
|
|
7
|
+
if (!(valor in valoresAceitos) &&
|
|
8
|
+
!(valor in globais_1.valoresGlobais)) {
|
|
9
|
+
throw new Error(`Propriedade '${nomePropriedade}' com valor ${valor} inválido. Valores aceitos:
|
|
9
10
|
${Object.keys(valoresAceitos).reduce((final, atual) => final += `, ${atual}`)},
|
|
10
11
|
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
const valorString = valor.toString();
|
|
16
|
+
let metodoValido = false;
|
|
17
|
+
for (let index = 0; index < valoresExtra.length; index++) {
|
|
18
|
+
if (metodoValido === false) {
|
|
19
|
+
metodoValido = valorString.includes(valoresExtra[index]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (!(valor in valoresAceitos) &&
|
|
23
|
+
!metodoValido &&
|
|
24
|
+
!(valor in globais_1.valoresGlobais)) {
|
|
25
|
+
throw new Error(`Propriedade '${nomePropriedade}' com valor ${valor} inválido. Valores aceitos:
|
|
26
|
+
${Object.keys(valoresAceitos).reduce((final, atual) => final += `, ${atual}`)},
|
|
27
|
+
${valoresExtra.reduce((final, atual) => final += `, ${atual}`)},
|
|
28
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
29
|
+
}
|
|
11
30
|
}
|
|
12
31
|
}
|
|
13
32
|
exports.validarValores = validarValores;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comum.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/comum.ts"],"names":[],"mappings":";;;AAAA,kDAAsD;AAEtD,SAAgB,cAAc,CAC1B,eAAuB,EACvB,KAAU,EACV,cAAgD;
|
|
1
|
+
{"version":3,"file":"comum.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/comum.ts"],"names":[],"mappings":";;;AAAA,kDAAsD;AAEtD,SAAgB,cAAc,CAC1B,eAAuB,EACvB,KAAU,EACV,cAAgD,EAChD,YAAkB;IAGlB,IAAI,YAAY,KAAK,SAAS,EAAE;QAC5B,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC;YAC9B,CAAC,CAAC,KAAK,IAAI,wBAAc,CAAC,EAC5B;YACE,MAAM,IAAI,KAAK,CAAC,gBAAgB,eAAe,eAAe,KAAK;cAC7D,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC;cAC3E,MAAM,CAAC,IAAI,CAAC,wBAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,GAAG,CAAC,CAAA;SACxF;KACA;SAAM;QACH,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QACrC,IAAI,YAAY,GAAG,KAAK,CAAC;QACzB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACtD,IAAG,YAAY,KAAK,KAAK,EAAE;gBACvB,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;aAC5D;SACJ;QAED,IACA,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC;YAC1B,CAAC,YAAY;YACb,CAAC,CAAC,KAAK,IAAI,wBAAc,CAAC,EAC5B;YACE,MAAM,IAAI,KAAK,CAAC,gBAAgB,eAAe,eAAe,KAAK;cAC7D,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC;cAC3E,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC;cAC5D,MAAM,CAAC,IAAI,CAAC,wBAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,GAAG,CAAC,CAAA;SACxF;KACA;AAEL,CAAC;AApCD,wCAoCC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Metodo } from "../../valores/metodos/metodo";
|
|
2
|
+
export declare function validarValorCor(nomePropriedade: string, valor: Metodo | string, valoresAceitos?: {
|
|
2
3
|
[valorFoles: string]: string;
|
|
3
4
|
}, valoresExtra?: {
|
|
4
5
|
[valorFoles: string]: string;
|
|
@@ -1,65 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validarValorCor = void 0;
|
|
4
|
+
const metodo_1 = require("../../valores/metodos/metodo");
|
|
4
5
|
const cores_1 = require("../atributos/cores");
|
|
5
6
|
const globais_1 = require("../atributos/globais");
|
|
6
7
|
function validarValorCor(nomePropriedade, valor, valoresAceitos, valoresExtra) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
!(valorString.includes('hsl')) && !(valorString.includes('hsla'));
|
|
12
|
-
const validaçõesHEX = !(valorString.startsWith('#') && valorString.length <= 7);
|
|
13
|
-
if (valoresAceitos === undefined && valoresExtra === undefined) {
|
|
14
|
-
if (!(valor in cores_1.cores) &&
|
|
15
|
-
validaçõesCor &&
|
|
16
|
-
validaçõesHEX &&
|
|
17
|
-
!(valor in globais_1.valoresGlobais)) {
|
|
18
|
-
throw new Error(`Propriedade '${nomePropriedade}' com valor ${valor} inválido. Valores aceitos:
|
|
19
|
-
rgb(), rgba(), hsl(), hsla(), #hex,
|
|
20
|
-
${Object.keys(cores_1.cores).reduce((final, atual) => final += `, ${atual}`)},
|
|
21
|
-
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
8
|
+
if (valor instanceof metodo_1.Metodo) {
|
|
9
|
+
if (!['rgb', 'rgba', 'hsl', 'hsla'].includes(valor.constructor.name.toLowerCase())) {
|
|
10
|
+
throw new Error(`Propriedade '${nomePropriedade}' com método '${valor.constructor.name}' inválido. Valores aceitos:
|
|
11
|
+
rgb(), rgba(), hsl(), hsla().`);
|
|
22
12
|
}
|
|
23
13
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
${Object.keys(cores_1.cores).reduce((final, atual) => final += `, ${atual}`)},
|
|
33
|
-
${Object.keys(valoresExtra).reduce((final, atual) => final += `, ${atual}`)},
|
|
34
|
-
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
14
|
+
else {
|
|
15
|
+
const valorString = String(valor);
|
|
16
|
+
if (valorString.startsWith('#')) {
|
|
17
|
+
if (valorString.length !== 4 && valorString.length !== 7) {
|
|
18
|
+
throw new Error(`Propriedade '${nomePropriedade}' com hexadecimal inválido: '${valorString}'. Hexadecimais
|
|
19
|
+
devem ter 3 ou 6 caracteres após a cerquilha, sendo cada caracter de 0 até 9 ou de A até F.`);
|
|
20
|
+
}
|
|
21
|
+
// TODO(Vitor): validação Hex aqui para 3 ou 6 caracteres hex.
|
|
35
22
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
23
|
+
else {
|
|
24
|
+
// Cores pelo nome.
|
|
25
|
+
if (valoresAceitos === undefined) {
|
|
26
|
+
if (valoresExtra === undefined) {
|
|
27
|
+
if (!(valor in cores_1.cores) && !(valor in globais_1.valoresGlobais)) {
|
|
28
|
+
throw new Error(`Propriedade '${nomePropriedade}' com valor ${valor} inválido. Valores aceitos:
|
|
29
|
+
${Object.keys(cores_1.cores).reduce((final, atual) => final += `, ${atual}`)},
|
|
30
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
if (!(valor in cores_1.cores) && !(valor in valoresExtra) && !(valor in globais_1.valoresGlobais)) {
|
|
35
|
+
throw new Error(`Propriedade '${nomePropriedade}' com valor ${valor} inválido. Valores aceitos:
|
|
36
|
+
${Object.keys(cores_1.cores).reduce((final, atual) => final += `, ${atual}`)},
|
|
37
|
+
${Object.keys(valoresExtra).reduce((final, atual) => final += `, ${atual}`)},
|
|
38
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
if (valoresExtra === undefined) {
|
|
44
|
+
if (!(valor in cores_1.cores) && !(valor in valoresAceitos) && !(valor in globais_1.valoresGlobais)) {
|
|
45
|
+
throw new Error(`Propriedade '${nomePropriedade}' com valor ${valor} inválido. Valores aceitos:
|
|
46
|
+
${Object.keys(cores_1.cores).reduce((final, atual) => final += `, ${atual}`)},
|
|
47
|
+
${Object.keys(valoresAceitos).reduce((final, atual) => final += `, ${atual}`)},
|
|
48
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (!(valor in cores_1.cores) && !(valor in valoresAceitos) && !(valor in valoresExtra) && !(valor in globais_1.valoresGlobais)) {
|
|
53
|
+
throw new Error(`Propriedade '${nomePropriedade}' com valor ${valor} inválido. Valores aceitos:
|
|
54
|
+
${Object.keys(cores_1.cores).reduce((final, atual) => final += `, ${atual}`)},
|
|
55
|
+
${Object.keys(valoresAceitos).reduce((final, atual) => final += `, ${atual}`)},
|
|
56
|
+
${Object.keys(valoresExtra).reduce((final, atual) => final += `, ${atual}`)},
|
|
57
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
63
61
|
}
|
|
64
62
|
}
|
|
65
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cor.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/cor.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAC3C,kDAAsD;AAEtD,SAAgB,eAAe,CAC3B,eAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"cor.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/cor.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AACtD,8CAA2C;AAC3C,kDAAsD;AAEtD,SAAgB,eAAe,CAC3B,eAAuB,EACvB,KAAsB,EACtB,cAAiD,EACjD,YAA+C;IAE/C,IAAI,KAAK,YAAY,eAAM,EAAE;QACzB,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ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AAC,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,wBAAc,CAAC,EAAE;wBAC3G,MAAM,IAAI,KAAK,CAAC,gBAAgB,eAAe,eAAe,KAAK;0BACjE,MAAM,CAAC,IAAI,CAAC,aAAK,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC;0BAClE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC;0BAC3E,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC;0BACzE,MAAM,CAAC,IAAI,CAAC,wBAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;qBACrF;iBACJ;aACJ;SACJ;KACJ;AACL,CAAC;AAzDD,0CAyDC"}
|
|
@@ -21,25 +21,22 @@ function validarValorNumerico(nomePropriedade, valor, valoresAceitos, valoresExt
|
|
|
21
21
|
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
if (valoresAceitos === undefined && valoresExtra !== undefined) {
|
|
25
|
-
if (Number.isNaN(parseInt(valor)) &&
|
|
26
|
-
!(valor in valoresExtra) &&
|
|
27
|
-
!(valor in globais_1.valoresGlobais)) {
|
|
28
|
-
throw new Error(`Propriedade '${nomePropriedade}' com valor ${valor} inválido. Valores aceitos:
|
|
29
|
-
número-quantificador,
|
|
30
|
-
${Object.keys(valoresExtra).reduce((final, atual) => final += `, ${atual}`)},
|
|
31
|
-
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
24
|
if (valoresAceitos !== undefined && valoresExtra !== undefined) {
|
|
25
|
+
const valorString = valor.toString();
|
|
26
|
+
let metodoValido = false;
|
|
27
|
+
for (let index = 0; index < valoresExtra.length; index++) {
|
|
28
|
+
if (metodoValido === false) {
|
|
29
|
+
metodoValido = valorString.includes(valoresExtra[index]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
35
32
|
if (Number.isNaN(parseInt(valor)) &&
|
|
36
33
|
!(valor in valoresAceitos) &&
|
|
37
|
-
!
|
|
34
|
+
!metodoValido &&
|
|
38
35
|
!(valor in globais_1.valoresGlobais)) {
|
|
39
36
|
throw new Error(`Propriedade '${nomePropriedade}' com valor ${valor} inválido. Valores aceitos:
|
|
40
37
|
número-quantificador,
|
|
41
38
|
${Object.keys(valoresAceitos).reduce((final, atual) => final += `, ${atual}`)},
|
|
42
|
-
${
|
|
39
|
+
${valoresExtra.reduce((final, atual) => final += `, ${atual}`)},
|
|
43
40
|
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => final += `, ${atual}`)}.`);
|
|
44
41
|
}
|
|
45
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numerica.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/numerica.ts"],"names":[],"mappings":";;;AAAA,kDAAsD;AAEtD,SAAgB,oBAAoB,CAChC,eAAuB,EACvB,KAAU,EACV,cAAiD,EACjD,
|
|
1
|
+
{"version":3,"file":"numerica.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/numerica.ts"],"names":[],"mappings":";;;AAAA,kDAAsD;AAEtD,SAAgB,oBAAoB,CAChC,eAAuB,EACvB,KAAU,EACV,cAAiD,EACjD,YAAkB;IAElB,IA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AAE;YACtD,IAAG,YAAY,KAAK,KAAK,EAAE;gBACvB,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;aAC5D;SACJ;QAED,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC;YAC1B,CAAC,YAAY;YACb,CAAC,CAAC,KAAK,IAAI,wBAAc,CAAC,EAC5B;YACE,MAAM,IAAI,KAAK,CAAC,gBAAgB,eAAe,eAAe,KAAK;;cAEjE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC;cAC3E,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC;cAC5D,MAAM,CAAC,IAAI,CAAC,wBAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,GAAG,CAAC,CAAA;SACpF;KACJ;AACL,CAAC;AAjDD,oDAiDC"}
|
|
@@ -14,13 +14,8 @@ class VelocidadeAnimacao extends superclasse_1.Modificador {
|
|
|
14
14
|
"final-lento": "ease-out",
|
|
15
15
|
"inicio-final-lento": "ease-in-out",
|
|
16
16
|
"início-final-lento": "ease-in-out",
|
|
17
|
-
"curva-cubica": "cubic-bezier",
|
|
18
|
-
"curva-cúbica": "cubic-bezier",
|
|
19
|
-
"passos": "steps",
|
|
20
17
|
"passo-inicial": "step-start",
|
|
21
|
-
"passo-final": "step-start"
|
|
22
|
-
};
|
|
23
|
-
this.termosSalto = {
|
|
18
|
+
"passo-final": "step-start",
|
|
24
19
|
"salto-inicial": "jump-start",
|
|
25
20
|
"salto-final": "jump-end",
|
|
26
21
|
"salto-nenhum": "jump-none",
|
|
@@ -28,22 +23,9 @@ class VelocidadeAnimacao extends superclasse_1.Modificador {
|
|
|
28
23
|
"inicial": "start",
|
|
29
24
|
"final": "end",
|
|
30
25
|
};
|
|
31
|
-
// Além dos valores aceitos, o modificador também pode receber:
|
|
32
|
-
// cubic-bezier(p1, p2, p3, p4) -> curva-cúbica, que recebe 4 números como parâmetro,
|
|
33
|
-
// onde p1 e p3 devem estar na faixa de 0 a 1.
|
|
34
|
-
// Ex.: curva-cúbica(1, 5, 0, 6);
|
|
35
|
-
// if (['curva-cubica', 'curva-cúbica'].includes(valor)){
|
|
36
|
-
// Lógica para validar 4 parâmetros
|
|
37
|
-
// }
|
|
38
|
-
// steps(n, <jumpterm>) -> passos, que recebe dois parâmetros: um número e um termo de salto.
|
|
39
|
-
// O número indica quantas pausas terão entre os saltos. O termo deve ser um dos listados em termosSalto.
|
|
40
|
-
// Ex.: passos(3, salto-inicial);
|
|
41
|
-
// if (['passos'].includes(valor)){
|
|
42
|
-
// Lógica para validar 2 parâmetros
|
|
43
|
-
// }
|
|
44
|
-
// TODO: Pensar em uma lógica para as duas condicionais acima.
|
|
45
26
|
// Demais valores aceitos
|
|
46
|
-
|
|
27
|
+
const valoresExtra = ['cubic-bezier', 'steps'];
|
|
28
|
+
(0, comum_1.validarValores)('velocidade-animação', valor, this.valoresAceitos, valoresExtra);
|
|
47
29
|
this.valor = valor;
|
|
48
30
|
// Não recebe quantificador
|
|
49
31
|
// this.quantificador = quantificador;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"velocidade-animacao.js","sourceRoot":"","sources":["../../../fontes/modificadores/velocidade-animacao.ts"],"names":[],"mappings":";;;AAAA,+CAAgE;AAChE,8CAAoD;AAEpD,MAAa,kBAAmB,SAAQ,yBAAW;
|
|
1
|
+
{"version":3,"file":"velocidade-animacao.js","sourceRoot":"","sources":["../../../fontes/modificadores/velocidade-animacao.ts"],"names":[],"mappings":";;;AAAA,+CAAgE;AAChE,8CAAoD;AAEpD,MAAa,kBAAmB,SAAQ,yBAAW;IAmB/C,YAAY,KAAa,EAAE,aAAsB,EAAE,OAA4B;QAC3E,KAAK,CACD,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,EAC9C,2BAA2B,CAC9B,CAAC;QAtBN,mBAAc,GAAqC;YAC/C,mBAAmB,EAAE,MAAM;YAC3B,QAAQ,EAAE,QAAQ;YAClB,cAAc,EAAE,SAAS;YACzB,cAAc,EAAE,SAAS;YACzB,aAAa,EAAE,UAAU;YACzB,oBAAoB,EAAE,aAAa;YACnC,oBAAoB,EAAE,aAAa;YACnC,eAAe,EAAE,YAAY;YAC7B,aAAa,EAAE,YAAY;YAC3B,eAAe,EAAE,YAAY;YAC7B,aAAa,EAAE,UAAU;YACzB,cAAc,EAAE,WAAW;YAC3B,gBAAgB,EAAE,WAAW;YAC7B,SAAS,EAAE,OAAO;YAClB,OAAO,EAAE,KAAK;SACjB,CAAA;QAQG,yBAAyB;QACzB,MAAM,YAAY,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAC/C,IAAA,sBAAc,EAAC,qBAAqB,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;QAEhF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,2BAA2B;QAC3B,sCAAsC;IAC1C,CAAC;CACJ;AAlCD,gDAkCC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
ATRIBUTO: string;
|
|
3
|
+
BARRA: string;
|
|
3
4
|
CERQUILHA: string;
|
|
4
5
|
CHAVE_DIREITA: string;
|
|
5
6
|
CHAVE_ESQUERDA: string;
|
|
@@ -23,6 +24,7 @@ declare const _default: {
|
|
|
23
24
|
PSEUDO_CLASSE: string;
|
|
24
25
|
QUANTIFICADOR: string;
|
|
25
26
|
QUALITATIVO: string;
|
|
27
|
+
TEXTO: string;
|
|
26
28
|
TIL: string;
|
|
27
29
|
VIRGULA: string;
|
|
28
30
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
ATRIBUTO: "ATRIBUTO",
|
|
5
|
+
BARRA: "BARRA",
|
|
5
6
|
CERQUILHA: "CERQUILHA",
|
|
6
7
|
CHAVE_DIREITA: "CHAVE_DIREITA",
|
|
7
8
|
CHAVE_ESQUERDA: "CHAVE_ESQUERDA",
|
|
@@ -25,6 +26,7 @@ exports.default = {
|
|
|
25
26
|
PSEUDO_CLASSE: "PSEUDO_CLASSE",
|
|
26
27
|
QUANTIFICADOR: "QUANTIFICADOR",
|
|
27
28
|
QUALITATIVO: "QUALITATIVO",
|
|
29
|
+
TEXTO: "TEXTO",
|
|
28
30
|
TIL: "TIL",
|
|
29
31
|
VIRGULA: "VIRGULA"
|
|
30
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foles.js","sourceRoot":"","sources":["../../../fontes/tipos-de-simbolos/foles.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACX,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,kBAAkB;IACpC,iBAAiB,EAAE,mBAAmB;IACtC,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,cAAc,EAAE,gBAAgB;IAChC,kBAAkB,EAAE,oBAAoB;IACxC,iBAAiB,EAAE,mBAAmB;IACtC,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAC,eAAe;IAC7B,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACrB,CAAA"}
|
|
1
|
+
{"version":3,"file":"foles.js","sourceRoot":"","sources":["../../../fontes/tipos-de-simbolos/foles.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACX,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,kBAAkB;IACpC,iBAAiB,EAAE,mBAAmB;IACtC,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,cAAc,EAAE,gBAAgB;IAChC,kBAAkB,EAAE,oBAAoB;IACxC,iBAAiB,EAAE,mBAAmB;IACtC,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAC,eAAe;IAC7B,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACrB,CAAA"}
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Tradutor = void 0;
|
|
7
7
|
const gerais_1 = require("../modificadores/atributos/gerais");
|
|
8
8
|
const seletores_1 = require("../seletores");
|
|
9
|
+
const seletor_espaco_reservado_1 = require("../seletores/seletor-espaco-reservado");
|
|
10
|
+
const metodo_1 = require("../valores/metodos/metodo");
|
|
9
11
|
const estruturas_html_1 = __importDefault(require("./estruturas-html"));
|
|
10
12
|
class Tradutor {
|
|
11
13
|
traduzirModificador(modificador) {
|
|
@@ -20,9 +22,9 @@ class Tradutor {
|
|
|
20
22
|
const valorTraduzido = objetoValores[modificador.valor];
|
|
21
23
|
return `\t${modificador.propriedadeCss}: ${valorTraduzido};\n`;
|
|
22
24
|
}
|
|
23
|
-
// Caso 3: Valor é RGB, RGBA, HSL, HSLA ou HEX, ou seja, um
|
|
24
|
-
if (
|
|
25
|
-
return `\t${modificador.propriedadeCss}: ${modificador.valor
|
|
25
|
+
// Caso 3: Valor é RGB, RGBA, HSL, HSLA ou HEX, ou seja, um método.
|
|
26
|
+
if (modificador.valor instanceof metodo_1.Metodo) {
|
|
27
|
+
return `\t${modificador.propriedadeCss}: ${modificador.valor.paraTexto() || ""};\n`;
|
|
26
28
|
}
|
|
27
29
|
// Caso 4: É um valor genérico, cuja tradução está na lista 'valoresGerais'.
|
|
28
30
|
const valorTraduzido = gerais_1.valoresGerais[modificador.valor];
|
|
@@ -31,22 +33,13 @@ class Tradutor {
|
|
|
31
33
|
traduzir(declaracoes) {
|
|
32
34
|
let resultado = "";
|
|
33
35
|
for (const declaracao of declaracoes) {
|
|
34
|
-
|
|
35
|
-
const encontrarHtml = Object.keys(estruturasHtml).filter(
|
|
36
|
-
(estrutura) => declaracao.seletores[0] === estrutura
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
if (encontrarHtml.length !== 0) {
|
|
40
|
-
resultado += `${declaracao.espacoReservado}${
|
|
41
|
-
estruturasHtml[declaracao.seletores[0]]
|
|
42
|
-
} {\n`;
|
|
43
|
-
} else {
|
|
44
|
-
resultado += `${declaracao.espacoReservado}${declaracao.seletores[0]} {\n`;
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
resultado += `${estruturasHtml[declaracao.seletores[0]]} {\n`;
|
|
48
|
-
} */
|
|
36
|
+
let deveImprimir = true;
|
|
49
37
|
for (const seletor of declaracao.seletores) {
|
|
38
|
+
// Espaços reservados não são escritos diretamente no CSS.
|
|
39
|
+
if (seletor instanceof seletor_espaco_reservado_1.SeletorEspacoReservado) {
|
|
40
|
+
deveImprimir = false;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
50
43
|
if (seletor instanceof seletores_1.SeletorEstrutura) {
|
|
51
44
|
const tagLmht = seletor.paraTexto();
|
|
52
45
|
const traducaoTag = estruturas_html_1.default[tagLmht];
|
|
@@ -56,6 +49,9 @@ class Tradutor {
|
|
|
56
49
|
resultado += seletor.paraTexto() + ', ';
|
|
57
50
|
}
|
|
58
51
|
}
|
|
52
|
+
if (!deveImprimir) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
59
55
|
resultado = resultado.slice(0, -2);
|
|
60
56
|
resultado += ' {\n';
|
|
61
57
|
for (const modificador of declaracao.modificadores) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tradutor.js","sourceRoot":"","sources":["../../../fontes/tradutor/tradutor.ts"],"names":[],"mappings":";;;;;;AAEA,8DAAkE;AAClE,4CAAgD;
|
|
1
|
+
{"version":3,"file":"tradutor.js","sourceRoot":"","sources":["../../../fontes/tradutor/tradutor.ts"],"names":[],"mappings":";;;;;;AAEA,8DAAkE;AAClE,4CAAgD;AAChD,oFAA+E;AAC/E,sDAAmD;AAEnD,wEAA+C;AAE/C,MAAa,QAAQ;IACjB,mBAAmB,CAAC,WAAwB;QACxC,kDAAkD;QAClD,IAAI,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,KAAK,WAAW,CAAC,cAAc,KAAK,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,aAAa,IAAI,EACxF,KAAK,CAAC;SACb;QAED,gEAAgE;QAChE,IACI,WAAW,CAAC,gBAAgB,CAAC,KAAK,SAAS;YAC3C,WAAW,CAAC,gBAAgB,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,CAAC,EACjE;YACE,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IAAI,MAAM,CAAC;YAEpB,KAAK,MAAM,WAAW,IAAI,UAAU,CAAC,aAAa,EAAE;gBAChD,SAAS,IAAI,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;aACtD;YAED,SAAS,IAAI,OAAO,CAAC;SACxB;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAlED,4BAkEC"}
|
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DicionarioValores = void 0;
|
|
4
|
+
const curva_cubica_1 = require("./metodos/curva-cubica");
|
|
5
|
+
const encaixar_conteudo_1 = require("./metodos/encaixar-conteudo");
|
|
4
6
|
const hex_1 = require("./metodos/hex");
|
|
5
7
|
const hsl_1 = require("./metodos/hsl");
|
|
6
8
|
const hsla_1 = require("./metodos/hsla");
|
|
9
|
+
const limitar_1 = require("./metodos/limitar");
|
|
10
|
+
const linear_1 = require("./metodos/linear");
|
|
11
|
+
const minmax_1 = require("./metodos/minmax");
|
|
7
12
|
const rgb_1 = require("./metodos/rgb");
|
|
8
13
|
const rgba_1 = require("./metodos/rgba");
|
|
14
|
+
const passos_1 = require("./metodos/passos");
|
|
15
|
+
const url_1 = require("./metodos/url");
|
|
9
16
|
exports.DicionarioValores = {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
17
|
+
"curva-cubica": curva_cubica_1.CurvaCubica,
|
|
18
|
+
"curva-cúbica": curva_cubica_1.CurvaCubica,
|
|
19
|
+
"encaixar-conteudo": encaixar_conteudo_1.EncaixarConteudo,
|
|
20
|
+
"encaixar-conteúdo": encaixar_conteudo_1.EncaixarConteudo,
|
|
12
21
|
"hsl": hsl_1.Hsl,
|
|
13
22
|
"hsla": hsla_1.Hsla,
|
|
14
23
|
"hex": hex_1.Hex,
|
|
24
|
+
"limitar": limitar_1.Limitar,
|
|
25
|
+
"linear": linear_1.Linear,
|
|
26
|
+
"minmax": minmax_1.MinMax,
|
|
27
|
+
"passos": passos_1.Passos,
|
|
28
|
+
"rgb": rgb_1.Rgb,
|
|
29
|
+
"rgba": rgba_1.Rgba,
|
|
30
|
+
"url": url_1.Url,
|
|
15
31
|
};
|
|
16
32
|
//# sourceMappingURL=dicionario-valores.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dicionario-valores.js","sourceRoot":"","sources":["../../../fontes/valores/dicionario-valores.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AACpC,uCAAoC;AACpC,yCAAsC;AACtC,uCAAoC;AACpC,yCAAsC;
|
|
1
|
+
{"version":3,"file":"dicionario-valores.js","sourceRoot":"","sources":["../../../fontes/valores/dicionario-valores.ts"],"names":[],"mappings":";;;AAAA,yDAAqD;AACrD,mEAA+D;AAC/D,uCAAoC;AACpC,uCAAoC;AACpC,yCAAsC;AACtC,+CAA4C;AAC5C,6CAA0C;AAC1C,6CAA0C;AAC1C,uCAAoC;AACpC,yCAAsC;AACtC,6CAA0C;AAC1C,uCAAoC;AAEvB,QAAA,iBAAiB,GAAiC;IAC3D,cAAc,EAAE,0BAAW;IAC3B,cAAc,EAAE,0BAAW;IAC3B,mBAAmB,EAAE,oCAAgB;IACrC,mBAAmB,EAAE,oCAAgB;IACrC,KAAK,EAAE,SAAG;IACV,MAAM,EAAE,WAAI;IACZ,KAAK,EAAE,SAAG;IACV,SAAS,EAAE,iBAAO;IAClB,QAAQ,EAAE,eAAM;IAChB,QAAQ,EAAE,eAAM;IAChB,QAAQ,EAAE,eAAM;IAChB,KAAK,EAAE,SAAG;IACV,MAAM,EAAE,WAAI;IACZ,KAAK,EAAE,SAAG;CACb,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Simbolo } from "../../lexador";
|
|
2
|
+
import { Metodo } from "./metodo";
|
|
3
|
+
export declare class CurvaCubica extends Metodo {
|
|
4
|
+
valor1: number;
|
|
5
|
+
valor2: number;
|
|
6
|
+
valor3: number;
|
|
7
|
+
valor4: number;
|
|
8
|
+
traducao: string;
|
|
9
|
+
constructor(valor1: Simbolo, valor2: Simbolo, valor3: Simbolo, valor4: Simbolo);
|
|
10
|
+
paraTexto(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CurvaCubica = void 0;
|
|
4
|
+
const metodo_1 = require("./metodo");
|
|
5
|
+
class CurvaCubica extends metodo_1.Metodo {
|
|
6
|
+
constructor(valor1, valor2, valor3, valor4) {
|
|
7
|
+
super();
|
|
8
|
+
this.valor1 = Number(valor1.lexema);
|
|
9
|
+
this.valor2 = Number(valor2.lexema);
|
|
10
|
+
this.valor3 = Number(valor3.lexema);
|
|
11
|
+
this.valor4 = Number(valor4.lexema);
|
|
12
|
+
this.traducao = 'cubic-bezier';
|
|
13
|
+
}
|
|
14
|
+
paraTexto() {
|
|
15
|
+
return `cubic-bezier(${this.valor1}, ${this.valor2}, ${this.valor3}, ${this.valor4})`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.CurvaCubica = CurvaCubica;
|
|
19
|
+
//# sourceMappingURL=curva-cubica.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curva-cubica.js","sourceRoot":"","sources":["../../../../fontes/valores/metodos/curva-cubica.ts"],"names":[],"mappings":";;;AACA,qCAAkC;AAElC,MAAa,WAAY,SAAQ,eAAM;IAOnC,YAAY,MAAe,EAAE,MAAe,EAAE,MAAe,EAAE,MAAe;QAC1E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC;IACnC,CAAC;IAED,SAAS;QACL,OAAO,gBAAgB,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,GAAG,CAAA;IACzF,CAAC;CACJ;AAnBD,kCAmBC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EncaixarConteudo = void 0;
|
|
4
|
+
const metodo_1 = require("./metodo");
|
|
5
|
+
class EncaixarConteudo extends metodo_1.Metodo {
|
|
6
|
+
constructor(valor, quantificador) {
|
|
7
|
+
super();
|
|
8
|
+
this.valor = Number(valor);
|
|
9
|
+
this.quantificador = quantificador;
|
|
10
|
+
}
|
|
11
|
+
paraTexto() {
|
|
12
|
+
return `fit-content(${this.valor}${this.quantificador})`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.EncaixarConteudo = EncaixarConteudo;
|
|
16
|
+
//# sourceMappingURL=encaixar-conteudo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encaixar-conteudo.js","sourceRoot":"","sources":["../../../../fontes/valores/metodos/encaixar-conteudo.ts"],"names":[],"mappings":";;;AACA,qCAAkC;AAElC,MAAa,gBAAiB,SAAQ,eAAM;IAIxC,YAAY,KAAc,EAAE,aAAqB;QAC7C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;IAED,SAAS;QACL,OAAO,eAAe,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,aAAa,GAAG,CAAA;IAC5D,CAAC;CACJ;AAbD,4CAaC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hex.js","sourceRoot":"","sources":["../../../../fontes/valores/metodos/hex.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAElC,MAAa,GAAI,SAAQ,eAAM;IAG3B,YAAY,MAAc;QACtB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"hex.js","sourceRoot":"","sources":["../../../../fontes/valores/metodos/hex.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAElC,MAAa,GAAI,SAAQ,eAAM;IAG3B,YAAY,MAAc;QACtB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,SAAS;QACL,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;IAC7B,CAAC;CACJ;AAXD,kBAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hsl.js","sourceRoot":"","sources":["../../../../fontes/valores/metodos/hsl.ts"],"names":[],"mappings":";;;AACA,qCAAkC;AAElC,MAAa,GAAI,SAAQ,eAAM;IAK3B,YAAY,KAAc,EAAE,SAAkB,EAAE,YAAqB;QACjE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"hsl.js","sourceRoot":"","sources":["../../../../fontes/valores/metodos/hsl.ts"],"names":[],"mappings":";;;AACA,qCAAkC;AAElC,MAAa,GAAI,SAAQ,eAAM;IAK3B,YAAY,KAAc,EAAE,SAAkB,EAAE,YAAqB;QACjE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAED,SAAS;QACL,OAAO,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,SAAS,MAAM,IAAI,CAAC,YAAY,IAAI,CAAA;IAC1E,CAAC;CACJ;AAfD,kBAeC"}
|