@umituz/react-native-settings 2.4.1 → 3.0.1
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 +5 -13
- package/src/presentation/components/CloudSyncSetting.tsx +2 -2
- package/src/presentation/components/SettingItem.tsx +4 -4
- package/src/presentation/components/StorageClearSetting.tsx +2 -2
- package/src/presentation/components/UserProfileHeader.tsx +3 -3
- package/src/presentation/screens/components/AboutLegalSection.tsx +3 -3
- package/src/presentation/screens/components/AppearanceSection.tsx +2 -2
- package/src/presentation/screens/components/LanguageSection.tsx +2 -2
- package/src/presentation/screens/components/NotificationsSection.tsx +3 -3
- package/lib/__tests__/setup.d.ts +0 -5
- package/lib/__tests__/setup.d.ts.map +0 -1
- package/lib/__tests__/setup.js +0 -143
- package/lib/__tests__/setup.js.map +0 -1
- package/lib/domain/repositories/ISettingsRepository.d.ts +0 -51
- package/lib/domain/repositories/ISettingsRepository.d.ts.map +0 -1
- package/lib/domain/repositories/ISettingsRepository.js +0 -8
- package/lib/domain/repositories/ISettingsRepository.js.map +0 -1
- package/lib/index.d.ts +0 -35
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -32
- package/lib/index.js.map +0 -1
- package/lib/infrastructure/storage/SettingsStore.d.ts +0 -36
- package/lib/infrastructure/storage/SettingsStore.d.ts.map +0 -1
- package/lib/infrastructure/storage/SettingsStore.js +0 -144
- package/lib/infrastructure/storage/SettingsStore.js.map +0 -1
- package/lib/presentation/components/CloudSyncSetting.d.ts +0 -16
- package/lib/presentation/components/CloudSyncSetting.d.ts.map +0 -1
- package/lib/presentation/components/CloudSyncSetting.js +0 -30
- package/lib/presentation/components/CloudSyncSetting.js.map +0 -1
- package/lib/presentation/components/DisclaimerCard.d.ts +0 -15
- package/lib/presentation/components/DisclaimerCard.d.ts.map +0 -1
- package/lib/presentation/components/DisclaimerCard.js +0 -73
- package/lib/presentation/components/DisclaimerCard.js.map +0 -1
- package/lib/presentation/components/DisclaimerModal.d.ts +0 -13
- package/lib/presentation/components/DisclaimerModal.d.ts.map +0 -1
- package/lib/presentation/components/DisclaimerModal.js +0 -62
- package/lib/presentation/components/DisclaimerModal.js.map +0 -1
- package/lib/presentation/components/DisclaimerSetting.d.ts +0 -39
- package/lib/presentation/components/DisclaimerSetting.d.ts.map +0 -1
- package/lib/presentation/components/DisclaimerSetting.js +0 -59
- package/lib/presentation/components/DisclaimerSetting.js.map +0 -1
- package/lib/presentation/components/SettingItem.d.ts +0 -45
- package/lib/presentation/components/SettingItem.d.ts.map +0 -1
- package/lib/presentation/components/SettingItem.js +0 -113
- package/lib/presentation/components/SettingItem.js.map +0 -1
- package/lib/presentation/components/SettingsErrorBoundary.d.ts +0 -23
- package/lib/presentation/components/SettingsErrorBoundary.d.ts.map +0 -1
- package/lib/presentation/components/SettingsErrorBoundary.js +0 -73
- package/lib/presentation/components/SettingsErrorBoundary.js.map +0 -1
- package/lib/presentation/components/SettingsFooter.d.ts +0 -11
- package/lib/presentation/components/SettingsFooter.d.ts.map +0 -1
- package/lib/presentation/components/SettingsFooter.js +0 -31
- package/lib/presentation/components/SettingsFooter.js.map +0 -1
- package/lib/presentation/components/SettingsSection.d.ts +0 -13
- package/lib/presentation/components/SettingsSection.d.ts.map +0 -1
- package/lib/presentation/components/SettingsSection.js +0 -37
- package/lib/presentation/components/SettingsSection.js.map +0 -1
- package/lib/presentation/components/StorageClearSetting.d.ts +0 -16
- package/lib/presentation/components/StorageClearSetting.d.ts.map +0 -1
- package/lib/presentation/components/StorageClearSetting.js +0 -21
- package/lib/presentation/components/StorageClearSetting.js.map +0 -1
- package/lib/presentation/components/UserProfileHeader.d.ts +0 -30
- package/lib/presentation/components/UserProfileHeader.d.ts.map +0 -1
- package/lib/presentation/components/UserProfileHeader.js +0 -119
- package/lib/presentation/components/UserProfileHeader.js.map +0 -1
- package/lib/presentation/screens/AppearanceScreen.d.ts +0 -8
- package/lib/presentation/screens/AppearanceScreen.d.ts.map +0 -1
- package/lib/presentation/screens/AppearanceScreen.js +0 -8
- package/lib/presentation/screens/AppearanceScreen.js.map +0 -1
- package/lib/presentation/screens/SettingsScreen.d.ts +0 -38
- package/lib/presentation/screens/SettingsScreen.d.ts.map +0 -1
- package/lib/presentation/screens/SettingsScreen.js +0 -37
- package/lib/presentation/screens/SettingsScreen.js.map +0 -1
- package/lib/presentation/screens/components/AboutLegalSection.d.ts +0 -15
- package/lib/presentation/screens/components/AboutLegalSection.d.ts.map +0 -1
- package/lib/presentation/screens/components/AboutLegalSection.js +0 -28
- package/lib/presentation/screens/components/AboutLegalSection.js.map +0 -1
- package/lib/presentation/screens/components/AppearanceSection.d.ts +0 -12
- package/lib/presentation/screens/components/AppearanceSection.d.ts.map +0 -1
- package/lib/presentation/screens/components/AppearanceSection.js +0 -21
- package/lib/presentation/screens/components/AppearanceSection.js.map +0 -1
- package/lib/presentation/screens/components/LanguageSection.d.ts +0 -12
- package/lib/presentation/screens/components/LanguageSection.d.ts.map +0 -1
- package/lib/presentation/screens/components/LanguageSection.js +0 -26
- package/lib/presentation/screens/components/LanguageSection.js.map +0 -1
- package/lib/presentation/screens/components/NotificationsSection.d.ts +0 -12
- package/lib/presentation/screens/components/NotificationsSection.d.ts.map +0 -1
- package/lib/presentation/screens/components/NotificationsSection.js +0 -58
- package/lib/presentation/screens/components/NotificationsSection.js.map +0 -1
- package/lib/presentation/screens/components/SettingsContent.d.ts +0 -36
- package/lib/presentation/screens/components/SettingsContent.d.ts.map +0 -1
- package/lib/presentation/screens/components/SettingsContent.js +0 -81
- package/lib/presentation/screens/components/SettingsContent.js.map +0 -1
- package/lib/presentation/screens/components/SettingsHeader.d.ts +0 -12
- package/lib/presentation/screens/components/SettingsHeader.d.ts.map +0 -1
- package/lib/presentation/screens/components/SettingsHeader.js +0 -59
- package/lib/presentation/screens/components/SettingsHeader.js.map +0 -1
- package/lib/presentation/screens/components/index.d.ts +0 -9
- package/lib/presentation/screens/components/index.d.ts.map +0 -1
- package/lib/presentation/screens/components/index.js +0 -9
- package/lib/presentation/screens/components/index.js.map +0 -1
- package/lib/presentation/screens/hooks/useFeatureDetection.d.ts +0 -21
- package/lib/presentation/screens/hooks/useFeatureDetection.d.ts.map +0 -1
- package/lib/presentation/screens/hooks/useFeatureDetection.js +0 -82
- package/lib/presentation/screens/hooks/useFeatureDetection.js.map +0 -1
- package/lib/presentation/screens/types/CustomSection.d.ts +0 -19
- package/lib/presentation/screens/types/CustomSection.d.ts.map +0 -1
- package/lib/presentation/screens/types/CustomSection.js +0 -6
- package/lib/presentation/screens/types/CustomSection.js.map +0 -1
- package/lib/presentation/screens/types/ExtendedConfig.d.ts +0 -68
- package/lib/presentation/screens/types/ExtendedConfig.d.ts.map +0 -1
- package/lib/presentation/screens/types/ExtendedConfig.js +0 -6
- package/lib/presentation/screens/types/ExtendedConfig.js.map +0 -1
- package/lib/presentation/screens/types/FeatureConfig.d.ts +0 -95
- package/lib/presentation/screens/types/FeatureConfig.d.ts.map +0 -1
- package/lib/presentation/screens/types/FeatureConfig.js +0 -6
- package/lib/presentation/screens/types/FeatureConfig.js.map +0 -1
- package/lib/presentation/screens/types/SettingsConfig.d.ts +0 -97
- package/lib/presentation/screens/types/SettingsConfig.d.ts.map +0 -1
- package/lib/presentation/screens/types/SettingsConfig.js +0 -6
- package/lib/presentation/screens/types/SettingsConfig.js.map +0 -1
- package/lib/presentation/screens/types/index.d.ts +0 -10
- package/lib/presentation/screens/types/index.d.ts.map +0 -1
- package/lib/presentation/screens/types/index.js +0 -6
- package/lib/presentation/screens/types/index.js.map +0 -1
- package/lib/presentation/screens/utils/normalizeConfig.d.ts +0 -44
- package/lib/presentation/screens/utils/normalizeConfig.d.ts.map +0 -1
- package/lib/presentation/screens/utils/normalizeConfig.js +0 -38
- package/lib/presentation/screens/utils/normalizeConfig.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Settings management for React Native apps - user preferences, theme, language, notifications",
|
|
5
|
-
"main": "./
|
|
6
|
-
"types": "./
|
|
5
|
+
"main": "./src/index.ts",
|
|
6
|
+
"types": "./src/index.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "tsc --skipLibCheck",
|
|
9
8
|
"typecheck": "tsc --noEmit",
|
|
10
9
|
"lint": "tsc --noEmit",
|
|
11
|
-
"test": "jest",
|
|
12
|
-
"test:watch": "jest --watch",
|
|
13
|
-
"test:coverage": "jest --coverage",
|
|
14
|
-
"prepublishOnly": "npm run build",
|
|
15
10
|
"version:minor": "npm version minor -m 'chore: release v%s'",
|
|
16
11
|
"version:major": "npm version major -m 'chore: release v%s'"
|
|
17
12
|
},
|
|
@@ -42,8 +37,8 @@
|
|
|
42
37
|
"@umituz/react-native-design-system-typography": "latest",
|
|
43
38
|
"@umituz/react-native-localization": "latest",
|
|
44
39
|
"@umituz/react-native-storage": "latest",
|
|
40
|
+
"@expo/vector-icons": ">=14.0.0",
|
|
45
41
|
"expo-linear-gradient": "^15.0.7",
|
|
46
|
-
"lucide-react-native": "^0.468.0",
|
|
47
42
|
"react": ">=18.2.0",
|
|
48
43
|
"react-native": ">=0.74.0",
|
|
49
44
|
"react-native-safe-area-context": "~5.6.0",
|
|
@@ -73,8 +68,6 @@
|
|
|
73
68
|
"@umituz/react-native-notifications": "latest",
|
|
74
69
|
"@umituz/react-native-storage": "latest",
|
|
75
70
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
76
|
-
"jest": "^29.7.0",
|
|
77
|
-
"lucide-react-native": "^0.468.0",
|
|
78
71
|
"metro-react-native-babel-preset": "^0.77.0",
|
|
79
72
|
"react": "^18.2.0",
|
|
80
73
|
"react-native": "^0.74.0",
|
|
@@ -86,9 +79,8 @@
|
|
|
86
79
|
"access": "public"
|
|
87
80
|
},
|
|
88
81
|
"files": [
|
|
89
|
-
"lib",
|
|
90
82
|
"src",
|
|
91
83
|
"README.md",
|
|
92
84
|
"LICENSE"
|
|
93
85
|
]
|
|
94
|
-
}
|
|
86
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React, { useCallback } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { Feather } from "@expo/vector-icons";
|
|
8
8
|
import { SettingItem } from "./SettingItem";
|
|
9
9
|
import type { SettingItemProps } from "./SettingItem";
|
|
10
10
|
|
|
@@ -46,7 +46,7 @@ export const CloudSyncSetting: React.FC<CloudSyncSettingProps> = ({
|
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
48
|
<SettingItem
|
|
49
|
-
icon={
|
|
49
|
+
icon={(props) => <Feather name={"cloud" as any} {...props} />}
|
|
50
50
|
title={title || "cloud_sync"}
|
|
51
51
|
value={displayDescription}
|
|
52
52
|
onPress={onPress}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View, Text, Pressable, StyleSheet, Switch } from "react-native";
|
|
9
|
-
import {
|
|
9
|
+
import { Feather } from "@expo/vector-icons";
|
|
10
10
|
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
11
11
|
|
|
12
12
|
export interface SettingItemProps {
|
|
13
|
-
/** Icon component from
|
|
14
|
-
icon:
|
|
13
|
+
/** Icon component from @expo/vector-icons */
|
|
14
|
+
icon: React.ComponentType<{ size?: number; color?: string; name?: string }>;
|
|
15
15
|
/** Main title text */
|
|
16
16
|
title: string;
|
|
17
17
|
/** Optional description/value text */
|
|
@@ -130,7 +130,7 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
130
130
|
ios_backgroundColor={`${colors.textSecondary}30`}
|
|
131
131
|
/>
|
|
132
132
|
) : (
|
|
133
|
-
<
|
|
133
|
+
<Feather name="chevron-right" size={20} color={colors.textSecondary} />
|
|
134
134
|
)}
|
|
135
135
|
</View>
|
|
136
136
|
</Pressable>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
|
-
import {
|
|
8
|
+
import { Feather } from "@expo/vector-icons";
|
|
9
9
|
import { SettingItem } from "./SettingItem";
|
|
10
10
|
|
|
11
11
|
export interface StorageClearSettingProps {
|
|
@@ -37,7 +37,7 @@ export const StorageClearSetting: React.FC<StorageClearSettingProps> = ({
|
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<SettingItem
|
|
40
|
-
icon={
|
|
40
|
+
icon={(props) => <Feather name={"trash-2" as any} {...props} />}
|
|
41
41
|
title={defaultTitle}
|
|
42
42
|
value={defaultDescription}
|
|
43
43
|
onPress={onPress}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React, { useState, useCallback } from "react";
|
|
8
8
|
import { View, TouchableOpacity, StyleSheet, Image } from "react-native";
|
|
9
|
-
import {
|
|
9
|
+
import { Feather } from "@expo/vector-icons";
|
|
10
10
|
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
11
11
|
import { AtomicText } from "@umituz/react-native-design-system-atoms";
|
|
12
12
|
import { useNavigation } from "@react-navigation/native";
|
|
@@ -54,7 +54,7 @@ export const UserProfileHeader: React.FC<UserProfileHeaderProps> = ({
|
|
|
54
54
|
|
|
55
55
|
const finalDisplayName = displayName || (isGuest ? guestDisplayName || defaultGuestDisplayName || "Guest" : defaultUserDisplayName || "User");
|
|
56
56
|
const avatarName = isGuest ? guestDisplayName || defaultGuestDisplayName || defaultGuestDisplayName || "Guest" : finalDisplayName;
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
const defaultAvatarService = avatarServiceUrl || "https://ui-avatars.com/api";
|
|
59
59
|
const finalAvatarUrl =
|
|
60
60
|
(imageError ? null : avatarUrl) ||
|
|
@@ -115,7 +115,7 @@ export const UserProfileHeader: React.FC<UserProfileHeaderProps> = ({
|
|
|
115
115
|
</View>
|
|
116
116
|
{shouldShowChevron && (
|
|
117
117
|
<View style={[styles.chevronContainer, { marginLeft: spacing.sm }]}>
|
|
118
|
-
<
|
|
118
|
+
<Feather name="chevron-right" size={22} color={colors.textSecondary} />
|
|
119
119
|
</View>
|
|
120
120
|
)}
|
|
121
121
|
</>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { Feather } from "@expo/vector-icons";
|
|
8
8
|
import { useNavigation } from "@react-navigation/native";
|
|
9
9
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
10
10
|
import type { NavigationProp } from "@react-navigation/native";
|
|
@@ -54,7 +54,7 @@ export const AboutLegalSection: React.FC<AboutLegalSectionProps> = ({
|
|
|
54
54
|
<SettingsSection title={t("settings.sections.about")}>
|
|
55
55
|
{showAbout && (
|
|
56
56
|
<SettingItem
|
|
57
|
-
icon={
|
|
57
|
+
icon={(props) => <Feather name={"info" as any} {...props} />}
|
|
58
58
|
title={aboutTitle}
|
|
59
59
|
value={aboutDescription}
|
|
60
60
|
onPress={() => navigation.navigate(aboutRoute as string)}
|
|
@@ -62,7 +62,7 @@ export const AboutLegalSection: React.FC<AboutLegalSectionProps> = ({
|
|
|
62
62
|
)}
|
|
63
63
|
{showLegal && (
|
|
64
64
|
<SettingItem
|
|
65
|
-
icon={
|
|
65
|
+
icon={(props) => <Feather name={"file-text" as any} {...props} />}
|
|
66
66
|
title={legalTitle}
|
|
67
67
|
value={legalDescription}
|
|
68
68
|
onPress={() => navigation.navigate(legalRoute as string)}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { Feather } from "@expo/vector-icons";
|
|
8
8
|
import { useNavigation } from "@react-navigation/native";
|
|
9
9
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
10
10
|
import { SettingItem } from "../../components/SettingItem";
|
|
@@ -28,7 +28,7 @@ export const AppearanceSection: React.FC<AppearanceSectionProps> = ({
|
|
|
28
28
|
return (
|
|
29
29
|
<SettingsSection title={t("settings.sections.app.title")}>
|
|
30
30
|
<SettingItem
|
|
31
|
-
icon={
|
|
31
|
+
icon={(props) => <Feather name={"droplet" as any} {...props} />}
|
|
32
32
|
title={title}
|
|
33
33
|
value={description}
|
|
34
34
|
onPress={() => navigation.navigate(route as never)}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { Feather } from "@expo/vector-icons";
|
|
8
8
|
import { useNavigation } from "@react-navigation/native";
|
|
9
9
|
import { useLocalization, getLanguageByCode } from "@umituz/react-native-localization";
|
|
10
10
|
import { SettingItem } from "../../components/SettingItem";
|
|
@@ -34,7 +34,7 @@ export const LanguageSection: React.FC<LanguageSectionProps> = ({
|
|
|
34
34
|
return (
|
|
35
35
|
<SettingsSection title={t("settings.sections.app.title")}>
|
|
36
36
|
<SettingItem
|
|
37
|
-
icon={
|
|
37
|
+
icon={(props) => <Feather name={"globe" as any} {...props} />}
|
|
38
38
|
title={title}
|
|
39
39
|
value={languageDisplay}
|
|
40
40
|
onPress={() => navigation.navigate(route as never)}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React, { useState, useEffect, useCallback } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { Feather } from "@expo/vector-icons";
|
|
8
8
|
import { useNavigation } from "@react-navigation/native";
|
|
9
9
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
10
10
|
import { SettingItem } from "../../components/SettingItem";
|
|
@@ -75,7 +75,7 @@ export const NotificationsSection: React.FC<NotificationsSectionProps> = ({
|
|
|
75
75
|
<SettingsSection title={t("settings.sections.general")}>
|
|
76
76
|
{showToggle ? (
|
|
77
77
|
<SettingItem
|
|
78
|
-
icon={
|
|
78
|
+
icon={(props) => <Feather name={"bell" as any} {...props} />}
|
|
79
79
|
title={title}
|
|
80
80
|
showSwitch={true}
|
|
81
81
|
switchValue={notificationsEnabled}
|
|
@@ -84,7 +84,7 @@ export const NotificationsSection: React.FC<NotificationsSectionProps> = ({
|
|
|
84
84
|
/>
|
|
85
85
|
) : (
|
|
86
86
|
<SettingItem
|
|
87
|
-
icon={
|
|
87
|
+
icon={(props) => <Feather name={"bell" as any} {...props} />}
|
|
88
88
|
title={title}
|
|
89
89
|
value={description}
|
|
90
90
|
onPress={handlePress}
|
package/lib/__tests__/setup.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/__tests__/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/lib/__tests__/setup.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Jest Test Setup
|
|
3
|
-
* Mock all external dependencies
|
|
4
|
-
*/
|
|
5
|
-
// Mock React Native modules
|
|
6
|
-
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
|
|
7
|
-
// Mock design system packages
|
|
8
|
-
jest.mock('@umituz/react-native-design-system-theme', () => ({
|
|
9
|
-
useDesignSystemTheme: () => ({
|
|
10
|
-
themeMode: 'light',
|
|
11
|
-
}),
|
|
12
|
-
useAppDesignTokens: () => ({
|
|
13
|
-
colors: {
|
|
14
|
-
backgroundPrimary: '#ffffff',
|
|
15
|
-
primary: '#007AFF',
|
|
16
|
-
textPrimary: '#000000',
|
|
17
|
-
textSecondary: '#666666',
|
|
18
|
-
surface: '#f5f5f5',
|
|
19
|
-
borderLight: '#e0e0e0',
|
|
20
|
-
warning: '#FF9800',
|
|
21
|
-
},
|
|
22
|
-
spacing: {
|
|
23
|
-
md: 16,
|
|
24
|
-
},
|
|
25
|
-
typography: {
|
|
26
|
-
labelLarge: {
|
|
27
|
-
fontWeight: '500',
|
|
28
|
-
fontSize: 14,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
}),
|
|
32
|
-
withAlpha: jest.fn((color, alpha) => `${color}${alpha}`),
|
|
33
|
-
}));
|
|
34
|
-
jest.mock('@umituz/react-native-design-system-atoms', () => ({
|
|
35
|
-
AtomicText: ({ children, type, color, style, testID }) => {
|
|
36
|
-
const React = require('react');
|
|
37
|
-
const { Text } = require('react-native');
|
|
38
|
-
return React.createElement(Text, {
|
|
39
|
-
style,
|
|
40
|
-
testID: testID || `atomic-text-${type}-${color}`
|
|
41
|
-
}, children);
|
|
42
|
-
},
|
|
43
|
-
AtomicIcon: ({ name, color, size, style, testID }) => {
|
|
44
|
-
const React = require('react');
|
|
45
|
-
const { Text } = require('react-native');
|
|
46
|
-
return React.createElement(Text, {
|
|
47
|
-
style,
|
|
48
|
-
testID: testID || `atomic-icon-${name}-${color}-${size}`
|
|
49
|
-
}, `Icon: ${name}`);
|
|
50
|
-
},
|
|
51
|
-
}));
|
|
52
|
-
// Mock localization
|
|
53
|
-
jest.mock('@umituz/react-native-localization', () => ({
|
|
54
|
-
useLocalization: () => ({
|
|
55
|
-
t: (key) => key,
|
|
56
|
-
changeLanguage: jest.fn(),
|
|
57
|
-
currentLanguage: 'en-US',
|
|
58
|
-
}),
|
|
59
|
-
}));
|
|
60
|
-
// Mock storage
|
|
61
|
-
jest.mock('@umituz/react-native-storage', () => ({
|
|
62
|
-
storageRepository: {
|
|
63
|
-
getItem: jest.fn(),
|
|
64
|
-
setItem: jest.fn(),
|
|
65
|
-
removeItem: jest.fn(),
|
|
66
|
-
clear: jest.fn(),
|
|
67
|
-
},
|
|
68
|
-
StorageKey: {
|
|
69
|
-
SETTINGS: 'settings',
|
|
70
|
-
},
|
|
71
|
-
createUserKey: (key, userId) => `${key}_${userId}`,
|
|
72
|
-
unwrap: (result, defaultValue) => result.success ? result.data : defaultValue,
|
|
73
|
-
}));
|
|
74
|
-
// Mock lucide-react-native
|
|
75
|
-
jest.mock('lucide-react-native', () => ({
|
|
76
|
-
Cloud: 'Cloud',
|
|
77
|
-
Bell: 'Bell',
|
|
78
|
-
Palette: 'Palette',
|
|
79
|
-
ChevronRight: 'ChevronRight',
|
|
80
|
-
AlertTriangle: 'AlertTriangle',
|
|
81
|
-
Info: 'Info',
|
|
82
|
-
X: 'X',
|
|
83
|
-
ArrowRight: 'ArrowRight',
|
|
84
|
-
Settings: 'Settings',
|
|
85
|
-
}));
|
|
86
|
-
// Mock navigation
|
|
87
|
-
jest.mock('@react-navigation/native', () => ({
|
|
88
|
-
useNavigation: () => ({
|
|
89
|
-
navigate: jest.fn(),
|
|
90
|
-
goBack: jest.fn(),
|
|
91
|
-
getState: jest.fn(() => ({
|
|
92
|
-
routes: [{ name: 'Settings' }],
|
|
93
|
-
})),
|
|
94
|
-
setOptions: jest.fn(),
|
|
95
|
-
isFocused: jest.fn(() => true),
|
|
96
|
-
addListener: jest.fn(() => jest.fn()),
|
|
97
|
-
removeListener: jest.fn(),
|
|
98
|
-
}),
|
|
99
|
-
useFocusEffect: jest.fn(),
|
|
100
|
-
useIsFocused: jest.fn(() => true),
|
|
101
|
-
NavigationContainer: ({ children }) => children,
|
|
102
|
-
}));
|
|
103
|
-
// Mock safe area context
|
|
104
|
-
jest.mock('react-native-safe-area-context', () => ({
|
|
105
|
-
SafeAreaProvider: ({ children }) => children,
|
|
106
|
-
SafeAreaView: ({ children }) => children,
|
|
107
|
-
useSafeAreaInsets: () => ({
|
|
108
|
-
top: 0,
|
|
109
|
-
bottom: 0,
|
|
110
|
-
left: 0,
|
|
111
|
-
right: 0,
|
|
112
|
-
}),
|
|
113
|
-
}));
|
|
114
|
-
// Mock linear gradient
|
|
115
|
-
jest.mock('expo-linear-gradient', () => ({
|
|
116
|
-
LinearGradient: ({ children }) => children,
|
|
117
|
-
}));
|
|
118
|
-
// Mock notification service
|
|
119
|
-
jest.mock('@umituz/react-native-notifications', () => ({
|
|
120
|
-
notificationService: {
|
|
121
|
-
hasPermissions: jest.fn(() => Promise.resolve(true)),
|
|
122
|
-
requestPermissions: jest.fn(() => Promise.resolve()),
|
|
123
|
-
},
|
|
124
|
-
}));
|
|
125
|
-
// Mock appearance
|
|
126
|
-
jest.mock('@umituz/react-native-appearance', () => ({
|
|
127
|
-
useAppearance: () => ({
|
|
128
|
-
colorScheme: 'light',
|
|
129
|
-
setColorScheme: jest.fn(),
|
|
130
|
-
}),
|
|
131
|
-
}));
|
|
132
|
-
// Mock console methods in tests
|
|
133
|
-
global.console = {
|
|
134
|
-
...console,
|
|
135
|
-
warn: jest.fn(),
|
|
136
|
-
error: jest.fn(),
|
|
137
|
-
};
|
|
138
|
-
// Set up __DEV__ mock
|
|
139
|
-
Object.defineProperty(global, '__DEV__', {
|
|
140
|
-
value: true,
|
|
141
|
-
writable: true,
|
|
142
|
-
});
|
|
143
|
-
//# sourceMappingURL=setup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/__tests__/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4BAA4B;AAC5B,IAAI,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;AAElE,8BAA8B;AAC9B,IAAI,CAAC,IAAI,CAAC,0CAA0C,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3D,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,EAAE,OAAO;KACnB,CAAC;IACF,kBAAkB,EAAE,GAAG,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE;YACN,iBAAiB,EAAE,SAAS;YAC5B,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,SAAS;YACtB,aAAa,EAAE,SAAS;YACxB,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,SAAS;YACtB,OAAO,EAAE,SAAS;SACnB;QACD,OAAO,EAAE;YACP,EAAE,EAAE,EAAE;SACP;QACD,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CA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,CAAC,CAAC;IACrD,mBAAmB,EAAE;QACnB,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACpD,kBAAkB,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;KACrD;CACF,CAAC,CAAC,CAAC;AAEJ,kBAAkB;AAClB,IAAI,CAAC,IAAI,CAAC,iCAAiC,EAAE,GAAG,EAAE,CAAC,CAAC;IAClD,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;QACpB,WAAW,EAAE,OAAO;QACpB,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;KAC1B,CAAC;CACH,CAAC,CAAC,CAAC;AAEJ,gCAAgC;AAChC,MAAM,CAAC,OAAO,GAAG;IACf,GAAG,OAAO;IACV,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;IACf,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;CACjB,CAAC;AAEF,sBAAsB;AACtB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE;IACvC,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Settings Repository Interface
|
|
3
|
-
*
|
|
4
|
-
* Defines contracts for settings persistence and retrieval
|
|
5
|
-
* Pure business logic - no dependencies on external frameworks
|
|
6
|
-
*/
|
|
7
|
-
export interface UserSettings {
|
|
8
|
-
userId: string;
|
|
9
|
-
theme: 'light' | 'dark' | 'auto';
|
|
10
|
-
language: string;
|
|
11
|
-
notificationsEnabled: boolean;
|
|
12
|
-
emailNotifications: boolean;
|
|
13
|
-
pushNotifications: boolean;
|
|
14
|
-
soundEnabled: boolean;
|
|
15
|
-
vibrationEnabled: boolean;
|
|
16
|
-
privacyMode: boolean;
|
|
17
|
-
updatedAt: Date;
|
|
18
|
-
}
|
|
19
|
-
export interface SettingsError extends Error {
|
|
20
|
-
code: 'LOAD_FAILED' | 'SAVE_FAILED' | 'NOT_FOUND' | 'INVALID_DATA';
|
|
21
|
-
}
|
|
22
|
-
export type SettingsResult<T> = {
|
|
23
|
-
success: true;
|
|
24
|
-
data: T;
|
|
25
|
-
} | {
|
|
26
|
-
success: false;
|
|
27
|
-
error: SettingsError;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Settings Repository Interface
|
|
31
|
-
* Repository pattern for settings management
|
|
32
|
-
*/
|
|
33
|
-
export interface ISettingsRepository {
|
|
34
|
-
/**
|
|
35
|
-
* Load user settings from persistent storage
|
|
36
|
-
*/
|
|
37
|
-
loadSettings(userId: string): Promise<SettingsResult<UserSettings>>;
|
|
38
|
-
/**
|
|
39
|
-
* Save user settings to persistent storage
|
|
40
|
-
*/
|
|
41
|
-
saveSettings(settings: Partial<UserSettings>): Promise<SettingsResult<UserSettings>>;
|
|
42
|
-
/**
|
|
43
|
-
* Reset settings to default values
|
|
44
|
-
*/
|
|
45
|
-
resetSettings(userId: string): Promise<SettingsResult<UserSettings>>;
|
|
46
|
-
/**
|
|
47
|
-
* Get default settings for a user
|
|
48
|
-
*/
|
|
49
|
-
getDefaultSettings(userId: string): UserSettings;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=ISettingsRepository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ISettingsRepository.d.ts","sourceRoot":"","sources":["../../../src/domain/repositories/ISettingsRepository.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC1C,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,cAAc,CAAC;CACpE;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;IAC9B,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC;CACT,GAAG;IACF,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IAEpE;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IAErF;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IAErE;;OAEG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC;CAClD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ISettingsRepository.js","sourceRoot":"","sources":["../../../src/domain/repositories/ISettingsRepository.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/lib/index.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @umituz/react-native-settings - Public API
|
|
3
|
-
*
|
|
4
|
-
* Settings management for React Native apps
|
|
5
|
-
* User preferences, theme, language, notifications
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* import { useSettings, useSettingsStore, SettingsScreen, AppearanceScreen, LanguageSelectionScreen, SettingItem, DisclaimerSetting } from '@umituz/react-native-settings';
|
|
9
|
-
*/
|
|
10
|
-
export type { ISettingsRepository, UserSettings, SettingsError, SettingsResult, } from './domain/repositories/ISettingsRepository';
|
|
11
|
-
export { useSettingsStore, useSettings, } from './infrastructure/storage/SettingsStore';
|
|
12
|
-
export { SettingsScreen } from './presentation/screens/SettingsScreen';
|
|
13
|
-
export type { SettingsScreenProps } from './presentation/screens/SettingsScreen';
|
|
14
|
-
export { AppearanceScreen } from './presentation/screens/AppearanceScreen';
|
|
15
|
-
export type { SettingsConfig, CustomSettingsSection } from './presentation/screens/types';
|
|
16
|
-
export { SettingItem } from './presentation/components/SettingItem';
|
|
17
|
-
export type { SettingItemProps } from './presentation/components/SettingItem';
|
|
18
|
-
export { SettingsSection } from './presentation/components/SettingsSection';
|
|
19
|
-
export type { SettingsSectionProps } from './presentation/components/SettingsSection';
|
|
20
|
-
export { SettingsFooter } from './presentation/components/SettingsFooter';
|
|
21
|
-
export type { SettingsFooterProps } from './presentation/components/SettingsFooter';
|
|
22
|
-
export { UserProfileHeader } from './presentation/components/UserProfileHeader';
|
|
23
|
-
export type { UserProfileHeaderProps } from './presentation/components/UserProfileHeader';
|
|
24
|
-
export { DisclaimerSetting } from './presentation/components/DisclaimerSetting';
|
|
25
|
-
export type { DisclaimerSettingProps } from './presentation/components/DisclaimerSetting';
|
|
26
|
-
export { DisclaimerCard } from './presentation/components/DisclaimerCard';
|
|
27
|
-
export type { DisclaimerCardProps } from './presentation/components/DisclaimerCard';
|
|
28
|
-
export { DisclaimerModal } from './presentation/components/DisclaimerModal';
|
|
29
|
-
export type { DisclaimerModalProps } from './presentation/components/DisclaimerModal';
|
|
30
|
-
export { SettingsErrorBoundary } from './presentation/components/SettingsErrorBoundary';
|
|
31
|
-
export { CloudSyncSetting } from './presentation/components/CloudSyncSetting';
|
|
32
|
-
export type { CloudSyncSettingProps } from './presentation/components/CloudSyncSetting';
|
|
33
|
-
export { StorageClearSetting } from './presentation/components/StorageClearSetting';
|
|
34
|
-
export type { StorageClearSettingProps } from './presentation/components/StorageClearSetting';
|
|
35
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,cAAc,GACf,MAAM,2CAA2C,CAAC;AAMnD,OAAO,EACL,gBAAgB,EAChB,WAAW,GACZ,MAAM,wCAAwC,CAAC;AAMhD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,YAAY,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAM3E,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAM1F,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,YAAY,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,YAAY,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,YAAY,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAE1F,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,YAAY,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,YAAY,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAExF,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,YAAY,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC"}
|
package/lib/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @umituz/react-native-settings - Public API
|
|
3
|
-
*
|
|
4
|
-
* Settings management for React Native apps
|
|
5
|
-
* User preferences, theme, language, notifications
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* import { useSettings, useSettingsStore, SettingsScreen, AppearanceScreen, LanguageSelectionScreen, SettingItem, DisclaimerSetting } from '@umituz/react-native-settings';
|
|
9
|
-
*/
|
|
10
|
-
// =============================================================================
|
|
11
|
-
// INFRASTRUCTURE LAYER - Storage
|
|
12
|
-
// =============================================================================
|
|
13
|
-
export { useSettingsStore, useSettings, } from './infrastructure/storage/SettingsStore';
|
|
14
|
-
// =============================================================================
|
|
15
|
-
// PRESENTATION LAYER - Screens
|
|
16
|
-
// =============================================================================
|
|
17
|
-
export { SettingsScreen } from './presentation/screens/SettingsScreen';
|
|
18
|
-
export { AppearanceScreen } from './presentation/screens/AppearanceScreen';
|
|
19
|
-
// =============================================================================
|
|
20
|
-
// PRESENTATION LAYER - Components
|
|
21
|
-
// =============================================================================
|
|
22
|
-
export { SettingItem } from './presentation/components/SettingItem';
|
|
23
|
-
export { SettingsSection } from './presentation/components/SettingsSection';
|
|
24
|
-
export { SettingsFooter } from './presentation/components/SettingsFooter';
|
|
25
|
-
export { UserProfileHeader } from './presentation/components/UserProfileHeader';
|
|
26
|
-
export { DisclaimerSetting } from './presentation/components/DisclaimerSetting';
|
|
27
|
-
export { DisclaimerCard } from './presentation/components/DisclaimerCard';
|
|
28
|
-
export { DisclaimerModal } from './presentation/components/DisclaimerModal';
|
|
29
|
-
export { SettingsErrorBoundary } from './presentation/components/SettingsErrorBoundary';
|
|
30
|
-
export { CloudSyncSetting } from './presentation/components/CloudSyncSetting';
|
|
31
|
-
export { StorageClearSetting } from './presentation/components/StorageClearSetting';
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,gFAAgF;AAChF,iCAAiC;AACjC,gFAAgF;AAEhF,OAAO,EACL,gBAAgB,EAChB,WAAW,GACZ,MAAM,wCAAwC,CAAC;AAEhD,gFAAgF;AAChF,+BAA+B;AAC/B,gFAAgF;AAEhF,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAQ3E,gFAAgF;AAChF,kCAAkC;AAClC,gFAAgF;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAGpE,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAG5E,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAG1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAGhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAGhF,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAG1E,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAG5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAG9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Settings Store - Zustand State Management
|
|
3
|
-
*
|
|
4
|
-
* Global settings state for app preferences
|
|
5
|
-
* Manages theme, language, notifications, and privacy settings
|
|
6
|
-
*
|
|
7
|
-
* DDD ARCHITECTURE: Uses @umituz/react-native-storage for all storage operations
|
|
8
|
-
* - Type-safe storage with StorageKey enum
|
|
9
|
-
* - Result pattern for error handling
|
|
10
|
-
* - Single source of truth for all storage
|
|
11
|
-
*/
|
|
12
|
-
import type { UserSettings } from '../../domain/repositories/ISettingsRepository';
|
|
13
|
-
interface SettingsStore {
|
|
14
|
-
settings: UserSettings | null;
|
|
15
|
-
loading: boolean;
|
|
16
|
-
error: string | null;
|
|
17
|
-
loadSettings: (userId: string) => Promise<void>;
|
|
18
|
-
updateSettings: (updates: Partial<UserSettings>) => Promise<void>;
|
|
19
|
-
resetSettings: (userId: string) => Promise<void>;
|
|
20
|
-
clearError: () => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const useSettingsStore: import("zustand").UseBoundStore<import("zustand").StoreApi<SettingsStore>>;
|
|
23
|
-
/**
|
|
24
|
-
* Hook for accessing settings state
|
|
25
|
-
*/
|
|
26
|
-
export declare const useSettings: () => {
|
|
27
|
-
settings: UserSettings | null;
|
|
28
|
-
loading: boolean;
|
|
29
|
-
error: string | null;
|
|
30
|
-
loadSettings: (userId: string) => Promise<void>;
|
|
31
|
-
updateSettings: (updates: Partial<UserSettings>) => Promise<void>;
|
|
32
|
-
resetSettings: (userId: string) => Promise<void>;
|
|
33
|
-
clearError: () => void;
|
|
34
|
-
};
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=SettingsStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsStore.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/SettingsStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAElF,UAAU,aAAa;IAErB,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAGrB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AA4BD,eAAO,MAAM,gBAAgB,4EAiH1B,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,WAAW;;;;2BAtJC,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;8BACrB,OAAO,CAAC,YAAY,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC;4BACzC,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;sBAC9B,IAAI;CAgKvB,CAAC"}
|