@umituz/react-native-ai-generation-content 1.17.238 → 1.17.240

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.17.238",
3
+ "version": "1.17.240",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -30,6 +30,8 @@ export interface Creation {
30
30
  readonly createdAt: Date;
31
31
  readonly isShared: boolean;
32
32
  readonly isFavorite: boolean;
33
+ readonly rating?: number;
34
+ readonly ratedAt?: Date;
33
35
  // Extended fields for job-based creations
34
36
  readonly status?: CreationStatus;
35
37
  readonly output?: CreationOutput;
@@ -49,6 +51,8 @@ export interface CreationDocument {
49
51
  readonly output?: CreationOutput | null;
50
52
  readonly isShared: boolean;
51
53
  readonly isFavorite?: boolean;
54
+ readonly rating?: number;
55
+ readonly ratedAt?: FirebaseTimestamp | Date;
52
56
  readonly createdAt: FirebaseTimestamp | Date;
53
57
  readonly completedAt?: FirebaseTimestamp | Date;
54
58
  }
@@ -78,6 +82,13 @@ export function mapDocumentToCreation(
78
82
  data.uri ||
79
83
  "";
80
84
 
85
+ let ratedAtDate: Date | undefined;
86
+ if (data.ratedAt instanceof Date) {
87
+ ratedAtDate = data.ratedAt;
88
+ } else if (data.ratedAt && typeof data.ratedAt === "object" && "toDate" in data.ratedAt && typeof data.ratedAt.toDate === "function") {
89
+ ratedAtDate = data.ratedAt.toDate();
90
+ }
91
+
81
92
  return {
82
93
  id,
83
94
  uri,
@@ -88,6 +99,8 @@ export function mapDocumentToCreation(
88
99
  createdAt: creationDate,
89
100
  isShared: data.isShared ?? false,
90
101
  isFavorite: data.isFavorite ?? false,
102
+ rating: data.rating,
103
+ ratedAt: ratedAtDate,
91
104
  status: data.status as CreationStatus | undefined,
92
105
  output: data.output ?? undefined,
93
106
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ResultActionBar Component
3
- * Action buttons for save, share, and try again
3
+ * Action buttons for save, share, retry, and rate
4
4
  */
5
5
 
6
6
  import React, { useMemo } from "react";
@@ -17,11 +17,13 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
17
17
  onDownload,
18
18
  onShare,
19
19
  onTryAgain,
20
+ onRate,
20
21
  saveButtonText,
21
22
  saveButtonLoadingText,
22
23
  shareButtonText,
23
24
  shareButtonLoadingText,
24
25
  tryAgainButtonText,
26
+ rateButtonText,
25
27
  }) => {
26
28
  const tokens = useAppDesignTokens();
27
29
 
@@ -29,15 +31,18 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
29
31
  () =>
30
32
  StyleSheet.create({
31
33
  container: {
34
+ marginTop: tokens.spacing.xl,
35
+ gap: tokens.spacing.md,
36
+ },
37
+ buttonRow: {
32
38
  flexDirection: "row",
33
39
  gap: tokens.spacing.md,
34
- marginBottom: tokens.spacing.lg,
35
40
  },
36
41
  button: {
37
42
  flex: 1,
38
43
  },
39
- tryAgainButton: {
40
- marginTop: tokens.spacing.md,
44
+ fullWidthButton: {
45
+ width: "100%",
41
46
  },
42
47
  }),
43
48
  [tokens],
@@ -45,30 +50,42 @@ export const ResultActionBar: React.FC<ResultActionBarProps> = ({
45
50
 
46
51
  return (
47
52
  <View style={styles.container}>
48
- <AtomicButton
49
- title={isSaving ? saveButtonLoadingText : saveButtonText}
50
- onPress={onDownload}
51
- disabled={isSaving}
52
- variant="secondary"
53
- icon="download"
54
- style={styles.button}
55
- />
56
- <AtomicButton
57
- title={isSharing ? shareButtonLoadingText : shareButtonText}
58
- onPress={onShare}
59
- disabled={isSharing}
60
- variant="primary"
61
- icon="share-social"
62
- style={styles.button}
63
- />
64
- <AtomicButton
65
- title={tryAgainButtonText}
66
- onPress={onTryAgain}
67
- variant="text"
68
- icon="refresh"
69
- fullWidth
70
- style={styles.tryAgainButton}
71
- />
53
+ <View style={styles.buttonRow}>
54
+ <AtomicButton
55
+ title={isSaving ? saveButtonLoadingText : saveButtonText}
56
+ onPress={onDownload}
57
+ disabled={isSaving}
58
+ variant="outline"
59
+ icon="download"
60
+ style={styles.button}
61
+ />
62
+ <AtomicButton
63
+ title={isSharing ? shareButtonLoadingText : shareButtonText}
64
+ onPress={onShare}
65
+ disabled={isSharing}
66
+ variant="primary"
67
+ icon="share-social"
68
+ style={styles.button}
69
+ />
70
+ </View>
71
+ <View style={styles.buttonRow}>
72
+ <AtomicButton
73
+ title={tryAgainButtonText}
74
+ onPress={onTryAgain}
75
+ variant="outline"
76
+ icon="refresh"
77
+ style={styles.button}
78
+ />
79
+ {onRate && rateButtonText && (
80
+ <AtomicButton
81
+ title={rateButtonText}
82
+ onPress={onRate}
83
+ variant="primary"
84
+ icon="star"
85
+ style={styles.button}
86
+ />
87
+ )}
88
+ </View>
72
89
  </View>
73
90
  );
74
91
  };
@@ -23,6 +23,7 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
23
23
  onShare,
24
24
  onTryAgain,
25
25
  onNavigateBack,
26
+ onRate,
26
27
  translations,
27
28
  style,
28
29
  }) => {
@@ -88,11 +89,13 @@ export const ResultPreviewScreen: React.FC<ResultPreviewScreenProps> = ({
88
89
  onDownload={onDownload}
89
90
  onShare={onShare}
90
91
  onTryAgain={onTryAgain}
92
+ onRate={onRate}
91
93
  saveButtonText={translations.saveButton}
92
94
  saveButtonLoadingText={translations.saving}
93
95
  shareButtonText={translations.shareButton}
94
96
  shareButtonLoadingText={translations.sharing}
95
97
  tryAgainButtonText={translations.tryAnother}
98
+ rateButtonText={translations.rateButton}
96
99
  />
97
100
  </View>
98
101
  </View>
@@ -63,6 +63,8 @@ export interface ResultActionBarProps {
63
63
  onShare: () => void;
64
64
  /** Try again callback */
65
65
  onTryAgain: () => void;
66
+ /** Rate callback (optional) */
67
+ onRate?: () => void;
66
68
  /** Save button text */
67
69
  saveButtonText: string;
68
70
  /** Save button text when loading */
@@ -73,6 +75,8 @@ export interface ResultActionBarProps {
73
75
  shareButtonLoadingText: string;
74
76
  /** Try again button text */
75
77
  tryAgainButtonText: string;
78
+ /** Rate button text (optional) */
79
+ rateButtonText?: string;
76
80
  }
77
81
 
78
82
  /**
@@ -89,6 +93,7 @@ export interface ResultPreviewScreenProps {
89
93
  onShare: () => void;
90
94
  onTryAgain: () => void;
91
95
  onNavigateBack: () => void;
96
+ onRate?: () => void;
92
97
  /** Translations */
93
98
  translations: ResultPreviewTranslations;
94
99
  /** Optional custom style */
@@ -113,6 +118,8 @@ export interface ResultPreviewTranslations {
113
118
  sharing: string;
114
119
  /** Try again button */
115
120
  tryAnother: string;
121
+ /** Rate button (optional) */
122
+ rateButton?: string;
116
123
  }
117
124
 
118
125
  /**