├── fontes ├── estruturas │ ├── lmht │ │ ├── index.ts │ │ ├── area.ts │ │ ├── aspas.ts │ │ ├── celula.ts │ │ ├── corpo.ts │ │ ├── linha.ts │ │ ├── lmht.ts │ │ ├── marca.ts │ │ ├── tempo.ts │ │ ├── termo.ts │ │ ├── aparte.ts │ │ ├── artigo.ts │ │ ├── audio.ts │ │ ├── botao.ts │ │ ├── cabeca.ts │ │ ├── campo.ts │ │ ├── canvas.ts │ │ ├── codigo.ts │ │ ├── coluna.ts │ │ ├── divisao.ts │ │ ├── excluido.ts │ │ ├── exemplo.ts │ │ ├── imagem.ts │ │ ├── italico.ts │ │ ├── ligacao.ts │ │ ├── medidor.ts │ │ ├── objeto.ts │ │ ├── opcao.ts │ │ ├── paragrafo.ts │ │ ├── recurso.ts │ │ ├── riscado.ts │ │ ├── script.ts │ │ ├── secao.ts │ │ ├── tabela.ts │ │ ├── teclado.ts │ │ ├── titulo1.ts │ │ ├── titulo2.ts │ │ ├── titulo3.ts │ │ ├── titulo4.ts │ │ ├── titulo5.ts │ │ ├── titulo6.ts │ │ ├── variavel.ts │ │ ├── abreviacao.ts │ │ ├── campos.ts │ │ ├── citacao.ts │ │ ├── definicao.ts │ │ ├── detalhes.ts │ │ ├── endereco.ts │ │ ├── etiqueta.ts │ │ ├── formulario.ts │ │ ├── invisivel.ts │ │ ├── item-lista.ts │ │ ├── navegacao.ts │ │ ├── negrito.ts │ │ ├── principal.ts │ │ ├── selecao.ts │ │ ├── sublinhado.ts │ │ ├── subscrito.ts │ │ ├── sumario.ts │ │ ├── area-texto.ts │ │ ├── lista-numerada.ts │ │ ├── lista-simples.ts │ │ ├── preformatado.ts │ │ ├── progresso.ts │ │ ├── quebra-linha.ts │ │ ├── sem-script.ts │ │ ├── sobrescrito.ts │ │ ├── cabeca-tabela.ts │ │ ├── corpo-tabela.ts │ │ ├── envelope-texto.ts │ │ ├── grupo-colunas.ts │ │ ├── grupo-opcoes.ts │ │ ├── linha-horizontal.ts │ │ ├── lista-definicoes.ts │ │ ├── texto-pequeno.ts │ │ ├── lista-pesquisavel.ts │ │ └── quebra-linha-oportuna.ts │ ├── pragmas-estrutura.ts │ ├── estrutura.ts │ ├── seletor-estruturas-html.ts │ └── seletor-estruturas-lmht.ts ├── importador │ └── index.ts ├── declaracoes │ ├── declaracao.ts │ ├── index.ts │ ├── declaracao-variavel.ts │ └── bloco-declaracao.ts ├── lexador │ ├── index.ts │ ├── palavras-reservadas │ │ └── index.ts │ ├── erro-lexador.ts │ ├── README.md │ └── simbolo.ts ├── tipos-de-simbolos │ └── index.ts ├── valores │ ├── valor.ts │ ├── valor-virgula.ts │ ├── valor-abreviacao.ts │ ├── metodos │ │ ├── foles │ │ │ ├── metodo.ts │ │ │ ├── hexadecimal-cor.ts │ │ │ ├── url.ts │ │ │ ├── pintura.ts │ │ │ ├── escalamento-eixo-z.ts │ │ │ ├── escalamento-vertical.ts │ │ │ ├── escalamento-horizontal.ts │ │ │ ├── rgb.ts │ │ │ ├── rgba.ts │ │ │ ├── encaixar-conteudo.ts │ │ │ ├── espirrar.ts │ │ │ ├── poligono.ts │ │ │ ├── estilistico.ts │ │ │ ├── linear.ts │ │ │ ├── hsl.ts │ │ │ ├── variar-caractere.ts │ │ │ ├── definir-imagem.ts │ │ │ ├── escalamento-3d.ts │ │ │ ├── escalamento.ts │ │ │ ├── repetir-gradiente-conico.ts │ │ │ ├── sepia.ts │ │ │ ├── borrar.ts │ │ │ ├── inverter.ts │ │ │ ├── opacar.ts │ │ │ ├── saturar.ts │ │ │ ├── brilho.ts │ │ │ ├── contraste.ts │ │ │ ├── escala-cinza.ts │ │ │ ├── translacao-eixo-z.ts │ │ │ ├── translacao-vertical.ts │ │ │ ├── perspectivar.ts │ │ │ ├── translacao-horizontal.ts │ │ │ ├── elemento.ts │ │ │ ├── xywh.ts │ │ │ ├── inserir.ts │ │ │ ├── gradiente-conico.ts │ │ │ ├── retangulo.ts │ │ │ ├── rotacionar.ts │ │ │ ├── inclinar-vertical.ts │ │ │ ├── curva-cubica.ts │ │ │ ├── inclinar-horizontal.ts │ │ │ ├── rotacionar-eixo-z.ts │ │ │ └── rotacionar-vertical.ts │ │ └── css │ │ │ ├── metodo-css.ts │ │ │ ├── paint.ts │ │ │ ├── scaleY.ts │ │ │ ├── scaleZ.ts │ │ │ ├── scaleX.ts │ │ │ ├── fit-content.ts │ │ │ ├── swash.ts │ │ │ ├── stylistic.ts │ │ │ ├── polygon.ts │ │ │ ├── character-variant.ts │ │ │ ├── scale3d.ts │ │ │ ├── scale.ts │ │ │ ├── sepia.ts │ │ │ ├── blur.ts │ │ │ ├── invert.ts │ │ │ ├── opacity.ts │ │ │ ├── rotate.ts │ │ │ ├── saturate.ts │ │ │ ├── constrast.ts │ │ │ ├── brightness.ts │ │ │ ├── grayscale.ts │ │ │ ├── skewY.ts │ │ │ ├── rotateZ.ts │ │ │ ├── skewX.ts │ │ │ ├── hue-rotate.ts │ │ │ ├── rotateY.ts │ │ │ ├── rotateX.ts │ │ │ ├── translateZ.ts │ │ │ ├── annotation.ts │ │ │ ├── perspective.ts │ │ │ ├── translateY.ts │ │ │ ├── translateX.ts │ │ │ ├── repeating-conic-gradient.ts │ │ │ ├── element.ts │ │ │ ├── xywh.ts │ │ │ ├── ornaments.ts │ │ │ ├── steps.ts │ │ │ ├── conic-gradient.ts │ │ │ └── cubic-bezier.ts │ ├── index.ts │ ├── valor-texto.ts │ ├── valor-qualitativo.ts │ ├── referencia-variavel.ts │ ├── seletor-valor.ts │ ├── valor-numerico.ts │ └── seletor-valor-reverso.ts ├── resolvedores │ ├── index.ts │ └── README.md ├── avaliador-sintatico │ ├── index.ts │ └── erro-avaliador-sintatico.ts ├── gerador-mapa │ └── README.md ├── interfaces │ ├── resultado-lexador-interface.ts │ ├── avaliador-sintatico-interface.ts │ ├── index.ts │ ├── simbolo-interface.ts │ ├── mapa-origens-interface.ts │ ├── importador-interface.ts │ └── lexador-interface.ts ├── index.ts ├── modificadores │ ├── superclasse │ │ ├── index.ts │ │ ├── pragmas-modificador.ts │ │ ├── modificador.ts │ │ ├── seletor-modificador.ts │ │ └── seletor-reverso-modificador.ts │ ├── validacoes │ │ ├── string.ts │ │ ├── proibir-quantificador.ts │ │ └── quantificador.ts │ ├── atributos │ │ ├── globais.ts │ │ ├── estilo.ts │ │ └── fontes.ts │ ├── estilo-lista-tipo.ts │ ├── cor.ts │ ├── cor-fundo.ts │ ├── dicionario │ │ └── dicionario-suplementar-metodos.ts │ ├── cor-borda-direita.ts │ ├── cor-borda-superior.ts │ ├── regras-cor-coluna.ts │ ├── cor-borda-em-bloco.ts │ ├── cor-borda-em-linha.ts │ ├── cor-borda-esquerda.ts │ ├── cor-borda-inferior.ts │ ├── cor-fim-borda-em-bloco.ts │ ├── cor-fim-borda-em-linha.ts │ ├── reiniciar-tudo.ts │ ├── recortar.ts │ ├── cor-enfase-texto.ts │ ├── cor-cursor.ts │ ├── estilo-borda-direita.ts │ ├── regras-estilo-coluna.ts │ ├── cor-destaque.ts │ ├── decoracao-cor-texto.ts │ ├── estilo-borda-em-bloco.ts │ ├── estilo-borda-em-linha.ts │ ├── estilo-borda-esquerda.ts │ ├── estilo-borda-inferior.ts │ ├── estilo-borda-superior.ts │ ├── cor-contorno.ts │ ├── posicao-mascara.ts │ ├── posicao-objeto.ts │ ├── cor-barra-rolagem.ts │ ├── isolamento.ts │ ├── cor-inicio-borda-em-bloco.ts │ ├── cor-inicio-borda-em-linha.ts │ ├── design-tabela.ts │ ├── direcao.ts │ ├── estender-coluna.ts │ ├── hifens.ts │ ├── recolher-borda.ts │ ├── celulas-vazias.ts │ ├── ordenar.ts │ ├── comportamento-rolagem.ts │ ├── filtro.ts │ ├── fixar-fundo.ts │ ├── fluxo-em-grade.ts │ ├── esquema-cor.ts │ ├── flex-reduzir.ts │ ├── largura-barra-rolagem.ts │ ├── tipo-mascara.ts │ ├── agrupar-palavra.ts │ ├── preencher-coluna.ts │ ├── flex-crescimento.ts │ ├── linhas-superiores.ts │ ├── visibilidade-fundo.ts │ ├── linhas-inferiores.ts │ ├── tamanho-caixa.ts │ ├── visibilidade.ts │ ├── sombra-caixa.ts │ ├── transformar-estilo.ts │ ├── agrupar-vazamento.ts │ ├── posicao.ts │ ├── flex-agrupar.ts │ ├── modo-escrita.ts │ ├── quebrar-palavra.ts │ ├── calha-barra-rolagem.ts │ ├── estilo-fim-borda-em-bloco.ts │ ├── estilo-fim-borda-em-linha.ts │ ├── ordem-pintura.ts │ ├── quebrar-linha.ts │ ├── sombra-texto.ts │ ├── tabulacao.ts │ └── forma-margem.ts ├── seletores │ ├── pragmas-seletor.ts │ ├── index.ts │ ├── seletor-espaco-reservado.ts │ ├── seletor.ts │ ├── seletor-id.ts │ └── seletor-classe.ts ├── listas │ ├── valores-personalizados.d.ts │ ├── valores-numericos.d.ts │ └── valor-string.ts ├── pseudoclasses │ ├── link.ts │ ├── ativo.ts │ ├── foco.ts │ ├── pausa.ts │ ├── sobre.ts │ ├── vazio.ts │ ├── atual.ts │ ├── escopo.ts │ ├── futuro.ts │ ├── passado.ts │ ├── em-branco.ts │ ├── invalido.ts │ ├── n-filho.ts │ ├── n-tipo.ts │ ├── visitado.ts │ ├── opcional.ts │ ├── todo-link.ts │ ├── estilo-alvo.ts │ ├── habilitado.ts │ ├── link-local.ts │ ├── obrigatorio.ts │ ├── reproduzir.ts │ ├── unico-tipo.ts │ ├── verificado.ts │ ├── desabilitado.ts │ ├── direcao-texto.ts │ ├── estilo-padrao.ts │ ├── filho-unico.ts │ ├── idioma-global.ts │ ├── ler-escrever.ts │ ├── ultimo-filho.ts │ ├── ultimo-tipo.ts │ ├── alvo-destaque.ts │ ├── estrutura-estilo.ts │ ├── foco-interno.ts │ ├── foco-visivel.ts │ ├── n-ultimo-tipo.ts │ ├── primeiro-tipo.ts │ ├── dentro-do-limite.ts │ ├── fora-do-limite.ts │ ├── indeterminado.ts │ ├── n-último-filho.ts │ ├── primeiro-filho.ts │ ├── somente-leitura.ts │ ├── usuario-invalido.ts │ ├── local-reservado-mostrado.ts │ ├── valido.ts │ ├── seletor-pseudoclasse.ts │ └── pseudoclasse.ts ├── exportador │ └── README.md └── tradutores │ └── README.md ├── bin ├── foles.cmd ├── foles-ts.cmd ├── foles └── foles-ts ├── .prettierrc ├── exemplos ├── importacao.foles ├── mapas-fontes │ ├── exemplo.foles │ ├── exemplo.html │ ├── exemplo.css.map │ └── exemplo.css ├── _parcial.foles ├── exemplo5.foles ├── reverso │ ├── aninhamentos.css │ ├── exemplo-codigo.css │ └── exemplo-liquido.css ├── exemplo4.foles ├── importacao.css ├── exemplo6.foles ├── exemplo.foles └── exemplo7.foles ├── testes └── modelos │ ├── arquivo-modelo.css │ └── arquivo-modelo.foles ├── recursos └── imagens │ └── icone-foles.png ├── jest.config.ts ├── .release-it.json ├── tsconfig.json └── .github ├── dependabot.yml └── workflows └── principal.yml /fontes/estruturas/lmht/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/foles.cmd: -------------------------------------------------------------------------------- 1 | node ..\execucao.js %* -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4 3 | } -------------------------------------------------------------------------------- /bin/foles-ts.cmd: -------------------------------------------------------------------------------- 1 | ts-node.cmd execucao.ts %* -------------------------------------------------------------------------------- /exemplos/importacao.foles: -------------------------------------------------------------------------------- 1 | @importar "_parcial" -------------------------------------------------------------------------------- /fontes/importador/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./importador"; 2 | -------------------------------------------------------------------------------- /bin/foles: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env node 2 | 3 | require('../execucao.js'); -------------------------------------------------------------------------------- /bin/foles-ts: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env ts-node 2 | 3 | require('../execucao'); -------------------------------------------------------------------------------- /fontes/declaracoes/declaracao.ts: -------------------------------------------------------------------------------- 1 | export abstract class Declaracao {} 2 | -------------------------------------------------------------------------------- /testes/modelos/arquivo-modelo.css: -------------------------------------------------------------------------------- 1 | html { 2 | max-width: 140px; 3 | } 4 | -------------------------------------------------------------------------------- /fontes/lexador/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./lexador"; 2 | export * from "./simbolo"; 3 | -------------------------------------------------------------------------------- /exemplos/mapas-fontes/exemplo.foles: -------------------------------------------------------------------------------- 1 | lmht { 2 | largura-borda-direita: 130mm; 3 | } 4 | -------------------------------------------------------------------------------- /fontes/tipos-de-simbolos/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./css"; 2 | export * from "./foles"; 3 | -------------------------------------------------------------------------------- /fontes/lexador/palavras-reservadas/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./css"; 2 | export * from "./foles"; 3 | -------------------------------------------------------------------------------- /fontes/valores/valor.ts: -------------------------------------------------------------------------------- 1 | export abstract class Valor { 2 | abstract paraTexto(): string; 3 | } 4 | -------------------------------------------------------------------------------- /fontes/resolvedores/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./resolvedor"; 2 | export * from "./resolvedor-reverso"; 3 | -------------------------------------------------------------------------------- /recursos/imagens/icone-foles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignLiquido/FolEs/HEAD/recursos/imagens/icone-foles.png -------------------------------------------------------------------------------- /fontes/avaliador-sintatico/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./avaliador-sintatico"; 2 | export * from "./erro-avaliador-sintatico"; 3 | -------------------------------------------------------------------------------- /exemplos/_parcial.foles: -------------------------------------------------------------------------------- 1 | lmht { 2 | tempo-transicao: curva-cúbica(0.42, 0.0, 1.0, 1.0); 3 | cor-destaque: rgb(100, 200, 300); 4 | } -------------------------------------------------------------------------------- /fontes/gerador-mapa/README.md: -------------------------------------------------------------------------------- 1 | # Gerador de Mapa de CSS 2 | 3 | Inspiração: https://www.mattzeunert.com/2016/02/14/how-do-source-maps-work.html -------------------------------------------------------------------------------- /fontes/declaracoes/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./bloco-declaracao"; 2 | export * from "./declaracao"; 3 | export * from "./declaracao-variavel"; 4 | -------------------------------------------------------------------------------- /fontes/lexador/erro-lexador.ts: -------------------------------------------------------------------------------- 1 | export interface ErroLexador { 2 | linha: number; 3 | caractere: string; 4 | mensagem: string; 5 | } 6 | -------------------------------------------------------------------------------- /fontes/interfaces/resultado-lexador-interface.ts: -------------------------------------------------------------------------------- 1 | export interface ResultadoLexadorInterface { 2 | simbolos: any[]; 3 | erros: any[]; 4 | } 5 | -------------------------------------------------------------------------------- /fontes/index.ts: -------------------------------------------------------------------------------- 1 | export * from './foles'; 2 | export * from './lexador'; 3 | export * from './avaliador-sintatico'; 4 | export * from './resolvedores'; 5 | -------------------------------------------------------------------------------- /fontes/lexador/README.md: -------------------------------------------------------------------------------- 1 | # Lexador 2 | 3 | O Lexador de FolEs é fortemente baseado no lexador padrão de [Delégua](https://github.com/DesignLiquido/delegua). -------------------------------------------------------------------------------- /fontes/modificadores/superclasse/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./modificador"; 2 | export * from "./pragmas-modificador"; 3 | export * from "./seletor-modificador"; 4 | -------------------------------------------------------------------------------- /fontes/seletores/pragmas-seletor.ts: -------------------------------------------------------------------------------- 1 | export interface PragmasSeletor { 2 | linha: number; 3 | colunaInicial: number; 4 | colunaFinal: number; 5 | } 6 | -------------------------------------------------------------------------------- /fontes/estruturas/pragmas-estrutura.ts: -------------------------------------------------------------------------------- 1 | export interface PragmasEstrutura { 2 | linha: number; 3 | colunaInicial: number; 4 | colunaFinal: number; 5 | } 6 | -------------------------------------------------------------------------------- /fontes/modificadores/superclasse/pragmas-modificador.ts: -------------------------------------------------------------------------------- 1 | export interface PragmasModificador { 2 | linha: number; 3 | colunaInicial: number; 4 | colunaFinal: number; 5 | } 6 | -------------------------------------------------------------------------------- /fontes/valores/valor-virgula.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "./valor"; 2 | 3 | export class ValorVirgula extends Valor { 4 | paraTexto(): string { 5 | return ","; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /exemplos/mapas-fontes/exemplo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Teste

7 | 8 | -------------------------------------------------------------------------------- /fontes/valores/valor-abreviacao.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "./valor"; 2 | 3 | export class ValorAbreviacao extends Valor { 4 | paraTexto(): string { 5 | return "/"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/metodo.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../../valor"; 2 | 3 | export abstract class Metodo extends Valor { 4 | traducao: string; 5 | abstract paraTexto(): string; 6 | } 7 | -------------------------------------------------------------------------------- /exemplos/exemplo5.foles: -------------------------------------------------------------------------------- 1 | $valor-padrao: 50%; 2 | $recuo-imediato: 20px; 3 | 4 | lmht { 5 | altura: $valor-padrao; 6 | recuo: $recuo-imediato; 7 | } 8 | 9 | lmht { 10 | largura: 20px; 11 | } -------------------------------------------------------------------------------- /fontes/seletores/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./pragmas-seletor"; 2 | export * from "./seletor"; 3 | export * from "./seletor-classe"; 4 | export * from "./seletor-estrutura"; 5 | export * from "./seletor-id"; 6 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/metodo-css.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../../valor"; 2 | 3 | export abstract class MetodoCss extends Valor { 4 | traducao: string; 5 | abstract paraTexto(): string; 6 | } 7 | -------------------------------------------------------------------------------- /exemplos/reverso/aninhamentos.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size:12px; 3 | } 4 | 5 | body { 6 | font-size:16px; 7 | max-width:20cm; 8 | 9 | p { 10 | color: #999; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /fontes/valores/index.ts: -------------------------------------------------------------------------------- 1 | export * from './valor'; 2 | export * from './valor-abreviacao'; 3 | export * from './valor-numerico'; 4 | export * from './valor-qualitativo'; 5 | export * from './valor-texto'; 6 | export * from './valor-virgula'; 7 | -------------------------------------------------------------------------------- /fontes/modificadores/validacoes/string.ts: -------------------------------------------------------------------------------- 1 | import { ValorTexto } from "../../valores"; 2 | 3 | export function validarValorString(valor: ValorTexto) { 4 | return valor.literalTexto.includes("'") || valor.literalTexto.includes('"'); 5 | } 6 | -------------------------------------------------------------------------------- /testes/modelos/arquivo-modelo.foles: -------------------------------------------------------------------------------- 1 | aspas { 2 | contém: nenhum; 3 | recortar: auto; 4 | fluxo: nenhum; 5 | conteudo: normal; 6 | citações: nenhum; 7 | tamanho-fonte: 16px; 8 | largura-maxima: 20cm; 9 | } 10 | -------------------------------------------------------------------------------- /fontes/listas/valores-personalizados.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ModificadoresValorPersonalizado: Array; 2 | export declare const ValoresPersonalizados: Array; 3 | export declare const ValoresPersonalizadosMultiplos: Array; 4 | -------------------------------------------------------------------------------- /fontes/interfaces/avaliador-sintatico-interface.ts: -------------------------------------------------------------------------------- 1 | import { Declaracao } from "../declaracoes"; 2 | import { Simbolo } from "../lexador"; 3 | 4 | export interface AvaliadorSintaticoInterface { 5 | analisar(simbolos: Simbolo[]): Declaracao[]; 6 | } 7 | -------------------------------------------------------------------------------- /fontes/interfaces/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./avaliador-sintatico-interface"; 2 | export * from "./importador-interface"; 3 | export * from "./lexador-interface"; 4 | export * from "./resultado-lexador-interface"; 5 | export * from "./simbolo-interface"; 6 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/link.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Link extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("link", "link", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/ativo.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Ativo extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("ativo", "active", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/foco.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Foco extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("foco", "focus", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/pausa.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Pausa extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("pausa", "paused", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/sobre.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Sobre extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("sobre", "hover", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/vazio.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Vazio extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("vazio", "empty", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/modificadores/atributos/globais.ts: -------------------------------------------------------------------------------- 1 | export const valoresGlobais: { [valorFolEs: string]: string } = { 2 | herdar: "inherit", 3 | inicial: "initial", 4 | reverter: "revert", 5 | "reverter-camada": "revert-layer", 6 | desarmar: "unset", 7 | }; 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/atual.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Atual extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("atual", "current", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/escopo.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Escopo extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("escopo", "scope", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/futuro.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Futuro extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("futuro", "future", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/passado.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Passado extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("passado", "past", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/em-branco.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class EmBranco extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("em-branco", "blank", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/invalido.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Invalido extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("invalido", "invalid", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/n-filho.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class NFilho extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("n-filho", "nth-child", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/n-tipo.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class NTipo extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("n-tipo", "nth-of-type", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/visitado.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Visitado extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("visitado", "visited", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/interfaces/simbolo-interface.ts: -------------------------------------------------------------------------------- 1 | export interface SimboloInterface { 2 | tipo: string; 3 | lexema: string; 4 | literal: string; 5 | linha: number; 6 | colunaInicial: number; 7 | colunaFinal: number; 8 | paraTexto: () => string; 9 | } 10 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/opcional.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Opcional extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("opcional", "optional", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/todo-link.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class TodoLink extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("todo-link", "any-link", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/area.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Area extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("area", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/aspas.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Aspas extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("q", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/celula.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Celula extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("td", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/corpo.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Corpo extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("body", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/linha.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Linha extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("tr", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/lmht.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Lmht extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("html", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/marca.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Marca extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("mark", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/tempo.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Tempo extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("time", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/termo.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Termo extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("dt", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/estilo-alvo.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class EstiloAlvo extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("estilo-alvo", "target", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/habilitado.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Habilitado extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("habilitado", "enabled", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/link-local.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class LinkLocal extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("link-local", "local-link", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/obrigatorio.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Obrigatorio extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("obrigatorio", "required", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/reproduzir.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Reproduzir extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("reproduzir", "playing", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/unico-tipo.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class UnicoTipo extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("unico-tipo", "only-of-type", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/verificado.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Verificado extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("verificado", "checked", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/aparte.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Aparte extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("aside", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/artigo.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Artigo extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("article", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/audio.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Audio extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("audio", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/botao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Botao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("button", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/cabeca.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Cabeca extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("head", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/campo.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Campo extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("input", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/canvas.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Canvas extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("canvas", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/codigo.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Codigo extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("code", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/coluna.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Coluna extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("col", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/divisao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Divisao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("div", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/excluido.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Excluido extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("del", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/exemplo.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Exemplo extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("samp", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/imagem.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Imagem extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("img", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/italico.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Italico extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("em", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/ligacao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Ligacao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("a", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/medidor.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Medidor extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("meter", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/objeto.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Objeto extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("object", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/opcao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Opcao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("option", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/paragrafo.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Paragrafo extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("p", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/recurso.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Recurso extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("link", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/riscado.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Riscado extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("s", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/script.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Script extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("script", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/secao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Secao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("section", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/tabela.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Tabela extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("table", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/teclado.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Teclado extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("kbd", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/titulo1.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Titulo1 extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("h1", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/titulo2.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Titulo2 extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("h2", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/titulo3.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Titulo3 extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("h3", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/titulo4.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Titulo4 extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("h4", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/titulo5.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Titulo5 extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("h5", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/titulo6.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Titulo6 extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("h6", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/variavel.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Variavel extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("var", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/interfaces/mapa-origens-interface.ts: -------------------------------------------------------------------------------- 1 | export interface MapaOrigensInterface { 2 | version: number; 3 | file: string; 4 | sourceRoot?: string; 5 | sources: string[]; 6 | sourcesContent: string[]; 7 | names?: string[]; 8 | mappings: string; 9 | } 10 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/desabilitado.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Desabilitado extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("desabilitado", "disabled", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/direcao-texto.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class DirecaoTexto extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("direção-do-texto", "dir", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/estilo-padrao.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class EstiloPadrao extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("estilo-padrão", "default", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/filho-unico.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class FilhoUnico extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("filho-unico", "only-child", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/idioma-global.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class IdiomaGlobal extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("idioma-global", "lang", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/ler-escrever.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class LerEscrever extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("ler-escrever", "read-write", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/ultimo-filho.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class UltimoFilho extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("ultimo-filho", "last-child", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/ultimo-tipo.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class UltimoTipo extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("ultimo-tipo", "last-of-type", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /exemplos/mapas-fontes/exemplo.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "file": "exemplo.css", 4 | "sourceRoot": "", 5 | "sources": [ "exemplo.foles" ], 6 | "sourcesContent": ["paragrafo {\n tamanho-texto: 14px;\n}"], 7 | "names": [], 8 | "mappings": "AAAA,CAAS;CACG,MAAa,EAAE,IAAI;" 9 | } -------------------------------------------------------------------------------- /fontes/estruturas/lmht/abreviacao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Abreviacao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("abbr", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/campos.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Campos extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("fieldset", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/citacao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Citacao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("blockquote", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/definicao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Definicao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("dfn", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/detalhes.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Detalhes extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("details", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/endereco.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Endereco extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("address", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/etiqueta.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Etiqueta extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("label", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/formulario.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Formulario extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("form", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/invisivel.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Invisivel extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("ins", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/item-lista.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class ItemLista extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("li", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/navegacao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Navegacao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("nav", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/negrito.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Negrito extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("strong", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/principal.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Principal extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("main", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/selecao.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Selecao extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("select", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/sublinhado.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Sublinhado extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("u", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/subscrito.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Subscrito extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("sub", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/sumario.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Sumario extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("summary", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/alvo-destaque.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class AlvoDestaque extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("alvo-destaque", "target-within", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/estrutura-estilo.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class EstruturaEstilo extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("estrutura-estilo", "root", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/foco-interno.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class FocoInterno extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("foco-interno", "focus-within", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/foco-visivel.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class FocoVisivel extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("foco-visivel", "focus-visible", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/n-ultimo-tipo.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class NUltimoTipo extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("n-ultimo-tipo", "nth-last-type", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/primeiro-tipo.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class PrimeiroTipo extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("primeiro-tipo", "first-of-type", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/area-texto.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class AreaTexto extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("textarea", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/lista-numerada.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class ListaNumerada extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("ol", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/lista-simples.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class ListaSimples extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("ul", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/preformatado.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Preformatado extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("pre", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/progresso.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Progresso extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("progress", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/quebra-linha.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class QuebraLinha extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("br", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/sem-script.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class SemScript extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("noscript", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/sobrescrito.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class Sobrescrito extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("sup", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/dentro-do-limite.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class DentroDoLimite extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("dentro-do-limite", "in-range", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/fora-do-limite.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class ForaDoLimite extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("fora-do-limite", "out-of-range", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/indeterminado.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class Indeterminado extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("indeterminado", "indeterminate", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/n-último-filho.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class NUltimoFilho extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("n-último-filho", "nth-last-child", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/primeiro-filho.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class PrimeiroFilho extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("primeiro-filho", "first-child", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/somente-leitura.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class SomenteLeitura extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("somente-leitura", "read-only", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/cabeca-tabela.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class CabecaTabela extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("thead", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/corpo-tabela.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class CorpoTabela extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("blockquote", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/envelope-texto.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class EnvelopeTexto extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("span", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/grupo-colunas.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class GrupoColunas extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("colgroup", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/grupo-opcoes.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class GrupoOpcoes extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("optgroup", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/linha-horizontal.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class LinhaHorizontal extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("hr", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/lista-definicoes.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class ListaDefinicoes extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("dl", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/texto-pequeno.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class TextoPequeno extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("small", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/usuario-invalido.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class UsuarioInvalido extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("usuario-invalido", "user-invalid", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/lista-pesquisavel.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class ListaPesquisavel extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("datalist", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/estruturas/lmht/quebra-linha-oportuna.ts: -------------------------------------------------------------------------------- 1 | import { Estrutura } from "../estrutura"; 2 | import { PragmasEstrutura } from "../pragmas-estrutura"; 3 | 4 | export class QuebraLinhaOportuna extends Estrutura { 5 | constructor(pragmas?: PragmasEstrutura) { 6 | super("wbr", pragmas); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /fontes/interfaces/importador-interface.ts: -------------------------------------------------------------------------------- 1 | import { ResultadoLexadorInterface } from "./resultado-lexador-interface"; 2 | 3 | export interface ImportadorInterface { 4 | importar( 5 | caminhoRelativoArquivo: string, 6 | importacaoInicial: boolean, 7 | ): [string[], ResultadoLexadorInterface]; 8 | } 9 | -------------------------------------------------------------------------------- /exemplos/exemplo4.foles: -------------------------------------------------------------------------------- 1 | divisão:ativo { 2 | tamanho-fonte: 12px; 3 | } 4 | 5 | divisao:foco { 6 | tamanho-fonte: 12px; 7 | } 8 | 9 | paragrafo:futuro { 10 | tamanho-fonte: 20px; 11 | } 12 | 13 | divisão:direcao-texto { 14 | altura: 20px; 15 | } 16 | 17 | lmht { 18 | filtro-fundo: borrar(10px); 19 | } -------------------------------------------------------------------------------- /fontes/interfaces/lexador-interface.ts: -------------------------------------------------------------------------------- 1 | import { ResultadoLexadorInterface } from "./resultado-lexador-interface"; 2 | import { SimboloInterface } from "./simbolo-interface"; 3 | 4 | export interface LexadorInterface { 5 | simbolos: Array; 6 | mapear(codigo: string[]): ResultadoLexadorInterface; 7 | } 8 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/local-reservado-mostrado.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 2 | 3 | export class LocalReservadoMostrado extends Pseudoclasse { 4 | constructor(pragmas?: PragmasPseudoclasse) { 5 | super("local-reservado-mostrado", "placeholder-shown", pragmas); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fontes/listas/valores-numericos.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ModificadoresDeValorNumerico: Array; 2 | export declare const ModificadoresDeValorNumericoApenas: Array; 3 | export declare const ModificadoresDeValorNumericoZeroUm: Array; 4 | export declare const ModificadoresDeValorNumericoComQuantificador: string[]; 5 | -------------------------------------------------------------------------------- /exemplos/reverso/exemplo-codigo.css: -------------------------------------------------------------------------------- 1 | div { 2 | border: dotted; 3 | mask-clip: view-box; 4 | outline: thick; 5 | } 6 | 7 | div { 8 | margin-top: 12px; 9 | } 10 | 11 | p { 12 | border: 50px; 13 | } 14 | 15 | html { 16 | appearance: textfield; 17 | border-color: blue; 18 | } 19 | 20 | div { 21 | padding: inherit; 22 | } 23 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/hexadecimal-cor.ts: -------------------------------------------------------------------------------- 1 | import { Metodo } from "./metodo"; 2 | 3 | export class HexadecimalCor extends Metodo { 4 | codigo: string; 5 | 6 | constructor(codigo: string) { 7 | super(); 8 | this.codigo = codigo; 9 | } 10 | 11 | paraTexto() { 12 | return `#${this.codigo}`; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /fontes/valores/valor-texto.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "./valor"; 2 | 3 | export class ValorTexto extends Valor { 4 | literalTexto: string; 5 | 6 | constructor(literalTexto: string) { 7 | super(); 8 | this.literalTexto = literalTexto; 9 | } 10 | 11 | paraTexto(): string { 12 | return `"${this.literalTexto}"`; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /fontes/valores/valor-qualitativo.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "./valor"; 2 | 3 | export class ValorQualitativo extends Valor { 4 | qualitativo: string; 5 | 6 | constructor(qualitativo: string) { 7 | super(); 8 | this.qualitativo = qualitativo; 9 | } 10 | 11 | paraTexto(): string { 12 | return `${this.qualitativo}`; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | import type {Config} from '@jest/types'; 2 | 3 | export default async (): Promise => { 4 | return { 5 | verbose: true, 6 | modulePathIgnorePatterns: ["/dist/"], 7 | preset: 'ts-jest', 8 | testEnvironment: 'node', 9 | coverageReporters: ['json-summary', 'text', 'text-summary', 'lcov'] 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /fontes/estruturas/estrutura.ts: -------------------------------------------------------------------------------- 1 | import { PragmasEstrutura } from "./pragmas-estrutura"; 2 | 3 | export class Estrutura { 4 | tagHtml: string; 5 | pragmas?: PragmasEstrutura; 6 | pseudoclasse?: string; 7 | 8 | constructor(tagHtml: string, pragmas?: PragmasEstrutura) { 9 | this.tagHtml = tagHtml; 10 | this.pragmas = pragmas; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.release-it.json: -------------------------------------------------------------------------------- 1 | { 2 | "git": { 3 | "commitMessage": "Lançamento da versão v${version}" 4 | }, 5 | "github": { 6 | "release": true 7 | }, 8 | "npm": { 9 | "publishPath": "./dist" 10 | }, 11 | "hooks": { 12 | "before:init": ["yarn empacotar"], 13 | "after:bump": "yarn copyfiles -V ./package.json ./dist" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/url.ts: -------------------------------------------------------------------------------- 1 | import { Metodo } from "./metodo"; 2 | 3 | export class Url extends Metodo { 4 | link: string; 5 | traducao: string; 6 | 7 | constructor(link: string) { 8 | super(); 9 | this.link = link; 10 | this.traducao = "url"; 11 | } 12 | 13 | paraTexto() { 14 | return `url('${this.link}')`; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /fontes/valores/referencia-variavel.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "./valor"; 2 | 3 | export class ReferenciaVariavel extends Valor { 4 | nomeVariavel: string; 5 | 6 | constructor(nomeVariavel: string) { 7 | super(); 8 | this.nomeVariavel = nomeVariavel; 9 | } 10 | 11 | paraTexto(): string { 12 | throw new Error("Não deveria cair aqui."); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /fontes/avaliador-sintatico/erro-avaliador-sintatico.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../lexador"; 2 | 3 | export class ErroAvaliadorSintatico extends Error { 4 | simbolo: Simbolo; 5 | 6 | constructor(simbolo: Simbolo, mensagem: string) { 7 | super(mensagem); 8 | this.simbolo = simbolo; 9 | Object.setPrototypeOf(this, ErroAvaliadorSintatico.prototype); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /fontes/exportador/README.md: -------------------------------------------------------------------------------- 1 | # Exportador 2 | 3 | A função do exportador é escrever arquivos. Por ora, este exportador fica neste projeto mesmo, mas pode ser que precisemos migrar o exportador para um projeto dedicado a Node.js, assim como foi feito com Delégua. A razão disso é que JavaScript tradicional não tem acesso a um sistema de arquivos, e execuções de FolEs em um navegador de internet têm de ser possíveis. -------------------------------------------------------------------------------- /exemplos/mapas-fontes/exemplo.css: -------------------------------------------------------------------------------- 1 | html { 2 | border-right-width: 130mm; 3 | } 4 | 5 | 6 | /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGUuY3NzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidGVzdGUuZm9sZXMiXSwic291cmNlc0NvbnRlbnQiOlsibG1odCB7XHUwMDAwXG4gICAgbGFyZ3VyYS1ib3JkYS1kaXJlaXRhOiAxMzBtbTtcclx1MDAwMFxufVxyXHUwMDAwXG5cdTAwMDAiXSwibWFwcGluZ3MiOiJBQUFBLElBQUk7SUFDQSxrQkFBcUIsRUFBRSxLQUFLOyJ9 */ 7 | -------------------------------------------------------------------------------- /fontes/declaracoes/declaracao-variavel.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores/valor"; 2 | import { Declaracao } from "./declaracao"; 3 | 4 | export class DeclaracaoVariavel extends Declaracao { 5 | nome: string; 6 | valores: Valor[] 7 | 8 | constructor( 9 | nome: string, 10 | valores: Valor[] 11 | ) { 12 | super(); 13 | this.nome = nome; 14 | this.valores = valores; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /exemplos/reverso/exemplo-liquido.css: -------------------------------------------------------------------------------- 1 | .minha-classe { 2 | accent-color: #f4f500; 3 | font-size: 16px; 4 | max-width: 20cm; 5 | } 6 | 7 | #elemento-caixa { 8 | height: 40px; 9 | } 10 | 11 | html { 12 | border-right-width: 130mm; 13 | } 14 | 15 | .minha-segunda-classe { 16 | margin-top: 13mm; 17 | } 18 | 19 | #meu-segundo-id { 20 | width: 400mm; 21 | } 22 | 23 | div { 24 | backdrop-filter: brightness(10px); 25 | } 26 | -------------------------------------------------------------------------------- /fontes/modificadores/validacoes/proibir-quantificador.ts: -------------------------------------------------------------------------------- 1 | export function proibirQuantificador( 2 | nomeModificadorOuVariavel: string, 3 | quantificador: string, 4 | ) { 5 | if (quantificador !== undefined) { 6 | throw new Error( 7 | `Modificador ou variável '${nomeModificadorOuVariavel}' aceita somente valores numéricos. O quantificador '${quantificador}' é inválido para esta operação.`, 8 | ); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /exemplos/importacao.css: -------------------------------------------------------------------------------- 1 | html { 2 | transition-timing-function: cubic-bezier(0.42, 0, 1, 1); 3 | accent-color: rgb(100, 200, 300); 4 | } 5 | 6 | 7 | /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGUuY3NzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidGVzdGUuZm9sZXMiXSwic291cmNlc0NvbnRlbnQiOlsiQGltcG9ydGFyIFwiX3BhcmNpYWxcIlx1MDAwMCJdLCJtYXBwaW5ncyI6IkFBQUEsSUFBSTtJQUNBLDBCQUFlLEVBQUUsZUFBZTs4QkFDMUIsc0NBQVksRUFBRSxlQUFlOyJ9 */ 8 | -------------------------------------------------------------------------------- /exemplos/exemplo6.foles: -------------------------------------------------------------------------------- 1 | lmht { 2 | estilo-lista: dentro meu-estilo; 3 | } 4 | 5 | lmht { 6 | recursos-fonte: "c2sc", "hist"; 7 | } 8 | 9 | lmht { 10 | eventos-ponteiro: delimitarCaixa; 11 | } 12 | 13 | lmht { 14 | espacamento-letras: .2rem; 15 | } 16 | 17 | lmht { 18 | fonte-texto: "Times New Roman", sem-serifa; 19 | } 20 | 21 | lmht { 22 | regras-coluna: fina; 23 | } 24 | 25 | lmht { 26 | imagem-borda: preencher 27px; 27 | } 28 | -------------------------------------------------------------------------------- /fontes/modificadores/atributos/estilo.ts: -------------------------------------------------------------------------------- 1 | export const estilos: { [valorFolEs: string]: string } = { 2 | tracejado: "dashed", 3 | pontilhado: "dotted", 4 | entalhado: "groove", 5 | solido: "solid", 6 | sólido: "solid", 7 | duplicado: "double", 8 | sulcado: "ridge", 9 | embutido: "inset", 10 | saltado: "outset", 11 | escondido: "hidden", 12 | nenhum: "none", 13 | }; 14 | 15 | // Baseado em: https://developer.mozilla.org/en-US/docs/Web/CSS/border-style 16 | -------------------------------------------------------------------------------- /fontes/seletores/seletor-espaco-reservado.ts: -------------------------------------------------------------------------------- 1 | import { PragmasSeletor } from "./pragmas-seletor"; 2 | import { Seletor } from "./seletor"; 3 | 4 | /** 5 | * Não deve ser impresso em CSS. 6 | */ 7 | export class SeletorEspacoReservado extends Seletor { 8 | nome: string; 9 | 10 | constructor(nome: string, pragmas?: PragmasSeletor) { 11 | super(undefined, pragmas); 12 | this.nome = nome; 13 | } 14 | 15 | paraTexto() { 16 | return ""; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/pintura.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Pintura extends Metodo { 5 | referencia: string; 6 | traducao: string; 7 | 8 | constructor (referencia: Simbolo) { 9 | super(); 10 | this.referencia = referencia.lexema; 11 | this.traducao = 'paint'; 12 | } 13 | 14 | paraTexto(): string { 15 | return `paint(${this.referencia})`; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/paint.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Paint extends MetodoCss { 5 | referencia: string; 6 | traducao: string; 7 | 8 | constructor (referencia: Simbolo) { 9 | super(); 10 | this.referencia = referencia.lexema; 11 | this.traducao = 'paint'; 12 | } 13 | 14 | paraTexto(): string { 15 | return `pintura(${this.referencia})`; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /fontes/resolvedores/README.md: -------------------------------------------------------------------------------- 1 | # Resolvedores 2 | 3 | Resolvedores são classes que efetivamente escrevem os arquivos de saída. 4 | 5 | Nas primeiras implementações de FolEs, os tradutores faziam este papel. Com a inclusão da funcionalidade de geração de mapas de código, os tradutores passaram a gerar uma estrutura de dados intermediária, muito semelhante ao que é gerado pela análise sintática. Essas estruturas possuem todos os pragmas (linha, coluna inicial e coluna final de cada símbolo) recalculados pela tradução. -------------------------------------------------------------------------------- /fontes/tradutores/README.md: -------------------------------------------------------------------------------- 1 | # Tradutores 2 | 3 | Inicialmente implementados como classes que montavam _strings_ de saída, os tradutores de FolEs recebem estruturas de dados do avaliador sintático e geram outras, com o recálculo dos pragmas (linha, coluna inicial e coluna final de cada símbolo). A ideia com isso é de gerar não apenas o arquivo de saída com a tradução como também seu respectivo mapa de símbolos, que pode ser usado em navegadores de internet (inspetor) para entender como cada símbolo foi transformado. -------------------------------------------------------------------------------- /fontes/valores/metodos/css/scaleY.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class ScaleY extends MetodoCss { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo, valor2: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "scaleY"; 12 | } 13 | 14 | paraTexto() { 15 | return `escalamento-vertical(${this.valor1})`; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/scaleZ.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class ScaleZ extends MetodoCss { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo, valor2: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "scaleZ"; 12 | } 13 | 14 | paraTexto() { 15 | return `escalamento-eixo-z(${this.valor1})`; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/escalamento-eixo-z.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class EscalamentoEixoZ extends Metodo { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo, valor2: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "scaleZ"; 12 | } 13 | 14 | paraTexto() { 15 | return `scaleZ(${this.valor1})`; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /fontes/valores/seletor-valor.ts: -------------------------------------------------------------------------------- 1 | import { DicionarioValores } from "./dicionario-valores"; 2 | 3 | export class SeletorValor { 4 | constructor(nomeFolEs: string, valores: any[]) { 5 | if ( 6 | DicionarioValores[nomeFolEs] === undefined || 7 | DicionarioValores[nomeFolEs] === null 8 | ) { 9 | throw new Error(`O valor \'${nomeFolEs}\' não foi encontrado.`); 10 | } 11 | return new DicionarioValores[nomeFolEs](...valores); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fontes/modificadores/estilo-lista-tipo.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | 4 | export class EstiloListaTipo extends Modificador { 5 | constructor( 6 | valores: Valor[], 7 | pragmas?: PragmasModificador, 8 | // variavel?: boolean 9 | ) { 10 | super("estilo-lista-tipo", "list-style-type", pragmas); 11 | 12 | this.valores = valores; 13 | // this.variavel = variavel; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/scaleX.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class ScaleX extends MetodoCss { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo, valor2: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "scaleX"; 12 | } 13 | 14 | paraTexto() { 15 | return `escalamento-horizontal(${this.valor1})`; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/escalamento-vertical.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class EscalamentoVertical extends Metodo { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo, valor2: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "scaleY"; 12 | } 13 | 14 | paraTexto() { 15 | return `scaleY(${this.valor1})`; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /fontes/seletores/seletor.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse } from "../pseudoclasses/pseudoclasse"; 2 | import { PragmasSeletor } from "./pragmas-seletor"; 3 | 4 | export abstract class Seletor { 5 | pseudoclasse?: Pseudoclasse; 6 | pragmas?: PragmasSeletor; 7 | pragmasTraducao?: PragmasSeletor; 8 | 9 | constructor(pseudoclasse?: Pseudoclasse, pragmas?: PragmasSeletor) { 10 | this.pseudoclasse = pseudoclasse; 11 | this.pragmas = pragmas; 12 | } 13 | 14 | abstract paraTexto(); 15 | } 16 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/escalamento-horizontal.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class EscalamentoHorizontal extends Metodo { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo, valor2: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "scaleX"; 12 | } 13 | 14 | paraTexto() { 15 | return `scaleX(${this.valor1})`; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "dist", 4 | "module": "commonjs", 5 | "target": "es2017", 6 | "rootDir": "fontes", 7 | "allowJs": true, 8 | "sourceMap": true, 9 | "declaration": true, 10 | "esModuleInterop": true 11 | }, 12 | "exclude": [ 13 | "babel.config.js", 14 | "coverage/**/*", 15 | "dist/**/*", 16 | "jest.config.ts", 17 | "node_modules", 18 | "testes/**/*" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/valido.ts: -------------------------------------------------------------------------------- 1 | import { cores } from "../modificadores/atributos/cores"; 2 | import { estilos } from "../modificadores/atributos/estilo"; 3 | import { valoresGlobais } from "../modificadores/atributos/globais"; 4 | import { unidadesMedida } from "../modificadores/atributos/quantificadores"; 5 | import { Pseudoclasse, PragmasPseudoclasse } from "./pseudoclasse"; 6 | 7 | export class Valido extends Pseudoclasse { 8 | constructor(pragmas?: PragmasPseudoclasse) { 9 | super("valido", "valid", pragmas); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /fontes/estruturas/seletor-estruturas-html.ts: -------------------------------------------------------------------------------- 1 | import { PragmasSeletor } from "../seletores"; 2 | import { DicionarioEstruturasHtml } from "./dicionario-estruturas-html"; 3 | 4 | export class SeletorEstruturasHtml { 5 | constructor(nomeCss: string, pragmas?: PragmasSeletor) { 6 | const estrutura = DicionarioEstruturasHtml[nomeCss]; 7 | if (estrutura === undefined || estrutura === null) { 8 | throw new Error(`A estrutura \'${nomeCss}\' não existe.`); 9 | } 10 | 11 | return new estrutura(pragmas); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fontes/estruturas/seletor-estruturas-lmht.ts: -------------------------------------------------------------------------------- 1 | import { PragmasSeletor } from "../seletores"; 2 | import { DicionarioEstruturasLmht } from "./dicionario-estruturas-lmht"; 3 | 4 | export class SeletorEstruturasLmht { 5 | constructor(nomeFolEs: string, pragmas?: PragmasSeletor) { 6 | const estrutura = DicionarioEstruturasLmht[nomeFolEs]; 7 | if (estrutura === undefined || estrutura === null) { 8 | throw new Error(`A estrutura \'${nomeFolEs}\' não existe.`); 9 | } 10 | 11 | return new estrutura(pragmas); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fontes/modificadores/atributos/fontes.ts: -------------------------------------------------------------------------------- 1 | export const fontes: { [nomeFoles: string]: string } = { 2 | // Fontes (family font name) 3 | Arial: "Arial", 4 | "Brush Script MT": "Brush Script MT", 5 | "Courier New": "Courier New", 6 | Garamond: "Garamond", 7 | "Gill Sans Extrabold": "Gill Sans Extrabold", 8 | Georgia: "Georgia", 9 | Helvetica: "Helvetica", 10 | "Lucida Console": "Lucida Console", 11 | Tahoma: "Tahoma", 12 | "Trebuchet MS": "Trebuchet MS", 13 | "Times New Roman": "Times New Roman", 14 | Verdana: "Verdana", 15 | }; 16 | -------------------------------------------------------------------------------- /fontes/modificadores/cor.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class Cor extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor", "color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /fontes/modificadores/validacoes/quantificador.ts: -------------------------------------------------------------------------------- 1 | export function validarQuantificador( 2 | nomePropriedade: string, 3 | quantificador: string, 4 | quantificadoresAceitos: { [valorFoles: string]: string }, 5 | ) { 6 | if ( 7 | !(quantificador in quantificadoresAceitos) || 8 | quantificador === undefined 9 | ) { 10 | throw new Error(`Modificador ou variável '${nomePropriedade}' com quantificador inválido. Valores aceitos: 11 | ${Object.keys(quantificadoresAceitos).reduce((final, atual) => (final += `, ${atual}`))}.`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/seletor-pseudoclasse.ts: -------------------------------------------------------------------------------- 1 | import { DicionarioPseudoClasses } from "./dicionario-pseudoclasses"; 2 | import { PragmasPseudoclasse, Pseudoclasse } from "./pseudoclasse"; 3 | 4 | export class SeletorPseudoclasse { 5 | constructor(nomeFolEs: string, pragmas?: PragmasPseudoclasse) { 6 | const pseudoclasse = DicionarioPseudoClasses[nomeFolEs]; 7 | if (pseudoclasse === undefined || pseudoclasse === null) { 8 | throw new Error(`A pseudoclasse \'${nomeFolEs}\' não existe.`); 9 | } 10 | 11 | return new pseudoclasse(pragmas); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/rgb.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Rgb extends Metodo { 5 | vermelho: number; 6 | verde: number; 7 | azul: number; 8 | 9 | constructor(vermelho: Simbolo, verde: Simbolo, azul: Simbolo) { 10 | super(); 11 | this.vermelho = Number(vermelho.lexema); 12 | this.verde = Number(verde.lexema); 13 | this.azul = Number(azul.lexema); 14 | } 15 | 16 | paraTexto() { 17 | return `rgb(${this.vermelho}, ${this.verde}, ${this.azul})`; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/rgba.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Rgba extends Metodo { 5 | vermelho: number; 6 | verde: number; 7 | azul: number; 8 | 9 | constructor(vermelho: Simbolo, verde: Simbolo, azul: Simbolo) { 10 | super(); 11 | this.vermelho = Number(vermelho.lexema); 12 | this.verde = Number(verde.lexema); 13 | this.azul = Number(azul.lexema); 14 | } 15 | 16 | paraTexto() { 17 | return `rgba(${this.vermelho}, ${this.verde}, ${this.azul})`; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-fundo.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorFundo extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor-fundo", "background-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor-fundo", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/encaixar-conteudo.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class EncaixarConteudo extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: string) { 10 | super(); 11 | this.valor = Number(valor); 12 | this.quantificador = quantificador; 13 | this.traducao = "fit-content"; 14 | } 15 | 16 | paraTexto() { 17 | return `fit-content(${this.valor}${this.quantificador})`; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/dicionario/dicionario-suplementar-metodos.ts: -------------------------------------------------------------------------------- 1 | import { Scale } from "../../valores/metodos/css/scale"; 2 | import { Opacity } from "../../valores/metodos/css/opacity"; 3 | import { Perspective } from "../../valores/metodos/css/perspective"; 4 | import { Rotate } from "../../valores/metodos/css/rotate"; 5 | import { Translate } from "../../valores/metodos/css/translate"; 6 | 7 | export const DicionarioSuplementarMetodos: { [nomeCss: string]: any } = { 8 | opacity: Opacity, 9 | perspective: Perspective, 10 | rotate: Rotate, 11 | scale: Scale, 12 | translate: Translate, 13 | }; 14 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/fit-content.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class FitContent extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: string) { 10 | super(); 11 | this.valor = Number(valor); 12 | this.quantificador = quantificador; 13 | this.traducao = "fit-content"; 14 | } 15 | 16 | paraTexto() { 17 | return `encaixar-conteudo(${this.valor}${this.quantificador})`; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/pseudoclasses/pseudoclasse.ts: -------------------------------------------------------------------------------- 1 | export interface PragmasPseudoclasse { 2 | linha: number; 3 | colunaInicial: number; 4 | colunaFinal: number; 5 | } 6 | 7 | export class Pseudoclasse { 8 | nomeFoles: string | string[]; 9 | pseudoclasseCss: string; 10 | pragmas?: PragmasPseudoclasse; 11 | 12 | constructor( 13 | nomeFoles: string | string[], 14 | pseudoclasseCss: string, 15 | pragmas?: PragmasPseudoclasse, 16 | ) { 17 | this.nomeFoles = nomeFoles; 18 | this.pseudoclasseCss = pseudoclasseCss; 19 | this.pragmas = pragmas; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/espirrar.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Espirrar extends Metodo { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "swash"; 12 | } 13 | 14 | paraTexto() { 15 | if (this.valor1 < 1 || this.valor1 > 99) { 16 | throw new Error('O valor da função espirrar() deve estar entre 1 e 99'); 17 | } 18 | 19 | return `swash(${this.valor1})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /exemplos/exemplo.foles: -------------------------------------------------------------------------------- 1 | .minha-classe { 2 | alinhar-conteudo: inseguro; 3 | estilo-contorno: herdar; 4 | cor-destaque: hsl(12, 13%, 24%); 5 | cor: #f100ff; 6 | cor-fundo: vermelho; 7 | tamanho-fonte: 16px; 8 | largura-maxima: 20cm; 9 | } 10 | 11 | .minha-classe:sobre { 12 | cor-fundo: azul; 13 | } 14 | 15 | #elemento-caixa { 16 | altura: 40px; 17 | } 18 | 19 | .minha-segunda-classe { 20 | margem-superior: 13mm; 21 | } 22 | 23 | #meu-segundo-id { 24 | largura: 400mm; 25 | } 26 | 27 | %campos { 28 | margem-inferior: 50px; 29 | } 30 | 31 | lmht { 32 | cor-fundo: hsl(50, 80%, 80%); 33 | } 34 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/swash.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Swash extends MetodoCss { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "swash"; 12 | } 13 | 14 | paraTexto() { 15 | if (this.valor1 < 1 || this.valor1 > 99) { 16 | throw new Error('O valor da função swash() deve estar entre 1 e 99'); 17 | } 18 | 19 | return `espirrar(${this.valor1})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-borda-direita.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorBordaDireita extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor-borda-direita", "border-right-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor-borda-direita", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-borda-superior.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorBordaSuperior extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor-borda-superior", "border-top-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor-borda-superior", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/modificadores/regras-cor-coluna.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class RegrasCorColuna extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("regras-cor-coluna", "column-rule-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("regras-cor-coluna", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/poligono.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValores } from "../comum"; 3 | import { Metodo } from "./metodo"; 4 | 5 | export class Poligono extends Metodo { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | 9 | constructor(arrayValores: Array) { 10 | super(); 11 | this.arrayValores = arrayValores; 12 | this.traducao = "polygon"; 13 | } 14 | 15 | paraTexto() { 16 | const traducaoRetorno: string = tratarValores(this.arrayValores); 17 | 18 | return `polygon(${traducaoRetorno})`; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-borda-em-bloco.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorBordaEmBloco extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor-borda-em-bloco", "border-block-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor-borda-em-bloco", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-borda-em-linha.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorBordaEmLinha extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor-borda-em-linha", "border-inline-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor-borda-em-linha", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-borda-esquerda.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorBordaEsquerda extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor-borda-esquerda", "border-left-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor-borda-esquerda", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-borda-inferior.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorBordaInferior extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor-borda-inferior", "border-bottom-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor-borda-inferior", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/estilistico.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Estilistico extends Metodo { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "stylistic"; 12 | } 13 | 14 | paraTexto() { 15 | if (this.valor1 < 1 || this.valor1 > 20) { 16 | throw new Error('O valor da função estilistico() deve estar entre 1 e 20'); 17 | } 18 | 19 | return `stylistic(${this.valor1})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/stylistic.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Stylistic extends MetodoCss { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "stylistic"; 12 | } 13 | 14 | paraTexto() { 15 | if (this.valor1 < 1 || this.valor1 > 20) { 16 | throw new Error('O valor da função stylistic() deve estar entre 1 e 20'); 17 | } 18 | 19 | return `estilístico(${this.valor1})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/linear.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Linear extends Metodo { 5 | inicio: number; 6 | meio: number; 7 | fim: number; 8 | traducao: string; 9 | 10 | constructor(inicio: Simbolo, meio: Simbolo, fim: Simbolo) { 11 | super(); 12 | this.inicio = Number(inicio.lexema); 13 | this.meio = Number(meio.lexema); 14 | this.fim = Number(fim.lexema); 15 | this.traducao = "linear"; 16 | } 17 | 18 | paraTexto() { 19 | return `linear(${this.inicio}, ${this.meio}, ${this.fim})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/valor-numerico.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "./valor"; 2 | 3 | export class ValorNumerico extends Valor { 4 | literalNumerico: number; 5 | quantificador?: string; 6 | 7 | constructor(nomeModificador: string, literalNumerico: number, quantificador?: string) { 8 | super(); 9 | this.literalNumerico = literalNumerico; 10 | this.quantificador = quantificador; 11 | } 12 | 13 | paraTexto(): string { 14 | let resultado = `${this.literalNumerico}`; 15 | if (this.quantificador) { 16 | resultado += this.quantificador; 17 | } 18 | 19 | return resultado; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-fim-borda-em-bloco.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorFimBordaEmBloco extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor-fim-borda-em-bloco", "border-block-end-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor-fim-borda-em-bloco", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-fim-borda-em-linha.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorFimBordaEmLinha extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("cor-fim-borda-em-linha", "border-inline-end-color", pragmas); 12 | 13 | if (!variavel) validarValorCor("cor-fim-borda-em-linha", valores); 14 | 15 | this.valores = valores; 16 | this.variavel = variavel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/polygon.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValoresReversos } from "../comum"; 3 | import { MetodoCss } from "./metodo-css"; 4 | 5 | export class Polygon extends MetodoCss { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | 9 | constructor(arrayValores: Array) { 10 | super(); 11 | 12 | this.arrayValores = arrayValores; 13 | this.traducao = "polygon"; 14 | } 15 | 16 | paraTexto() { 17 | const traducaoRetorno: string = tratarValoresReversos(this.arrayValores); 18 | 19 | return `polígono(${traducaoRetorno})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/hsl.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Hsl extends Metodo { 5 | matiz: number; // em inglês: 'hue' 6 | saturacao: number; 7 | luminosidade: number; 8 | 9 | constructor(matiz: Simbolo, saturacao: Simbolo, luminosidade: Simbolo) { 10 | super(); 11 | this.matiz = Number(matiz.lexema); 12 | this.saturacao = Number(saturacao.lexema); 13 | this.luminosidade = Number(luminosidade.lexema); 14 | } 15 | 16 | paraTexto() { 17 | return `hsl(${this.matiz} ${this.saturacao}% ${this.luminosidade}%)`; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/reiniciar-tudo.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { valoresGlobais } from "./atributos/globais"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValores } from "./validacoes/comum"; 5 | 6 | export class ReiniciarTudo extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("reiniciar-tudo", "all", pragmas); 13 | 14 | if (!variavel) validarValores("reiniciar-tudo", valores, {}); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/variar-caractere.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class VariarCaractere extends Metodo { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "character-variant"; 12 | } 13 | 14 | paraTexto() { 15 | if (this.valor1 < 1 || this.valor1 > 99) { 16 | throw new Error('O valor da função variar-caractere() deve estar entre 1 e 99'); 17 | } 18 | 19 | return `character-variant(${this.valor1})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /exemplos/exemplo7.foles: -------------------------------------------------------------------------------- 1 | lmht { 2 | posicao-deslocamento: 20% centro; 3 | limite-forma-imagem: 0.9; 4 | espaçamento-letras: .2rem; 5 | area-mascara: completar-caixa, preenchimento; 6 | coluna-em-grade: auto / auto; 7 | } 8 | 9 | lmht { 10 | posicao-direita: 20%; 11 | configuracoes-variacao-fonte: 10; 12 | cor-barra-rolagem: rgb(10, 20, 30); 13 | } 14 | 15 | lmht { 16 | cor-barra-rolagem: #ffffff; 17 | } 18 | 19 | lmht { 20 | cor-barra-rolagem: verde; 21 | } 22 | 23 | lmht { 24 | borda-direita: 20%; 25 | } 26 | 27 | lmht { 28 | fonte-texto: "Arial"; 29 | } 30 | 31 | lmht { 32 | agrupar-palavra: normal; 33 | ao-mudar: auto; 34 | } 35 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/character-variant.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class CharacterVariant extends MetodoCss { 5 | valor1: number; 6 | traducao: string; 7 | 8 | constructor(valor1: Simbolo) { 9 | super(); 10 | this.valor1 = Number(valor1.lexema); 11 | this.traducao = "character-variant"; 12 | } 13 | 14 | paraTexto() { 15 | if (this.valor1 < 1 || this.valor1 > 99) { 16 | throw new Error('O valor da função character-variant() deve estar entre 1 e 99'); 17 | } 18 | 19 | return `variar-caractere(${this.valor1})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/definir-imagem.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class DefinirImagem extends Metodo { 5 | link: string; 6 | tamanho: number; 7 | proporcao: string; 8 | traducao: string; 9 | 10 | constructor(link: Simbolo, tamanho: Simbolo, proporcao: Simbolo) { 11 | super(); 12 | this.link = link.lexema; 13 | this.tamanho = Number(tamanho.lexema); 14 | this.proporcao = proporcao.lexema; 15 | this.traducao = "image-set"; 16 | } 17 | 18 | paraTexto() { 19 | return `image-set(${this.link} ${this.tamanho}${this.proporcao})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/escalamento-3d.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Escalamento3d extends Metodo { 5 | valor1: number; 6 | valor2: number; 7 | valor3: number; 8 | traducao: string; 9 | 10 | constructor(valor1: Simbolo, valor2: Simbolo, valor3: Simbolo) { 11 | super(); 12 | this.valor1 = Number(valor1.lexema); 13 | this.valor2 = Number(valor2.lexema); 14 | this.valor3 = Number(valor3.lexema); 15 | this.traducao = "scale3d"; 16 | } 17 | 18 | paraTexto() { 19 | return `scale3d(${this.valor1}, ${this.valor2}, ${this.valor3})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/escalamento.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Escalamento extends Metodo { 5 | valor1: number; 6 | valor2: number; 7 | traducao: string; 8 | 9 | constructor(valor1: Simbolo, valor2: Simbolo) { 10 | super(); 11 | this.valor1 = Number(valor1.lexema); 12 | this.valor2 = valor2 ? Number(valor2.lexema) : null; 13 | this.traducao = "scale"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.valor2) { 18 | return `scale(${this.valor1}, ${this.valor2})`; 19 | } 20 | 21 | return `scale(${this.valor1})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/scale3d.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Scale3d extends MetodoCss { 5 | valor1: number; 6 | valor2: number; 7 | valor3: number; 8 | traducao: string; 9 | 10 | constructor(valor1: Simbolo, valor2: Simbolo, valor3: Simbolo) { 11 | super(); 12 | this.valor1 = Number(valor1.lexema); 13 | this.valor2 = Number(valor2.lexema); 14 | this.valor3 = Number(valor3.lexema); 15 | this.traducao = "scale3d"; 16 | } 17 | 18 | paraTexto() { 19 | return `escalamento-3d(${this.valor1}, ${this.valor2}, ${this.valor3})`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/repetir-gradiente-conico.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValores } from "../comum"; 3 | import { Metodo } from "./metodo"; 4 | 5 | export class RepetirGradienteConico extends Metodo { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | 9 | constructor(arrayValores: Array) { 10 | super(); 11 | this.arrayValores = arrayValores; 12 | this.traducao = "repeating-conic-gradient"; 13 | } 14 | 15 | paraTexto() { 16 | const traducaoRetorno: string = tratarValores(this.arrayValores); 17 | 18 | return `repeating-conic-gradient(${traducaoRetorno})`; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/scale.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Scale extends MetodoCss { 5 | valor1: number; 6 | valor2: number; 7 | traducao: string; 8 | 9 | constructor(valor1: Simbolo, valor2: Simbolo) { 10 | super(); 11 | this.valor1 = Number(valor1.lexema); 12 | this.valor2 = valor2 ? Number(valor2.lexema) : null; 13 | this.traducao = "scale"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.valor2) { 18 | return `escalamento(${this.valor1}, ${this.valor2})`; 19 | } 20 | 21 | return `escalamento(${this.valor1})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/recortar.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class Recortar extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | }; 9 | 10 | constructor( 11 | valores: Valor[], 12 | pragmas?: PragmasModificador, 13 | variavel?: boolean 14 | ) { 15 | super("recortar", "clip", pragmas); 16 | 17 | if (!variavel) validarValores("recortar", valores, this.valoresAceitos); 18 | 19 | this.valores = valores; 20 | this.variavel = variavel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/sepia.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Sepia extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "sepia"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `sepia(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `sepia(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-enfase-texto.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorEnfaseTexto extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super( 12 | ["cor-enfase-texto", "cor-ênfase-texto"], 13 | "text-emphasis-color", 14 | pragmas, 15 | ); 16 | 17 | if (!variavel) validarValorCor("cor-ênfase-texto", valores); 18 | 19 | this.valores = valores; 20 | this.variavel = variavel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/sepia.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Sepia extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "sepia"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `sepia(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `sepia(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/borrar.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Borrar extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | 13 | this.quantificador = quantificador ? quantificador.lexema : null; 14 | this.traducao = "blur"; 15 | } 16 | 17 | paraTexto() { 18 | if (this.quantificador) { 19 | return `blur(${this.valor}${this.quantificador})`; 20 | } 21 | 22 | return `blur(${this.valor})`; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/inverter.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Inverter extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "invert"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `invert(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `invert(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/opacar.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Opacar extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "opacity"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `opacity(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `opacity(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/blur.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Blur extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | 13 | this.quantificador = quantificador ? quantificador.lexema : null; 14 | this.traducao = "blur"; 15 | } 16 | 17 | paraTexto() { 18 | if (this.quantificador) { 19 | return `borrar(${this.valor}${this.quantificador})`; 20 | } 21 | 22 | return `borrar(${this.valor})`; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/saturar.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Saturar extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "saturate"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `saturate(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `saturate(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-cursor.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorCursor extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | }; 9 | 10 | constructor( 11 | valores: Valor[], 12 | pragmas?: PragmasModificador, 13 | variavel?: boolean 14 | ) { 15 | super("cor-cursor", "caret-color", pragmas); 16 | 17 | if (!variavel) validarValorCor("cor-cursor", valores, this.valoresAceitos); 18 | 19 | this.valores = valores; 20 | this.variavel = variavel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/invert.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Invert extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "invert"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `inverter(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `inverter(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/opacity.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Opacity extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "opacity"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `opacar(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `opacar(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/estilo-borda-direita.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { estilos } from "./atributos/estilo"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class EstiloBordaDireita extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("estilo-borda-direita", "border-right-style", pragmas); 13 | 14 | if (!variavel) validarValoresAdicionais("estilo-borda-direita", valores, estilos); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/regras-estilo-coluna.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { estilos } from "./atributos/estilo"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class RegrasEstiloColuna extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("regras-estilo-coluna", "column-rule-style", pragmas); 13 | 14 | if (!variavel) validarValoresAdicionais("regras-estilo-coluna", valores, estilos); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/rotate.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Rotate extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "rotate"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `rotacionar(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `rotacionar(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/saturate.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Saturate extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "saturate"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `saturar(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `saturar(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/brilho.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Brilho extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | 13 | this.quantificador = quantificador ? quantificador.lexema : null; 14 | this.traducao = "brightness"; 15 | } 16 | 17 | paraTexto() { 18 | if (this.quantificador) { 19 | return `brightness(${this.valor}${this.quantificador})`; 20 | } 21 | 22 | return `brightness(${this.valor})`; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/contraste.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Contraste extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | 13 | this.quantificador = quantificador ? quantificador.lexema : null; 14 | this.traducao = "contrast"; 15 | } 16 | 17 | paraTexto() { 18 | if (this.quantificador) { 19 | return `contrast(${this.valor}${this.quantificador})`; 20 | } 21 | 22 | return `contrast(${this.valor})`; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-destaque.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorDestaque extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | }; 9 | 10 | constructor( 11 | valores: Valor[], 12 | pragmas?: PragmasModificador, 13 | variavel?: boolean 14 | ) { 15 | super("cor-destaque", "accent-color", pragmas); 16 | 17 | if (!variavel) validarValorCor("cor-destaque", valores, this.valoresAceitos); 18 | 19 | this.valores = valores; 20 | this.variavel = variavel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/modificadores/decoracao-cor-texto.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class DecoracaoCorTexto extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super( 12 | ["decoracao-cor-texto", "decoração-cor-texto"], 13 | "text-decoration-color", 14 | pragmas, 15 | ); 16 | 17 | if (!variavel) validarValorCor("decoração-cor-texto", valores); 18 | 19 | this.valores = valores; 20 | this.variavel = variavel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/modificadores/estilo-borda-em-bloco.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { estilos } from "./atributos/estilo"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class EstiloBordaEmBloco extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("estilo-borda-em-bloco", "border-block-style", pragmas); 13 | 14 | if (!variavel) validarValoresAdicionais("estilo-borda-em-bloco", valores, estilos); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/estilo-borda-em-linha.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { estilos } from "./atributos/estilo"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class EstiloBordaEmLinha extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("estilo-borda-em-linha", "border-inline-style", pragmas); 13 | 14 | if (!variavel) validarValoresAdicionais("estilo-borda-em-linha", valores, estilos); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/estilo-borda-esquerda.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { estilos } from "./atributos/estilo"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class EstiloBordaEsquerda extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("estilo-borda-esquerda", "border-left-style", pragmas); 13 | 14 | if (!variavel) validarValoresAdicionais("estilo-borda-esquerda", valores, estilos); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/estilo-borda-inferior.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { estilos } from "./atributos/estilo"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class EstiloBordaInferior extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("estilo-borda-inferior", "border-bottom-style", pragmas); 13 | 14 | if (!variavel) validarValoresAdicionais("estilo-borda-inferior", valores, estilos); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/estilo-borda-superior.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { estilos } from "./atributos/estilo"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class EstiloBordaSuperior extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("estilo-borda-superior", "border-top-style", pragmas); 13 | 14 | if (!variavel) validarValoresAdicionais("estilo-borda-superior", valores, estilos); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/constrast.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Contrast extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "contrast"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `contraste(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `contraste(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/escala-cinza.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class EscalaCinza extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "grayscale"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `grayscale(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `grayscale(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-contorno.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorContorno extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | inverter: "invert", 8 | }; 9 | 10 | constructor( 11 | valores: Valor[], 12 | pragmas?: PragmasModificador, 13 | variavel?: boolean 14 | ) { 15 | super("cor-contorno", "outline-color", pragmas); 16 | 17 | if (!variavel) validarValorCor("cor-contorno", valores, this.valoresAceitos); 18 | 19 | this.valores = valores; 20 | this.variavel = variavel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/brightness.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Brightness extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | 13 | this.quantificador = quantificador ? quantificador.lexema : null; 14 | this.traducao = "brightness"; 15 | } 16 | 17 | paraTexto() { 18 | if (this.quantificador) { 19 | return `brilho(${this.valor}${this.quantificador})`; 20 | } 21 | 22 | return `brilho(${this.valor})`; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/grayscale.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Grayscale extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "grayscale"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `escala-cinza(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `escala-cinza(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/skewY.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class SkewY extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "skewY"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `inclinar-vertical(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `inclinar-vertical(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/posicao-mascara.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { posicoesBasicas } from "./atributos/posicoes"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class PosicaoMascara extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super(["posicao-mascara", "posição-máscara"], "mask-position", pragmas); 13 | 14 | if (!variavel) validarValoresAdicionais("posição-máscara", valores, posicoesBasicas); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/posicao-objeto.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { posicoesBasicas } from "./atributos/posicoes"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class PosicaoObjeto extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super(["posicao-objeto", "posição-objeto"], "object-position", pragmas); 13 | 14 | if (!variavel) validarValoresAdicionais("posição-objeto", valores, posicoesBasicas); 15 | 16 | this.valores = valores; 17 | this.variavel = variavel; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/rotateZ.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class RotateZ extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "rotateZ"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `rotacionar-eixo-z(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `rotacionar-eixo-z(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/skewX.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class SkewX extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "skewX"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `inclinar-horizontal(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `inclinar-horizontal(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/translacao-eixo-z.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class TranslacaoEixoZ extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "translateZ"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `translateZ(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `translateZ(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/superclasse/modificador.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../../valores"; 2 | import { PragmasModificador } from "./pragmas-modificador"; 3 | 4 | export class Modificador { 5 | nomeFoles: string | string[]; 6 | propriedadeCss: string; 7 | valores: Valor[]; 8 | pragmas?: PragmasModificador; 9 | pragmasTraducao?: PragmasModificador; 10 | valoresAceitos?: { [valorFoles: string]: string }; 11 | variavel: boolean = false; 12 | 13 | constructor( 14 | nomeFoles: string | string[], 15 | propriedadeCss: string, 16 | pragmas?: PragmasModificador, 17 | ) { 18 | this.nomeFoles = nomeFoles; 19 | this.propriedadeCss = propriedadeCss; 20 | this.pragmas = pragmas; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/hue-rotate.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class HueRotate extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "hue-rotate"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `rotacionar-matiz(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `rotacionar-matiz(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/rotateY.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class RotateY extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "rotateY"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `rotacionar-vertical(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `rotacionar-vertical(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/translacao-vertical.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class TranslacaoVertical extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "translateY"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `translateY(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `translateY(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-barra-rolagem.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorBarraRolagem extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | }; 9 | 10 | constructor( 11 | valores: Valor[], 12 | pragmas?: PragmasModificador, 13 | variavel?: boolean 14 | ) { 15 | super("cor-barra-rolagem", "scrollbar-color", pragmas); 16 | 17 | if (!variavel) validarValorCor("cor-barra-rolagem", valores, this.valoresAceitos); 18 | 19 | this.valores = valores; 20 | this.variavel = variavel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/modificadores/isolamento.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class Isolamento extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | isolar: "isolate", 9 | }; 10 | 11 | constructor( 12 | valores: Valor[], 13 | pragmas?: PragmasModificador, 14 | variavel?: boolean 15 | ) { 16 | super("isolamento", "isolation", pragmas); 17 | 18 | if (!variavel) validarValores("isolamento", valores, this.valoresAceitos); 19 | 20 | this.valores = valores; 21 | this.variavel = variavel; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/rotateX.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class RotateX extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "rotateX"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `rotacionar-horizontal(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `rotacionar-horizontal(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/translateZ.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class TranslateZ extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "translateZ"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `translacao-eixo-z(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `translacao-eixo-z(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/perspectivar.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Perspectivar extends Metodo { 5 | valor: number | string; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = (valor as Simbolo).lexema; 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "perspective"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `perspective(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `perspective(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/translacao-horizontal.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class TranslacaoHorizontal extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "translateX"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `translateX(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `translateX(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/listas/valor-string.ts: -------------------------------------------------------------------------------- 1 | export const ValorString: Array = [ 2 | 'citações', 3 | 'citacoes', 4 | 'configurações-variação-fonte', 5 | 'configuracoes-variacao-fonte', 6 | 'ênfase-texto', 7 | 'enfase-texto', 8 | 'estilo-ênfase-texto', 9 | 'estilo-enfase-texto', 10 | 'substituir-idioma-fonte', 11 | 'vazamento-texto', 12 | ]; 13 | 14 | export const ValorStringAcentuado: Array = [ 15 | 'citações', 16 | 'configurações-variação-fonte', 17 | 'ênfase-texto', 18 | 'estilo-ênfase-texto', 19 | 'substituir-idioma-fonte', 20 | 'vazamento-texto', 21 | ]; 22 | 23 | /* 24 | 25 | VALORES STRING - Exemplos 26 | "x" 27 | "<" 28 | 'foo' 29 | "\25B2" 30 | "«" "»" "‹" "›" 31 | 'xxxxx' 32 | */ -------------------------------------------------------------------------------- /fontes/valores/metodos/css/annotation.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Annotation extends MetodoCss { 5 | valor: number | string; 6 | traducao: string; 7 | 8 | constructor(valor: Simbolo) { 9 | super(); 10 | this.valor = valor.tipo === 'NUMERO' ? Number(valor.lexema) : valor.lexema; 11 | this.traducao = "annotation"; 12 | } 13 | 14 | paraTexto() { 15 | if (typeof this.valor === 'number') { 16 | if (this.valor < 1 || this.valor > 99) { 17 | throw new Error('O valor da função annotation() deve estar entre 1 e 99'); 18 | } 19 | } 20 | return `anotação(${this.valor})`; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/perspective.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Perspective extends MetodoCss { 5 | valor: number | string; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = (valor as Simbolo).lexema; 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "perspective"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `perspectivar(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `perspectivar(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/translateY.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class TranslateY extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "translateY"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `translacao-vertical(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `translacao-vertical(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/lexador/simbolo.ts: -------------------------------------------------------------------------------- 1 | export class Simbolo { 2 | lexema: string; 3 | tipo: string; 4 | literal: any; 5 | linha: number; 6 | colunaInicial: number; 7 | colunaFinal: number; 8 | 9 | constructor( 10 | tipo: string, 11 | lexema: string, 12 | literal: any, 13 | linha: number, 14 | colunaInicial: number, 15 | colunaFinal: number, 16 | ) { 17 | this.tipo = tipo; 18 | this.lexema = lexema; 19 | this.literal = literal; 20 | this.linha = linha; 21 | this.colunaInicial = colunaInicial; 22 | this.colunaFinal = colunaFinal; 23 | } 24 | 25 | paraTexto(): string { 26 | return this.tipo + " " + this.lexema + " " + this.literal; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-inicio-borda-em-bloco.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorInicioBordaEmBloco extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super( 12 | ["cor-inicio-borda-em-bloco", "cor-início-borda-em-bloco"], 13 | "border-block-start-color", 14 | pragmas, 15 | ); 16 | 17 | if (!variavel) validarValorCor("cor-início-borda-em-bloco", valores); 18 | 19 | this.valores = valores; 20 | this.variavel = variavel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/modificadores/cor-inicio-borda-em-linha.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorCor } from "./validacoes/cor"; 4 | 5 | export class CorInicioBordaEmLinha extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super( 12 | ["cor-inicio-borda-em-linha", "cor-início-borda-em-linha"], 13 | "border-inline-start-color", 14 | pragmas, 15 | ); 16 | 17 | if (!variavel) validarValorCor("cor-início-borda-em-linha", valores); 18 | 19 | this.valores = valores; 20 | this.variavel = variavel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/modificadores/design-tabela.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class DesignTabela extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | fixo: "fixed", 9 | }; 10 | 11 | constructor( 12 | valores: Valor[], 13 | pragmas?: PragmasModificador, 14 | variavel?: boolean 15 | ) { 16 | super("design-tabela", "table-layout", pragmas); 17 | 18 | if (!variavel) validarValores("design-tabela", valores, this.valoresAceitos); 19 | 20 | this.valores = valores; 21 | this.variavel = variavel; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/translateX.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class TranslateX extends MetodoCss { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "translateX"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | return `translacao-horizontal(${this.valor}${this.quantificador})`; 19 | } 20 | 21 | return `translacao-horizontal(${this.valor})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/superclasse/seletor-modificador.ts: -------------------------------------------------------------------------------- 1 | import { DicionarioModificadores } from "../dicionario/dicionario-modificadores"; 2 | import { PragmasModificador } from "../../modificadores/superclasse"; 3 | import { Valor } from "../../valores"; 4 | 5 | export class SeletorModificador { 6 | constructor( 7 | nomeFolEs: string, 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel: boolean = false, 11 | ) { 12 | const modificador = DicionarioModificadores[nomeFolEs]; 13 | if (modificador === undefined || modificador === null) { 14 | throw new Error(`O seletor \'${nomeFolEs}\' não existe.`); 15 | } 16 | 17 | return new modificador(valores, pragmas, variavel); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fontes/modificadores/direcao.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class Direcao extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | "esquerda-direita": "ltr", 8 | "direita-esquerda": "rtl", 9 | }; 10 | 11 | constructor( 12 | valores: Valor[], 13 | pragmas?: PragmasModificador, 14 | variavel?: boolean 15 | ) { 16 | super(["direcao", "direção"], "direction", pragmas); 17 | 18 | if (!variavel) validarValores("direção", valores, this.valoresAceitos); 19 | 20 | this.valores = valores; 21 | this.variavel = variavel; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/estender-coluna.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class EstenderColuna extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | nenhuma: "none", 8 | todas: "all", 9 | }; 10 | 11 | constructor( 12 | valores: Valor[], 13 | pragmas?: PragmasModificador, 14 | variavel?: boolean 15 | ) { 16 | super("estender-coluna", "column-span", pragmas); 17 | 18 | if (!variavel) validarValores("estender-coluna", valores, this.valoresAceitos); 19 | 20 | this.valores = valores; 21 | this.variavel = variavel; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/hifens.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class Hifens extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | nenhum: "none", 8 | manual: "manual", 9 | auto: "auto", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super(["hifens", "hífens"], "hyphens", pragmas); 18 | 19 | if (!variavel) validarValores("hífens", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/repeating-conic-gradient.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValoresReversos } from "../comum"; 3 | import { MetodoCss } from "./metodo-css"; 4 | 5 | export class RepeatingConicGradient extends MetodoCss { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | valoresAceitos: { [nomeFolEs: string]: string }; 9 | 10 | constructor(arrayValores: Array) { 11 | super(); 12 | 13 | this.arrayValores = arrayValores; 14 | this.traducao = "repeating-conic-gradient"; 15 | } 16 | 17 | paraTexto() { 18 | let traducaoRetorno: string = tratarValoresReversos(this.arrayValores); 19 | 20 | return `repetir-gradiente-cônico(${traducaoRetorno})`; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fontes/modificadores/recolher-borda.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class RecolherBorda extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | recolher: "collapse", 8 | separar: "separate", 9 | }; 10 | 11 | constructor( 12 | valores: Valor[], 13 | pragmas?: PragmasModificador, 14 | variavel?: boolean 15 | ) { 16 | super("recolher-borda", "border-collapse", pragmas); 17 | 18 | if (!variavel) validarValores("recolher-borda", valores, this.valoresAceitos); 19 | 20 | this.valores = valores; 21 | this.variavel = variavel; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/elemento.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Elemento extends Metodo { 5 | simbolo: string; 6 | referencia: string; 7 | traducao: string; 8 | 9 | constructor (simbolo: Simbolo, referencia: Simbolo) { 10 | super(); 11 | this.simbolo = simbolo.lexema; 12 | this.referencia = referencia.lexema; 13 | this.traducao = 'element'; 14 | } 15 | 16 | paraTexto(): string { 17 | if (this.simbolo !== "#"){ 18 | throw new Error("Atribuição inválida de referência para a função elemento(). O valor deve ser um id válido (ex.: #meu-id)"); 19 | } 20 | 21 | return `element(${this.simbolo}${this.referencia})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/celulas-vazias.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class CelulasVazias extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | exibir: "show", 8 | ocultar: "hide", 9 | }; 10 | 11 | constructor( 12 | valores: Valor[], 13 | pragmas?: PragmasModificador, 14 | variavel?: boolean 15 | ) { 16 | super(["celulas-vazias", "células-vazias"], "empty-cells", pragmas); 17 | 18 | if (!variavel) validarValores("células-vazias", valores, this.valoresAceitos); 19 | 20 | this.valores = valores; 21 | this.variavel = variavel; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/xywh.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValores } from "../comum"; 3 | import { Metodo } from "./metodo"; 4 | 5 | export class Xywh extends Metodo { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | valoresAceitos: { [nomeFolEs: string]: string }; 9 | 10 | constructor(arrayValores: Array) { 11 | super(); 12 | 13 | this.arrayValores = arrayValores; 14 | this.traducao = "xywh"; 15 | 16 | this.valoresAceitos = { 17 | "round": "arredondar", 18 | } 19 | } 20 | 21 | paraTexto() { 22 | let traducaoRetorno: string = tratarValores(this.arrayValores, this.valoresAceitos); 23 | 24 | return `xywh(${traducaoRetorno})`; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/modificadores/ordenar.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorNumerico } from "./validacoes/numerica"; 4 | 5 | export class Ordenar extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("ordenar", "order", pragmas); 12 | 13 | if (!variavel) { 14 | validarValorNumerico( 15 | "ordenar", 16 | valores, 17 | null, 18 | null, 19 | null, 20 | true 21 | ); 22 | } 23 | 24 | this.valores = valores; 25 | this.variavel = variavel; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fontes/modificadores/comportamento-rolagem.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class ComportamentoRolagem extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | suave: "smooth", 9 | }; 10 | 11 | constructor( 12 | valores: Valor[], 13 | pragmas?: PragmasModificador, 14 | variavel?: boolean 15 | ) { 16 | super("comportamento-rolagem", "scroll-behavior", pragmas); 17 | 18 | if (!variavel) validarValores("comportamento-rolagem", valores, this.valoresAceitos); 19 | 20 | this.valores = valores; 21 | this.variavel = variavel; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/filtro.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class Filtro extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | url: "url", 8 | }; 9 | 10 | constructor( 11 | valores: Valor[], 12 | pragmas?: PragmasModificador, 13 | variavel?: boolean 14 | ) { 15 | super("filtro", "filter", pragmas); 16 | 17 | const valoresExtra = ["url", "blur", "brightness", "contrast"]; 18 | 19 | if (!variavel) validarValores("filtro", valores, this.valoresAceitos, valoresExtra); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/modificadores/fixar-fundo.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class FixarFundo extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | fixo: "fixed", 8 | local: "local", 9 | rolar: "scroll", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("fixar-fundo", "background-attachment", pragmas); 18 | 19 | if (!variavel) validarValores("fixar-fundo", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/modificadores/fluxo-em-grade.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class FluxoEmGrade extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | linha: "row", 8 | coluna: "column", 9 | denso: "dense", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("fluxo-em-grade", "grid-auto-flow", pragmas); 18 | 19 | if (!variavel) validarValores("fluxo-em-grade", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/element.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Element extends MetodoCss { 5 | simbolo: string; 6 | referencia: string; 7 | traducao: string; 8 | 9 | constructor (simbolo: Simbolo, referencia: Simbolo) { 10 | super(); 11 | this.simbolo = simbolo.lexema; 12 | this.referencia = referencia.lexema; 13 | this.traducao = 'element'; 14 | } 15 | 16 | paraTexto(): string { 17 | if (this.simbolo !== "#"){ 18 | throw new Error("Atribuição inválida de referência para a função element(). O valor deve ser um id válido (ex.: #meu-id)"); 19 | } 20 | 21 | return `elemento(${this.simbolo}${this.referencia})`; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/inserir.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValores } from "../comum"; 3 | import { Metodo } from "./metodo"; 4 | 5 | export class Inserir extends Metodo { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | valoresAceitos: { [nomeFolEs: string]: string }; 9 | 10 | constructor(arrayValores: Array) { 11 | super(); 12 | 13 | this.arrayValores = arrayValores; 14 | this.traducao = "inset"; 15 | 16 | this.valoresAceitos = { 17 | "round": "arredondar", 18 | } 19 | } 20 | 21 | paraTexto() { 22 | const traducaoRetorno: string = tratarValores(this.arrayValores, this.valoresAceitos); 23 | 24 | return `inset(${traducaoRetorno})`; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/xywh.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValoresReversos } from "../comum"; 3 | import { MetodoCss } from "./metodo-css"; 4 | 5 | export class Xywh extends MetodoCss { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | valoresAceitos: { [nomeFolEs: string]: string }; 9 | 10 | constructor(arrayValores: Array) { 11 | super(); 12 | 13 | this.arrayValores = arrayValores; 14 | this.traducao = "xywh"; 15 | 16 | this.valoresAceitos = { 17 | "arredondar": "round", 18 | } 19 | } 20 | 21 | paraTexto() { 22 | const traducaoRetorno: string = tratarValoresReversos(this.arrayValores, this.valoresAceitos); 23 | 24 | return `xywh(${traducaoRetorno})`; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/modificadores/esquema-cor.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class EsquemaCor extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | normal: "normal", 8 | claro: "light", 9 | escuro: "dark", 10 | apenas: "only", 11 | }; 12 | 13 | constructor( 14 | valores: Valor[], 15 | pragmas?: PragmasModificador, 16 | variavel?: boolean 17 | ) { 18 | super("esquema-cor", "color-scheme", pragmas); 19 | 20 | if (!variavel) validarValores("esquema-cor", valores, this.valoresAceitos); 21 | 22 | this.valores = valores; 23 | this.variavel = variavel; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fontes/modificadores/flex-reduzir.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorNumerico } from "./validacoes/numerica"; 4 | 5 | export class FlexReduzir extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("flex-reduzir", "flex-shrink", pragmas); 12 | 13 | if (!variavel) { 14 | validarValorNumerico( 15 | "flex-reduzir", 16 | valores, 17 | null, 18 | null, 19 | null, 20 | true 21 | ); 22 | } 23 | 24 | this.valores = valores; 25 | this.variavel = variavel; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fontes/seletores/seletor-id.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse } from "../pseudoclasses/pseudoclasse"; 2 | import { PragmasSeletor } from "./pragmas-seletor"; 3 | import { Seletor } from "./seletor"; 4 | 5 | export class SeletorId extends Seletor { 6 | id: string; 7 | pragmas?: PragmasSeletor; 8 | 9 | constructor( 10 | id: string, 11 | pseudoclasse?: Pseudoclasse, 12 | pragmas?: PragmasSeletor, 13 | ) { 14 | super(pseudoclasse); 15 | this.id = id; 16 | this.pragmas = pragmas; 17 | } 18 | 19 | paraTexto() { 20 | let resultado = `#${this.id}`; 21 | if (this.pseudoclasse !== undefined && this.pseudoclasse !== null) { 22 | resultado += `:${this.pseudoclasse.pseudoclasseCss}`; 23 | } 24 | 25 | return resultado; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/ornaments.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Ornaments extends MetodoCss { 5 | valor: number | string; 6 | traducao: string; 7 | 8 | constructor(valor: Simbolo) { 9 | super(); 10 | this.valor = valor.tipo === 'NUMERO' ? Number(valor.lexema) : valor.lexema; 11 | this.traducao = "ornaments"; 12 | } 13 | 14 | paraTexto() { 15 | if (typeof this.valor === 'number') { 16 | if (this.valor < 1 || this.valor > 99) { 17 | throw new Error('O valor da função ornaments() deve estar entre 1 e 99'); 18 | } 19 | return `ornamentos(${this.valor})`; 20 | } 21 | 22 | return `ornamentos("${this.valor}")`; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/declaracoes/bloco-declaracao.ts: -------------------------------------------------------------------------------- 1 | import { Modificador } from "../modificadores"; 2 | import { Seletor } from "../seletores/seletor"; 3 | import { Declaracao } from "./declaracao"; 4 | 5 | export class BlocoDeclaracao extends Declaracao { 6 | seletores: Seletor[]; 7 | modificadores: Modificador[]; 8 | declaracoesAninhadas: Declaracao[]; 9 | espacoReservado?: string; 10 | 11 | constructor( 12 | seletores: Seletor[], 13 | modificadores: Modificador[], 14 | declaracoesAninhadas: Declaracao[], 15 | espacoReservado: string = null, 16 | ) { 17 | super(); 18 | this.seletores = seletores; 19 | this.modificadores = modificadores; 20 | this.declaracoesAninhadas = declaracoesAninhadas; 21 | this.espacoReservado = espacoReservado; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/largura-barra-rolagem.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class LarguraBarraRolagem extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | fina: "thin", 9 | nenhum: "none", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("largura-barra-rolagem", "scrollbar-width", pragmas); 18 | 19 | if (!variavel) validarValores("largura-barra-rolagem", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/modificadores/tipo-mascara.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class TipoMascara extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | alfa: "alpha", 8 | luminancia: "luminance", 9 | luminância: "luminance", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super(["tipo-mascara", "tipo-máscara"], "mask-type", pragmas); 18 | 19 | if (!variavel) validarValores("tipo-máscara", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/modificadores/agrupar-palavra.ts: -------------------------------------------------------------------------------- 1 | import { validarValores } from "./validacoes/comum"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { Valor } from "../valores"; 4 | 5 | export class AgruparPalavra extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | normal: "normal", 8 | "quebrar-tudo": "break-all", 9 | "manter-tudo": "keep-all", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("agrupar-palavra", "word-break", pragmas); 18 | 19 | if (!variavel) validarValores("agrupar-palavra", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/modificadores/preencher-coluna.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class PreencherColuna extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | equilibrar: "balance", 9 | "equilibrar-tudo": "balance-all", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("preencher-coluna", "column-fill", pragmas); 18 | 19 | if (!variavel) validarValores("preencher-coluna", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/gradiente-conico.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValores } from "../comum"; 3 | import { Metodo } from "./metodo"; 4 | 5 | export class GradienteConico extends Metodo { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | valoresAceitos: { [nomeFolEs: string]: string }; 9 | 10 | constructor(arrayValores: Array) { 11 | super(); 12 | this.arrayValores = arrayValores; 13 | this.traducao = "conic-gradient"; 14 | 15 | this.valoresAceitos = { 16 | "de": "from", 17 | } 18 | } 19 | 20 | paraTexto() { 21 | const traducaoRetorno: string = tratarValores(this.arrayValores, this.valoresAceitos); 22 | 23 | return `conic-gradient(${traducaoRetorno})`; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fontes/valores/seletor-valor-reverso.ts: -------------------------------------------------------------------------------- 1 | import { DicionarioReversoModificadores } from "../modificadores/dicionario/dicionario-reverso-modificadores"; 2 | import { DicionarioSuplementarMetodos } from "../modificadores/dicionario/dicionario-suplementar-metodos"; 3 | 4 | export class SeletorValorReverso { 5 | constructor(nomeCss: string, valores: any[], metodo?: boolean) { 6 | let modificador; 7 | 8 | if (metodo) { 9 | modificador = DicionarioSuplementarMetodos[nomeCss]; 10 | } else { 11 | modificador = DicionarioReversoModificadores[nomeCss]; 12 | } 13 | 14 | if (modificador === undefined || modificador === null) { 15 | throw new Error(`O valor \'${nomeCss}\' não foi encontrado.`); 16 | } 17 | return new modificador(...valores); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.github/workflows/principal.yml: -------------------------------------------------------------------------------- 1 | name: Commit e PR - Principal 2 | 3 | on: 4 | pull_request: 5 | branches: [ principal ] 6 | 7 | jobs: 8 | testes-unitarios: 9 | permissions: 10 | checks: write 11 | pull-requests: write 12 | contents: write 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: '20' 20 | - uses: ArtiomTr/jest-coverage-report-action@v2 21 | id: coverage 22 | with: 23 | github-token: ${{ secrets.GITHUB_TOKEN }} 24 | test-script: yarn testes-unitarios 25 | package-manager: yarn 26 | output: report-markdown 27 | - uses: marocchino/sticky-pull-request-comment@v2 28 | with: 29 | message: ${{ steps.coverage.outputs.report }} 30 | -------------------------------------------------------------------------------- /fontes/modificadores/flex-crescimento.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorNumerico } from "./validacoes/numerica"; 4 | 5 | export class FlexCrescimento extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("flex-crescimento", "flex-grow", pragmas); 12 | 13 | if (!variavel) { 14 | validarValorNumerico( 15 | "flex-crescimento", 16 | valores, 17 | null, 18 | null, 19 | null, 20 | true 21 | ); 22 | } 23 | 24 | this.valores = valores; 25 | this.variavel = variavel; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fontes/modificadores/linhas-superiores.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorNumerico } from "./validacoes/numerica"; 4 | 5 | export class LinhasSuperiores extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("linhas-superiores", "widows", pragmas); 12 | 13 | if (!variavel) { 14 | validarValorNumerico( 15 | "linhas-superiores", 16 | valores, 17 | null, 18 | null, 19 | null, 20 | true 21 | ); 22 | } 23 | 24 | this.valores = valores; 25 | this.variavel = variavel; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fontes/modificadores/visibilidade-fundo.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class VisibilidadeFundo extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | visivel: "visible", 8 | visível: "visible", 9 | escondido: "hidden", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("visibilidade-fundo", "backface-visibility", pragmas); 18 | 19 | if (!variavel) validarValores("visibilidade-fundo", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/steps.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class Steps extends MetodoCss { 5 | numero: number; 6 | salto: string; 7 | traducao: string; 8 | 9 | saltos = { 10 | "jump-start": "salto-inicial", 11 | "jump-end": "salto-final", 12 | "jump-none": "salto-nenhum", 13 | "jump-both": "salto-conjunto", 14 | start: "inicial", 15 | end: "final", 16 | }; 17 | 18 | constructor(numero: Simbolo, salto: string) { 19 | super(); 20 | this.numero = Number(numero.lexema); 21 | this.salto = this.saltos[salto["lexema"]]; 22 | this.traducao = "steps"; 23 | } 24 | 25 | paraTexto() { 26 | return `passos(${this.numero}, ${this.salto})`; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fontes/modificadores/linhas-inferiores.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValorNumerico } from "./validacoes/numerica"; 4 | 5 | export class LinhasInferiores extends Modificador { 6 | constructor( 7 | valores: Valor[], 8 | pragmas?: PragmasModificador, 9 | variavel?: boolean 10 | ) { 11 | super("linhas-inferiores", "orphans", pragmas); 12 | 13 | if (!variavel) { 14 | validarValorNumerico( 15 | "linhas-inferiores", 16 | valores, 17 | null, 18 | null, 19 | null, 20 | true 21 | ); 22 | } 23 | 24 | this.valores = valores; 25 | this.variavel = variavel; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fontes/modificadores/tamanho-caixa.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class TamanhoCaixa extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | "conteudo-caixa": "content-box", 8 | "conteúdo-caixa": "content-box", 9 | "borda-caixa": "border-box", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("tamanho-caixa", "box-sizing", pragmas); 18 | 19 | if (!variavel) validarValores("tamanho-caixa", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/modificadores/visibilidade.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class Visibilidade extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | visivel: "visible", 8 | visível: "visible", 9 | escondido: "hidden", 10 | recolher: "collapse", 11 | }; 12 | 13 | constructor( 14 | valores: Valor[], 15 | pragmas?: PragmasModificador, 16 | variavel?: boolean 17 | ) { 18 | super("visibilidade", "visibility", pragmas); 19 | 20 | if (!variavel) validarValores("visibilidade", valores, this.valoresAceitos); 21 | 22 | this.valores = valores; 23 | this.variavel = variavel; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fontes/seletores/seletor-classe.ts: -------------------------------------------------------------------------------- 1 | import { Pseudoclasse } from "../pseudoclasses/pseudoclasse"; 2 | import { PragmasSeletor } from "./pragmas-seletor"; 3 | import { Seletor } from "./seletor"; 4 | 5 | export class SeletorClasse extends Seletor { 6 | nomeClasse: string; 7 | pragmas?: PragmasSeletor; 8 | 9 | constructor( 10 | nomeClasse: string, 11 | pseudoclasse?: Pseudoclasse, 12 | pragmas?: PragmasSeletor, 13 | ) { 14 | super(pseudoclasse, pragmas); 15 | this.nomeClasse = nomeClasse; 16 | } 17 | 18 | paraTexto() { 19 | let resultado = `.${this.nomeClasse}`; 20 | if (this.pseudoclasse !== undefined && this.pseudoclasse !== null) { 21 | resultado += `:${this.pseudoclasse.pseudoclasseCss}`; 22 | } 23 | 24 | return resultado; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/retangulo.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValores } from "../comum"; 3 | import { Metodo } from "./metodo"; 4 | 5 | export class Retangulo extends Metodo { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | valoresAceitos: { [nomeFolEs: string]: string }; 9 | 10 | constructor(arrayValores: Array = []) { 11 | super(); 12 | 13 | this.arrayValores = arrayValores; 14 | this.traducao = "rect"; 15 | 16 | this.valoresAceitos = { 17 | "round": "arredondar", 18 | "auto": "auto", 19 | } 20 | } 21 | 22 | paraTexto() { 23 | const traducaoRetorno: string = tratarValores(this.arrayValores, this.valoresAceitos); 24 | 25 | return `rect(${traducaoRetorno})`; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fontes/modificadores/sombra-caixa.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { unidadesMedida } from "./atributos/quantificadores"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarMultiplosQualitativos } from "./validacoes/multiplos-qualitativos"; 5 | 6 | export class SombraCaixa extends Modificador { 7 | valoresAceitos: { [valorFoles: string]: string } = { 8 | nenhuma: "none", 9 | }; 10 | 11 | constructor( 12 | valores: Valor[], 13 | pragmas?: PragmasModificador, 14 | variavel?: boolean 15 | ) { 16 | super("sombra-caixa", "box-shadow", pragmas); 17 | 18 | if (!variavel) validarMultiplosQualitativos("sombra-caixa", valores, null, unidadesMedida); 19 | 20 | this.valores = valores; 21 | this.variavel = variavel; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fontes/modificadores/transformar-estilo.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class TransformarEstilo extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | achatar: "flat", 8 | "espaco-3d": "preserve-3d", 9 | "espaço-3d": "preserve-3d", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("transformar-estilo", "transform-style", pragmas); 18 | 19 | if (!variavel) validarValores("transformar-estilo", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/modificadores/agrupar-vazamento.ts: -------------------------------------------------------------------------------- 1 | import { validarValores } from "./validacoes/comum"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { Valor } from "../valores"; 4 | 5 | export class AgruparVazamento extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | normal: "normal", 8 | "quebrar-palavras": "break-word", 9 | "qualquer-lugar": "anywhere", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("agrupar-vazamento", "overflow-wrap", pragmas); 18 | 19 | if (!variavel) validarValores("agrupar-vazamento", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/rotacionar.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class Rotacionar extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "rotate"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | this.quantificador === "graus" 19 | ? (this.quantificador = "deg") 20 | : null; 21 | return `rotate(${this.valor}${this.quantificador})`; 22 | } 23 | 24 | return `rotate(${this.valor})`; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/modificadores/posicao.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class Posicao extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | dentro: "static", 8 | relativa: "relative", 9 | absoluta: "absolute", 10 | fixa: "fixed", 11 | colada: "sticky", 12 | }; 13 | 14 | constructor( 15 | valores: Valor[], 16 | pragmas?: PragmasModificador, 17 | variavel?: boolean 18 | ) { 19 | super(["posicao", "posição"], "position", pragmas); 20 | 21 | if (!variavel) validarValores("posição", valores, this.valoresAceitos); 22 | 23 | this.valores = valores; 24 | this.variavel = variavel; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/modificadores/flex-agrupar.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class FlexAgrupar extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | "nao-agrupar": "nowrap", 8 | "não-agrupar": "nowrap", 9 | agrupar: "wrap", 10 | "inverter-agrupamento": "wrap-reverse", 11 | }; 12 | 13 | constructor( 14 | valores: Valor[], 15 | pragmas?: PragmasModificador, 16 | variavel?: boolean 17 | ) { 18 | super("flex-agrupar", "flex-wrap", pragmas); 19 | 20 | if (!variavel) validarValores("flex-agrupar", valores, this.valoresAceitos); 21 | 22 | this.valores = valores; 23 | this.variavel = variavel; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fontes/modificadores/modo-escrita.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class ModoEscrita extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | horizontal: "horizontal-tb", 8 | "vertical-direita-esquerda": "vertical-rl", 9 | "vertical-esquerda-direita": "vertical-lr", 10 | }; 11 | 12 | constructor( 13 | valores: Valor[], 14 | pragmas?: PragmasModificador, 15 | variavel?: boolean 16 | ) { 17 | super("modo-escrita", "writing-mode", pragmas); 18 | 19 | if (!variavel) validarValores("modo-escrita", valores, this.valoresAceitos); 20 | 21 | this.valores = valores; 22 | this.variavel = variavel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/inclinar-vertical.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class InclinarVertical extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "skewY"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | this.quantificador === "graus" 19 | ? (this.quantificador = "deg") 20 | : null; 21 | return `skewY(${this.valor}${this.quantificador})`; 22 | } 23 | 24 | return `skewY(${this.valor})`; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/modificadores/quebrar-palavra.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class QuebrarPalavra extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | normal: "normal", 8 | "quebrar-tudo": "break-all", 9 | "manter-tudo": "keep-all", 10 | quebrar: "break-word", 11 | }; 12 | 13 | constructor( 14 | valores: Valor[], 15 | pragmas?: PragmasModificador, 16 | variavel?: boolean 17 | ) { 18 | super("quebrar-palavra", "word-break", pragmas); 19 | 20 | if (!variavel) validarValores("quebrar-palavra", valores, this.valoresAceitos); 21 | 22 | this.valores = valores; 23 | this.variavel = variavel; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fontes/modificadores/superclasse/seletor-reverso-modificador.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../../valores/valor"; 2 | import { DicionarioReversoModificadores } from "../dicionario/dicionario-reverso-modificadores"; 3 | import { PragmasModificador } from "./pragmas-modificador"; 4 | 5 | export class SeletorReversoModificador { 6 | constructor( 7 | nomeCss: string, 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel: boolean = false, 11 | ) { 12 | if ( 13 | DicionarioReversoModificadores[nomeCss] === undefined || 14 | DicionarioReversoModificadores[nomeCss] === null 15 | ) { 16 | throw new Error(`O seletor \'${nomeCss}\' não foi encontrado.`); 17 | } 18 | 19 | return new DicionarioReversoModificadores[nomeCss](valores, pragmas, variavel); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/conic-gradient.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { tratarValores, tratarValoresReversos } from "../comum"; 3 | import { MetodoCss } from "./metodo-css"; 4 | 5 | export class ConicGradient extends MetodoCss { 6 | arrayValores: Array = []; 7 | traducao: string; 8 | valoresAceitos: { [nomeFolEs: string]: string }; 9 | 10 | constructor(arrayValores: Array) { 11 | super(); 12 | this.arrayValores = arrayValores; 13 | this.traducao = "conic-gradient"; 14 | 15 | this.valoresAceitos = { 16 | "from": "de", 17 | } 18 | } 19 | 20 | paraTexto() { 21 | const traducaoRetorno: string = tratarValoresReversos(this.arrayValores, this.valoresAceitos); 22 | 23 | return `gradiente-cônico(${traducaoRetorno})`; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/curva-cubica.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class CurvaCubica extends Metodo { 5 | valor1: number; 6 | valor2: number; 7 | valor3: number; 8 | valor4: number; 9 | traducao: string; 10 | 11 | constructor( 12 | valor1: Simbolo, 13 | valor2: Simbolo, 14 | valor3: Simbolo, 15 | valor4: Simbolo, 16 | ) { 17 | super(); 18 | this.valor1 = Number(valor1.lexema); 19 | this.valor2 = Number(valor2.lexema); 20 | this.valor3 = Number(valor3.lexema); 21 | this.valor4 = Number(valor4.lexema); 22 | this.traducao = "cubic-bezier"; 23 | } 24 | 25 | paraTexto() { 26 | return `cubic-bezier(${this.valor1}, ${this.valor2}, ${this.valor3}, ${this.valor4})`; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/inclinar-horizontal.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class InclinarHorizontal extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "skewX"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | this.quantificador === "graus" 19 | ? (this.quantificador = "deg") 20 | : null; 21 | return `skewX(${this.valor}${this.quantificador})`; 22 | } 23 | 24 | return `skewX(${this.valor})`; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/rotacionar-eixo-z.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class RotacionarEixoZ extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "rotateZ"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | this.quantificador === "graus" 19 | ? (this.quantificador = "deg") 20 | : null; 21 | return `rotateZ(${this.valor}${this.quantificador})`; 22 | } 23 | 24 | return `rotateZ(${this.valor})`; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/modificadores/calha-barra-rolagem.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class CalhaBarraRolagem extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | estavel: "stable", 9 | estável: "stable", 10 | "ambas-bordas": "both-edges", 11 | }; 12 | 13 | constructor( 14 | valores: Valor[], 15 | pragmas?: PragmasModificador, 16 | variavel?: boolean 17 | ) { 18 | super("calha-barra-rolagem", "scrollbar-gutter", pragmas); 19 | 20 | if (!variavel) validarValores("calha-barra-rolagem", valores, this.valoresAceitos); 21 | 22 | this.valores = valores; 23 | this.variavel = variavel; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fontes/modificadores/estilo-fim-borda-em-bloco.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { estilos } from "./atributos/estilo"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class EstiloFimBordaEmBloco extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("estilo-fim-borda-em-bloco", "border-block-end-style", pragmas); 13 | 14 | if (!variavel) { 15 | validarValoresAdicionais( 16 | "estilo-fim-borda-em-bloco", 17 | valores, 18 | estilos, 19 | ); 20 | } 21 | 22 | this.valores = valores; 23 | this.variavel = variavel; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fontes/modificadores/estilo-fim-borda-em-linha.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { estilos } from "./atributos/estilo"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValoresAdicionais } from "./validacoes/condicao-extra"; 5 | 6 | export class EstiloFimBordaEmLinha extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("estilo-fim-borda-em-linha", "border-inline-end-style", pragmas); 13 | 14 | if (!variavel) { 15 | validarValoresAdicionais( 16 | "estilo-fim-borda-em-linha", 17 | valores, 18 | estilos, 19 | ); 20 | } 21 | 22 | this.valores = valores; 23 | this.variavel = variavel; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fontes/modificadores/ordem-pintura.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class OrdemPintura extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | normal: "normal", 8 | tracado: "stroke", 9 | traçado: "stroke", 10 | preencher: "fill", 11 | marcadores: "markers", 12 | }; 13 | 14 | constructor( 15 | valores: Valor[], 16 | pragmas?: PragmasModificador, 17 | variavel?: boolean 18 | ) { 19 | super("ordem-pintura", "paint-order", pragmas); 20 | 21 | if (!variavel) validarValores("ordem-pintura", valores, this.valoresAceitos); 22 | 23 | this.valores = valores; 24 | this.variavel = variavel; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/modificadores/quebrar-linha.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { Modificador, PragmasModificador } from "./superclasse"; 3 | import { validarValores } from "./validacoes/comum"; 4 | 5 | export class QuebrarLinha extends Modificador { 6 | valoresAceitos: { [valorFoles: string]: string } = { 7 | auto: "auto", 8 | solta: "loose", 9 | normal: "normal", 10 | rigorosa: "strict", 11 | "qualquer-lugar": "anywhere", 12 | }; 13 | 14 | constructor( 15 | valores: Valor[], 16 | pragmas?: PragmasModificador, 17 | variavel?: boolean 18 | ) { 19 | super("quebrar-linha", "line-break", pragmas); 20 | 21 | if (!variavel) validarValores("quebrar-linha", valores, this.valoresAceitos); 22 | 23 | this.valores = valores; 24 | this.variavel = variavel; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/modificadores/sombra-texto.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { unidadesMedida } from "./atributos/quantificadores"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValorNumerico } from "./validacoes/numerica"; 5 | 6 | export class SombraTexto extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("sombra-texto", "text-shadow", pragmas); 13 | 14 | if (!variavel) { 15 | validarValorNumerico( 16 | "sombra-texto", 17 | valores, 18 | null, 19 | null, 20 | unidadesMedida 21 | ); 22 | } 23 | 24 | this.valores = valores; 25 | this.variavel = variavel; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fontes/modificadores/tabulacao.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { comprimentos } from "./atributos/quantificadores"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValorNumerico } from "./validacoes/numerica"; 5 | 6 | export class Tabulacao extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super(["tabulacao", "tabulação"], "tab-size", pragmas); 13 | 14 | if (!variavel) { 15 | validarValorNumerico( 16 | "tabulação", 17 | valores, 18 | null, 19 | null, 20 | comprimentos 21 | ); 22 | } 23 | 24 | this.valores = valores; 25 | this.variavel = variavel; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fontes/valores/metodos/css/cubic-bezier.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { MetodoCss } from "./metodo-css"; 3 | 4 | export class CubicBezier extends MetodoCss { 5 | valor1: number; 6 | valor2: number; 7 | valor3: number; 8 | valor4: number; 9 | traducao: string; 10 | 11 | constructor( 12 | valor1: Simbolo, 13 | valor2: Simbolo, 14 | valor3: Simbolo, 15 | valor4: Simbolo, 16 | ) { 17 | super(); 18 | this.valor1 = Number(valor1.lexema); 19 | this.valor2 = Number(valor2.lexema); 20 | this.valor3 = Number(valor3.lexema); 21 | this.valor4 = Number(valor4.lexema); 22 | this.traducao = "cubic-bezier"; 23 | } 24 | 25 | paraTexto() { 26 | return `curva-cubica(${this.valor1}, ${this.valor2}, ${this.valor3}, ${this.valor4})`; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fontes/valores/metodos/foles/rotacionar-vertical.ts: -------------------------------------------------------------------------------- 1 | import { Simbolo } from "../../../lexador"; 2 | import { Metodo } from "./metodo"; 3 | 4 | export class RotacionarVertical extends Metodo { 5 | valor: number; 6 | quantificador: string; 7 | traducao: string; 8 | 9 | constructor(valor: Simbolo, quantificador: Simbolo) { 10 | super(); 11 | this.valor = Number(valor.lexema); 12 | this.quantificador = quantificador ? quantificador.lexema : null; 13 | this.traducao = "rotateY"; 14 | } 15 | 16 | paraTexto() { 17 | if (this.quantificador) { 18 | this.quantificador === "graus" 19 | ? (this.quantificador = "deg") 20 | : null; 21 | return `rotateY(${this.valor}${this.quantificador})`; 22 | } 23 | 24 | return `rotateY(${this.valor})`; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fontes/modificadores/forma-margem.ts: -------------------------------------------------------------------------------- 1 | import { Valor } from "../valores"; 2 | import { unidadesMedida } from "./atributos/quantificadores"; 3 | import { Modificador, PragmasModificador } from "./superclasse"; 4 | import { validarValorNumerico } from "./validacoes/numerica"; 5 | 6 | export class FormaMargem extends Modificador { 7 | constructor( 8 | valores: Valor[], 9 | pragmas?: PragmasModificador, 10 | variavel?: boolean 11 | ) { 12 | super("forma-margem", "shape-margin", pragmas); 13 | 14 | if (!variavel) { 15 | validarValorNumerico( 16 | "forma-margem", 17 | valores, 18 | null, 19 | null, 20 | unidadesMedida 21 | ); 22 | } 23 | 24 | this.valores = valores; 25 | this.variavel = variavel; 26 | } 27 | } 28 | --------------------------------------------------------------------------------