@jjlmoya/utils-pets 1.11.0 → 1.13.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 +1 -1
- package/src/pages/[locale]/[slug].astro +29 -13
- package/src/tests/locale_completeness.test.ts +4 -14
- package/src/tests/shared-test-helpers.ts +56 -0
- package/src/tests/tool_exports.test.ts +34 -0
- package/src/tests/tool_validation.test.ts +2 -2
- package/src/tool/petAge/bibliography.astro +2 -10
- package/src/tool/petAge/bibliography.ts +6 -0
- package/src/tool/petAge/entry.ts +2 -0
- package/src/tool/petAge/i18n/de.ts +2 -7
- package/src/tool/petAge/i18n/en.ts +2 -7
- package/src/tool/petAge/i18n/es.ts +2 -7
- package/src/tool/petAge/i18n/fr.ts +2 -7
- package/src/tool/petAge/i18n/id.ts +2 -7
- package/src/tool/petAge/i18n/it.ts +2 -7
- package/src/tool/petAge/i18n/ja.ts +2 -7
- package/src/tool/petAge/i18n/ko.ts +2 -7
- package/src/tool/petAge/i18n/nl.ts +2 -7
- package/src/tool/petAge/i18n/pl.ts +2 -7
- package/src/tool/petAge/i18n/pt.ts +2 -7
- package/src/tool/petAge/i18n/ru.ts +2 -7
- package/src/tool/petAge/i18n/sv.ts +2 -7
- package/src/tool/petAge/i18n/tr.ts +2 -7
- package/src/tool/petAge/i18n/zh.ts +2 -7
- package/src/tool/petAge/pet-age-calculator.css +15 -15
- package/src/tool/petAge/seo.astro +2 -48
- package/src/tool/petRation/bibliography.astro +2 -10
- package/src/tool/petRation/bibliography.ts +6 -0
- package/src/tool/petRation/entry.ts +2 -0
- package/src/tool/petRation/i18n/de.ts +2 -7
- package/src/tool/petRation/i18n/en.ts +2 -7
- package/src/tool/petRation/i18n/es.ts +2 -7
- package/src/tool/petRation/i18n/fr.ts +2 -7
- package/src/tool/petRation/i18n/id.ts +2 -7
- package/src/tool/petRation/i18n/it.ts +2 -7
- package/src/tool/petRation/i18n/ja.ts +2 -7
- package/src/tool/petRation/i18n/ko.ts +2 -7
- package/src/tool/petRation/i18n/nl.ts +2 -7
- package/src/tool/petRation/i18n/pl.ts +2 -7
- package/src/tool/petRation/i18n/pt.ts +2 -7
- package/src/tool/petRation/i18n/ru.ts +2 -7
- package/src/tool/petRation/i18n/sv.ts +2 -7
- package/src/tool/petRation/i18n/tr.ts +2 -7
- package/src/tool/petRation/i18n/zh.ts +2 -7
- package/src/tool/petRation/pet-daily-ration-calculator.css +16 -16
- package/src/tool/petRation/seo.astro +2 -48
- package/src/types.ts +0 -2
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
.theme-dark .pet-ration-calculator-final {
|
|
30
30
|
background: var(--color-surface-dark, #1e293b);
|
|
31
31
|
color: var(--color-text-dark, #e2e8f0);
|
|
32
32
|
border-color: var(--color-border-dark, #334155);
|
|
33
33
|
box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.3);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
.theme-dark .calc-loader {
|
|
37
37
|
background: var(--color-surface-dark, #1e293b);
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
letter-spacing: 0.05em;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
.theme-dark .section-title {
|
|
89
89
|
color: var(--color-heading-dark, #f8fafc);
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
border-bottom: none;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
.theme-dark .calc-section {
|
|
102
102
|
border-bottom-color: var(--color-border-dark, #334155);
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
.theme-dark .btn-species {
|
|
145
145
|
background: var(--color-btn-bg-dark, #0f172a);
|
|
146
146
|
border-color: var(--color-btn-border-dark, #334155);
|
|
147
147
|
}
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
transform: translateY(-2px);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
.theme-dark .species-selector-v2 input:checked + .btn-species {
|
|
163
163
|
background: var(--color-surface-elevated-dark, #1e293b);
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
border: 1px solid var(--color-btn-border, #e2e8f0);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
.theme-dark .segmented-v2 {
|
|
175
175
|
background: var(--color-btn-bg-dark, #0f172a);
|
|
176
176
|
border-color: var(--color-btn-border-dark, #334155);
|
|
177
177
|
}
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
border-radius: 10px;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
.theme-dark .range-v2 {
|
|
222
222
|
background: var(--color-range-track-dark, #334155);
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
transition: all 0.2s;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
.theme-dark .ratio-presets label {
|
|
260
260
|
background: var(--color-btn-bg-dark, #0f172a);
|
|
261
261
|
border-color: var(--color-btn-border-dark, #334155);
|
|
262
262
|
}
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
box-shadow: 0 4px 10px rgba(245, 158, 11, 0.1);
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
.theme-dark .ratio-presets input:checked + label {
|
|
272
272
|
background: var(--color-surface-elevated-dark, #1e293b);
|
|
273
273
|
}
|
|
274
274
|
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
border: 1px solid var(--color-btn-border, #e2e8f0);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
.theme-dark .manual-slider-box {
|
|
294
294
|
background: var(--color-btn-bg-dark, #0f172a);
|
|
295
295
|
border-color: var(--color-btn-border-dark, #334155);
|
|
296
296
|
}
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.3);
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
-
|
|
314
|
+
.theme-dark .results-v2 {
|
|
315
315
|
background: var(--color-accent, #f59e0b);
|
|
316
316
|
color: var(--color-results-text-dark, #0f172a);
|
|
317
317
|
box-shadow: 0 20px 40px -10px rgba(245, 158, 11, 0.2);
|
|
@@ -332,7 +332,7 @@
|
|
|
332
332
|
padding: 0.5rem 1.5rem;
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
|
|
335
|
+
.theme-dark .res-card-v2 {
|
|
336
336
|
border-left-color: var(--color-results-bg, #0f172a);
|
|
337
337
|
}
|
|
338
338
|
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
align-self: flex-start;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
|
|
348
|
+
.theme-dark .res-tag {
|
|
349
349
|
color: var(--color-results-bg, #0f172a);
|
|
350
350
|
opacity: 0.7;
|
|
351
351
|
}
|
|
@@ -371,7 +371,7 @@
|
|
|
371
371
|
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
|
|
374
|
+
.theme-dark .res-footer-v2 {
|
|
375
375
|
border-top-color: rgba(0, 0, 0, 0.1);
|
|
376
376
|
}
|
|
377
377
|
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
font-weight: 900;
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
-
|
|
403
|
+
.theme-dark .status-box-v2 {
|
|
404
404
|
background: var(--color-results-bg, #0f172a);
|
|
405
405
|
color: var(--color-results-text, #fff);
|
|
406
406
|
}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
3
|
-
SEOTitle,
|
|
4
|
-
SEOCard,
|
|
5
|
-
SEOStats,
|
|
6
|
-
SEOTip,
|
|
7
|
-
SEOArticle,
|
|
8
|
-
SEOTable,
|
|
9
|
-
SEOProsCons,
|
|
10
|
-
SEOSummary,
|
|
11
|
-
SEOGlossary,
|
|
12
|
-
SEODiagnostic,
|
|
13
|
-
} from '@jjlmoya/utils-shared';
|
|
2
|
+
import { SEORenderer } from '@jjlmoya/utils-shared';
|
|
14
3
|
import { petRation } from './index';
|
|
15
4
|
import type { KnownLocale } from '../../types';
|
|
16
5
|
|
|
@@ -21,41 +10,6 @@ interface Props {
|
|
|
21
10
|
const { locale = 'es' } = Astro.props;
|
|
22
11
|
const content = await petRation.i18n[locale]?.();
|
|
23
12
|
if (!content) return null;
|
|
24
|
-
|
|
25
|
-
const { seo } = content;
|
|
26
13
|
---
|
|
27
14
|
|
|
28
|
-
<
|
|
29
|
-
{seo.map((section: any) => {
|
|
30
|
-
switch (section.type) {
|
|
31
|
-
case 'summary':
|
|
32
|
-
return <SEOSummary title={section.title} items={section.items} />;
|
|
33
|
-
case 'title':
|
|
34
|
-
return <SEOTitle title={section.text} level={section.level || 2} />;
|
|
35
|
-
case 'paragraph':
|
|
36
|
-
return <p set:html={section.html} />;
|
|
37
|
-
case 'stats':
|
|
38
|
-
return <SEOStats stats={section.items} columns={section.columns} />;
|
|
39
|
-
case 'card':
|
|
40
|
-
return <SEOCard title={section.title} icon={section.icon}><Fragment set:html={section.html} /></SEOCard>;
|
|
41
|
-
case 'tip':
|
|
42
|
-
return <SEOTip title={section.title}><Fragment set:html={section.html} /></SEOTip>;
|
|
43
|
-
case 'table':
|
|
44
|
-
return (
|
|
45
|
-
<SEOTable headers={section.headers}>
|
|
46
|
-
{section.rows.map((row: string[]) => (
|
|
47
|
-
<tr>{row.map((cell: string) => <td set:html={cell} />)}</tr>
|
|
48
|
-
))}
|
|
49
|
-
</SEOTable>
|
|
50
|
-
);
|
|
51
|
-
case 'proscons':
|
|
52
|
-
return <SEOProsCons title={section.title} items={section.items} />;
|
|
53
|
-
case 'diagnostic':
|
|
54
|
-
return <SEODiagnostic title={section.title} icon={section.icon} type={section.variant} badge={section.badge}><Fragment set:html={section.html} /></SEODiagnostic>;
|
|
55
|
-
case 'glossary':
|
|
56
|
-
return <SEOGlossary items={section.items} />;
|
|
57
|
-
default:
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
})}
|
|
61
|
-
</SEOArticle>
|
|
15
|
+
{content.seo?.length > 0 && <SEORenderer content={{ locale, sections: content.seo }} />}
|
package/src/types.ts
CHANGED
|
@@ -29,9 +29,7 @@ export interface ToolLocaleContent<TUI extends Record<string, string> = Record<s
|
|
|
29
29
|
description: string;
|
|
30
30
|
ui: TUI;
|
|
31
31
|
seo: SEOSection[];
|
|
32
|
-
faqTitle?: string;
|
|
33
32
|
faq: FAQItem[];
|
|
34
|
-
bibliographyTitle?: string;
|
|
35
33
|
bibliography: BibliographyEntry[];
|
|
36
34
|
howTo: HowToStep[];
|
|
37
35
|
schemas: WithContext<Thing>[];
|