@jjlmoya/utils-drones 1.1.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 +61 -0
- package/src/category/i18n/en.ts +107 -0
- package/src/category/i18n/es.ts +106 -0
- package/src/category/i18n/fr.ts +107 -0
- package/src/category/index.ts +15 -0
- package/src/category/seo.astro +92 -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 +22 -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/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/seo_length.test.ts +22 -0
- package/src/tests/seo_section_types.test.ts +75 -0
- package/src/tests/tool_validation.test.ts +17 -0
- package/src/tool/antenna-length-calculator/AntennaLengthCalculator.css +684 -0
- package/src/tool/antenna-length-calculator/bibliography.astro +14 -0
- package/src/tool/antenna-length-calculator/component.astro +360 -0
- package/src/tool/antenna-length-calculator/i18n/en.ts +204 -0
- package/src/tool/antenna-length-calculator/i18n/es.ts +204 -0
- package/src/tool/antenna-length-calculator/i18n/fr.ts +204 -0
- package/src/tool/antenna-length-calculator/index.ts +27 -0
- package/src/tool/antenna-length-calculator/seo.astro +39 -0
- package/src/tool/drone-flight-time/FlightTimeCalculator.css +363 -0
- package/src/tool/drone-flight-time/bibliography.astro +14 -0
- package/src/tool/drone-flight-time/component.astro +262 -0
- package/src/tool/drone-flight-time/components/AutonomyChart.astro +13 -0
- package/src/tool/drone-flight-time/components/BatterySpecs.astro +46 -0
- package/src/tool/drone-flight-time/components/ConsumptionStats.astro +33 -0
- package/src/tool/drone-flight-time/components/FlightDashboard.astro +33 -0
- package/src/tool/drone-flight-time/i18n/en.ts +200 -0
- package/src/tool/drone-flight-time/i18n/es.ts +200 -0
- package/src/tool/drone-flight-time/i18n/fr.ts +200 -0
- package/src/tool/drone-flight-time/index.ts +27 -0
- package/src/tool/drone-flight-time/seo.astro +31 -0
- package/src/tool/gps-coordinates-converter/GpsCoordinatesConverter.css +310 -0
- package/src/tool/gps-coordinates-converter/bibliography.astro +14 -0
- package/src/tool/gps-coordinates-converter/component.astro +355 -0
- package/src/tool/gps-coordinates-converter/components/GpsHistory.astro +36 -0
- package/src/tool/gps-coordinates-converter/components/GpsInputs.astro +92 -0
- package/src/tool/gps-coordinates-converter/components/GpsMap.astro +18 -0
- package/src/tool/gps-coordinates-converter/components/GpsResults.astro +50 -0
- package/src/tool/gps-coordinates-converter/i18n/en.ts +201 -0
- package/src/tool/gps-coordinates-converter/i18n/es.ts +201 -0
- package/src/tool/gps-coordinates-converter/i18n/fr.ts +201 -0
- package/src/tool/gps-coordinates-converter/index.ts +27 -0
- package/src/tool/gps-coordinates-converter/seo.astro +39 -0
- package/src/tools.ts +16 -0
- package/src/types.ts +72 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { SEOArticle, SEOTitle, SEOList, SEOTable } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { gpsCoordinatesConverter } 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 gpsCoordinatesConverter.i18n[locale]?.();
|
|
12
|
+
if (!content) return null;
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<SEOArticle>
|
|
16
|
+
{content.seo.map((section: any) => {
|
|
17
|
+
if (section.type === 'title') {
|
|
18
|
+
return <SEOTitle title={section.text} level={section.level || 2} />;
|
|
19
|
+
}
|
|
20
|
+
if (section.type === 'paragraph') {
|
|
21
|
+
return <p set:html={section.html} />;
|
|
22
|
+
}
|
|
23
|
+
if (section.type === 'list') {
|
|
24
|
+
return <SEOList items={section.items} />;
|
|
25
|
+
}
|
|
26
|
+
if (section.type === 'table') {
|
|
27
|
+
return (
|
|
28
|
+
<SEOTable headers={section.headers}>
|
|
29
|
+
{section.rows.map((row: string[]) => (
|
|
30
|
+
<tr>
|
|
31
|
+
{row.map((cell: string) => <td set:html={cell} />)}
|
|
32
|
+
</tr>
|
|
33
|
+
))}
|
|
34
|
+
</SEOTable>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
})}
|
|
39
|
+
</SEOArticle>
|
package/src/tools.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DRONE_FLIGHT_TIME_TOOL } from './tool/drone-flight-time/index';
|
|
2
|
+
import { ANTENNA_LENGTH_CALCULATOR_TOOL } from './tool/antenna-length-calculator/index';
|
|
3
|
+
import { GPS_COORDINATES_CONVERTER_TOOL } from './tool/gps-coordinates-converter/index';
|
|
4
|
+
import type { ToolDefinition } from './types';
|
|
5
|
+
|
|
6
|
+
export const ALL_TOOLS: ToolDefinition[] = [
|
|
7
|
+
DRONE_FLIGHT_TIME_TOOL,
|
|
8
|
+
ANTENNA_LENGTH_CALCULATOR_TOOL,
|
|
9
|
+
GPS_COORDINATES_CONVERTER_TOOL,
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
DRONE_FLIGHT_TIME_TOOL,
|
|
14
|
+
ANTENNA_LENGTH_CALCULATOR_TOOL,
|
|
15
|
+
GPS_COORDINATES_CONVERTER_TOOL,
|
|
16
|
+
};
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { SEOSection } from '@jjlmoya/utils-shared';
|
|
2
|
+
import type { WithContext, Thing } from 'schema-dts';
|
|
3
|
+
|
|
4
|
+
export type { SEOSection };
|
|
5
|
+
|
|
6
|
+
export type KnownLocale =
|
|
7
|
+
| 'ar' | 'da' | 'de' | 'en' | 'es' | 'fi'
|
|
8
|
+
| 'fr' | 'it' | 'ja' | 'ko' | 'nb' | 'nl'
|
|
9
|
+
| 'pl' | 'pt' | 'ru' | 'sv' | 'tr' | 'zh';
|
|
10
|
+
|
|
11
|
+
export interface FAQItem {
|
|
12
|
+
question: string;
|
|
13
|
+
answer: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface BibliographyEntry {
|
|
17
|
+
name: string;
|
|
18
|
+
url: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface HowToStep {
|
|
22
|
+
name: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ToolLocaleContent<TUI extends Record<string, string> = Record<string, string>> {
|
|
27
|
+
slug: string;
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
ui: TUI;
|
|
31
|
+
seo: SEOSection[];
|
|
32
|
+
faqTitle?: string;
|
|
33
|
+
faq: FAQItem[];
|
|
34
|
+
bibliographyTitle?: string;
|
|
35
|
+
bibliography: BibliographyEntry[];
|
|
36
|
+
howTo: HowToStep[];
|
|
37
|
+
schemas: WithContext<Thing>[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface CategoryLocaleContent {
|
|
41
|
+
slug: string;
|
|
42
|
+
title: string;
|
|
43
|
+
description: string;
|
|
44
|
+
seo: SEOSection[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type LocaleLoader<T> = () => Promise<T>;
|
|
48
|
+
|
|
49
|
+
export type LocaleMap<T> = Partial<Record<KnownLocale, LocaleLoader<T>>>;
|
|
50
|
+
|
|
51
|
+
export interface DronesToolEntry<TUI extends Record<string, string> = Record<string, string>> {
|
|
52
|
+
id: string;
|
|
53
|
+
icons: {
|
|
54
|
+
bg: string;
|
|
55
|
+
fg: string;
|
|
56
|
+
};
|
|
57
|
+
i18n: LocaleMap<ToolLocaleContent<TUI>>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface DronesCategoryEntry {
|
|
61
|
+
icon: string;
|
|
62
|
+
tools: DronesToolEntry[];
|
|
63
|
+
i18n: LocaleMap<CategoryLocaleContent>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ToolDefinition {
|
|
67
|
+
entry: DronesToolEntry;
|
|
68
|
+
Component: unknown;
|
|
69
|
+
SEOComponent: unknown;
|
|
70
|
+
BibliographyComponent: unknown;
|
|
71
|
+
}
|
|
72
|
+
|