@umituz/react-native-settings 4.21.12 → 4.21.13

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 (39) hide show
  1. package/package.json +1 -1
  2. package/src/domains/gamification/components/GamificationScreenWrapper.tsx +28 -10
  3. package/src/domains/gamification/index.ts +1 -0
  4. package/src/domains/gamification/types/index.ts +18 -0
  5. package/src/{notifications → domains/notifications}/index.ts +21 -21
  6. package/src/{notifications → domains/notifications}/presentation/hooks/useNotificationSettingsUI.ts +1 -1
  7. package/src/{notifications → domains/notifications}/presentation/screens/NotificationSettingsScreen.tsx +3 -3
  8. package/src/{notifications/domains → domains/notifications}/quietHours/infrastructure/hooks/useQuietHoursActions.ts +1 -1
  9. package/src/{notifications/domains → domains/notifications}/quietHours/presentation/components/QuietHoursCard.tsx +2 -2
  10. package/src/{notifications/domains → domains/notifications}/reminders/infrastructure/config/reminderPresets.ts +1 -1
  11. package/src/{notifications/domains → domains/notifications}/reminders/infrastructure/hooks/useReminderActions.ts +4 -4
  12. package/src/{notifications/domains → domains/notifications}/reminders/infrastructure/storage/RemindersStore.ts +1 -1
  13. package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/FrequencySelector.tsx +1 -1
  14. package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/ReminderForm.tsx +1 -1
  15. package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/ReminderItem.tsx +1 -1
  16. package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/TimePresetSelector.tsx +1 -1
  17. package/src/{notifications/domains → domains/notifications}/reminders/presentation/screens/ReminderListScreen.tsx +1 -1
  18. package/src/index.ts +1 -1
  19. /package/src/{notifications → domains/notifications}/infrastructure/config/notificationsConfig.ts +0 -0
  20. /package/src/{notifications → domains/notifications}/infrastructure/hooks/useNotificationSettings.ts +0 -0
  21. /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationBadgeManager.ts +0 -0
  22. /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationManager.ts +0 -0
  23. /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationPermissions.ts +0 -0
  24. /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationScheduler.ts +0 -0
  25. /package/src/{notifications → domains/notifications}/infrastructure/services/NotificationService.ts +0 -0
  26. /package/src/{notifications → domains/notifications}/infrastructure/services/types.ts +0 -0
  27. /package/src/{notifications → domains/notifications}/infrastructure/storage/NotificationsStore.ts +0 -0
  28. /package/src/{notifications → domains/notifications}/infrastructure/utils/dev.ts +0 -0
  29. /package/src/{notifications → domains/notifications}/infrastructure/utils/idGenerator.ts +0 -0
  30. /package/src/{notifications → domains/notifications}/infrastructure/utils/triggerBuilder.ts +0 -0
  31. /package/src/{notifications → domains/notifications}/presentation/components/NotificationsSection.tsx +0 -0
  32. /package/src/{notifications → domains/notifications}/presentation/components/RemindersNavRow.styles.ts +0 -0
  33. /package/src/{notifications → domains/notifications}/presentation/components/RemindersNavRow.tsx +0 -0
  34. /package/src/{notifications → domains/notifications}/presentation/components/SettingRow.tsx +0 -0
  35. /package/src/{notifications → domains/notifications}/presentation/hooks/useTimePicker.ts +0 -0
  36. /package/src/{notifications → domains/notifications}/presentation/screens/NotificationSettingsScreen.styles.ts +0 -0
  37. /package/src/{notifications → domains/notifications}/presentation/screens/NotificationsScreen.tsx +0 -0
  38. /package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/FormButton.tsx +0 -0
  39. /package/src/{notifications/domains → domains/notifications}/reminders/presentation/components/WeekdaySelector.tsx +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-settings",
3
- "version": "4.21.12",
3
+ "version": "4.21.13",
4
4
  "description": "Complete settings hub for React Native apps - consolidated package with settings, about, legal, appearance, feedback, FAQs, rating, and gamification",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { useGamification } from '../hooks/useGamification';
3
3
  import { GamificationScreen } from './GamificationScreen';
4
4
  import type { GamificationConfig } from '../types';
5
+ import type { AchievementItemProps } from '../components';
5
6
 
6
7
  interface GamificationScreenWrapperProps {
7
8
  config: GamificationConfig;
@@ -16,6 +17,19 @@ export const GamificationScreenWrapper: React.FC<GamificationScreenWrapperProps>
16
17
  achievements,
17
18
  } = useGamification(config);
18
19
 
20
+ // Transform store achievements to UI props
21
+ const achievementItems: any[] = achievements.map(a => ({
22
+ ...a,
23
+ title: a.title,
24
+ description: a.description,
25
+ icon: a.icon,
26
+ isUnlocked: a.isUnlocked,
27
+ progress: a.progress,
28
+ threshold: a.threshold,
29
+ id: a.id,
30
+ type: a.type
31
+ }));
32
+
19
33
  return (
20
34
  <GamificationScreen
21
35
  title={config.translations.title}
@@ -24,22 +38,26 @@ export const GamificationScreenWrapper: React.FC<GamificationScreenWrapperProps>
24
38
  streakTitle={config.translations.streakTitle}
25
39
  levelProps={{
26
40
  level: level.currentLevel,
27
- currentPoints: level.currentPoints,
41
+ points: level.currentPoints,
28
42
  pointsToNext: level.pointsToNext,
29
43
  progress: level.progress,
30
44
  levelTitle: config.translations.levelTitle,
45
+ showPoints: true,
31
46
  }}
32
47
  streakProps={{
33
- streak: streak.current,
34
- longestStreak: streak.longest,
35
- title: config.translations.streakTitle,
36
- }}
37
- stats={{
38
- points,
39
- tasksCompleted: totalTasksCompleted,
40
- streak: streak.current,
48
+ current: streak.current,
49
+ longest: streak.longest,
50
+ // streakLabel: config.translations.streakTitle, // Omitted by GamificationScreen types apparently
51
+ bestLabel: config.translations.bestStreak,
41
52
  }}
42
- achievements={achievements}
53
+ stats={[
54
+ {
55
+ label: config.translations.statsTitle,
56
+ value: points, // Pass number directly
57
+ icon: "star",
58
+ },
59
+ ]}
60
+ achievements={achievementItems}
43
61
  emptyAchievementsText={config.translations.emptyAchievements}
44
62
  />
45
63
  );
@@ -15,6 +15,7 @@ export type {
15
15
  LevelState,
16
16
  StreakState,
17
17
  GamificationConfig,
18
+ GamificationSettingsConfig,
18
19
  GamificationState,
19
20
  GamificationActions,
20
21
  GamificationStore,
@@ -8,6 +8,9 @@ export interface AchievementDefinition {
8
8
  id: string;
9
9
  threshold: number;
10
10
  type: "count" | "streak" | "milestone";
11
+ title: string;
12
+ description: string;
13
+ icon: string;
11
14
  }
12
15
 
13
16
  // Achievement State (internal)
@@ -39,6 +42,17 @@ export interface StreakState {
39
42
  lastActivityDate: string | null;
40
43
  }
41
44
 
45
+ // Gamification Translations
46
+ export interface GamificationTranslations {
47
+ title: string;
48
+ statsTitle: string;
49
+ achievementsTitle: string;
50
+ streakTitle: string;
51
+ bestStreak: string;
52
+ levelTitle: string;
53
+ emptyAchievements: string;
54
+ }
55
+
42
56
  // Gamification Config (provided by app via props)
43
57
  export interface GamificationConfig {
44
58
  storageKey: string;
@@ -46,8 +60,12 @@ export interface GamificationConfig {
46
60
  levels: LevelDefinition[];
47
61
  pointsPerAction?: number;
48
62
  streakBonusMultiplier?: number;
63
+ enabled?: boolean;
64
+ translations: GamificationTranslations;
49
65
  }
50
66
 
67
+ export type GamificationSettingsConfig = GamificationConfig;
68
+
51
69
  // Store State
52
70
  export interface GamificationState {
53
71
  points: number;
@@ -41,8 +41,8 @@ export {
41
41
  getTimePresetById,
42
42
  formatTime,
43
43
  parseTime,
44
- } from './domains/reminders/infrastructure/config/reminderPresets';
45
- export type { FrequencyOption, WeekdayOption } from './domains/reminders/infrastructure/config/reminderPresets';
44
+ } from './reminders/infrastructure/config/reminderPresets';
45
+ export type { FrequencyOption, WeekdayOption } from './reminders/infrastructure/config/reminderPresets';
46
46
 
47
47
  // ============================================================================
48
48
  // SERVICES
@@ -66,15 +66,15 @@ export {
66
66
  useQuietHours,
67
67
  useRemindersLoading,
68
68
  useRemindersInitialized,
69
- } from './domains/reminders/infrastructure/storage/RemindersStore';
69
+ } from './reminders/infrastructure/storage/RemindersStore';
70
70
 
71
71
  // ============================================================================
72
72
  // HOOKS
73
73
  // ============================================================================
74
74
 
75
75
  export { useNotificationSettings } from './infrastructure/hooks/useNotificationSettings';
76
- export { useReminderActions } from './domains/reminders/infrastructure/hooks/useReminderActions';
77
- export { useQuietHoursActions } from './domains/quietHours/infrastructure/hooks/useQuietHoursActions';
76
+ export { useReminderActions } from './reminders/infrastructure/hooks/useReminderActions';
77
+ export { useQuietHoursActions } from './quietHours/infrastructure/hooks/useQuietHoursActions';
78
78
  export { useNotificationSettingsUI } from './presentation/hooks/useNotificationSettingsUI';
79
79
 
80
80
  // ============================================================================
@@ -87,8 +87,8 @@ export type { NotificationsScreenProps } from './presentation/screens/Notificati
87
87
  export { NotificationSettingsScreen } from './presentation/screens/NotificationSettingsScreen';
88
88
  export type { NotificationSettingsScreenProps } from './presentation/screens/NotificationSettingsScreen';
89
89
 
90
- export { ReminderListScreen } from './domains/reminders/presentation/screens/ReminderListScreen';
91
- export type { ReminderListScreenProps } from './domains/reminders/presentation/screens/ReminderListScreen';
90
+ export { ReminderListScreen } from './reminders/presentation/screens/ReminderListScreen';
91
+ export type { ReminderListScreenProps } from './reminders/presentation/screens/ReminderListScreen';
92
92
 
93
93
  // ============================================================================
94
94
  // COMPONENTS
@@ -97,26 +97,26 @@ export type { ReminderListScreenProps } from './domains/reminders/presentation/s
97
97
  export { NotificationsSection } from './presentation/components/NotificationsSection';
98
98
  export type { NotificationsSectionProps, NotificationsSectionConfig } from './presentation/components/NotificationsSection';
99
99
 
100
- export { TimePresetSelector } from './domains/reminders/presentation/components/TimePresetSelector';
101
- export type { TimePresetSelectorProps } from './domains/reminders/presentation/components/TimePresetSelector';
100
+ export { TimePresetSelector } from './reminders/presentation/components/TimePresetSelector';
101
+ export type { TimePresetSelectorProps } from './reminders/presentation/components/TimePresetSelector';
102
102
 
103
- export { FrequencySelector } from './domains/reminders/presentation/components/FrequencySelector';
104
- export type { FrequencySelectorProps } from './domains/reminders/presentation/components/FrequencySelector';
103
+ export { FrequencySelector } from './reminders/presentation/components/FrequencySelector';
104
+ export type { FrequencySelectorProps } from './reminders/presentation/components/FrequencySelector';
105
105
 
106
- export { WeekdaySelector } from './domains/reminders/presentation/components/WeekdaySelector';
107
- export type { WeekdaySelectorProps } from './domains/reminders/presentation/components/WeekdaySelector';
106
+ export { WeekdaySelector } from './reminders/presentation/components/WeekdaySelector';
107
+ export type { WeekdaySelectorProps } from './reminders/presentation/components/WeekdaySelector';
108
108
 
109
- export { ReminderItem } from './domains/reminders/presentation/components/ReminderItem';
110
- export type { ReminderItemProps, ReminderItemTranslations } from './domains/reminders/presentation/components/ReminderItem';
109
+ export { ReminderItem } from './reminders/presentation/components/ReminderItem';
110
+ export type { ReminderItemProps, ReminderItemTranslations } from './reminders/presentation/components/ReminderItem';
111
111
 
112
- export { ReminderForm } from './domains/reminders/presentation/components/ReminderForm';
113
- export type { ReminderFormProps, ReminderFormTranslations } from './domains/reminders/presentation/components/ReminderForm';
112
+ export { ReminderForm } from './reminders/presentation/components/ReminderForm';
113
+ export type { ReminderFormProps, ReminderFormTranslations } from './reminders/presentation/components/ReminderForm';
114
114
 
115
- export { FormButton } from './domains/reminders/presentation/components/FormButton';
116
- export type { FormButtonProps } from './domains/reminders/presentation/components/FormButton';
115
+ export { FormButton } from './reminders/presentation/components/FormButton';
116
+ export type { FormButtonProps } from './reminders/presentation/components/FormButton';
117
117
 
118
- export { QuietHoursCard } from './domains/quietHours/presentation/components/QuietHoursCard';
119
- export type { QuietHoursCardProps } from './domains/quietHours/presentation/components/QuietHoursCard';
118
+ export { QuietHoursCard } from './quietHours/presentation/components/QuietHoursCard';
119
+ export type { QuietHoursCardProps } from './quietHours/presentation/components/QuietHoursCard';
120
120
 
121
121
  export { RemindersNavRow } from './presentation/components/RemindersNavRow';
122
122
  export type { RemindersNavRowProps } from './presentation/components/RemindersNavRow';
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { useEffect, useCallback } from 'react';
7
- import { useNotificationPreferences, useQuietHours, usePreferencesStore, useRemindersLoading } from '../../domains/reminders/infrastructure/storage/RemindersStore';
7
+ import { useNotificationPreferences, useQuietHours, usePreferencesStore, useRemindersLoading } from '../../reminders/infrastructure/storage/RemindersStore';
8
8
  import { notificationService } from '../../infrastructure/services/NotificationService';
9
9
 
10
10
  export const useNotificationSettingsUI = () => {
@@ -6,13 +6,13 @@
6
6
  import React from 'react';
7
7
  import { View } from 'react-native';
8
8
  import { AtomicCard, ScreenLayout, AtomicSpinner } from '@umituz/react-native-design-system';
9
- import { QuietHoursCard } from '../../domains/quietHours/presentation/components/QuietHoursCard';
9
+ import { QuietHoursCard } from '../../quietHours/presentation/components/QuietHoursCard';
10
10
  import { SettingRow } from '../components/SettingRow';
11
11
  import { RemindersNavRow } from '../components/RemindersNavRow';
12
12
  import { useNotificationSettingsUI } from '../hooks/useNotificationSettingsUI';
13
13
  import { useTimePicker } from '../hooks/useTimePicker';
14
- import { useReminders } from '../../domains/reminders/infrastructure/storage/RemindersStore';
15
- import { useQuietHoursActions } from '../../domains/quietHours/infrastructure/hooks/useQuietHoursActions';
14
+ import { useReminders } from '../../reminders/infrastructure/storage/RemindersStore';
15
+ import { useQuietHoursActions } from '../../quietHours/infrastructure/hooks/useQuietHoursActions';
16
16
  import type { NotificationSettingsTranslations, QuietHoursTranslations } from '../../infrastructure/services/types';
17
17
  import { createStyles } from './NotificationSettingsScreen.styles';
18
18
  import { useAppDesignTokens } from '@umituz/react-native-design-system';
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { useCallback } from 'react';
7
7
  import { usePreferencesStore, useQuietHours } from '../../../reminders/infrastructure/storage/RemindersStore';
8
- import type { QuietHoursConfig } from '../../../../infrastructure/services/types';
8
+ import type { QuietHoursConfig } from '../../../infrastructure/services/types';
9
9
 
10
10
  export const useQuietHoursActions = () => {
11
11
  const quietHours = useQuietHours();
@@ -8,8 +8,8 @@ import { View, TouchableOpacity, StyleSheet } from 'react-native';
8
8
  import { AtomicText, AtomicIcon, AtomicCard } from '@umituz/react-native-design-system';
9
9
  import { Switch } from 'react-native';
10
10
  import { useAppDesignTokens } from '@umituz/react-native-design-system';
11
- import { SettingRow } from '../../../../presentation/components/SettingRow';
12
- import type { QuietHoursConfig, QuietHoursTranslations } from '../../../../infrastructure/services/types';
11
+ import { SettingRow } from '../../../presentation/components/SettingRow';
12
+ import type { QuietHoursConfig, QuietHoursTranslations } from '../../../infrastructure/services/types';
13
13
 
14
14
  export interface QuietHoursCardProps {
15
15
  config: QuietHoursConfig;
@@ -3,7 +3,7 @@
3
3
  * Default time presets and frequency options for reminders
4
4
  */
5
5
 
6
- import type { TimePreset, ReminderFrequency } from '../../../../infrastructure/services/types';
6
+ import type { TimePreset, ReminderFrequency } from '../../../infrastructure/services/types';
7
7
 
8
8
  // ============================================================================
9
9
  // DEFAULT TIME PRESETS
@@ -5,10 +5,10 @@
5
5
 
6
6
  import { useCallback } from 'react';
7
7
  import { useRemindersStore } from '../storage/RemindersStore';
8
- import { NotificationScheduler } from '../../../../infrastructure/services/NotificationScheduler';
9
- import { generateReminderId } from '../../../../infrastructure/utils/idGenerator';
10
- import { buildTrigger } from '../../../../infrastructure/utils/triggerBuilder';
11
- import type { Reminder, CreateReminderInput, UpdateReminderInput } from '../../../../infrastructure/services/types';
8
+ import { NotificationScheduler } from '../../../infrastructure/services/NotificationScheduler';
9
+ import { generateReminderId } from '../../../infrastructure/utils/idGenerator';
10
+ import { buildTrigger } from '../../../infrastructure/utils/triggerBuilder';
11
+ import type { Reminder, CreateReminderInput, UpdateReminderInput } from '../../../infrastructure/services/types';
12
12
 
13
13
  const scheduler = new NotificationScheduler();
14
14
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { createStore } from '@umituz/react-native-storage';
7
- import type { Reminder, QuietHoursConfig, NotificationPreferences } from '../../../../infrastructure/services/types';
7
+ import type { Reminder, QuietHoursConfig, NotificationPreferences } from '../../../infrastructure/services/types';
8
8
 
9
9
  // ============================================================================
10
10
  // REMINDERS STORE
@@ -7,7 +7,7 @@ import React, { useMemo } from 'react';
7
7
  import { View, TouchableOpacity, StyleSheet } from 'react-native';
8
8
  import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
9
9
  import { useAppDesignTokens } from '@umituz/react-native-design-system';
10
- import type { ReminderFrequency } from '../../../../infrastructure/services/types';
10
+ import type { ReminderFrequency } from '../../../infrastructure/services/types';
11
11
  import type { FrequencyOption } from '../../infrastructure/config/reminderPresets';
12
12
 
13
13
  export interface FrequencySelectorProps {
@@ -12,7 +12,7 @@ import { FrequencySelector } from './FrequencySelector';
12
12
  import { WeekdaySelector } from './WeekdaySelector';
13
13
  import { FormButton } from './FormButton';
14
14
  import { DEFAULT_TIME_PRESETS, FREQUENCY_OPTIONS } from '../../infrastructure/config/reminderPresets';
15
- import type { Reminder, ReminderFrequency, CreateReminderInput, TimePreset } from '../../../../infrastructure/services/types';
15
+ import type { Reminder, ReminderFrequency, CreateReminderInput, TimePreset } from '../../../infrastructure/services/types';
16
16
 
17
17
  export interface ReminderFormTranslations {
18
18
  titleLabel: string;
@@ -8,7 +8,7 @@ import { View, TouchableOpacity, StyleSheet } from 'react-native';
8
8
  import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
9
9
  import { Switch } from 'react-native';
10
10
  import { useAppDesignTokens } from '@umituz/react-native-design-system';
11
- import type { Reminder, ReminderFrequency } from '../../../../infrastructure/services/types';
11
+ import type { Reminder, ReminderFrequency } from '../../../infrastructure/services/types';
12
12
 
13
13
  export interface ReminderItemTranslations {
14
14
  frequencyOnce: string;
@@ -7,7 +7,7 @@ import React, { useMemo } from 'react';
7
7
  import { View, TouchableOpacity, StyleSheet } from 'react-native';
8
8
  import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
9
9
  import { useAppDesignTokens } from '@umituz/react-native-design-system';
10
- import type { TimePreset } from '../../../../infrastructure/services/types';
10
+ import type { TimePreset } from '../../../infrastructure/services/types';
11
11
 
12
12
  export interface TimePresetSelectorProps {
13
13
  presets: TimePreset[];
@@ -10,7 +10,7 @@ import { useAppDesignTokens } from '@umituz/react-native-design-system';
10
10
  import { ReminderItem } from '../components/ReminderItem';
11
11
  import { useRemindersStore, useReminders, useRemindersLoading } from '../../infrastructure/storage/RemindersStore';
12
12
  import { useReminderActions } from '../../infrastructure/hooks/useReminderActions';
13
- import type { Reminder, ReminderTranslations } from '../../../../infrastructure/services/types';
13
+ import type { Reminder, ReminderTranslations } from '../../../infrastructure/services/types';
14
14
 
15
15
  export interface ReminderListScreenProps {
16
16
  translations: ReminderTranslations;
package/src/index.ts CHANGED
@@ -129,7 +129,7 @@ export * from "./domains/gamification";
129
129
  // =============================================================================
130
130
 
131
131
  // Notifications Domain
132
- export * from "./notifications";
132
+ export * from "./domains/notifications";
133
133
 
134
134
  export {
135
135
  createAppearanceConfig,