@umituz/react-native-settings 5.3.43 → 5.3.44
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/account.d.ts +1 -2
- package/dist/domains/feedback/domain/entities/FeedbackEntity.d.ts +0 -20
- package/dist/domains/feedback/index.d.ts +0 -1
- package/dist/presentation/utils/index.d.ts +0 -1
- package/package.json +1 -1
- package/src/account.ts +1 -4
- package/src/domains/feedback/README.md +2 -4
- package/src/domains/feedback/domain/entities/FeedbackEntity.ts +0 -47
- package/src/domains/feedback/index.ts +0 -1
- package/src/presentation/hooks/useSettingsScreenConfig.ts +1 -7
- package/src/presentation/utils/index.ts +0 -1
- package/src/domains/feedback/domain/repositories/IFeedbackRepository.ts +0 -28
- package/src/presentation/utils/faqTranslator.ts +0 -9
package/dist/account.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
8
|
* import {
|
|
9
|
-
*
|
|
9
|
+
* useSettingsScreenConfig,
|
|
10
10
|
* AccountScreen,
|
|
11
11
|
* ProfileSection,
|
|
12
12
|
* } from '@umituz/react-native-settings/account';
|
|
@@ -22,6 +22,5 @@ export { AccountScreen, ProfileSection } from "@umituz/react-native-auth";
|
|
|
22
22
|
export { useAuth, useUserProfile, useAuthHandlers } from "@umituz/react-native-auth";
|
|
23
23
|
export type { AccountScreenConfig } from "@umituz/react-native-auth";
|
|
24
24
|
export { useSettingsScreenConfig } from './presentation/hooks/useSettingsScreenConfig';
|
|
25
|
-
export { useSettingsScreenConfig as useSettingsScreenConfigWithAuth } from './presentation/hooks/useSettingsScreenConfig';
|
|
26
25
|
export type { UseSettingsScreenConfigParams, SettingsScreenConfigResult, SettingsFeatures, } from './presentation/hooks/useSettingsScreenConfig';
|
|
27
26
|
export type { AccountConfig } from './presentation/navigation/types';
|
|
@@ -2,24 +2,4 @@
|
|
|
2
2
|
* Feedback Entity
|
|
3
3
|
*/
|
|
4
4
|
export type FeedbackType = 'general' | 'bug_report' | 'feature_request' | 'improvement' | 'other';
|
|
5
|
-
export type FeedbackStatus = 'pending' | 'reviewed' | 'resolved' | 'closed';
|
|
6
5
|
export type FeedbackRating = 1 | 2 | 3 | 4 | 5;
|
|
7
|
-
export interface FeedbackEntity {
|
|
8
|
-
id: string;
|
|
9
|
-
userId: string | null;
|
|
10
|
-
userEmail?: string | null;
|
|
11
|
-
type: FeedbackType;
|
|
12
|
-
title: string;
|
|
13
|
-
description: string;
|
|
14
|
-
rating?: FeedbackRating;
|
|
15
|
-
status: FeedbackStatus;
|
|
16
|
-
deviceInfo?: {
|
|
17
|
-
platform: string;
|
|
18
|
-
osVersion: string;
|
|
19
|
-
appVersion: string;
|
|
20
|
-
};
|
|
21
|
-
metadata?: Record<string, unknown>;
|
|
22
|
-
createdAt: string;
|
|
23
|
-
updatedAt: string;
|
|
24
|
-
}
|
|
25
|
-
export declare function createFeedback(userId: string | null, type: FeedbackType, title: string, description: string, userEmail?: string | null, rating?: FeedbackRating, deviceInfo?: FeedbackEntity['deviceInfo'], metadata?: Record<string, unknown>): Omit<FeedbackEntity, 'id'>;
|
|
@@ -8,4 +8,3 @@ export * from './presentation/components/SupportSection';
|
|
|
8
8
|
export * from './presentation/hooks/useFeedbackForm';
|
|
9
9
|
export * from './domain/entities/FeedbackEntity';
|
|
10
10
|
export * from './domain/entities/FeatureRequestEntity';
|
|
11
|
-
export * from './domain/repositories/IFeedbackRepository';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.44",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
package/src/account.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
8
|
* import {
|
|
9
|
-
*
|
|
9
|
+
* useSettingsScreenConfig,
|
|
10
10
|
* AccountScreen,
|
|
11
11
|
* ProfileSection,
|
|
12
12
|
* } from '@umituz/react-native-settings/account';
|
|
@@ -31,9 +31,6 @@ export type { AccountScreenConfig } from "@umituz/react-native-auth";
|
|
|
31
31
|
// Base hook (already handles auth internally via useAuth/useUserProfile/useAuthHandlers)
|
|
32
32
|
export { useSettingsScreenConfig } from './presentation/hooks/useSettingsScreenConfig';
|
|
33
33
|
|
|
34
|
-
// Alias for clarity - useSettingsScreenConfig already includes auth
|
|
35
|
-
export { useSettingsScreenConfig as useSettingsScreenConfigWithAuth } from './presentation/hooks/useSettingsScreenConfig';
|
|
36
|
-
|
|
37
34
|
// Re-export types
|
|
38
35
|
export type {
|
|
39
36
|
UseSettingsScreenConfigParams,
|
|
@@ -16,7 +16,7 @@ Provides components and utilities for collecting user feedback including feedbac
|
|
|
16
16
|
|
|
17
17
|
**Domain:**
|
|
18
18
|
- `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/feedback/domain/entities/FeedbackEntity.ts`
|
|
19
|
-
- `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/feedback/domain/
|
|
19
|
+
- `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/feedback/domain/entities/FeatureRequestEntity.ts`
|
|
20
20
|
|
|
21
21
|
**Index:**
|
|
22
22
|
- `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/feedback/index.ts`
|
|
@@ -26,14 +26,12 @@ Provides components and utilities for collecting user feedback including feedbac
|
|
|
26
26
|
1. **Form State Management**: Use useFeedbackForm hook for centralized form state and validation
|
|
27
27
|
2. **Type Categorization**: Categorize feedback by type (bug, feature, general, etc.) for better routing
|
|
28
28
|
3. **Star Rating Integration**: Integrate with Rating domain for 1-5 star ratings
|
|
29
|
-
4. **
|
|
30
|
-
5. **Validation First**: Always validate form state before submission to prevent invalid data
|
|
29
|
+
4. **Validation First**: Always validate form state before submission to prevent invalid data
|
|
31
30
|
|
|
32
31
|
## Restrictions (Forbidden)
|
|
33
32
|
|
|
34
33
|
### DO NOT
|
|
35
34
|
- ❌ DO NOT submit feedback without validating required fields (type, title)
|
|
36
|
-
- ❌ DO NOT bypass the repository pattern when submitting feedback
|
|
37
35
|
- ❌ DO NOT use FeedbackForm without providing texts configuration
|
|
38
36
|
- ❌ DO NOT handle feedback submission manually when the hook provides everything needed
|
|
39
37
|
|
|
@@ -9,51 +9,4 @@ export type FeedbackType =
|
|
|
9
9
|
| 'improvement'
|
|
10
10
|
| 'other';
|
|
11
11
|
|
|
12
|
-
export type FeedbackStatus = 'pending' | 'reviewed' | 'resolved' | 'closed';
|
|
13
|
-
|
|
14
12
|
export type FeedbackRating = 1 | 2 | 3 | 4 | 5;
|
|
15
|
-
|
|
16
|
-
export interface FeedbackEntity {
|
|
17
|
-
id: string;
|
|
18
|
-
userId: string | null;
|
|
19
|
-
userEmail?: string | null;
|
|
20
|
-
type: FeedbackType;
|
|
21
|
-
title: string;
|
|
22
|
-
description: string;
|
|
23
|
-
rating?: FeedbackRating;
|
|
24
|
-
status: FeedbackStatus;
|
|
25
|
-
deviceInfo?: {
|
|
26
|
-
platform: string;
|
|
27
|
-
osVersion: string;
|
|
28
|
-
appVersion: string;
|
|
29
|
-
};
|
|
30
|
-
metadata?: Record<string, unknown>;
|
|
31
|
-
createdAt: string;
|
|
32
|
-
updatedAt: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function createFeedback(
|
|
36
|
-
userId: string | null,
|
|
37
|
-
type: FeedbackType,
|
|
38
|
-
title: string,
|
|
39
|
-
description: string,
|
|
40
|
-
userEmail?: string | null,
|
|
41
|
-
rating?: FeedbackRating,
|
|
42
|
-
deviceInfo?: FeedbackEntity['deviceInfo'],
|
|
43
|
-
metadata?: Record<string, unknown>
|
|
44
|
-
): Omit<FeedbackEntity, 'id'> {
|
|
45
|
-
const now = new Date().toISOString();
|
|
46
|
-
return {
|
|
47
|
-
userId,
|
|
48
|
-
userEmail,
|
|
49
|
-
type,
|
|
50
|
-
title,
|
|
51
|
-
description,
|
|
52
|
-
rating,
|
|
53
|
-
status: 'pending',
|
|
54
|
-
deviceInfo,
|
|
55
|
-
metadata,
|
|
56
|
-
createdAt: now,
|
|
57
|
-
updatedAt: now,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
@@ -9,4 +9,3 @@ export * from './presentation/components/SupportSection';
|
|
|
9
9
|
export * from './presentation/hooks/useFeedbackForm';
|
|
10
10
|
export * from './domain/entities/FeedbackEntity';
|
|
11
11
|
export * from './domain/entities/FeatureRequestEntity';
|
|
12
|
-
export * from './domain/repositories/IFeedbackRepository';
|
|
@@ -10,7 +10,6 @@ import { useMemo } from "react";
|
|
|
10
10
|
import { useAuth, useUserProfile, useAuthHandlers } from "@umituz/react-native-auth";
|
|
11
11
|
import { createUserProfileDisplay } from "../utils/userProfileUtils";
|
|
12
12
|
import { createAccountConfig } from "../utils/accountConfigUtils";
|
|
13
|
-
import { translateFAQData } from "../utils/faqTranslator";
|
|
14
13
|
import { useSettingsConfigFactory } from "../utils/settingsConfigFactory";
|
|
15
14
|
import type { SettingsConfig, SettingsTranslations } from "../screens/types";
|
|
16
15
|
import type { FeedbackFormData } from "../utils/config-creators";
|
|
@@ -151,16 +150,11 @@ export const useSettingsScreenConfig = (
|
|
|
151
150
|
translations: translations?.account as any,
|
|
152
151
|
}), [user, userProfileData, handleSignIn, handleSignOut, handleDeleteAccount, translations]);
|
|
153
152
|
|
|
154
|
-
const translatedFaqData = useMemo(() =>
|
|
155
|
-
translateFAQData(faqData, appInfo),
|
|
156
|
-
[faqData, appInfo]
|
|
157
|
-
);
|
|
158
|
-
|
|
159
153
|
return {
|
|
160
154
|
settingsConfig,
|
|
161
155
|
userProfile,
|
|
162
156
|
accountConfig,
|
|
163
|
-
translatedFaqData,
|
|
157
|
+
translatedFaqData: faqData,
|
|
164
158
|
isLoading: loading,
|
|
165
159
|
isAuthReady,
|
|
166
160
|
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Feedback Repository Interface
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { FeedbackEntity } from '../entities/FeedbackEntity';
|
|
6
|
-
|
|
7
|
-
export interface FeedbackError {
|
|
8
|
-
message: string;
|
|
9
|
-
code?: 'SUBMIT_FAILED' | 'FETCH_FAILED' | 'DELETE_FAILED' | 'VALIDATION_ERROR';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type FeedbackResult<T> =
|
|
13
|
-
| {
|
|
14
|
-
success: true;
|
|
15
|
-
data: T;
|
|
16
|
-
}
|
|
17
|
-
| {
|
|
18
|
-
success: false;
|
|
19
|
-
error: FeedbackError;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export interface IFeedbackRepository {
|
|
23
|
-
submitFeedback(
|
|
24
|
-
feedback: FeedbackEntity | Omit<FeedbackEntity, 'id'>
|
|
25
|
-
): Promise<FeedbackResult<FeedbackEntity>>;
|
|
26
|
-
getUserFeedback(userId: string): Promise<FeedbackResult<FeedbackEntity[]>>;
|
|
27
|
-
deleteFeedback(feedbackId: string): Promise<FeedbackResult<boolean>>;
|
|
28
|
-
}
|