@jjlmoya/utils-developer 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +64 -0
- package/src/category/i18n/en.ts +34 -0
- package/src/category/i18n/es.ts +34 -0
- package/src/category/i18n/fr.ts +34 -0
- package/src/category/index.ts +31 -0
- package/src/category/seo.astro +15 -0
- package/src/components/PreviewNavSidebar.astro +116 -0
- package/src/components/PreviewToolbar.astro +143 -0
- package/src/data.ts +11 -0
- package/src/env.d.ts +5 -0
- package/src/index.ts +78 -0
- package/src/layouts/PreviewLayout.astro +117 -0
- package/src/pages/[locale]/[slug].astro +146 -0
- package/src/pages/[locale].astro +251 -0
- package/src/pages/index.astro +4 -0
- package/src/tests/css_specificity_logic.test.ts +39 -0
- package/src/tests/faq_count.test.ts +19 -0
- package/src/tests/locale_completeness.test.ts +42 -0
- package/src/tests/mocks/astro_mock.js +2 -0
- package/src/tests/no_h1_in_components.test.ts +48 -0
- package/src/tests/schemas_fulfillment.test.ts +23 -0
- package/src/tests/seo_length.test.ts +22 -0
- package/src/tests/title_quality.test.ts +55 -0
- package/src/tests/tool_validation.test.ts +17 -0
- package/src/tool/aspectRatio/bibliography.astro +14 -0
- package/src/tool/aspectRatio/component.astro +468 -0
- package/src/tool/aspectRatio/i18n/en.ts +177 -0
- package/src/tool/aspectRatio/i18n/es.ts +177 -0
- package/src/tool/aspectRatio/i18n/fr.ts +177 -0
- package/src/tool/aspectRatio/index.ts +34 -0
- package/src/tool/aspectRatio/seo.astro +14 -0
- package/src/tool/aspectRatio/ui.ts +12 -0
- package/src/tool/calculadoraTiempoDatos/bibliography.astro +14 -0
- package/src/tool/calculadoraTiempoDatos/component.astro +829 -0
- package/src/tool/calculadoraTiempoDatos/i18n/en.ts +150 -0
- package/src/tool/calculadoraTiempoDatos/i18n/es.ts +163 -0
- package/src/tool/calculadoraTiempoDatos/i18n/fr.ts +150 -0
- package/src/tool/calculadoraTiempoDatos/index.ts +33 -0
- package/src/tool/calculadoraTiempoDatos/seo.astro +14 -0
- package/src/tool/calculadoraTiempoDatos/ui.ts +24 -0
- package/src/tool/colorConverter/bibliography.astro +14 -0
- package/src/tool/colorConverter/component.astro +504 -0
- package/src/tool/colorConverter/i18n/en.ts +126 -0
- package/src/tool/colorConverter/i18n/es.ts +126 -0
- package/src/tool/colorConverter/i18n/fr.ts +126 -0
- package/src/tool/colorConverter/index.ts +33 -0
- package/src/tool/colorConverter/seo.astro +14 -0
- package/src/tool/colorConverter/ui.ts +16 -0
- package/src/tool/conversorExcelCsvHtml/bibliography.astro +14 -0
- package/src/tool/conversorExcelCsvHtml/component.astro +595 -0
- package/src/tool/conversorExcelCsvHtml/i18n/en.ts +129 -0
- package/src/tool/conversorExcelCsvHtml/i18n/es.ts +129 -0
- package/src/tool/conversorExcelCsvHtml/i18n/fr.ts +129 -0
- package/src/tool/conversorExcelCsvHtml/index.ts +33 -0
- package/src/tool/conversorExcelCsvHtml/seo.astro +14 -0
- package/src/tool/conversorExcelCsvHtml/ui.ts +14 -0
- package/src/tool/cronGenerator/bibliography.astro +14 -0
- package/src/tool/cronGenerator/component.astro +667 -0
- package/src/tool/cronGenerator/i18n/en.ts +191 -0
- package/src/tool/cronGenerator/i18n/es.ts +191 -0
- package/src/tool/cronGenerator/i18n/fr.ts +191 -0
- package/src/tool/cronGenerator/index.ts +34 -0
- package/src/tool/cronGenerator/seo.astro +14 -0
- package/src/tool/cronGenerator/ui.ts +45 -0
- package/src/tool/cssSpecificityCalculator/bibliography.astro +14 -0
- package/src/tool/cssSpecificityCalculator/component.astro +292 -0
- package/src/tool/cssSpecificityCalculator/i18n/en.ts +168 -0
- package/src/tool/cssSpecificityCalculator/i18n/es.ts +168 -0
- package/src/tool/cssSpecificityCalculator/i18n/fr.ts +168 -0
- package/src/tool/cssSpecificityCalculator/index.ts +34 -0
- package/src/tool/cssSpecificityCalculator/logic.ts +100 -0
- package/src/tool/cssSpecificityCalculator/seo.astro +14 -0
- package/src/tool/cssSpecificityCalculator/ui-controller.ts +57 -0
- package/src/tool/cssSpecificityCalculator/ui.ts +11 -0
- package/src/tool/cssToInlineConverter/bibliography.astro +14 -0
- package/src/tool/cssToInlineConverter/component.astro +308 -0
- package/src/tool/cssToInlineConverter/i18n/en.ts +160 -0
- package/src/tool/cssToInlineConverter/i18n/es.ts +160 -0
- package/src/tool/cssToInlineConverter/i18n/fr.ts +160 -0
- package/src/tool/cssToInlineConverter/index.ts +34 -0
- package/src/tool/cssToInlineConverter/seo.astro +14 -0
- package/src/tool/cssToInlineConverter/ui.ts +12 -0
- package/src/tool/duplicateCssRemover/bibliography.astro +14 -0
- package/src/tool/duplicateCssRemover/component.astro +353 -0
- package/src/tool/duplicateCssRemover/i18n/en.ts +167 -0
- package/src/tool/duplicateCssRemover/i18n/es.ts +167 -0
- package/src/tool/duplicateCssRemover/i18n/fr.ts +167 -0
- package/src/tool/duplicateCssRemover/index.ts +34 -0
- package/src/tool/duplicateCssRemover/seo.astro +14 -0
- package/src/tool/duplicateCssRemover/ui.ts +12 -0
- package/src/tool/generadorSecurityTxt/bibliography.astro +14 -0
- package/src/tool/generadorSecurityTxt/component.astro +473 -0
- package/src/tool/generadorSecurityTxt/i18n/en.ts +173 -0
- package/src/tool/generadorSecurityTxt/i18n/es.ts +173 -0
- package/src/tool/generadorSecurityTxt/i18n/fr.ts +173 -0
- package/src/tool/generadorSecurityTxt/index.ts +33 -0
- package/src/tool/generadorSecurityTxt/seo.astro +14 -0
- package/src/tool/generadorSecurityTxt/ui.ts +27 -0
- package/src/tool/hashGenerator/bibliography.astro +14 -0
- package/src/tool/hashGenerator/component.astro +367 -0
- package/src/tool/hashGenerator/i18n/en.ts +118 -0
- package/src/tool/hashGenerator/i18n/es.ts +118 -0
- package/src/tool/hashGenerator/i18n/fr.ts +118 -0
- package/src/tool/hashGenerator/index.ts +33 -0
- package/src/tool/hashGenerator/md5.ts +138 -0
- package/src/tool/hashGenerator/seo.astro +14 -0
- package/src/tool/hashGenerator/ui.ts +11 -0
- package/src/tool/inspectorCertificadosSsl/bibliography.astro +14 -0
- package/src/tool/inspectorCertificadosSsl/component.astro +580 -0
- package/src/tool/inspectorCertificadosSsl/i18n/en.ts +214 -0
- package/src/tool/inspectorCertificadosSsl/i18n/es.ts +214 -0
- package/src/tool/inspectorCertificadosSsl/i18n/fr.ts +214 -0
- package/src/tool/inspectorCertificadosSsl/index.ts +33 -0
- package/src/tool/inspectorCertificadosSsl/seo.astro +14 -0
- package/src/tool/inspectorCertificadosSsl/ui.ts +29 -0
- package/src/tool/jsonFormatter/bibliography.astro +14 -0
- package/src/tool/jsonFormatter/component.astro +590 -0
- package/src/tool/jsonFormatter/i18n/en.ts +156 -0
- package/src/tool/jsonFormatter/i18n/es.ts +156 -0
- package/src/tool/jsonFormatter/i18n/fr.ts +156 -0
- package/src/tool/jsonFormatter/index.ts +34 -0
- package/src/tool/jsonFormatter/seo.astro +14 -0
- package/src/tool/jsonFormatter/ui.ts +15 -0
- package/src/tool/keycode/bibliography.astro +14 -0
- package/src/tool/keycode/component.astro +540 -0
- package/src/tool/keycode/i18n/en.ts +160 -0
- package/src/tool/keycode/i18n/es.ts +160 -0
- package/src/tool/keycode/i18n/fr.ts +160 -0
- package/src/tool/keycode/index.ts +34 -0
- package/src/tool/keycode/seo.astro +14 -0
- package/src/tool/keycode/ui.ts +10 -0
- package/src/tool/llmCostCalculator/bibliography.astro +14 -0
- package/src/tool/llmCostCalculator/component.astro +488 -0
- package/src/tool/llmCostCalculator/data.ts +99 -0
- package/src/tool/llmCostCalculator/i18n/en.ts +165 -0
- package/src/tool/llmCostCalculator/i18n/es.ts +165 -0
- package/src/tool/llmCostCalculator/i18n/fr.ts +165 -0
- package/src/tool/llmCostCalculator/index.ts +34 -0
- package/src/tool/llmCostCalculator/seo.astro +14 -0
- package/src/tool/llmCostCalculator/ui.ts +11 -0
- package/src/tool/mobileMockupGenerator/app.ts +614 -0
- package/src/tool/mobileMockupGenerator/bibliography.astro +14 -0
- package/src/tool/mobileMockupGenerator/component.astro +1044 -0
- package/src/tool/mobileMockupGenerator/constants.ts +48 -0
- package/src/tool/mobileMockupGenerator/i18n/en.ts +121 -0
- package/src/tool/mobileMockupGenerator/i18n/es.ts +121 -0
- package/src/tool/mobileMockupGenerator/i18n/fr.ts +121 -0
- package/src/tool/mobileMockupGenerator/index.ts +33 -0
- package/src/tool/mobileMockupGenerator/rendering.ts +189 -0
- package/src/tool/mobileMockupGenerator/seo.astro +14 -0
- package/src/tool/mobileMockupGenerator/store.ts +145 -0
- package/src/tool/mobileMockupGenerator/types.ts +41 -0
- package/src/tool/mobileMockupGenerator/ui.ts +48 -0
- package/src/tool/musicalTypography/bibliography.astro +14 -0
- package/src/tool/musicalTypography/component.astro +480 -0
- package/src/tool/musicalTypography/i18n/en.ts +179 -0
- package/src/tool/musicalTypography/i18n/es.ts +179 -0
- package/src/tool/musicalTypography/i18n/fr.ts +179 -0
- package/src/tool/musicalTypography/index.ts +33 -0
- package/src/tool/musicalTypography/seo.astro +14 -0
- package/src/tool/musicalTypography/ui.ts +25 -0
- package/src/tool/placeholderGenerator/bibliography.astro +14 -0
- package/src/tool/placeholderGenerator/component.astro +499 -0
- package/src/tool/placeholderGenerator/i18n/en.ts +176 -0
- package/src/tool/placeholderGenerator/i18n/es.ts +176 -0
- package/src/tool/placeholderGenerator/i18n/fr.ts +176 -0
- package/src/tool/placeholderGenerator/index.ts +34 -0
- package/src/tool/placeholderGenerator/seo.astro +14 -0
- package/src/tool/placeholderGenerator/ui.ts +14 -0
- package/src/tool/promptLibrary/bibliography.astro +14 -0
- package/src/tool/promptLibrary/component.astro +1131 -0
- package/src/tool/promptLibrary/controller.ts +49 -0
- package/src/tool/promptLibrary/i18n/en.ts +131 -0
- package/src/tool/promptLibrary/i18n/es.ts +131 -0
- package/src/tool/promptLibrary/i18n/fr.ts +126 -0
- package/src/tool/promptLibrary/index.ts +33 -0
- package/src/tool/promptLibrary/seo.astro +14 -0
- package/src/tool/promptLibrary/ui.ts +29 -0
- package/src/tool/readabilityCalculator/bibliography.astro +14 -0
- package/src/tool/readabilityCalculator/component.astro +534 -0
- package/src/tool/readabilityCalculator/i18n/en.ts +133 -0
- package/src/tool/readabilityCalculator/i18n/es.ts +133 -0
- package/src/tool/readabilityCalculator/i18n/fr.ts +133 -0
- package/src/tool/readabilityCalculator/index.ts +33 -0
- package/src/tool/readabilityCalculator/seo.astro +14 -0
- package/src/tool/readabilityCalculator/ui.ts +27 -0
- package/src/tool/svgSanitizer/bibliography.astro +14 -0
- package/src/tool/svgSanitizer/component.astro +554 -0
- package/src/tool/svgSanitizer/i18n/en.ts +125 -0
- package/src/tool/svgSanitizer/i18n/es.ts +125 -0
- package/src/tool/svgSanitizer/i18n/fr.ts +125 -0
- package/src/tool/svgSanitizer/index.ts +33 -0
- package/src/tool/svgSanitizer/seo.astro +14 -0
- package/src/tool/svgSanitizer/ui.ts +18 -0
- package/src/tool/svgToCss/bibliography.astro +14 -0
- package/src/tool/svgToCss/component.astro +381 -0
- package/src/tool/svgToCss/i18n/en.ts +174 -0
- package/src/tool/svgToCss/i18n/es.ts +174 -0
- package/src/tool/svgToCss/i18n/fr.ts +174 -0
- package/src/tool/svgToCss/index.ts +34 -0
- package/src/tool/svgToCss/seo.astro +14 -0
- package/src/tool/svgToCss/ui.ts +13 -0
- package/src/tool/urlCleaner/bibliography.astro +14 -0
- package/src/tool/urlCleaner/component.astro +458 -0
- package/src/tool/urlCleaner/i18n/en.ts +116 -0
- package/src/tool/urlCleaner/i18n/es.ts +116 -0
- package/src/tool/urlCleaner/i18n/fr.ts +116 -0
- package/src/tool/urlCleaner/index.ts +33 -0
- package/src/tool/urlCleaner/seo.astro +14 -0
- package/src/tool/urlCleaner/ui.ts +12 -0
- package/src/tool/urlEncoderDecoder/bibliography.astro +14 -0
- package/src/tool/urlEncoderDecoder/component.astro +291 -0
- package/src/tool/urlEncoderDecoder/i18n/en.ts +162 -0
- package/src/tool/urlEncoderDecoder/i18n/es.ts +162 -0
- package/src/tool/urlEncoderDecoder/i18n/fr.ts +162 -0
- package/src/tool/urlEncoderDecoder/index.ts +34 -0
- package/src/tool/urlEncoderDecoder/seo.astro +14 -0
- package/src/tool/urlEncoderDecoder/ui.ts +11 -0
- package/src/tool/utmGenerator/bibliography.astro +14 -0
- package/src/tool/utmGenerator/component.astro +270 -0
- package/src/tool/utmGenerator/i18n/en.ts +117 -0
- package/src/tool/utmGenerator/i18n/es.ts +117 -0
- package/src/tool/utmGenerator/i18n/fr.ts +117 -0
- package/src/tool/utmGenerator/index.ts +33 -0
- package/src/tool/utmGenerator/seo.astro +14 -0
- package/src/tool/utmGenerator/ui.ts +13 -0
- package/src/tools.ts +27 -0
- package/src/types.ts +72 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
import type { SvgSanitizerUI } from '../ui';
|
|
4
|
+
|
|
5
|
+
const slug = 'saneador-svg';
|
|
6
|
+
const title = 'Saneador de SVG Online';
|
|
7
|
+
const description = 'Optimiza y limpia SVGs exportados desde Figma, Adobe Illustrator o Inkscape. Elimina metadatos, atributos innecesarios y grupos vac\u00edos para obtener un SVG listo para producci\u00f3n.';
|
|
8
|
+
|
|
9
|
+
const faqData = [
|
|
10
|
+
{
|
|
11
|
+
question: '\u00bfPuedo pegar el HTML completo de una p\u00e1gina con SVG embebido?',
|
|
12
|
+
answer: 'S\u00ed. El saneador detecta el elemento SVG dentro del HTML y extrae solo ese bloque para procesarlo. Tambi\u00e9n funciona si pegas directamente el fragmento SVG.',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
question: '\u00bfSe puede usar con SVGs de Illustrator?',
|
|
16
|
+
answer: 'S\u00ed. Illustrator exporta SVGs con declaraciones XML, metadatos y namespaces propios que el saneador elimina. El resultado es un SVG compatible con todos los navegadores modernos.',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
question: '\u00bfQu\u00e9 diferencia hay entre limpiar y minificar?',
|
|
20
|
+
answer: 'Limpiar elimina atributos y etiquetas innecesarios pero mantiene el formato con indentaci\u00f3n para que puedas leer y editar el c\u00f3digo. Minificar adem\u00e1s colapsa todo en una sola l\u00ednea para reducir el peso al m\u00e1ximo.',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
question: '\u00bfAl eliminar IDs puede romperse el SVG?',
|
|
24
|
+
answer: 'Solo si alg\u00fan elemento del SVG referencia otro por ID, por ejemplo a trav\u00e9s de fill="url(#gradient)". En ese caso desactiva la opci\u00f3n Eliminar IDs. Por defecto est\u00e1 desactivada precisamente para evitar este problema.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
question: '\u00bfMi c\u00f3digo SVG se env\u00eda a alg\u00fan servidor?',
|
|
28
|
+
answer: 'No. Todo el proceso ocurre en tu navegador usando las APIs nativas DOMParser y XMLSerializer. El c\u00f3digo nunca abandona tu dispositivo.',
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const howToData = [
|
|
33
|
+
{ name: 'Pegar el SVG', text: 'Pega el c\u00f3digo SVG exportado desde Figma, Illustrator o Inkscape en el \u00e1rea de texto.' },
|
|
34
|
+
{ name: 'Configurar opciones', text: 'Activa o desactiva las opciones: eliminar IDs, quitar width/height y minificar seg\u00fan tus necesidades.' },
|
|
35
|
+
{ name: 'Limpiar', text: 'Haz clic en Limpiar SVG para procesar el c\u00f3digo y obtener el resultado optimizado.' },
|
|
36
|
+
{ name: 'Copiar o descargar', text: 'Usa los botones Copiar o Descargar para obtener el SVG limpio listo para producci\u00f3n.' },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const faqSchema: WithContext<FAQPage> = {
|
|
40
|
+
'@context': 'https://schema.org',
|
|
41
|
+
'@type': 'FAQPage',
|
|
42
|
+
mainEntity: faqData.map((item) => ({
|
|
43
|
+
'@type': 'Question',
|
|
44
|
+
name: item.question,
|
|
45
|
+
acceptedAnswer: { '@type': 'Answer', text: item.answer },
|
|
46
|
+
})),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const howToSchema: WithContext<HowToThing> = {
|
|
50
|
+
'@context': 'https://schema.org',
|
|
51
|
+
'@type': 'HowTo',
|
|
52
|
+
name: title,
|
|
53
|
+
description,
|
|
54
|
+
step: howToData.map((s, i) => ({ '@type': 'HowToStep', position: i + 1, name: s.name, text: s.text })),
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
58
|
+
'@context': 'https://schema.org',
|
|
59
|
+
'@type': 'SoftwareApplication',
|
|
60
|
+
name: title,
|
|
61
|
+
description,
|
|
62
|
+
applicationCategory: 'UtilityApplication',
|
|
63
|
+
operatingSystem: 'All',
|
|
64
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
65
|
+
inLanguage: 'es',
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const ui: SvgSanitizerUI = {
|
|
69
|
+
labelInput: 'Pega tu SVG sucio aqu\u00ed',
|
|
70
|
+
labelOutput: 'SVG limpio',
|
|
71
|
+
optRemoveIds: 'Eliminar IDs',
|
|
72
|
+
optRemoveWH: 'Quitar width/height',
|
|
73
|
+
optMinify: 'Minificar',
|
|
74
|
+
btnSanitize: 'Limpiar SVG',
|
|
75
|
+
btnCopy: 'Copiar',
|
|
76
|
+
btnCopied: 'Copiado',
|
|
77
|
+
btnDownload: 'Descargar',
|
|
78
|
+
statOriginal: 'Original',
|
|
79
|
+
statCleaned: 'Limpio',
|
|
80
|
+
statReduction: 'Reducci\u00f3n',
|
|
81
|
+
statElems: 'Elem. eliminados',
|
|
82
|
+
statAttrs: 'Attrs. eliminados',
|
|
83
|
+
errorPaste: 'Pega un SVG antes de limpiar.',
|
|
84
|
+
errorProcess: 'Error al procesar el SVG.',
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const content: ToolLocaleContent<SvgSanitizerUI> = {
|
|
88
|
+
slug,
|
|
89
|
+
title,
|
|
90
|
+
description,
|
|
91
|
+
ui,
|
|
92
|
+
faqTitle: 'Preguntas Frecuentes',
|
|
93
|
+
faq: faqData,
|
|
94
|
+
bibliographyTitle: 'Referencias',
|
|
95
|
+
bibliography: [
|
|
96
|
+
{ name: 'SVG Specification - W3C', url: 'https://www.w3.org/TR/SVG2/' },
|
|
97
|
+
{ name: 'Figma SVG Export - Documentaci\u00f3n oficial', url: 'https://help.figma.com/hc/en-us/articles/360040028114-Export-from-Figma' },
|
|
98
|
+
{ name: 'SVGO - SVG Optimizer (referencia open source)', url: 'https://github.com/svg/svgo' },
|
|
99
|
+
],
|
|
100
|
+
howTo: howToData,
|
|
101
|
+
schemas: [faqSchema, howToSchema, appSchema],
|
|
102
|
+
seo: [
|
|
103
|
+
{ type: 'title', text: 'Saneador de SVG: Limpia el C\u00f3digo de Figma e Illustrator', level: 2 },
|
|
104
|
+
{
|
|
105
|
+
type: 'paragraph',
|
|
106
|
+
html: 'Pega cualquier SVG exportado desde <strong>Figma</strong>, Adobe Illustrator o el inspector del navegador y obt\u00e9n un archivo vectorial limpio, optimizado y listo para producci\u00f3n.',
|
|
107
|
+
},
|
|
108
|
+
{ type: 'title', text: '\u00bfPor qu\u00e9 los SVG exportados son tan sucios?', level: 3 },
|
|
109
|
+
{
|
|
110
|
+
type: 'paragraph',
|
|
111
|
+
html: 'Cuando exportas un SVG desde Figma, recibes un archivo cargado de atributos que solo tienen sentido dentro de la aplicaci\u00f3n: <code>data-name</code>, <code>xml:space</code>, referencias a capas internas y metadatos de dise\u00f1o. El resultado es un SVG que puede pesar un 40\u201370% m\u00e1s de lo necesario.',
|
|
112
|
+
},
|
|
113
|
+
{ type: 'title', text: 'Qu\u00e9 elimina el Saneador', level: 3 },
|
|
114
|
+
{
|
|
115
|
+
type: 'list',
|
|
116
|
+
items: [
|
|
117
|
+
'<strong>Metadatos de editor:</strong> etiquetas <code>metadata</code>, <code>title</code> y <code>desc</code> que Figma e Illustrator a\u00f1aden autom\u00e1ticamente.',
|
|
118
|
+
'<strong>Namespaces de Inkscape:</strong> todos los elementos con prefijo <code>inkscape:</code> y <code>sodipodi:</code>.',
|
|
119
|
+
'<strong>Atributos innecesarios:</strong> <code>xml:space</code>, <code>version</code>, <code>xmlns:*</code> superfluos y atributos <code>data-*</code> de Figma.',
|
|
120
|
+
'<strong>Grupos vac\u00edos:</strong> elementos <code><g></code> sin contenido que los editores dejan como artefactos de capas eliminadas.',
|
|
121
|
+
'<strong>Declaraciones XML:</strong> la declaraci\u00f3n <code><?xml version="1.0"?></code> y el DOCTYPE innecesarios al embeber SVG en HTML.',
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
import type { SvgSanitizerUI } from '../ui';
|
|
4
|
+
|
|
5
|
+
const slug = 'nettoyeur-svg';
|
|
6
|
+
const title = 'Nettoyeur SVG en Ligne';
|
|
7
|
+
const description = 'Optimisez et nettoyez les SVG export\u00e9s depuis Figma, Adobe Illustrator ou Inkscape. Supprimez les m\u00e9tadonn\u00e9es, attributs inutiles et groupes vides pour obtenir un SVG pr\u00eat pour la production.';
|
|
8
|
+
|
|
9
|
+
const faqData = [
|
|
10
|
+
{
|
|
11
|
+
question: 'Puis-je coller le HTML complet d\'une page avec SVG int\u00e9gr\u00e9?',
|
|
12
|
+
answer: 'Oui. Le nettoyeur d\u00e9tecte l\'\u00e9l\u00e9ment SVG dans le HTML et extrait uniquement ce bloc pour le traiter. Cela fonctionne aussi si vous collez directement le fragment SVG.',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
question: 'Est-ce utilisable avec des SVG d\'Illustrator?',
|
|
16
|
+
answer: 'Oui. Illustrator exporte des SVG avec des d\u00e9clarations XML, des m\u00e9tadonn\u00e9es et des espaces de noms propri\u00e9taires que le nettoyeur supprime. Le r\u00e9sultat est un SVG compatible avec tous les navigateurs modernes.',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
question: 'Quelle est la diff\u00e9rence entre nettoyer et minifier?',
|
|
20
|
+
answer: 'Nettoyer supprime les attributs et balises inutiles mais conserve le format indent\u00e9 pour que vous puissiez lire et \u00e9diter le code. Minifier r\u00e9duit \u00e9galement tout en une seule ligne pour r\u00e9duire le poids au maximum.',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
question: 'Supprimer les IDs peut-il casser le SVG?',
|
|
24
|
+
answer: 'Seulement si un \u00e9l\u00e9ment du SVG r\u00e9f\u00e9rence un autre par ID, par exemple via fill="url(#gradient)". Dans ce cas, d\u00e9sactivez l\'option Supprimer les IDs. Elle est d\u00e9sactiv\u00e9e par d\u00e9faut pr\u00e9cis\u00e9ment pour \u00e9viter ce probl\u00e8me.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
question: 'Mon code SVG est-il envoy\u00e9 \u00e0 un serveur?',
|
|
28
|
+
answer: 'Non. Tout le traitement se d\u00e9roule dans votre navigateur en utilisant les API natives DOMParser et XMLSerializer. Le code ne quitte jamais votre appareil.',
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const howToData = [
|
|
33
|
+
{ name: 'Coller le SVG', text: 'Collez le code SVG export\u00e9 depuis Figma, Illustrator ou Inkscape dans la zone de texte.' },
|
|
34
|
+
{ name: 'Configurer les options', text: 'Activez ou d\u00e9sactivez les options\u00a0: supprimer les IDs, retirer width/height et minifier selon vos besoins.' },
|
|
35
|
+
{ name: 'Nettoyer', text: 'Cliquez sur Nettoyer SVG pour traiter le code et obtenir le r\u00e9sultat optimis\u00e9.' },
|
|
36
|
+
{ name: 'Copier ou t\u00e9l\u00e9charger', text: 'Utilisez les boutons Copier ou T\u00e9l\u00e9charger pour obtenir le SVG propre pr\u00eat pour la production.' },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const faqSchema: WithContext<FAQPage> = {
|
|
40
|
+
'@context': 'https://schema.org',
|
|
41
|
+
'@type': 'FAQPage',
|
|
42
|
+
mainEntity: faqData.map((item) => ({
|
|
43
|
+
'@type': 'Question',
|
|
44
|
+
name: item.question,
|
|
45
|
+
acceptedAnswer: { '@type': 'Answer', text: item.answer },
|
|
46
|
+
})),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const howToSchema: WithContext<HowToThing> = {
|
|
50
|
+
'@context': 'https://schema.org',
|
|
51
|
+
'@type': 'HowTo',
|
|
52
|
+
name: title,
|
|
53
|
+
description,
|
|
54
|
+
step: howToData.map((s, i) => ({ '@type': 'HowToStep', position: i + 1, name: s.name, text: s.text })),
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
58
|
+
'@context': 'https://schema.org',
|
|
59
|
+
'@type': 'SoftwareApplication',
|
|
60
|
+
name: title,
|
|
61
|
+
description,
|
|
62
|
+
applicationCategory: 'UtilityApplication',
|
|
63
|
+
operatingSystem: 'All',
|
|
64
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
65
|
+
inLanguage: 'fr',
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const ui: SvgSanitizerUI = {
|
|
69
|
+
labelInput: 'Collez votre SVG brut ici',
|
|
70
|
+
labelOutput: 'SVG propre',
|
|
71
|
+
optRemoveIds: 'Supprimer les IDs',
|
|
72
|
+
optRemoveWH: 'Retirer width/height',
|
|
73
|
+
optMinify: 'Minifier',
|
|
74
|
+
btnSanitize: 'Nettoyer SVG',
|
|
75
|
+
btnCopy: 'Copier',
|
|
76
|
+
btnCopied: 'Copi\u00e9',
|
|
77
|
+
btnDownload: 'T\u00e9l\u00e9charger',
|
|
78
|
+
statOriginal: 'Original',
|
|
79
|
+
statCleaned: 'Propre',
|
|
80
|
+
statReduction: 'R\u00e9duction',
|
|
81
|
+
statElems: '\u00c9l\u00e9m. supprim\u00e9s',
|
|
82
|
+
statAttrs: 'Attrs. supprim\u00e9s',
|
|
83
|
+
errorPaste: 'Collez un SVG avant de nettoyer.',
|
|
84
|
+
errorProcess: 'Erreur lors du traitement du SVG.',
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const content: ToolLocaleContent<SvgSanitizerUI> = {
|
|
88
|
+
slug,
|
|
89
|
+
title,
|
|
90
|
+
description,
|
|
91
|
+
ui,
|
|
92
|
+
faqTitle: 'Questions Fr\u00e9quentes',
|
|
93
|
+
faq: faqData,
|
|
94
|
+
bibliographyTitle: 'R\u00e9f\u00e9rences',
|
|
95
|
+
bibliography: [
|
|
96
|
+
{ name: 'SVG Specification - W3C', url: 'https://www.w3.org/TR/SVG2/' },
|
|
97
|
+
{ name: 'Figma SVG Export - Documentation officielle', url: 'https://help.figma.com/hc/en-us/articles/360040028114-Export-from-Figma' },
|
|
98
|
+
{ name: 'SVGO - SVG Optimizer (r\u00e9f\u00e9rence open source)', url: 'https://github.com/svg/svgo' },
|
|
99
|
+
],
|
|
100
|
+
howTo: howToData,
|
|
101
|
+
schemas: [faqSchema, howToSchema, appSchema],
|
|
102
|
+
seo: [
|
|
103
|
+
{ type: 'title', text: 'Nettoyeur SVG\u00a0: Nettoyez le Code de Figma et Illustrator', level: 2 },
|
|
104
|
+
{
|
|
105
|
+
type: 'paragraph',
|
|
106
|
+
html: 'Collez n\'importe quel SVG export\u00e9 depuis <strong>Figma</strong>, Adobe Illustrator ou l\'inspecteur du navigateur et obtenez un fichier vectoriel propre, optimis\u00e9 et pr\u00eat pour la production.',
|
|
107
|
+
},
|
|
108
|
+
{ type: 'title', text: 'Pourquoi les SVG export\u00e9s sont-ils si sales\u00a0?', level: 3 },
|
|
109
|
+
{
|
|
110
|
+
type: 'paragraph',
|
|
111
|
+
html: 'Lorsque vous exportez un SVG depuis Figma, vous obtenez un fichier charg\u00e9 d\'attributs qui n\'ont de sens qu\'au sein de l\'application\u00a0: <code>data-name</code>, <code>xml:space</code>, r\u00e9f\u00e9rences aux calques internes et m\u00e9tadonn\u00e9es de design. Le r\u00e9sultat est un SVG qui peut peser 40 \u00e0 70\u00a0% de plus que n\u00e9cessaire.',
|
|
112
|
+
},
|
|
113
|
+
{ type: 'title', text: 'Ce que le Nettoyeur supprime', level: 3 },
|
|
114
|
+
{
|
|
115
|
+
type: 'list',
|
|
116
|
+
items: [
|
|
117
|
+
'<strong>M\u00e9tadonn\u00e9es d\'\u00e9diteur\u00a0:</strong> balises <code>metadata</code>, <code>title</code> et <code>desc</code> ajout\u00e9es automatiquement par Figma et Illustrator.',
|
|
118
|
+
'<strong>Espaces de noms Inkscape\u00a0:</strong> tous les \u00e9l\u00e9ments avec pr\u00e9fixe <code>inkscape:</code> et <code>sodipodi:</code>.',
|
|
119
|
+
'<strong>Attributs inutiles\u00a0:</strong> <code>xml:space</code>, <code>version</code>, <code>xmlns:*</code> superflus et attributs <code>data-*</code> de Figma.',
|
|
120
|
+
'<strong>Groupes vides\u00a0:</strong> \u00e9l\u00e9ments <code><g></code> sans contenu laiss\u00e9s comme artefacts de calques supprim\u00e9s.',
|
|
121
|
+
'<strong>D\u00e9clarations XML\u00a0:</strong> la d\u00e9claration <code><?xml version="1.0"?></code> et le DOCTYPE inutiles lors de l\'int\u00e9gration du SVG dans le HTML.',
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DeveloperToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
|
|
2
|
+
import SvgSanitizerComponent from './component.astro';
|
|
3
|
+
import SvgSanitizerSEO from './seo.astro';
|
|
4
|
+
import SvgSanitizerBibliography from './bibliography.astro';
|
|
5
|
+
import type { SvgSanitizerUI } from './ui';
|
|
6
|
+
|
|
7
|
+
export type SvgSanitizerLocaleContent = ToolLocaleContent<SvgSanitizerUI>;
|
|
8
|
+
|
|
9
|
+
import { content as es } from './i18n/es';
|
|
10
|
+
import { content as en } from './i18n/en';
|
|
11
|
+
import { content as fr } from './i18n/fr';
|
|
12
|
+
|
|
13
|
+
export const svgSanitizer: DeveloperToolEntry<SvgSanitizerUI> = {
|
|
14
|
+
id: 'svg-sanitizer',
|
|
15
|
+
icons: {
|
|
16
|
+
bg: 'mdi:xml',
|
|
17
|
+
fg: 'mdi:broom',
|
|
18
|
+
},
|
|
19
|
+
i18n: {
|
|
20
|
+
es: async () => es,
|
|
21
|
+
en: async () => en,
|
|
22
|
+
fr: async () => fr,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { SvgSanitizerComponent, SvgSanitizerSEO, SvgSanitizerBibliography };
|
|
27
|
+
|
|
28
|
+
export const SVG_SANITIZER_TOOL: ToolDefinition = {
|
|
29
|
+
entry: svgSanitizer,
|
|
30
|
+
Component: SvgSanitizerComponent,
|
|
31
|
+
SEOComponent: SvgSanitizerSEO,
|
|
32
|
+
BibliographyComponent: SvgSanitizerBibliography,
|
|
33
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { SEORenderer } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { svgSanitizer } from './index';
|
|
4
|
+
import type { KnownLocale } from '../../types';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
locale?: KnownLocale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { locale = 'es' } = Astro.props;
|
|
11
|
+
const content = await svgSanitizer.i18n[locale]?.();
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{content && <SEORenderer content={{ locale, sections: content.seo }} />}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface SvgSanitizerUI extends Record<string, string> {
|
|
2
|
+
labelInput: string;
|
|
3
|
+
labelOutput: string;
|
|
4
|
+
optRemoveIds: string;
|
|
5
|
+
optRemoveWH: string;
|
|
6
|
+
optMinify: string;
|
|
7
|
+
btnSanitize: string;
|
|
8
|
+
btnCopy: string;
|
|
9
|
+
btnCopied: string;
|
|
10
|
+
btnDownload: string;
|
|
11
|
+
statOriginal: string;
|
|
12
|
+
statCleaned: string;
|
|
13
|
+
statReduction: string;
|
|
14
|
+
statElems: string;
|
|
15
|
+
statAttrs: string;
|
|
16
|
+
errorPaste: string;
|
|
17
|
+
errorProcess: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { svgToCss } from './index';
|
|
4
|
+
import type { KnownLocale } from '../../types';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
locale?: KnownLocale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { locale = 'es' } = Astro.props;
|
|
11
|
+
const content = await svgToCss.i18n[locale]?.();
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{content && <SharedBibliography links={content.bibliography} />}
|