@jjlmoya/utils-pets 1.26.0 → 1.28.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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/src/category/index.ts +2 -1
  3. package/src/data.ts +2 -0
  4. package/src/entries.ts +4 -1
  5. package/src/index.ts +1 -0
  6. package/src/tests/locale_completeness.test.ts +1 -1
  7. package/src/tests/tool_validation.test.ts +12 -10
  8. package/src/tool/petAge/component.astro +1 -1
  9. package/src/tool/petMedicationSchedulePlanner/bibliography.astro +6 -0
  10. package/src/tool/petMedicationSchedulePlanner/bibliography.ts +6 -0
  11. package/src/tool/petMedicationSchedulePlanner/component.astro +40 -0
  12. package/src/tool/petMedicationSchedulePlanner/controller.ts +95 -0
  13. package/src/tool/petMedicationSchedulePlanner/dom-views.ts +57 -0
  14. package/src/tool/petMedicationSchedulePlanner/entry.ts +26 -0
  15. package/src/tool/petMedicationSchedulePlanner/i18n/content.ts +58 -0
  16. package/src/tool/petMedicationSchedulePlanner/i18n/de.ts +6 -0
  17. package/src/tool/petMedicationSchedulePlanner/i18n/en.ts +7 -0
  18. package/src/tool/petMedicationSchedulePlanner/i18n/es.ts +6 -0
  19. package/src/tool/petMedicationSchedulePlanner/i18n/fr.ts +6 -0
  20. package/src/tool/petMedicationSchedulePlanner/i18n/id.ts +6 -0
  21. package/src/tool/petMedicationSchedulePlanner/i18n/it.ts +6 -0
  22. package/src/tool/petMedicationSchedulePlanner/i18n/ja.ts +6 -0
  23. package/src/tool/petMedicationSchedulePlanner/i18n/ko.ts +6 -0
  24. package/src/tool/petMedicationSchedulePlanner/i18n/nl.ts +6 -0
  25. package/src/tool/petMedicationSchedulePlanner/i18n/pl.ts +6 -0
  26. package/src/tool/petMedicationSchedulePlanner/i18n/pt.ts +6 -0
  27. package/src/tool/petMedicationSchedulePlanner/i18n/ru.ts +6 -0
  28. package/src/tool/petMedicationSchedulePlanner/i18n/sv.ts +6 -0
  29. package/src/tool/petMedicationSchedulePlanner/i18n/tr.ts +6 -0
  30. package/src/tool/petMedicationSchedulePlanner/i18n/zh.ts +6 -0
  31. package/src/tool/petMedicationSchedulePlanner/index.ts +12 -0
  32. package/src/tool/petMedicationSchedulePlanner/logic.test.ts +24 -0
  33. package/src/tool/petMedicationSchedulePlanner/logic.ts +118 -0
  34. package/src/tool/petMedicationSchedulePlanner/pet-medication-schedule-planner.css +368 -0
  35. package/src/tool/petMedicationSchedulePlanner/seo.astro +11 -0
  36. package/src/tool/petMedicationSchedulePlanner/storage.ts +32 -0
  37. package/src/tool/petMedicationSchedulePlanner/ui.ts +37 -0
  38. package/src/tools.ts +3 -0
@@ -0,0 +1,32 @@
1
+ import type { MedicationScheduleInput } from './logic';
2
+
3
+ const STORAGE_KEY = 'jjlmoya-pet-medication-schedule';
4
+
5
+ export interface MedicationStorageState extends MedicationScheduleInput {
6
+ completedIds: string[];
7
+ }
8
+
9
+ export function loadMedicationState(): Partial<MedicationStorageState> {
10
+ try {
11
+ const raw = window.localStorage.getItem(STORAGE_KEY);
12
+ return raw ? JSON.parse(raw) as Partial<MedicationStorageState> : {};
13
+ } catch {
14
+ return {};
15
+ }
16
+ }
17
+
18
+ export function saveMedicationState(state: MedicationStorageState): void {
19
+ try {
20
+ window.localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
21
+ } catch {
22
+ return;
23
+ }
24
+ }
25
+
26
+ export function clearMedicationState(): void {
27
+ try {
28
+ window.localStorage.removeItem(STORAGE_KEY);
29
+ } catch {
30
+ return;
31
+ }
32
+ }
@@ -0,0 +1,37 @@
1
+ import type { ToolLocaleContent } from '../../types';
2
+
3
+ export interface PetMedicationSchedulePlannerUI {
4
+ [key: string]: string;
5
+ dateLocale: string;
6
+ medicationNameLabel: string;
7
+ medicationNamePlaceholder: string;
8
+ startDateLabel: string;
9
+ startTimeLabel: string;
10
+ scheduleModeLabel: string;
11
+ intervalMode: string;
12
+ timesMode: string;
13
+ intervalHoursLabel: string;
14
+ timesLabel: string;
15
+ timesHint: string;
16
+ durationLabel: string;
17
+ durationUnit: string;
18
+ instructionsLabel: string;
19
+ instructionsPlaceholder: string;
20
+ reset: string;
21
+ scheduleTitle: string;
22
+ nextDoseLabel: string;
23
+ noNextDose: string;
24
+ completedCount: string;
25
+ markDone: string;
26
+ markUndone: string;
27
+ completed: string;
28
+ upcoming: string;
29
+ due: string;
30
+ emptySchedule: string;
31
+ invalidInput: string;
32
+ safetyTitle: string;
33
+ safetyText: string;
34
+ scheduleIllustration: string;
35
+ }
36
+
37
+ export type PetMedicationSchedulePlannerLocaleContent = ToolLocaleContent<PetMedicationSchedulePlannerUI>;
package/src/tools.ts CHANGED
@@ -5,6 +5,7 @@ import { PET_GESTATION_TOOL } from './tool/petGestation';
5
5
  import { PET_TOXICITY_TOOL } from './tool/petToxicity';
6
6
  import { PET_WATER_INTAKE_TOOL } from './tool/petWaterIntake';
7
7
  import { PET_CARRIER_CRATE_SIZE_PLANNER_TOOL } from './tool/petCarrierCrateSizePlanner';
8
+ import { PET_MEDICATION_SCHEDULE_PLANNER_TOOL } from './tool/petMedicationSchedulePlanner';
8
9
  import type { ToolDefinition } from './types';
9
10
 
10
11
  export const ALL_TOOLS: ToolDefinition[] = [
@@ -14,6 +15,7 @@ export const ALL_TOOLS: ToolDefinition[] = [
14
15
  PET_TOXICITY_TOOL,
15
16
  PET_WATER_INTAKE_TOOL,
16
17
  PET_CARRIER_CRATE_SIZE_PLANNER_TOOL,
18
+ PET_MEDICATION_SCHEDULE_PLANNER_TOOL,
17
19
  ];
18
20
 
19
21
  export {
@@ -23,4 +25,5 @@ export {
23
25
  PET_TOXICITY_TOOL,
24
26
  PET_WATER_INTAKE_TOOL,
25
27
  PET_CARRIER_CRATE_SIZE_PLANNER_TOOL,
28
+ PET_MEDICATION_SCHEDULE_PLANNER_TOOL,
26
29
  };