@designliquido/foles 0.10.0 → 0.11.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 +7 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico-reverso.d.ts +4 -2
- package/fontes/avaliador-sintatico/avaliador-sintatico-reverso.js +59 -11
- package/fontes/avaliador-sintatico/avaliador-sintatico-reverso.js.map +1 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico.js +0 -5
- package/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -1
- package/fontes/foles.js +4 -3
- package/fontes/foles.js.map +1 -1
- package/fontes/lexador/palavras-reservadas/css.d.ts +451 -34
- package/fontes/lexador/palavras-reservadas/css.js +472 -41
- package/fontes/lexador/palavras-reservadas/css.js.map +1 -1
- package/fontes/lexador/palavras-reservadas/foles.d.ts +9 -9
- package/fontes/lexador/palavras-reservadas/foles.js +9 -10
- package/fontes/lexador/palavras-reservadas/foles.js.map +1 -1
- package/fontes/modificadores/aparencia.js +1 -1
- package/fontes/modificadores/aparencia.js.map +1 -1
- package/fontes/modificadores/atributos/gerais.js +1 -0
- package/fontes/modificadores/atributos/gerais.js.map +1 -1
- package/fontes/modificadores/cor-borda.js +1 -1
- package/fontes/modificadores/cor-borda.js.map +1 -1
- package/fontes/modificadores/margem-superior.js +1 -0
- package/fontes/modificadores/margem-superior.js.map +1 -1
- package/fontes/modificadores/superclasse/seletor-reverso-modificador.d.ts +1 -1
- package/fontes/modificadores/superclasse/seletor-reverso-modificador.js +2 -2
- package/fontes/modificadores/superclasse/seletor-reverso-modificador.js.map +1 -1
- package/fontes/modificadores/validacoes/comum.js +22 -5
- package/fontes/modificadores/validacoes/comum.js.map +1 -1
- package/fontes/modificadores/validacoes/condicao-extra.js +20 -5
- package/fontes/modificadores/validacoes/condicao-extra.js.map +1 -1
- package/fontes/modificadores/validacoes/cor.js +21 -9
- package/fontes/modificadores/validacoes/cor.js.map +1 -1
- package/fontes/modificadores/validacoes/fonte.js +11 -2
- package/fontes/modificadores/validacoes/fonte.js.map +1 -1
- package/fontes/modificadores/validacoes/multiplos-qualitativos.js +29 -7
- package/fontes/modificadores/validacoes/multiplos-qualitativos.js.map +1 -1
- package/fontes/modificadores/validacoes/numerica.js +30 -6
- package/fontes/modificadores/validacoes/numerica.js.map +1 -1
- package/fontes/pseudoclasses/n-ultimo-tipo.js +1 -1
- package/fontes/pseudoclasses/n-ultimo-tipo.js.map +1 -1
- package/fontes/resolvedores/resolvedor-reverso.d.ts +9 -2
- package/fontes/resolvedores/resolvedor-reverso.js +137 -37
- package/fontes/resolvedores/resolvedor-reverso.js.map +1 -1
- package/fontes/tipos-de-simbolos/css.d.ts +4 -0
- package/fontes/tipos-de-simbolos/css.js +4 -0
- package/fontes/tipos-de-simbolos/css.js.map +1 -1
- package/fontes/valores/metodos/css/annotation.js +1 -5
- package/fontes/valores/metodos/css/annotation.js.map +1 -1
- package/fontes/valores/metodos/css/counter.js +1 -1
- package/fontes/valores/metodos/css/counter.js.map +1 -1
- package/fontes/valores/metodos/css/ornaments.js +0 -3
- package/fontes/valores/metodos/css/ornaments.js.map +1 -1
- package/fontes/valores/metodos/foles/hsl.js +1 -1
- package/fontes/valores/metodos/foles/hsl.js.map +1 -1
- package/fontes/valores/metodos/foles/hsla.js +1 -1
- package/fontes/valores/metodos/foles/hsla.js.map +1 -1
- package/package.json +2 -2
- package/testes/avaliador-sintatico-reverso.test.d.ts +1 -0
- package/testes/avaliador-sintatico-reverso.test.js +117 -0
- package/testes/avaliador-sintatico-reverso.test.js.map +1 -0
- package/testes/avaliador-sintatico.test.js +34 -0
- package/testes/avaliador-sintatico.test.js.map +1 -1
- package/testes/lexador-reverso.test.js.map +1 -1
- package/testes/listas/traducao-reversa.d.ts +2 -0
- package/testes/listas/traducao-reversa.js +129 -5
- package/testes/listas/traducao-reversa.js.map +1 -1
- package/testes/listas/valores-quantificadores.d.ts +2 -0
- package/testes/listas/valores-quantificadores.js +146 -1
- package/testes/listas/valores-quantificadores.js.map +1 -1
- package/testes/modificadores/cores.test.js +6 -6
- package/testes/modificadores/cores.test.js.map +1 -1
- package/testes/modificadores/metodos-reversos.test.js +485 -48
- package/testes/modificadores/metodos-reversos.test.js.map +1 -1
- package/testes/modificadores/metodos.test.js +34 -1
- package/testes/modificadores/metodos.test.js.map +1 -1
- package/testes/modificadores/suporte-variaveis.test.js +4 -9
- package/testes/modificadores/suporte-variaveis.test.js.map +1 -1
- package/testes/resolvedor-reverso.test.js +85 -8
- package/testes/resolvedor-reverso.test.js.map +1 -1
- package/testes/resolvedor.test.js +4 -4
- package/testes/resolvedor.test.js.map +1 -1
|
@@ -14,22 +14,40 @@ function validarValorNumerico(nomePropriedade, valores, valoresAceitos, valoresE
|
|
|
14
14
|
if (quantificadoresAceitos && valorModificador.numerico && valorNumericoTipado.quantificador) {
|
|
15
15
|
(0, quantificador_1.validarQuantificador)(nomePropriedade, valorNumericoTipado.quantificador, quantificadoresAceitos);
|
|
16
16
|
}
|
|
17
|
+
let valoresCss = [];
|
|
18
|
+
if (valoresAceitos) {
|
|
19
|
+
valoresCss = Object.values(valoresAceitos);
|
|
20
|
+
}
|
|
21
|
+
const valoresGlobaisCss = Object.values(globais_1.valoresGlobais);
|
|
22
|
+
valoresGlobaisCss.forEach((valor) => valoresCss.push(valor));
|
|
17
23
|
if (valoresAceitos === null && valoresExtra === null) {
|
|
18
24
|
if (typeof valorModificador.valor !== 'number' &&
|
|
25
|
+
!(valoresCss.includes(valorModificador.valor)) &&
|
|
19
26
|
!(valorModificador.valor in globais_1.valoresGlobais)) {
|
|
20
27
|
throw new Error(`Modificador ou variável '${nomePropriedade}' com valor ${valorModificador.valor} inválido. Valores aceitos:
|
|
21
|
-
número-quantificador (ex.: 12px)
|
|
22
|
-
|
|
28
|
+
número-quantificador (ex.: 12px);
|
|
29
|
+
|
|
30
|
+
Valores Foles aceitos:
|
|
31
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}.
|
|
32
|
+
|
|
33
|
+
Valores CSS aceitos:
|
|
34
|
+
${valoresCss.reduce((final, atual) => (final += `, ${atual}`))}.`);
|
|
23
35
|
}
|
|
24
36
|
}
|
|
25
37
|
if (valoresAceitos !== null && valoresExtra === null) {
|
|
26
38
|
if (typeof valorModificador.valor !== 'number' &&
|
|
27
39
|
!(valorModificador.valor in valoresAceitos) &&
|
|
40
|
+
!(valoresCss.includes(valorModificador.valor)) &&
|
|
28
41
|
!(valorModificador.valor in globais_1.valoresGlobais)) {
|
|
29
42
|
throw new Error(`Modificador ou variável '${nomePropriedade}' com valor ${valorModificador.valor} inválido. Valores aceitos:
|
|
30
|
-
número-quantificador (ex.: 12px)
|
|
43
|
+
número-quantificador (ex.: 12px);
|
|
44
|
+
|
|
45
|
+
Valores FolEs aceitos:
|
|
31
46
|
${Object.keys(valoresAceitos).reduce((final, atual) => (final += `, ${atual}`))},
|
|
32
|
-
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}
|
|
47
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}.
|
|
48
|
+
|
|
49
|
+
Valores CSS aceitos:
|
|
50
|
+
${valoresCss.reduce((final, atual) => (final += `, ${atual}`))}.`);
|
|
33
51
|
}
|
|
34
52
|
}
|
|
35
53
|
if (valoresAceitos !== null && valoresExtra !== null) {
|
|
@@ -43,13 +61,19 @@ function validarValorNumerico(nomePropriedade, valores, valoresAceitos, valoresE
|
|
|
43
61
|
}
|
|
44
62
|
if (typeof valorModificador.valor !== 'number' &&
|
|
45
63
|
!(valorModificador.valor in valoresAceitos) &&
|
|
64
|
+
!(valoresCss.includes(valorModificador.valor)) &&
|
|
46
65
|
!metodoValido &&
|
|
47
66
|
!(valorModificador.valor in globais_1.valoresGlobais)) {
|
|
48
67
|
throw new Error(`Modificador ou variável '${nomePropriedade}' com valor ${valorModificador.valor} inválido. Valores aceitos:
|
|
49
|
-
número-quantificador (ex.: 12px)
|
|
68
|
+
número-quantificador (ex.: 12px);
|
|
69
|
+
|
|
70
|
+
Valores FolEs aceitos:
|
|
50
71
|
${Object.keys(valoresAceitos).reduce((final, atual) => (final += `, ${atual}`))},
|
|
51
72
|
${valoresExtra.reduce((final, atual) => (final += `, ${atual}`))},
|
|
52
|
-
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}
|
|
73
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}.
|
|
74
|
+
|
|
75
|
+
Valores CSS aceitos:
|
|
76
|
+
${valoresCss.reduce((final, atual) => (final += `, ${atual}`))}.`);
|
|
53
77
|
}
|
|
54
78
|
}
|
|
55
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numerica.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/numerica.ts"],"names":[],"mappings":";;AAMA,
|
|
1
|
+
{"version":3,"file":"numerica.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/numerica.ts"],"names":[],"mappings":";;AAMA,oDA2FC;AAhGD,kDAAsD;AACtD,qDAAiD;AACjD,mEAA+D;AAC/D,mDAAuD;AAEvD,SAAgB,oBAAoB,CAChC,eAAuB,EACvB,OAAgB,EAChB,cAAiD,EACjD,YAAkB,EAClB,sBAAyD,EACzD,yBAAkC,KAAK;IAEvC,MAAM,gBAAgB,GAAmE,IAAA,8BAAa,EAAC,OAAO,CAAC,CAAC;IAEhH,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,CAAkB,CAAC;IACxD,IAAI,sBAAsB,IAAI,gBAAgB,CAAC,QAAQ,IAAI,mBAAmB,CAAC,aAAa,EAAE,CAAC;QAC3F,IAAA,4CAAoB,EAAC,eAAe,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,sBAAsB,IAAI,gBAAgB,CAAC,QAAQ,IAAI,mBAAmB,CAAC,aAAa,EAAE,CAA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AAC,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAC9C,CAAC,YAAY;YACb,CAAC,CAAC,gBAAgB,CAAC,KAAK,IAAI,wBAAc,CAAC,EAC7C,CAAC;YACC,MAAM,IAAI,KAAK,CAAC,4BAA4B,eAAe,eAAe,gBAAgB,CAAC,KAAK;;;;cAI9F,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;cAC7E,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;cAC9D,MAAM,CAAC,IAAI,CAAC,wBAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;;;cAG7E,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;QACvE,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.NUltimoTipo = void 0;
|
|
|
4
4
|
const pseudoclasse_1 = require("./pseudoclasse");
|
|
5
5
|
class NUltimoTipo extends pseudoclasse_1.Pseudoclasse {
|
|
6
6
|
constructor(pragmas) {
|
|
7
|
-
super("n-ultimo-tipo", "nth-
|
|
7
|
+
super("n-ultimo-tipo", "nth-last-type", pragmas);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.NUltimoTipo = NUltimoTipo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"n-ultimo-tipo.js","sourceRoot":"","sources":["../../../fontes/pseudoclasses/n-ultimo-tipo.ts"],"names":[],"mappings":";;;AAAA,iDAAmE;AAEnE,MAAa,WAAY,SAAQ,2BAAY;IACzC,YAAY,OAA6B;QACrC,KAAK,CAAC,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"n-ultimo-tipo.js","sourceRoot":"","sources":["../../../fontes/pseudoclasses/n-ultimo-tipo.ts"],"names":[],"mappings":";;;AAAA,iDAAmE;AAEnE,MAAa,WAAY,SAAQ,2BAAY;IACzC,YAAY,OAA6B;QACrC,KAAK,CAAC,eAAe,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACJ;AAJD,kCAIC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Declaracao } from "../declaracoes";
|
|
1
|
+
import { BlocoDeclaracao, Declaracao, DeclaracaoVariavel } from "../declaracoes";
|
|
2
2
|
import { Modificador } from "../modificadores";
|
|
3
3
|
import { Valor } from "../valores";
|
|
4
4
|
/**
|
|
@@ -7,8 +7,15 @@ import { Valor } from "../valores";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class ResolvedorReverso {
|
|
9
9
|
resolverComAninhamentos: boolean;
|
|
10
|
+
variaveis: {
|
|
11
|
+
[key: string]: Valor[];
|
|
12
|
+
};
|
|
10
13
|
constructor(resolverComAninhamentos?: boolean);
|
|
11
|
-
protected resolverValor(valor: Valor
|
|
14
|
+
protected resolverValor(valor: Valor, valoresAceitos?: {
|
|
15
|
+
[valorFoles: string]: string;
|
|
16
|
+
}): string;
|
|
12
17
|
resolverModificador(modificador: Modificador, indentacao?: number): string;
|
|
18
|
+
resolverDeclaracaoVariavel(declaracaoVariavel: DeclaracaoVariavel): void;
|
|
19
|
+
resolverBlocoDeclaracao(declaracao: BlocoDeclaracao, indentacao: number, textoSeletorAnterior: string): string;
|
|
13
20
|
resolver(declaracoes: Declaracao[], indentacao?: number, seletorAnterior?: string): string;
|
|
14
21
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ResolvedorReverso = void 0;
|
|
4
|
-
const
|
|
7
|
+
const estrutura_1 = require("../estruturas/estrutura");
|
|
8
|
+
const gerais_1 = require("../modificadores/atributos/gerais");
|
|
9
|
+
const seletor_espaco_reservado_1 = require("../seletores/seletor-espaco-reservado");
|
|
10
|
+
const estruturas_lmht_1 = __importDefault(require("../tradutores/estruturas-lmht"));
|
|
5
11
|
const metodo_css_1 = require("../valores/metodos/css/metodo-css");
|
|
6
12
|
const metodo_1 = require("../valores/metodos/foles/metodo");
|
|
7
13
|
/**
|
|
@@ -11,24 +17,136 @@ const metodo_1 = require("../valores/metodos/foles/metodo");
|
|
|
11
17
|
class ResolvedorReverso {
|
|
12
18
|
constructor(resolverComAninhamentos = true) {
|
|
13
19
|
this.resolverComAninhamentos = resolverComAninhamentos;
|
|
20
|
+
this.variaveis = {};
|
|
14
21
|
}
|
|
15
|
-
resolverValor(valor) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
resolverValor(valor, valoresAceitos) {
|
|
23
|
+
switch (valor.constructor.name) {
|
|
24
|
+
case 'ReferenciaVariavel':
|
|
25
|
+
const valorReferenciaVariavel = valor;
|
|
26
|
+
const valoresVariavelCorrespondente = this.variaveis[valorReferenciaVariavel.nomeVariavel];
|
|
27
|
+
if (valoresVariavelCorrespondente === undefined) {
|
|
28
|
+
throw new Error(`A variável '${valorReferenciaVariavel.nomeVariavel}' deve ser declarada antes da atribuição de valor.`);
|
|
29
|
+
}
|
|
30
|
+
let valoresVariavelResolvidos = "";
|
|
31
|
+
for (const valorVariavel of valoresVariavelCorrespondente) {
|
|
32
|
+
const valorResolvido = this.resolverValor(valorVariavel);
|
|
33
|
+
if (valorResolvido === ",") {
|
|
34
|
+
valoresVariavelResolvidos = valoresVariavelResolvidos.slice(0, -1);
|
|
35
|
+
}
|
|
36
|
+
valoresVariavelResolvidos += valorResolvido + " ";
|
|
37
|
+
}
|
|
38
|
+
valoresVariavelResolvidos = valoresVariavelResolvidos.slice(0, -1);
|
|
39
|
+
return valoresVariavelResolvidos;
|
|
40
|
+
case 'ValorAbreviacao':
|
|
41
|
+
return "/";
|
|
42
|
+
case 'ValorNumerico':
|
|
43
|
+
const valorNumerico = valor;
|
|
44
|
+
return `${valorNumerico.literalNumerico}${valorNumerico.quantificador || ''}`;
|
|
45
|
+
case 'ValorQualitativo':
|
|
46
|
+
const valorQualitativo = valor;
|
|
47
|
+
let traducaoQualitativo = undefined;
|
|
48
|
+
for (const [chave, valor] of Object.entries(gerais_1.valoresGerais)) {
|
|
49
|
+
if (valor === valorQualitativo.qualitativo) {
|
|
50
|
+
traducaoQualitativo = chave;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (!traducaoQualitativo) {
|
|
54
|
+
for (const [chave, valor] of Object.entries(valoresAceitos)) {
|
|
55
|
+
if (valor === valorQualitativo.qualitativo) {
|
|
56
|
+
traducaoQualitativo = chave;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (!traducaoQualitativo)
|
|
61
|
+
traducaoQualitativo = valorQualitativo.qualitativo;
|
|
62
|
+
return `${traducaoQualitativo}`;
|
|
63
|
+
case 'ValorTexto':
|
|
64
|
+
const valorTexto = valor;
|
|
65
|
+
return valorTexto.literalTexto;
|
|
66
|
+
case 'ValorVirgula':
|
|
67
|
+
return ",";
|
|
68
|
+
default:
|
|
69
|
+
// Valor é RGB, RGBA, HSL, HSLA ou HEX, ou seja, um método.
|
|
70
|
+
if (valor instanceof metodo_css_1.MetodoCss || valor instanceof metodo_1.Metodo) {
|
|
71
|
+
return valor.paraTexto();
|
|
72
|
+
}
|
|
73
|
+
throw new Error(JSON.stringify(valor) + " não é um valor válido para resolução.");
|
|
21
74
|
}
|
|
22
|
-
return String(valor);
|
|
23
75
|
}
|
|
24
76
|
resolverModificador(modificador, indentacao = 0) {
|
|
25
|
-
let
|
|
77
|
+
let valoresTraduzidos = "";
|
|
26
78
|
for (const valor of modificador.valores) {
|
|
27
|
-
|
|
79
|
+
let valoresAceitos = null;
|
|
80
|
+
if (modificador.valoresAceitos)
|
|
81
|
+
valoresAceitos = modificador.valoresAceitos;
|
|
82
|
+
const valorResolvido = this.resolverValor(valor, valoresAceitos);
|
|
83
|
+
if (valorResolvido === ",") {
|
|
84
|
+
valoresTraduzidos = valoresTraduzidos.slice(0, -1);
|
|
85
|
+
}
|
|
86
|
+
valoresTraduzidos += valorResolvido + " ";
|
|
28
87
|
}
|
|
29
|
-
|
|
88
|
+
valoresTraduzidos = valoresTraduzidos.slice(0, -1);
|
|
30
89
|
return (" ".repeat(indentacao) +
|
|
31
|
-
`${Array.isArray(modificador.nomeFoles) ? modificador.nomeFoles[0] : modificador.nomeFoles}: ${
|
|
90
|
+
`${Array.isArray(modificador.nomeFoles) ? modificador.nomeFoles[0] : modificador.nomeFoles}: ${valoresTraduzidos};\n`);
|
|
91
|
+
}
|
|
92
|
+
resolverDeclaracaoVariavel(declaracaoVariavel) {
|
|
93
|
+
this.variaveis[declaracaoVariavel.nome] = declaracaoVariavel.valores;
|
|
94
|
+
}
|
|
95
|
+
resolverBlocoDeclaracao(declaracao, indentacao, textoSeletorAnterior) {
|
|
96
|
+
let resultado = "";
|
|
97
|
+
const prefixos = [];
|
|
98
|
+
let deveImprimir = true;
|
|
99
|
+
for (const seletor of declaracao.seletores) {
|
|
100
|
+
if (seletor instanceof seletor_espaco_reservado_1.SeletorEspacoReservado) {
|
|
101
|
+
deveImprimir = false;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
let prefixo;
|
|
105
|
+
if (seletor instanceof estrutura_1.Estrutura) {
|
|
106
|
+
if (seletor.pseudoclasse) {
|
|
107
|
+
const seletorHtml = seletor.tagHtml;
|
|
108
|
+
const seletorSemPseudoclasse = seletorHtml.split(":")[0];
|
|
109
|
+
const traducaoSeletor = estruturas_lmht_1.default[seletorSemPseudoclasse][0];
|
|
110
|
+
const traducaoPseudoclasse = seletor.pseudoclasse.pseudoclasseCss;
|
|
111
|
+
prefixo = (textoSeletorAnterior +
|
|
112
|
+
" " +
|
|
113
|
+
`${traducaoSeletor}:${traducaoPseudoclasse}`).trimStart();
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
const seletorLmht = seletor.tagHtml;
|
|
117
|
+
const traducaoSeletor = estruturas_lmht_1.default[seletorLmht][0];
|
|
118
|
+
prefixo = (textoSeletorAnterior +
|
|
119
|
+
" " +
|
|
120
|
+
traducaoSeletor).trimStart();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
prefixo = (textoSeletorAnterior +
|
|
125
|
+
" " +
|
|
126
|
+
seletor.paraTexto()).trimStart();
|
|
127
|
+
}
|
|
128
|
+
prefixos.push(prefixo);
|
|
129
|
+
resultado += " ".repeat(indentacao) + prefixo + ", ";
|
|
130
|
+
}
|
|
131
|
+
if (!deveImprimir) {
|
|
132
|
+
return resultado;
|
|
133
|
+
}
|
|
134
|
+
resultado = resultado.slice(0, -2);
|
|
135
|
+
resultado += " {\n";
|
|
136
|
+
for (const modificador of declaracao.modificadores) {
|
|
137
|
+
resultado += this.resolverModificador(modificador, indentacao + 4);
|
|
138
|
+
}
|
|
139
|
+
if (this.resolverComAninhamentos) {
|
|
140
|
+
resultado += this.resolver(declaracao.declaracoesAninhadas, indentacao + 4);
|
|
141
|
+
resultado += `${" ".repeat(indentacao)}}\n\n`;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
resultado += `${" ".repeat(indentacao)}}\n\n`;
|
|
145
|
+
for (const prefixo of prefixos) {
|
|
146
|
+
resultado += this.resolver(declaracao.declaracoesAninhadas, indentacao, prefixo);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return resultado;
|
|
32
150
|
}
|
|
33
151
|
resolver(declaracoes, indentacao = 0, seletorAnterior = undefined) {
|
|
34
152
|
let resultado = "";
|
|
@@ -37,33 +155,15 @@ class ResolvedorReverso {
|
|
|
37
155
|
textoSeletorAnterior = seletorAnterior;
|
|
38
156
|
}
|
|
39
157
|
for (const declaracao of declaracoes) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
resultado += " ".repeat(indentacao) + prefixo + ", ";
|
|
48
|
-
}
|
|
49
|
-
resultado = resultado.slice(0, -2);
|
|
50
|
-
resultado += " {\n";
|
|
51
|
-
for (const modificador of declaracao.modificadores) {
|
|
52
|
-
resultado += this.resolverModificador(modificador, indentacao + 4);
|
|
53
|
-
}
|
|
54
|
-
if (this.resolverComAninhamentos) {
|
|
55
|
-
resultado += this.resolver(declaracao.declaracoesAninhadas, indentacao + 4);
|
|
56
|
-
resultado += `${" ".repeat(indentacao)}}\n\n`;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
resultado += `${" ".repeat(indentacao)}}\n\n`;
|
|
60
|
-
for (const prefixo of prefixos) {
|
|
61
|
-
resultado += this.resolver(declaracao.declaracoesAninhadas, indentacao, prefixo);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
158
|
+
switch (declaracao.constructor.name) {
|
|
159
|
+
case "BlocoDeclaracao":
|
|
160
|
+
resultado += this.resolverBlocoDeclaracao(declaracao, indentacao, textoSeletorAnterior);
|
|
161
|
+
break;
|
|
162
|
+
case "DeclaracaoVariavel":
|
|
163
|
+
this.resolverDeclaracaoVariavel(declaracao);
|
|
164
|
+
break;
|
|
64
165
|
}
|
|
65
166
|
}
|
|
66
|
-
// TODO: Adicionar caso if (declaracao instanceof DeclaracaoVariavel)
|
|
67
167
|
return resultado;
|
|
68
168
|
}
|
|
69
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedor-reverso.js","sourceRoot":"","sources":["../../../fontes/resolvedores/resolvedor-reverso.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolvedor-reverso.js","sourceRoot":"","sources":["../../../fontes/resolvedores/resolvedor-reverso.ts"],"names":[],"mappings":";;;;;;AACA,uDAAoD;AAEpD,8DAAkE;AAClE,oFAA+E;AAC/E,oFAA2D;AAE3D,kEAA8D;AAC9D,4DAAyD;AAGzD;;;GAGG;AACH,MAAa,iBAAiB;IAI1B,YAAY,0BAAmC,IAAI;QAC/C,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;IAES,aAAa,CACnB,KAAY,EACZ,cAAiD;QAEjD,QAAQ,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YAC7B,KAAK,oBAAoB;gBACrB,MAAM,uBAAuB,GAAG,KAA2B,CAAC;gBAC5D,MAAM,6BAA6B,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;gBAC3F,IAAI,6BAA6B,KAAK,SAAS,EAAE,CAAC;oBAC9C,MAAM,IAAI,KAAK,CAAC,eAAe,uBAAuB,CAAC,YAAY,oDAAoD,CAAC,CAAC;gBAC7H,CAAC;gBAED,IAAI,yBAAyB,GAAG,EAAE,CAAC;gBACnC,KAAK,MAAM,aAAa,IAAI,6BAA6B,EAAE,CAAC;oBACxD,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;oBACzD,IAAI,cAAc,KAAK,GAAG,EAAE,CAAC;wBACzB,yBAAyB,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;oBACvE,CAAC;oBACD,yBAAyB,IAAI,cAAc,GAAG,GAAG,CAAC;gBACtD,CAAC;gBAED,yBAAyB,GAAG,yBAAyB,CAAC,K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BAClC,KAAK,iBAAiB;oBAClB,SAAS,IAAI,IAAI,CAAC,uBAAuB,CACrC,UAA6B,EAC7B,UAAU,EACV,oBAAoB,CACvB,CAAC;oBACF,MAAM;gBACV,KAAK,oBAAoB;oBACrB,IAAI,CAAC,0BAA0B,CAC3B,UAAgC,CACnC,CAAC;oBACF,MAAM;YACd,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AA9ND,8CA8NC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
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;
|
|
7
|
+
CIFRAO: string;
|
|
6
8
|
CLASSE: string;
|
|
7
9
|
COLCHETE_DIREITO: string;
|
|
8
10
|
COLCHETE_ESQUERDO: string;
|
|
@@ -17,8 +19,10 @@ declare const _default: {
|
|
|
17
19
|
PERCENTUAL: string;
|
|
18
20
|
PONTO: string;
|
|
19
21
|
PONTO_E_VIRGULA: string;
|
|
22
|
+
PSEUDO_CLASSE: string;
|
|
20
23
|
QUALITATIVO: string;
|
|
21
24
|
QUANTIFICADOR: string;
|
|
25
|
+
TEXTO: string;
|
|
22
26
|
TIL: string;
|
|
23
27
|
VIRGULA: string;
|
|
24
28
|
};
|
|
@@ -2,9 +2,11 @@
|
|
|
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",
|
|
9
|
+
CIFRAO: "CIFRAO",
|
|
8
10
|
CLASSE: "CLASSE",
|
|
9
11
|
COLCHETE_DIREITO: "COLCHETE_DIREITO",
|
|
10
12
|
COLCHETE_ESQUERDO: "COLCHETE_ESQUERDO",
|
|
@@ -19,8 +21,10 @@ exports.default = {
|
|
|
19
21
|
PERCENTUAL: "PERCENTUAL",
|
|
20
22
|
PONTO: "PONTO",
|
|
21
23
|
PONTO_E_VIRGULA: "PONTO_E_VIRGULA",
|
|
24
|
+
PSEUDO_CLASSE: "PSEUDO_CLASSE",
|
|
22
25
|
QUALITATIVO: "QUALITATIVO",
|
|
23
26
|
QUANTIFICADOR: "QUANTIFICADOR",
|
|
27
|
+
TEXTO: "TEXTO",
|
|
24
28
|
TIL: "TIL",
|
|
25
29
|
VIRGULA: "VIRGULA",
|
|
26
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","sourceRoot":"","sources":["../../../fontes/tipos-de-simbolos/css.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,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,kBAAkB,EAAE,oBAAoB;IACxC,iBAAiB,EAAE,mBAAmB;IACtC,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"css.js","sourceRoot":"","sources":["../../../fontes/tipos-de-simbolos/css.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,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,kBAAkB;IACpC,iBAAiB,EAAE,mBAAmB;IACtC,WAAW,EAAE,aAAa;IAC1B,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,kBAAkB,EAAE,oBAAoB;IACxC,iBAAiB,EAAE,mBAAmB;IACtC,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACrB,CAAC"}
|
|
@@ -13,12 +13,8 @@ class Annotation extends metodo_css_1.MetodoCss {
|
|
|
13
13
|
if (this.valor < 1 || this.valor > 99) {
|
|
14
14
|
throw new Error('O valor da função annotation() deve estar entre 1 e 99');
|
|
15
15
|
}
|
|
16
|
-
return `anotação(${this.valor})`;
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
// TODO: Repensar
|
|
20
|
-
// validarIdentificacaoPersonalizada('variação-fonte-alternativa', valorSemAspas);
|
|
21
|
-
return `anotação("${this.valor}")`;
|
|
17
|
+
return `anotação(${this.valor})`;
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
exports.Annotation = Annotation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation.js","sourceRoot":"","sources":["../../../../../fontes/valores/metodos/css/annotation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"annotation.js","sourceRoot":"","sources":["../../../../../fontes/valores/metodos/css/annotation.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAEzC,MAAa,UAAW,SAAQ,sBAAS;IAIrC,YAAY,KAAc;QACtB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;QAC3E,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC;IACjC,CAAC;IAED,SAAS;QACL,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC;gBACpC,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;YAC9E,CAAC;QACL,CAAC;QACD,OAAO,YAAY,IAAI,CAAC,KAAK,GAAG,CAAC;IACrC,CAAC;CACJ;AAlBD,gCAkBC"}
|
|
@@ -6,7 +6,7 @@ class Counter extends metodo_css_1.MetodoCss {
|
|
|
6
6
|
constructor(nome, estilo) {
|
|
7
7
|
super();
|
|
8
8
|
this.nome = nome.lexema;
|
|
9
|
-
this.estilo = estilo ? estilo.lexema :
|
|
9
|
+
this.estilo = estilo ? estilo.lexema : undefined;
|
|
10
10
|
this.traducao = "counter";
|
|
11
11
|
this.estilosAceitos = {
|
|
12
12
|
"decimal": "decimal",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counter.js","sourceRoot":"","sources":["../../../../../fontes/valores/metodos/css/counter.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAEzC,MAAa,OAAQ,SAAQ,sBAAS;IAMlC,YAAY,IAAa,EAAE,MAAe;QACtC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;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;IAED,SAAS;QACL,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAEzD,IAAI,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBACxC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACJ,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,CAAC,MAAM;kBAC5C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;YAC7F,CAAC;YAED,OAAO,YAAY,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC;QACpD,CAAC;QAED,OAAO,YAAY,IAAI,CAAC,IAAI,GAAG,CAAC;IACpC,CAAC;CACJ;AAzDD,0BAyDC"}
|
|
@@ -15,9 +15,6 @@ class Ornaments extends metodo_css_1.MetodoCss {
|
|
|
15
15
|
}
|
|
16
16
|
return `ornamentos(${this.valor})`;
|
|
17
17
|
}
|
|
18
|
-
const valorSemAspas = this.valor.replace(/^['"]|['"]$/g, '');
|
|
19
|
-
// TODO: Repensar
|
|
20
|
-
// validarIdentificacaoPersonalizada('variação-fonte-alternativa', valorSemAspas);
|
|
21
18
|
return `ornamentos("${this.valor}")`;
|
|
22
19
|
}
|
|
23
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ornaments.js","sourceRoot":"","sources":["../../../../../fontes/valores/metodos/css/ornaments.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ornaments.js","sourceRoot":"","sources":["../../../../../fontes/valores/metodos/css/ornaments.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAEzC,MAAa,SAAU,SAAQ,sBAAS;IAIpC,YAAY,KAAc;QACtB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;QAC3E,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;IAChC,CAAC;IAED,SAAS;QACL,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC;gBACpC,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;YAC7E,CAAC;YACD,OAAO,cAAc,IAAI,CAAC,KAAK,GAAG,CAAC;QACvC,CAAC;QAED,OAAO,eAAe,IAAI,CAAC,KAAK,IAAI,CAAC;IACzC,CAAC;CACJ;AApBD,8BAoBC"}
|
|
@@ -10,7 +10,7 @@ class Hsl extends metodo_1.Metodo {
|
|
|
10
10
|
this.luminosidade = Number(luminosidade.lexema);
|
|
11
11
|
}
|
|
12
12
|
paraTexto() {
|
|
13
|
-
return `hsl(${this.matiz}
|
|
13
|
+
return `hsl(${this.matiz} ${this.saturacao}% ${this.luminosidade}%)`;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.Hsl = Hsl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hsl.js","sourceRoot":"","sources":["../../../../../fontes/valores/metodos/foles/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,
|
|
1
|
+
{"version":3,"file":"hsl.js","sourceRoot":"","sources":["../../../../../fontes/valores/metodos/foles/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,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,YAAY,IAAI,CAAC;IACzE,CAAC;CACJ;AAfD,kBAeC"}
|
|
@@ -10,7 +10,7 @@ class Hsla extends metodo_1.Metodo {
|
|
|
10
10
|
this.luminosidade = Number(luminosidade.lexema);
|
|
11
11
|
}
|
|
12
12
|
paraTexto() {
|
|
13
|
-
return `hsla(${this.matiz}
|
|
13
|
+
return `hsla(${this.matiz} ${this.saturacao}% ${this.luminosidade}%)`;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.Hsla = Hsla;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hsla.js","sourceRoot":"","sources":["../../../../../fontes/valores/metodos/foles/hsla.ts"],"names":[],"mappings":";;;AACA,qCAAkC;AAElC,MAAa,IAAK,SAAQ,eAAM;IAK5B,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,QAAQ,IAAI,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"hsla.js","sourceRoot":"","sources":["../../../../../fontes/valores/metodos/foles/hsla.ts"],"names":[],"mappings":";;;AACA,qCAAkC;AAElC,MAAa,IAAK,SAAQ,eAAM;IAK5B,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,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,YAAY,IAAI,CAAC;IAC1E,CAAC;CACJ;AAfD,oBAeC;AAED,qCAAqC;AACrC,oHAAoH;AACpH,kHAAkH;AAElH,8DAA8D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designliquido/foles",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Linguagem de folhas de estilo para documentos em geral em português",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"jest-coverage-badges": "^1.1.2",
|
|
45
45
|
"prettier": "^3.5.3",
|
|
46
46
|
"release-it": "^19.0.3",
|
|
47
|
-
"rimraf": "^
|
|
47
|
+
"rimraf": "^6.1.0",
|
|
48
48
|
"ts-jest": "^29.0.3",
|
|
49
49
|
"ts-node": "^10.9.1",
|
|
50
50
|
"typescript": "^5.6.3"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|