@umituz/react-native-settings 5.4.18 → 5.4.20
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
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger Utility
|
|
3
|
+
*
|
|
4
|
+
* Centralized logging with development mode support.
|
|
5
|
+
* All logging should go through this utility for consistency.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { logger } from '@/core/utils/logger';
|
|
10
|
+
*
|
|
11
|
+
* logger.info('MyComponent', 'Component mounted');
|
|
12
|
+
* logger.error('MyService', 'Operation failed', error);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export type LogLevel = 'info' | 'warn' | 'error' | 'debug';
|
|
16
|
+
export interface LogContext {
|
|
17
|
+
component?: string;
|
|
18
|
+
service?: string;
|
|
19
|
+
domain?: string;
|
|
20
|
+
operation?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Centralized logger with development mode support
|
|
24
|
+
*/
|
|
25
|
+
export declare class Logger {
|
|
26
|
+
private context;
|
|
27
|
+
constructor(context: LogContext);
|
|
28
|
+
/**
|
|
29
|
+
* Log info message (only in development)
|
|
30
|
+
*/
|
|
31
|
+
info(message: string, ...args: unknown[]): void;
|
|
32
|
+
/**
|
|
33
|
+
* Log warning message (only in development)
|
|
34
|
+
*/
|
|
35
|
+
warn(message: string, ...args: unknown[]): void;
|
|
36
|
+
/**
|
|
37
|
+
* Log error message (only in development)
|
|
38
|
+
*/
|
|
39
|
+
error(message: string, error?: unknown, ...args: unknown[]): void;
|
|
40
|
+
/**
|
|
41
|
+
* Log debug message (only in development)
|
|
42
|
+
*/
|
|
43
|
+
debug(message: string, ...args: unknown[]): void;
|
|
44
|
+
/**
|
|
45
|
+
* Create a child logger with additional context
|
|
46
|
+
*/
|
|
47
|
+
child(additionalContext: Partial<LogContext>): Logger;
|
|
48
|
+
/**
|
|
49
|
+
* Format log prefix with context
|
|
50
|
+
*/
|
|
51
|
+
private formatPrefix;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Create a logger instance with context
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const logger = createLogger({ component: 'MyComponent' });
|
|
59
|
+
* logger.info('Something happened');
|
|
60
|
+
* // Output: [INFO] | MyComponent: Something happened
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function createLogger(context: LogContext): Logger;
|
|
64
|
+
/**
|
|
65
|
+
* Default logger instance for quick usage
|
|
66
|
+
*/
|
|
67
|
+
export declare const logger: Logger;
|
|
68
|
+
/**
|
|
69
|
+
* Convenience functions for quick logging
|
|
70
|
+
*/
|
|
71
|
+
export declare const log: {
|
|
72
|
+
info: (message: string, ...args: unknown[]) => void;
|
|
73
|
+
warn: (message: string, ...args: unknown[]) => void;
|
|
74
|
+
error: (message: string, error?: unknown, ...args: unknown[]) => void;
|
|
75
|
+
debug: (message: string, ...args: unknown[]) => void;
|
|
76
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common Validators
|
|
3
|
+
*
|
|
4
|
+
* Reusable validation functions for domains.
|
|
5
|
+
* All validators should be pure functions.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { validators } from '@/core/utils/validators';
|
|
10
|
+
*
|
|
11
|
+
* if (!validators.isValidEmail(email)) {
|
|
12
|
+
* return { error: 'Invalid email' };
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Common validation utilities
|
|
18
|
+
*/
|
|
19
|
+
export declare const validators: {
|
|
20
|
+
/**
|
|
21
|
+
* Check if value is not empty (null, undefined, or empty string)
|
|
22
|
+
*/
|
|
23
|
+
isNotEmpty: <T>(value: T | null | undefined | "") => value is T;
|
|
24
|
+
/**
|
|
25
|
+
* Check if string is a valid email format
|
|
26
|
+
*/
|
|
27
|
+
isValidEmail: (email: string) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Check if string is a valid URL
|
|
30
|
+
*/
|
|
31
|
+
isValidUrl: (url: string) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Check if value is within range (inclusive)
|
|
34
|
+
*/
|
|
35
|
+
isInRange: (value: number, min: number, max: number) => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Check if value is a positive number
|
|
38
|
+
*/
|
|
39
|
+
isPositive: (value: number) => boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check if value is a non-negative number
|
|
42
|
+
*/
|
|
43
|
+
isNonNegative: (value: number) => boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Check if array has items
|
|
46
|
+
*/
|
|
47
|
+
hasItems: <T>(array: T[] | readonly T[]) => boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Check if value is a valid ISO date string
|
|
50
|
+
*/
|
|
51
|
+
isValidISODate: (dateString: string) => boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Check if date is in the past
|
|
54
|
+
*/
|
|
55
|
+
isPastDate: (dateString: string) => boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Check if date is in the future
|
|
58
|
+
*/
|
|
59
|
+
isFutureDate: (dateString: string) => boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Check if object has required properties
|
|
62
|
+
*/
|
|
63
|
+
hasProperties: <T extends object>(obj: T, properties: (keyof T)[]) => boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Check if string meets minimum length
|
|
66
|
+
*/
|
|
67
|
+
hasMinLength: (str: string, min: number) => boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Check if string meets maximum length
|
|
70
|
+
*/
|
|
71
|
+
hasMaxLength: (str: string, max: number) => boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Check if value is one of the allowed values
|
|
74
|
+
*/
|
|
75
|
+
isOneOf: <T>(value: T, allowed: readonly T[]) => boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Check if time is valid (hour: minute)
|
|
78
|
+
*/
|
|
79
|
+
isValidTime: (hour: number, minute: number) => boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Check if time range is valid (start before end)
|
|
82
|
+
*/
|
|
83
|
+
isValidTimeRange: (startHour: number, startMinute: number, endHour: number, endMinute: number) => boolean;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Validation result type
|
|
87
|
+
*/
|
|
88
|
+
export type ValidationResult<T> = {
|
|
89
|
+
valid: true;
|
|
90
|
+
data: T;
|
|
91
|
+
} | {
|
|
92
|
+
valid: false;
|
|
93
|
+
error: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Create a validation result
|
|
97
|
+
*/
|
|
98
|
+
export declare function valid<T>(data: T): ValidationResult<T>;
|
|
99
|
+
/**
|
|
100
|
+
* Create an invalid validation result
|
|
101
|
+
*/
|
|
102
|
+
export declare function invalid(error: string): ValidationResult<never>;
|
|
103
|
+
/**
|
|
104
|
+
* Chain multiple validations
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* const result = validateAll(
|
|
109
|
+
* validators.isValidEmail(email) || 'Invalid email',
|
|
110
|
+
* validators.hasMinLength(email, 5) || 'Email too short'
|
|
111
|
+
* );
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export declare function validateAll(...checks: (boolean | string)[]): ValidationResult<null>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @umituz/react-native-settings - AI Consent Domain
|
|
3
|
+
*
|
|
4
|
+
* AI consent management for React Native apps
|
|
5
|
+
* Required by Apple App Store Guidelines 5.1.1(i) & 5.1.2(i)
|
|
6
|
+
*
|
|
7
|
+
* Displays AI technology disclosure and obtains user consent before
|
|
8
|
+
* using AI generation features.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* import {
|
|
12
|
+
* AIConsentScreen,
|
|
13
|
+
* AIConsentModal,
|
|
14
|
+
* AIConsentSetting,
|
|
15
|
+
* useAIConsent
|
|
16
|
+
* } from '@umituz/react-native-settings/ai-consent';
|
|
17
|
+
*
|
|
18
|
+
* // Show modal on app launch
|
|
19
|
+
* const { isConsentModalVisible, handleAcceptConsent, handleDeclineConsent } = useAIConsent();
|
|
20
|
+
*
|
|
21
|
+
* <AIConsentModal
|
|
22
|
+
* visible={isConsentModalVisible}
|
|
23
|
+
* onAccept={handleAcceptConsent}
|
|
24
|
+
* onDecline={handleDeclineConsent}
|
|
25
|
+
* />
|
|
26
|
+
*
|
|
27
|
+
* // Add to settings screen
|
|
28
|
+
* <AIConsentSetting />
|
|
29
|
+
*/
|
|
30
|
+
export { AIConsentModal } from './presentation/components/AIConsentModal';
|
|
31
|
+
export type { AIConsentModalProps } from './presentation/components/AIConsentModal';
|
|
32
|
+
export { AIConsentSetting } from './presentation/components/AIConsentSetting';
|
|
33
|
+
export type { AIConsentSettingProps } from './presentation/components/AIConsentSetting';
|
|
34
|
+
export { AIConsentScreen } from './presentation/screens/AIConsentScreen';
|
|
35
|
+
export type { AIConsentScreenProps, AIConsentScreenParams, AIProvider } from './presentation/screens/AIConsentScreen';
|
|
36
|
+
export { useAIConsent } from './presentation/hooks/useAIConsent';
|
|
37
|
+
export type { UseAIConsentReturn, AIConsentState } from './presentation/hooks/useAIConsent';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Consent Modal
|
|
3
|
+
*
|
|
4
|
+
* Modal wrapper for AI consent screen.
|
|
5
|
+
* Required by Apple App Store Guidelines 5.1.1(i) & 5.1.2(i)
|
|
6
|
+
*
|
|
7
|
+
* Displays on first app launch before any AI features are used.
|
|
8
|
+
* Can also be shown manually from settings.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* <AIConsentModal
|
|
12
|
+
* visible={isConsentModalVisible}
|
|
13
|
+
* onAccept={handleAccept}
|
|
14
|
+
* onDecline={handleDecline}
|
|
15
|
+
* />
|
|
16
|
+
*/
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { type AIProvider } from '../screens/AIConsentScreen';
|
|
19
|
+
export interface AIConsentModalProps {
|
|
20
|
+
visible: boolean;
|
|
21
|
+
onAccept: () => void;
|
|
22
|
+
onDecline: () => void;
|
|
23
|
+
providers?: AIProvider[];
|
|
24
|
+
customMessage?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const AIConsentModal: React.FC<AIConsentModalProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AIConsentSetting Component
|
|
3
|
+
*
|
|
4
|
+
* Settings list item for AI consent management.
|
|
5
|
+
* Shows current consent status and navigates to full consent screen.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Displays consent status (accepted/declined/pending)
|
|
9
|
+
* - Tappable card that opens AI consent screen
|
|
10
|
+
* - Icon with background color
|
|
11
|
+
* - Internationalized
|
|
12
|
+
* - Universal across iOS, Android, Web
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* import { AIConsentSetting } from '@umituz/react-native-settings/ai-consent';
|
|
16
|
+
*
|
|
17
|
+
* <AIConsentSetting />
|
|
18
|
+
*/
|
|
19
|
+
import React from 'react';
|
|
20
|
+
export interface AIConsentSettingProps {
|
|
21
|
+
/** Custom title */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** Custom description when consented */
|
|
24
|
+
consentedDescription?: string;
|
|
25
|
+
/** Custom description when not consented */
|
|
26
|
+
notConsentedDescription?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const AIConsentSetting: React.FC<AIConsentSettingProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAIConsent Hook
|
|
3
|
+
* Manages AI consent state and display logic
|
|
4
|
+
* Required by Apple App Store Guidelines 5.1.1(i) & 5.1.2(i)
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Checks if user has consented to AI services
|
|
8
|
+
* - Shows modal on first use
|
|
9
|
+
* - Persists consent state
|
|
10
|
+
* - Memoized for performance
|
|
11
|
+
*/
|
|
12
|
+
export interface AIConsentState {
|
|
13
|
+
hasConsented: boolean;
|
|
14
|
+
consentTimestamp?: number;
|
|
15
|
+
consentVersion?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface UseAIConsentReturn {
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
isConsentModalVisible: boolean;
|
|
20
|
+
hasConsented: boolean;
|
|
21
|
+
consentState: AIConsentState | null;
|
|
22
|
+
handleAcceptConsent: () => Promise<void>;
|
|
23
|
+
handleDeclineConsent: () => void;
|
|
24
|
+
showConsentModal: () => void;
|
|
25
|
+
checkConsent: () => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export declare const useAIConsent: () => UseAIConsentReturn;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Consent Screen
|
|
3
|
+
*
|
|
4
|
+
* Full screen for displaying AI technology disclosure and consent.
|
|
5
|
+
* Required by Apple App Store Guidelines 5.1.1(i) & 5.1.2(i)
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Lists all AI providers and their purposes
|
|
9
|
+
* - Explains data sharing practices
|
|
10
|
+
* - Provides privacy policy links
|
|
11
|
+
* - Accept/Decline buttons
|
|
12
|
+
* - Scrollable content
|
|
13
|
+
*/
|
|
14
|
+
import React from 'react';
|
|
15
|
+
export interface AIProvider {
|
|
16
|
+
name: string;
|
|
17
|
+
purpose: string;
|
|
18
|
+
privacyUrl: string;
|
|
19
|
+
}
|
|
20
|
+
export interface AIConsentScreenParams {
|
|
21
|
+
providers?: AIProvider[];
|
|
22
|
+
customMessage?: string;
|
|
23
|
+
onAccept?: () => void;
|
|
24
|
+
onDecline?: () => void;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
export interface AIConsentScreenProps {
|
|
28
|
+
route?: {
|
|
29
|
+
params?: AIConsentScreenParams;
|
|
30
|
+
};
|
|
31
|
+
providers?: AIProvider[];
|
|
32
|
+
customMessage?: string;
|
|
33
|
+
onAccept?: () => void;
|
|
34
|
+
onDecline?: () => void;
|
|
35
|
+
standalone?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare const AIConsentScreen: React.FC<AIConsentScreenProps>;
|
|
@@ -11,7 +11,5 @@ export { DisclaimerSetting } from './presentation/components/DisclaimerSetting';
|
|
|
11
11
|
export type { DisclaimerSettingProps } from './presentation/components/DisclaimerSetting';
|
|
12
12
|
export { DisclaimerCard } from './presentation/components/DisclaimerCard';
|
|
13
13
|
export type { DisclaimerCardProps } from './presentation/components/DisclaimerCard';
|
|
14
|
-
export { DisclaimerModal } from './presentation/components/DisclaimerModal';
|
|
15
|
-
export type { DisclaimerModalProps } from './presentation/components/DisclaimerModal';
|
|
16
14
|
export { DisclaimerScreen } from './presentation/screens/DisclaimerScreen';
|
|
17
15
|
export type { DisclaimerScreenProps } from './presentation/screens/DisclaimerScreen';
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* Used in About screens for apps that require disclaimers
|
|
6
6
|
*
|
|
7
7
|
* Features:
|
|
8
|
-
* - Tappable card that opens full disclaimer
|
|
8
|
+
* - Tappable card that opens full disclaimer screen
|
|
9
9
|
* - Warning icon with background color
|
|
10
10
|
* - Internationalized title and message
|
|
11
|
-
* - Full-screen modal with scrollable content
|
|
12
11
|
* - NO shadows (CLAUDE.md compliance)
|
|
13
12
|
* - Universal across iOS, Android, Web (NO Platform.OS checks)
|
|
14
13
|
*
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Disclaimer Screen
|
|
3
3
|
*
|
|
4
|
-
* Full
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - SafeAreaView wrapper for proper display
|
|
9
|
-
* - Scrollable content for long disclaimers
|
|
10
|
-
* - Customizable title and content via props or translations
|
|
11
|
-
* - NO shadows (CLAUDE.md compliance)
|
|
12
|
-
* - Universal across iOS, Android, Web
|
|
4
|
+
* Full screen for displaying disclaimer/important legal notice.
|
|
5
|
+
* Replaces modal approach with native navigation.
|
|
13
6
|
*/
|
|
14
7
|
import React from 'react';
|
|
8
|
+
export interface DisclaimerScreenParams {
|
|
9
|
+
title: string;
|
|
10
|
+
content: string;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
15
13
|
export interface DisclaimerScreenProps {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
titleKey?: string;
|
|
20
|
-
/** Custom content (overrides translation) */
|
|
21
|
-
content?: string;
|
|
22
|
-
/** Custom content translation key */
|
|
23
|
-
contentKey?: string;
|
|
24
|
-
/** Custom icon name */
|
|
25
|
-
iconName?: string;
|
|
14
|
+
route: {
|
|
15
|
+
params: DisclaimerScreenParams;
|
|
16
|
+
};
|
|
26
17
|
}
|
|
27
18
|
export declare const DisclaimerScreen: React.FC<DisclaimerScreenProps>;
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* User feedback, bug reports, feature requests
|
|
4
4
|
*/
|
|
5
5
|
export * from './presentation/components/FeedbackForm';
|
|
6
|
-
export * from './presentation/components/FeedbackModal';
|
|
7
6
|
export { SupportSection } from './presentation/components/SupportSection';
|
|
8
7
|
export type { SupportSectionProps, FeedbackModalTexts } from './presentation/components/SupportSection';
|
|
9
8
|
export * from './presentation/hooks/useFeedbackForm';
|
|
10
9
|
export * from './domain/entities/FeedbackEntity';
|
|
11
10
|
export * from './domain/entities/FeatureRequestEntity';
|
|
11
|
+
export { FeedbackScreen } from './presentation/screens/FeedbackScreen';
|
|
12
|
+
export type { FeedbackScreenProps, FeedbackScreenParams } from './presentation/screens/FeedbackScreen';
|
|
@@ -56,7 +56,7 @@ export interface SupportSectionProps {
|
|
|
56
56
|
onPress: () => void;
|
|
57
57
|
isLast?: boolean;
|
|
58
58
|
}) => React.ReactElement | null;
|
|
59
|
-
/** Texts for the feedback
|
|
59
|
+
/** Texts for the feedback screen */
|
|
60
60
|
feedbackModalTexts?: FeedbackModalTexts;
|
|
61
61
|
}
|
|
62
62
|
export declare const SupportSection: React.FC<SupportSectionProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback Screen
|
|
3
|
+
*
|
|
4
|
+
* Full screen for submitting feedback.
|
|
5
|
+
* Replaces modal approach with native navigation.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { FeedbackType } from '../../domain/entities/FeedbackEntity';
|
|
9
|
+
import type { FeedbackFormProps } from '../components/FeedbackFormProps';
|
|
10
|
+
export interface FeedbackScreenParams {
|
|
11
|
+
initialType?: FeedbackType;
|
|
12
|
+
title?: string;
|
|
13
|
+
texts: FeedbackFormProps['texts'];
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface FeedbackScreenProps {
|
|
17
|
+
route: {
|
|
18
|
+
params: FeedbackScreenParams;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const FeedbackScreen: React.FC<FeedbackScreenProps>;
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Pure utility functions - NO side effects
|
|
4
4
|
*/
|
|
5
5
|
import type { LevelDefinition, LevelState, AchievementDefinition } from "../types";
|
|
6
|
+
export declare const DEFAULT_LEVEL_RANGE = 100;
|
|
7
|
+
export declare const DEFAULT_POINTS_PER_LEVEL = 50;
|
|
8
|
+
export declare const MAX_PROGRESS = 100;
|
|
6
9
|
export declare const calculateLevel: (points: number, levels: LevelDefinition[]) => LevelState;
|
|
7
10
|
export declare const checkAchievementUnlock: (definition: AchievementDefinition, tasksCompleted: number, currentStreak: number) => boolean;
|
|
8
11
|
export declare const updateAchievementProgress: (definition: AchievementDefinition, tasksCompleted: number, currentStreak: number) => number;
|
|
@@ -10,7 +10,7 @@ export { LanguageSelectionScreen } from './presentation/screens/LanguageSelectio
|
|
|
10
10
|
export type { LanguageSelectionScreenProps } from './presentation/screens/LanguageSelectionScreen.types';
|
|
11
11
|
export { LanguageSection } from './presentation/components/LanguageSection';
|
|
12
12
|
export type { LanguageSectionProps, LanguageSectionConfig } from './presentation/components/LanguageSection';
|
|
13
|
-
export {
|
|
13
|
+
export { i18n } from './infrastructure/config/i18n';
|
|
14
14
|
export { I18nInitializer } from './infrastructure/config/I18nInitializer';
|
|
15
15
|
export { DEFAULT_LANGUAGE, getLanguageByCode, isLanguageSupported, getDefaultLanguage, getDeviceLocale, searchLanguages, } from './infrastructure/config/languages';
|
|
16
16
|
export type { Language, ILocalizationRepository } from './domain/repositories/ILocalizationRepository';
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Notification Service
|
|
3
3
|
*
|
|
4
4
|
* Simple facade for offline notification system.
|
|
5
5
|
* Works in ALL apps - offline, online, hybrid - no backend required.
|
|
6
|
+
* Refactored to extend BaseService.
|
|
6
7
|
*
|
|
7
8
|
* @module NotificationService
|
|
8
9
|
*/
|
|
9
10
|
import { NotificationManager } from './NotificationManager';
|
|
11
|
+
import { BaseService } from '../../../../core/base/BaseService';
|
|
10
12
|
export * from './types';
|
|
11
13
|
/**
|
|
12
14
|
* Notification service singleton
|
|
13
15
|
* Provides simple access to notification manager
|
|
14
16
|
*/
|
|
15
|
-
export declare class NotificationService {
|
|
17
|
+
export declare class NotificationService extends BaseService {
|
|
18
|
+
protected serviceName: string;
|
|
16
19
|
private static instance;
|
|
17
20
|
private isConfigured;
|
|
18
21
|
readonly notifications: NotificationManager;
|
package/dist/domains/notifications/quietHours/infrastructure/hooks/useQuietHoursActions.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import type { QuietHoursConfig } from '../../../infrastructure/services/types';
|
|
6
6
|
export declare const useQuietHoursActions: () => {
|
|
7
7
|
quietHours: QuietHoursConfig;
|
|
8
|
-
setQuietHoursEnabled: (enabled: boolean) =>
|
|
9
|
-
setStartTime: (hour: number, minute: number) =>
|
|
10
|
-
setEndTime: (hour: number, minute: number) =>
|
|
11
|
-
setQuietHours: (config: QuietHoursConfig) =>
|
|
8
|
+
setQuietHoursEnabled: (enabled: boolean) => void;
|
|
9
|
+
setStartTime: (hour: number, minute: number) => void;
|
|
10
|
+
setEndTime: (hour: number, minute: number) => void;
|
|
11
|
+
setQuietHours: (config: QuietHoursConfig) => void;
|
|
12
12
|
isInQuietHours: () => boolean;
|
|
13
13
|
};
|
|
@@ -1,33 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Rating Service
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
|
+
* Core business logic for app rating system.
|
|
5
|
+
* Refactored to extend BaseService for consistent error handling.
|
|
6
|
+
*
|
|
7
|
+
* @module RatingService
|
|
4
8
|
*/
|
|
5
9
|
import type { RatingConfig, RatingState } from "../../domain/entities/RatingConfig";
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
import { BaseService } from "../../../../core/base/BaseService";
|
|
11
|
+
/**
|
|
12
|
+
* Rating Service Class
|
|
13
|
+
*/
|
|
14
|
+
export declare class RatingService extends BaseService {
|
|
15
|
+
protected serviceName: string;
|
|
16
|
+
/**
|
|
17
|
+
* Track an event occurrence
|
|
18
|
+
*/
|
|
19
|
+
trackEvent(eventType: string): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Check if prompt should be shown based on criteria
|
|
22
|
+
*/
|
|
23
|
+
shouldShowPrompt(config: RatingConfig): Promise<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* Mark that prompt was shown to user
|
|
26
|
+
*/
|
|
27
|
+
markPromptShown(eventType: string): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Mark that user has rated the app
|
|
30
|
+
*/
|
|
31
|
+
markRated(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Mark that user permanently dismissed the prompt
|
|
34
|
+
*/
|
|
35
|
+
markDismissed(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Get current rating state for event type
|
|
38
|
+
*/
|
|
39
|
+
getState(eventType: string): Promise<RatingState>;
|
|
40
|
+
/**
|
|
41
|
+
* Reset rating data (for testing or specific event type)
|
|
42
|
+
*/
|
|
43
|
+
reset(eventType?: string): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get rating service singleton instance
|
|
47
|
+
*/
|
|
48
|
+
export declare function getRatingService(): RatingService;
|
|
49
|
+
/**
|
|
50
|
+
* Default export for backward compatibility
|
|
51
|
+
*/
|
|
52
|
+
export declare const ratingService: RatingService;
|
|
53
|
+
/**
|
|
54
|
+
* Static convenience functions that delegate to singleton
|
|
8
55
|
*/
|
|
9
56
|
export declare function trackEvent(eventType: string): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Check if prompt should be shown based on criteria
|
|
12
|
-
*/
|
|
13
57
|
export declare function shouldShowPrompt(config: RatingConfig): Promise<boolean>;
|
|
14
|
-
/**
|
|
15
|
-
* Mark that prompt was shown to user
|
|
16
|
-
*/
|
|
17
58
|
export declare function markPromptShown(eventType: string): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Mark that user has rated the app
|
|
20
|
-
*/
|
|
21
59
|
export declare function markRated(): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* Mark that user permanently dismissed the prompt
|
|
24
|
-
*/
|
|
25
60
|
export declare function markDismissed(): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Get current rating state for event type
|
|
28
|
-
*/
|
|
29
61
|
export declare function getState(eventType: string): Promise<RatingState>;
|
|
30
|
-
/**
|
|
31
|
-
* Reset rating data (for testing or specific event type)
|
|
32
|
-
*/
|
|
33
62
|
export declare function reset(eventType?: string): Promise<void>;
|
|
@@ -7,6 +7,6 @@ export type { RatingConfig, RatingState, RatingTranslations, UseAppRatingResult,
|
|
|
7
7
|
export { DEFAULT_RATING_CONFIG } from './domain/entities/RatingConfig';
|
|
8
8
|
export { StarRating } from './presentation/components/StarRating';
|
|
9
9
|
export type { StarRatingProps } from './presentation/components/StarRating';
|
|
10
|
-
export {
|
|
11
|
-
export type {
|
|
10
|
+
export { RatingPromptScreen } from './presentation/screens/RatingPromptScreen';
|
|
11
|
+
export type { RatingPromptScreenProps, RatingPromptScreenParams } from './presentation/screens/RatingPromptScreen';
|
|
12
12
|
export { useAppRating } from './presentation/hooks/useAppRating';
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { RatingConfig, UseAppRatingResult } from "../../domain/entities/RatingConfig";
|
|
7
7
|
/**
|
|
8
|
-
* App rating hook with
|
|
8
|
+
* App rating hook with navigation-based prompt flow
|
|
9
9
|
*/
|
|
10
10
|
export declare function useAppRating(config: RatingConfig): UseAppRatingResult;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rating Prompt Screen
|
|
3
|
+
*
|
|
4
|
+
* Full screen for app rating prompt.
|
|
5
|
+
* Replaces modal approach with native navigation.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { RatingTranslations } from '../../domain/entities/RatingConfig';
|
|
9
|
+
export interface RatingPromptScreenParams {
|
|
10
|
+
appName?: string;
|
|
11
|
+
translations?: RatingTranslations;
|
|
12
|
+
onPositive?: () => void;
|
|
13
|
+
onNegative?: () => void;
|
|
14
|
+
onLater?: () => void;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface RatingPromptScreenProps {
|
|
18
|
+
route: {
|
|
19
|
+
params: RatingPromptScreenParams;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare const RatingPromptScreen: React.FC<RatingPromptScreenProps>;
|