@umituz/react-native-settings 5.4.18 → 5.4.19
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/dist/core/base/BaseService.d.ts +86 -0
- package/dist/core/index.d.ts +27 -0
- package/dist/core/patterns/Modal/ModalConfig.d.ts +197 -0
- package/dist/core/patterns/Modal/useModalState.d.ts +53 -0
- package/dist/core/patterns/Screen/ScreenConfig.d.ts +273 -0
- package/dist/core/patterns/Screen/useScreenData.d.ts +62 -0
- package/dist/core/utils/logger.d.ts +76 -0
- package/dist/core/utils/validators.d.ts +114 -0
- package/dist/domains/ai-consent/index.d.ts +37 -0
- package/dist/domains/ai-consent/presentation/components/AIConsentModal.d.ts +26 -0
- package/dist/domains/ai-consent/presentation/components/AIConsentSetting.d.ts +28 -0
- package/dist/domains/ai-consent/presentation/hooks/useAIConsent.d.ts +27 -0
- package/dist/domains/ai-consent/presentation/screens/AIConsentScreen.d.ts +37 -0
- package/dist/domains/disclaimer/index.d.ts +0 -2
- package/dist/domains/disclaimer/presentation/components/DisclaimerSetting.d.ts +1 -2
- package/dist/domains/disclaimer/presentation/screens/DisclaimerScreen.d.ts +11 -20
- package/dist/domains/feedback/index.d.ts +2 -1
- package/dist/domains/feedback/presentation/components/SupportSection.d.ts +1 -1
- package/dist/domains/feedback/presentation/screens/FeedbackScreen.d.ts +21 -0
- package/dist/domains/gamification/types/index.d.ts +1 -0
- package/dist/domains/gamification/utils/calculations.d.ts +3 -0
- package/dist/domains/localization/index.d.ts +1 -1
- package/dist/domains/localization/infrastructure/config/i18n.d.ts +1 -1
- package/dist/domains/notifications/infrastructure/services/NotificationService.d.ts +5 -2
- package/dist/domains/notifications/quietHours/infrastructure/hooks/useQuietHoursActions.d.ts +4 -4
- package/dist/domains/rating/application/services/RatingService.d.ts +50 -21
- package/dist/domains/rating/index.d.ts +2 -2
- package/dist/domains/rating/presentation/hooks/useAppRating.d.ts +1 -1
- package/dist/domains/rating/presentation/screens/RatingPromptScreen.d.ts +22 -0
- package/dist/index.d.ts +4 -0
- package/dist/infrastructure/services/SettingsService.d.ts +5 -2
- package/dist/presentation/components/GenericModal.d.ts +35 -0
- package/dist/presentation/components/GenericScreen.d.ts +41 -0
- package/dist/presentation/components/index.d.ts +17 -0
- package/dist/presentation/navigation/hooks/useSettingsNavigation.d.ts +21 -15
- package/dist/presentation/navigation/types.d.ts +8 -0
- package/dist/presentation/navigation/utils/navigationHelpers.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,12 +7,15 @@
|
|
|
7
7
|
* Usage:
|
|
8
8
|
* import { useSettings, SettingsScreen, AppearanceScreen, SettingsItemCard, DisclaimerSetting } from '@umituz/react-native-settings';
|
|
9
9
|
*/
|
|
10
|
+
export * from './core';
|
|
11
|
+
export * from './presentation/components';
|
|
10
12
|
export type { ISettingsRepository, UserSettings, SettingsError, SettingsResult, } from './application/ports/ISettingsRepository';
|
|
11
13
|
export { getSettingsService } from './infrastructure/services/SettingsService';
|
|
12
14
|
export { SettingsRepository } from './infrastructure/repositories/SettingsRepository';
|
|
13
15
|
export { useSettings } from './presentation/hooks/useSettings';
|
|
14
16
|
export { useSettingsQuery } from './presentation/hooks/queries/useSettingsQuery';
|
|
15
17
|
export { useUpdateSettingsMutation, useResetSettingsMutation } from './presentation/hooks/mutations/useSettingsMutations';
|
|
18
|
+
export { useSettingsScreenConfig, type SettingsFeatures, type UseSettingsScreenConfigParams, type SettingsScreenConfigResult } from './presentation/hooks/useSettingsScreenConfig';
|
|
16
19
|
export { SettingsScreen } from './presentation/screens/SettingsScreen';
|
|
17
20
|
export type { SettingsScreenProps } from './presentation/screens/SettingsScreen';
|
|
18
21
|
export { AppearanceScreen } from './presentation/screens/AppearanceScreen';
|
|
@@ -37,5 +40,6 @@ export * from "./domains/cloud-sync";
|
|
|
37
40
|
export * from "./domains/dev";
|
|
38
41
|
export * from "./domains/gamification";
|
|
39
42
|
export * from "./domains/localization";
|
|
43
|
+
export * from "./domains/ai-consent";
|
|
40
44
|
export * from "./domains/notifications";
|
|
41
45
|
export { createAppearanceConfig, createLanguageConfig, createNotificationsConfig, createAboutConfig, createLegalConfig, createFeedbackConfig, createRatingConfig, createFAQConfig, createSubscriptionConfig, createGamificationConfig, type TranslationFunction, type FeedbackFormData, } from './presentation/utils';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Settings Service
|
|
3
3
|
*
|
|
4
|
-
* Orchestrates settings operations using SettingsRepository
|
|
4
|
+
* Orchestrates settings operations using SettingsRepository.
|
|
5
|
+
* Refactored to extend BaseService for consistent error handling.
|
|
5
6
|
*/
|
|
7
|
+
import { BaseService } from '../../core/base/BaseService';
|
|
6
8
|
import type { UserSettings, SettingsResult } from '../../application/ports/ISettingsRepository';
|
|
7
|
-
export declare class SettingsService {
|
|
9
|
+
export declare class SettingsService extends BaseService {
|
|
10
|
+
protected serviceName: string;
|
|
8
11
|
private repository;
|
|
9
12
|
constructor();
|
|
10
13
|
getSettings(userId: string): Promise<SettingsResult<UserSettings>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GenericModal Component
|
|
3
|
+
*
|
|
4
|
+
* Universal modal component that works with ModalConfig.
|
|
5
|
+
* Replaces all custom modal implementations.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const modal = useModalState();
|
|
10
|
+
*
|
|
11
|
+
* return (
|
|
12
|
+
* <>
|
|
13
|
+
* <Button onPress={() => modal.show(ModalPresets.confirm(...))} />
|
|
14
|
+
* <GenericModal state={modal} />
|
|
15
|
+
* </>
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
import React from 'react';
|
|
20
|
+
import type { ModalState } from '../../core/patterns/Modal/ModalConfig';
|
|
21
|
+
export interface GenericModalProps {
|
|
22
|
+
/**
|
|
23
|
+
* Modal state from useModalState hook
|
|
24
|
+
*/
|
|
25
|
+
state: ModalState;
|
|
26
|
+
/**
|
|
27
|
+
* Custom container style
|
|
28
|
+
*/
|
|
29
|
+
containerStyle?: object;
|
|
30
|
+
/**
|
|
31
|
+
* Test ID for E2E testing
|
|
32
|
+
*/
|
|
33
|
+
testID?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const GenericModal: React.FC<GenericModalProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GenericScreen Component
|
|
3
|
+
*
|
|
4
|
+
* Universal screen component that works with ScreenConfig.
|
|
5
|
+
* Handles loading, error, and empty states automatically.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const screenData = useScreenData({ fetch: async () => await api.getData() });
|
|
10
|
+
*
|
|
11
|
+
* return (
|
|
12
|
+
* <GenericScreen
|
|
13
|
+
* data={screenData}
|
|
14
|
+
* config={ScreenPresets.default}
|
|
15
|
+
* >
|
|
16
|
+
* <MyContent data={screenData.data} />
|
|
17
|
+
* </GenericScreen>
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import type { ScreenConfig, ScreenData } from '../../core/patterns/Screen/ScreenConfig';
|
|
23
|
+
export interface GenericScreenProps<T> {
|
|
24
|
+
/**
|
|
25
|
+
* Screen data from useScreenData hook
|
|
26
|
+
*/
|
|
27
|
+
data: ScreenData<T>;
|
|
28
|
+
/**
|
|
29
|
+
* Screen configuration
|
|
30
|
+
*/
|
|
31
|
+
config?: ScreenConfig;
|
|
32
|
+
/**
|
|
33
|
+
* Content component (renders when data is loaded)
|
|
34
|
+
*/
|
|
35
|
+
children: React.ReactNode | ((data: T) => React.ReactNode);
|
|
36
|
+
/**
|
|
37
|
+
* Test ID for E2E testing
|
|
38
|
+
*/
|
|
39
|
+
testID?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function GenericScreen<T>({ data, config, children, testID, }: GenericScreenProps<T>): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presentation Components - Public API
|
|
3
|
+
*
|
|
4
|
+
* Shared UI components for the entire application.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { GenericModal, GenericScreen } from '@/presentation/components';
|
|
9
|
+
*
|
|
10
|
+
* const modal = useModalState();
|
|
11
|
+
* return <GenericModal state={modal} />;
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export { GenericModal } from './GenericModal';
|
|
15
|
+
export type { GenericModalProps } from './GenericModal';
|
|
16
|
+
export { GenericScreen } from './GenericScreen';
|
|
17
|
+
export type { GenericScreenProps } from './GenericScreen';
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Settings Navigation Hook
|
|
3
3
|
*
|
|
4
|
-
* Provides
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
import type { StackNavigationProp } from '@react-navigation/stack';
|
|
8
|
-
import type { SettingsStackParamList } from '../types';
|
|
9
|
-
/**
|
|
10
|
-
* Type for Settings navigation prop
|
|
11
|
-
*/
|
|
12
|
-
export type SettingsNavigationProp = StackNavigationProp<SettingsStackParamList>;
|
|
13
|
-
/**
|
|
14
|
-
* Hook to get typed navigation for Settings screens
|
|
4
|
+
* Provides standardized navigation for Settings stack screens.
|
|
5
|
+
* Uses useAppNavigation from design system for consistency.
|
|
15
6
|
*
|
|
16
7
|
* @example
|
|
17
8
|
* ```typescript
|
|
18
|
-
*
|
|
19
|
-
*
|
|
9
|
+
* import { useSettingsNavigation } from '@umituz/react-native-settings/presentation/navigation';
|
|
10
|
+
*
|
|
11
|
+
* function LanguageSelectionScreen() {
|
|
12
|
+
* const navigation = useSettingsNavigation();
|
|
13
|
+
* navigation.navigate('Appearance');
|
|
14
|
+
* navigation.goBack();
|
|
15
|
+
* }
|
|
20
16
|
* ```
|
|
21
17
|
*/
|
|
22
|
-
|
|
18
|
+
import { useAppNavigation } from '@umituz/react-native-design-system/molecules';
|
|
19
|
+
/**
|
|
20
|
+
* Navigation result type inferred from useAppNavigation
|
|
21
|
+
*/
|
|
22
|
+
type SettingsNavigation = ReturnType<typeof useAppNavigation>;
|
|
23
|
+
/**
|
|
24
|
+
* Hook to get navigation for Settings screens
|
|
25
|
+
* Delegates to useAppNavigation for consistent API
|
|
26
|
+
*/
|
|
27
|
+
export declare const useSettingsNavigation: () => SettingsNavigation;
|
|
28
|
+
export {};
|
|
@@ -5,6 +5,10 @@ import type React from 'react';
|
|
|
5
5
|
import type { SettingsConfig, CustomSettingsSection } from "../screens/types";
|
|
6
6
|
import type { DevSettingsProps } from "../../domains/dev";
|
|
7
7
|
import type { FAQCategory } from "../../domains/faqs";
|
|
8
|
+
import type { DisclaimerScreenParams } from "../../domains/disclaimer/presentation/screens/DisclaimerScreen";
|
|
9
|
+
import type { FeedbackScreenParams } from "../../domains/feedback/presentation/screens/FeedbackScreen";
|
|
10
|
+
import type { RatingPromptScreenParams } from "../../domains/rating/presentation/screens/RatingPromptScreen";
|
|
11
|
+
import type { AIConsentScreenParams } from "../../domains/ai-consent/presentation/screens/AIConsentScreen";
|
|
8
12
|
/**
|
|
9
13
|
* App Info passed from main app (APP_INFO constant)
|
|
10
14
|
*/
|
|
@@ -44,6 +48,10 @@ export type SettingsStackParamList = {
|
|
|
44
48
|
Account: undefined;
|
|
45
49
|
VideoTutorial: undefined;
|
|
46
50
|
FeatureRequest: undefined;
|
|
51
|
+
Disclaimer: DisclaimerScreenParams;
|
|
52
|
+
Feedback: FeedbackScreenParams;
|
|
53
|
+
RatingPrompt: RatingPromptScreenParams;
|
|
54
|
+
AIConsent: AIConsentScreenParams;
|
|
47
55
|
PasswordPrompt: {
|
|
48
56
|
onComplete: (password: string | null) => void;
|
|
49
57
|
title?: string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { SettingsStackParamList } from '../types';
|
|
6
6
|
type NavigateFunction = <RouteName extends keyof SettingsStackParamList>(route: RouteName, params?: SettingsStackParamList[RouteName]) => void;
|
|
7
7
|
interface RouteOrPressConfig<T extends keyof SettingsStackParamList = keyof SettingsStackParamList> {
|
|
8
|
-
route?: T;
|
|
8
|
+
route?: T | string;
|
|
9
9
|
onPress?: () => void;
|
|
10
10
|
fallback?: T;
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.19",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification - expo-store-review and expo-device now lazy loaded",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./dist/index.d.ts",
|