@jjlmoya/utils-pets 1.7.0 → 1.10.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 CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-pets",
3
- "version": "1.7.0",
3
+ "version": "1.10.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
7
7
  "exports": {
8
8
  ".": "./src/index.ts",
9
- "./data": "./src/data.ts"
9
+ "./data": "./src/data.ts",
10
+ "./entries": "./src/entries.ts"
10
11
  },
11
12
  "files": [
12
13
  "src"
@@ -1,6 +1,6 @@
1
1
  import type { PetCategoryEntry } from '../types';
2
- import { petAge } from '../tool/petAge';
3
- import { petRation } from '../tool/petRation';
2
+ import { petAge } from '../tool/petAge/entry';
3
+ import { petRation } from '../tool/petRation/entry';
4
4
 
5
5
  export const petsCategory: PetCategoryEntry = {
6
6
  icon: 'mdi:paw',
package/src/entries.ts ADDED
@@ -0,0 +1,8 @@
1
+ export { petAge } from './tool/petAge/entry';
2
+ export type { PetAgeUI, PetAgeLocaleContent } from './tool/petAge/entry';
3
+ export { petRation } from './tool/petRation/entry';
4
+ export type { PetRationUI, PetRationLocaleContent } from './tool/petRation/entry';
5
+ export { petsCategory } from './category';
6
+ import { petAge } from './tool/petAge/entry';
7
+ import { petRation } from './tool/petRation/entry';
8
+ export const ALL_ENTRIES = [petAge, petRation];
package/src/index.ts CHANGED
@@ -2,7 +2,7 @@ export * from './tool/petAge';
2
2
  export * from './tool/petRation';
3
3
 
4
4
  export { petsCategory } from './category';
5
- export { default as PetsCategorySEO } from './category/seo.astro';
5
+ export const PetsCategorySEO = () => import('./category/seo.astro').then((m) => m.default);
6
6
 
7
7
  export type {
8
8
  KnownLocale,
@@ -14,7 +14,8 @@ import type { UtilitySEOContent } from "@jjlmoya/utils-shared";
14
14
  export async function getStaticPaths() {
15
15
  const paths = [];
16
16
 
17
- for (const { entry, Component } of ALL_TOOLS) {
17
+ for (const { entry, Component: lazyComp } of ALL_TOOLS) {
18
+ const { default: Component } = await lazyComp();
18
19
  const localeEntries = Object.entries(entry.i18n) as [
19
20
  KnownLocale,
20
21
  () => Promise<ToolLocaleContent>,
@@ -52,8 +53,6 @@ export async function getStaticPaths() {
52
53
  return paths;
53
54
  }
54
55
 
55
- type ToolComponent = (props: { ui: Record<string, string> }) => unknown;
56
-
57
56
  interface NavItem {
58
57
  id: string;
59
58
  title: string;
@@ -62,7 +61,7 @@ interface NavItem {
62
61
  }
63
62
 
64
63
  interface Props {
65
- Component: ToolComponent;
64
+ Component: unknown;
66
65
  locale: KnownLocale;
67
66
  content: ToolLocaleContent;
68
67
  localeUrls: Partial<Record<KnownLocale, string>>;
@@ -0,0 +1,64 @@
1
+ import type { PetToolEntry, ToolLocaleContent } from '../../types';
2
+
3
+ export interface PetAgeUI {
4
+ [key: string]: string;
5
+ toolTitle: string;
6
+ toolSubtitle: string;
7
+ petNameLabel: string;
8
+ petNamePlaceholder: string;
9
+ petTypeDog: string;
10
+ petTypeCat: string;
11
+ sizeSmall: string;
12
+ sizeMedium: string;
13
+ sizeLarge: string;
14
+ sizeGiant: string;
15
+ birthYearLabel: string;
16
+ humanAgeLabel: string;
17
+ humanAgeUnit: string;
18
+ lifeStageLabel: string;
19
+ milestoneLabel: string;
20
+ shareBtn: string;
21
+ shareSuccess: string;
22
+ humanAgeTitle: string;
23
+ humanAgeYears: string;
24
+ recalculateBtn: string;
25
+ realAgeLabel: string;
26
+ defaultPetName: string;
27
+ stageDogPuppy: string;
28
+ stageDogTeen: string;
29
+ stageDogAdult: string;
30
+ stageDogMature: string;
31
+ stageDogSenior: string;
32
+ stageCatKitten: string;
33
+ stageCatYouth: string;
34
+ stageCatReign: string;
35
+ stageCatVeteran: string;
36
+ stageCatVenerable: string;
37
+ }
38
+
39
+ export type PetAgeLocaleContent = ToolLocaleContent<PetAgeUI>;
40
+
41
+ export const petAge: PetToolEntry<PetAgeUI> = {
42
+ id: 'pet-age',
43
+ icons: {
44
+ bg: 'mdi:paw',
45
+ fg: 'mdi:cake-variant',
46
+ },
47
+ i18n: {
48
+ de: () => import('./i18n/de').then((m) => m.content),
49
+ en: () => import('./i18n/en').then((m) => m.content),
50
+ es: () => import('./i18n/es').then((m) => m.content),
51
+ fr: () => import('./i18n/fr').then((m) => m.content),
52
+ id: () => import('./i18n/id').then((m) => m.content),
53
+ it: () => import('./i18n/it').then((m) => m.content),
54
+ ja: () => import('./i18n/ja').then((m) => m.content),
55
+ ko: () => import('./i18n/ko').then((m) => m.content),
56
+ nl: () => import('./i18n/nl').then((m) => m.content),
57
+ pl: () => import('./i18n/pl').then((m) => m.content),
58
+ pt: () => import('./i18n/pt').then((m) => m.content),
59
+ ru: () => import('./i18n/ru').then((m) => m.content),
60
+ sv: () => import('./i18n/sv').then((m) => m.content),
61
+ tr: () => import('./i18n/tr').then((m) => m.content),
62
+ zh: () => import('./i18n/zh').then((m) => m.content),
63
+ },
64
+ };
@@ -1,76 +1,8 @@
1
- import type { PetToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import PetAgeCalculator from './component.astro';
3
- import PetAgeSEO from './seo.astro';
4
- import PetAgeBibliography from './bibliography.astro';
5
-
6
- export interface PetAgeUI {
7
- [key: string]: string;
8
- toolTitle: string;
9
- toolSubtitle: string;
10
- petNameLabel: string;
11
- petNamePlaceholder: string;
12
- petTypeDog: string;
13
- petTypeCat: string;
14
- sizeSmall: string;
15
- sizeMedium: string;
16
- sizeLarge: string;
17
- sizeGiant: string;
18
- birthYearLabel: string;
19
- humanAgeLabel: string;
20
- humanAgeUnit: string;
21
- lifeStageLabel: string;
22
- milestoneLabel: string;
23
- shareBtn: string;
24
- shareSuccess: string;
25
- humanAgeTitle: string;
26
- humanAgeYears: string;
27
- recalculateBtn: string;
28
- realAgeLabel: string;
29
- defaultPetName: string;
30
- stageDogPuppy: string;
31
- stageDogTeen: string;
32
- stageDogAdult: string;
33
- stageDogMature: string;
34
- stageDogSenior: string;
35
- stageCatKitten: string;
36
- stageCatYouth: string;
37
- stageCatReign: string;
38
- stageCatVeteran: string;
39
- stageCatVenerable: string;
40
- }
41
-
42
- export type PetAgeLocaleContent = ToolLocaleContent<PetAgeUI>;
43
-
44
- export const petAge: PetToolEntry<PetAgeUI> = {
45
- id: 'pet-age',
46
- icons: {
47
- bg: 'mdi:paw',
48
- fg: 'mdi:cake-variant',
49
- },
50
- i18n: {
51
- de: () => import('./i18n/de').then((m) => m.content),
52
- en: () => import('./i18n/en').then((m) => m.content),
53
- es: () => import('./i18n/es').then((m) => m.content),
54
- fr: () => import('./i18n/fr').then((m) => m.content),
55
- id: () => import('./i18n/id').then((m) => m.content),
56
- it: () => import('./i18n/it').then((m) => m.content),
57
- ja: () => import('./i18n/ja').then((m) => m.content),
58
- ko: () => import('./i18n/ko').then((m) => m.content),
59
- nl: () => import('./i18n/nl').then((m) => m.content),
60
- pl: () => import('./i18n/pl').then((m) => m.content),
61
- pt: () => import('./i18n/pt').then((m) => m.content),
62
- ru: () => import('./i18n/ru').then((m) => m.content),
63
- sv: () => import('./i18n/sv').then((m) => m.content),
64
- tr: () => import('./i18n/tr').then((m) => m.content),
65
- zh: () => import('./i18n/zh').then((m) => m.content),
66
- },
67
- };
68
-
69
- export { PetAgeCalculator, PetAgeSEO, PetAgeBibliography };
70
-
1
+ import { petAge } from './entry';
2
+ export * from './entry';
71
3
  export const PET_AGE_TOOL: ToolDefinition = {
72
4
  entry: petAge,
73
- Component: PetAgeCalculator,
74
- SEOComponent: PetAgeSEO,
75
- BibliographyComponent: PetAgeBibliography,
5
+ Component: () => import('./component.astro'),
6
+ SEOComponent: () => import('./seo.astro'),
7
+ BibliographyComponent: () => import('./bibliography.astro'),
76
8
  };
@@ -0,0 +1,63 @@
1
+ import type { PetToolEntry, ToolLocaleContent } from '../../types';
2
+
3
+ export interface PetRationUI {
4
+ [key: string]: string;
5
+ toolTitle: string;
6
+ sectionProfile: string;
7
+ labelAnimal: string;
8
+ labelStage: string;
9
+ labelWeight: string;
10
+ labelActivity: string;
11
+ sectionDiet: string;
12
+ labelDietType: string;
13
+ speciesDog: string;
14
+ speciesCat: string;
15
+ speciesRabbit: string;
16
+ stagePuppy: string;
17
+ stageAdult: string;
18
+ stageSenior: string;
19
+ activityLow: string;
20
+ activityMod: string;
21
+ activityHigh: string;
22
+ dietDry: string;
23
+ dietMixed25: string;
24
+ dietHalf: string;
25
+ dietWet: string;
26
+ manualAdjust: string;
27
+ wetPercentLabel: string;
28
+ tagDry: string;
29
+ tagWet: string;
30
+ totalKcal: string;
31
+ kcalUnit: string;
32
+ statusPuppy: string;
33
+ statusSenior: string;
34
+ statusLargeDog: string;
35
+ statusDefault: string;
36
+ }
37
+
38
+ export type PetRationLocaleContent = ToolLocaleContent<PetRationUI>;
39
+
40
+ export const petRation: PetToolEntry<PetRationUI> = {
41
+ id: 'pet-ration',
42
+ icons: {
43
+ bg: 'mdi:dog',
44
+ fg: 'mdi:scale',
45
+ },
46
+ i18n: {
47
+ de: () => import('./i18n/de').then((m) => m.content),
48
+ en: () => import('./i18n/en').then((m) => m.content),
49
+ es: () => import('./i18n/es').then((m) => m.content),
50
+ fr: () => import('./i18n/fr').then((m) => m.content),
51
+ id: () => import('./i18n/id').then((m) => m.content),
52
+ it: () => import('./i18n/it').then((m) => m.content),
53
+ ja: () => import('./i18n/ja').then((m) => m.content),
54
+ ko: () => import('./i18n/ko').then((m) => m.content),
55
+ nl: () => import('./i18n/nl').then((m) => m.content),
56
+ pl: () => import('./i18n/pl').then((m) => m.content),
57
+ pt: () => import('./i18n/pt').then((m) => m.content),
58
+ ru: () => import('./i18n/ru').then((m) => m.content),
59
+ sv: () => import('./i18n/sv').then((m) => m.content),
60
+ tr: () => import('./i18n/tr').then((m) => m.content),
61
+ zh: () => import('./i18n/zh').then((m) => m.content),
62
+ },
63
+ };
@@ -1,75 +1,8 @@
1
- import type { PetToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import PetRationCalculator from './component.astro';
3
- import PetRationSEO from './seo.astro';
4
- import PetRationBibliography from './bibliography.astro';
5
-
6
- export interface PetRationUI {
7
- [key: string]: string;
8
- toolTitle: string;
9
- sectionProfile: string;
10
- labelAnimal: string;
11
- labelStage: string;
12
- labelWeight: string;
13
- labelActivity: string;
14
- sectionDiet: string;
15
- labelDietType: string;
16
- speciesDog: string;
17
- speciesCat: string;
18
- speciesRabbit: string;
19
- stagePuppy: string;
20
- stageAdult: string;
21
- stageSenior: string;
22
- activityLow: string;
23
- activityMod: string;
24
- activityHigh: string;
25
- dietDry: string;
26
- dietMixed25: string;
27
- dietHalf: string;
28
- dietWet: string;
29
- manualAdjust: string;
30
- wetPercentLabel: string;
31
- tagDry: string;
32
- tagWet: string;
33
- totalKcal: string;
34
- kcalUnit: string;
35
- statusPuppy: string;
36
- statusSenior: string;
37
- statusLargeDog: string;
38
- statusDefault: string;
39
- }
40
-
41
- export type PetRationLocaleContent = ToolLocaleContent<PetRationUI>;
42
-
43
- export const petRation: PetToolEntry<PetRationUI> = {
44
- id: 'pet-ration',
45
- icons: {
46
- bg: 'mdi:dog',
47
- fg: 'mdi:scale',
48
- },
49
- i18n: {
50
- de: () => import('./i18n/de').then((m) => m.content),
51
- en: () => import('./i18n/en').then((m) => m.content),
52
- es: () => import('./i18n/es').then((m) => m.content),
53
- fr: () => import('./i18n/fr').then((m) => m.content),
54
- id: () => import('./i18n/id').then((m) => m.content),
55
- it: () => import('./i18n/it').then((m) => m.content),
56
- ja: () => import('./i18n/ja').then((m) => m.content),
57
- ko: () => import('./i18n/ko').then((m) => m.content),
58
- nl: () => import('./i18n/nl').then((m) => m.content),
59
- pl: () => import('./i18n/pl').then((m) => m.content),
60
- pt: () => import('./i18n/pt').then((m) => m.content),
61
- ru: () => import('./i18n/ru').then((m) => m.content),
62
- sv: () => import('./i18n/sv').then((m) => m.content),
63
- tr: () => import('./i18n/tr').then((m) => m.content),
64
- zh: () => import('./i18n/zh').then((m) => m.content),
65
- },
66
- };
67
-
68
- export { PetRationCalculator, PetRationSEO, PetRationBibliography };
69
-
1
+ import { petRation } from './entry';
2
+ export * from './entry';
70
3
  export const PET_RATION_TOOL: ToolDefinition = {
71
4
  entry: petRation,
72
- Component: PetRationCalculator,
73
- SEOComponent: PetRationSEO,
74
- BibliographyComponent: PetRationBibliography,
5
+ Component: () => import('./component.astro'),
6
+ SEOComponent: () => import('./seo.astro'),
7
+ BibliographyComponent: () => import('./bibliography.astro'),
75
8
  };
package/src/tools.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { ALL_ENTRIES } from './entries';
1
2
  import { PET_AGE_TOOL } from './tool/petAge';
2
3
  import { PET_RATION_TOOL } from './tool/petRation';
3
4
  import type { ToolDefinition } from './types';
@@ -12,4 +13,3 @@ export {
12
13
  PET_RATION_TOOL,
13
14
  };
14
15
 
15
- export const ALL_ENTRIES = ALL_TOOLS.map(t => t.entry);