@umituz/react-native-ai-generation-content 1.17.75 → 1.17.77

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.75",
3
+ "version": "1.17.77",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/index.ts CHANGED
@@ -199,6 +199,10 @@ export {
199
199
  prepareImage,
200
200
  createDevCallbacks,
201
201
  createFeatureUtils,
202
+ // Video helpers
203
+ showVideoGenerationSuccess,
204
+ handleGenerationError,
205
+ showContentModerationWarning,
202
206
  } from "./infrastructure/utils";
203
207
 
204
208
  export type {
@@ -215,6 +219,8 @@ export type {
215
219
  CreditChecker,
216
220
  AlertFunction,
217
221
  FeatureUtilsConfig,
222
+ // Video helpers types
223
+ VideoAlertFunction,
218
224
  } from "./infrastructure/utils";
219
225
 
220
226
  // =============================================================================
@@ -9,3 +9,4 @@ export * from "./status-checker.util";
9
9
  export * from "./result-validator.util";
10
10
  export * from "./photo-generation";
11
11
  export * from "./feature-utils";
12
+ export * from "./video-helpers";
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Video Generation Helpers
3
+ * Generic helper functions for video generation features
4
+ */
5
+
6
+ /**
7
+ * Alert function type for displaying messages
8
+ */
9
+ export type VideoAlertFunction = (title: string, message: string) => void;
10
+
11
+ /**
12
+ * Default no-op alert function
13
+ */
14
+ const noOpAlert: VideoAlertFunction = () => {
15
+ // No-op for environments without alerts
16
+ };
17
+
18
+ /**
19
+ * Show video generation success
20
+ */
21
+ export function showVideoGenerationSuccess(
22
+ showAlert: VideoAlertFunction = noOpAlert
23
+ ): void {
24
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
25
+ console.log("[VideoGeneration] Success");
26
+ }
27
+ showAlert("Success", "Your video has been generated successfully!");
28
+ }
29
+
30
+ /**
31
+ * Handle generation error
32
+ */
33
+ export function handleGenerationError(
34
+ error: Error | unknown,
35
+ showAlert: VideoAlertFunction = noOpAlert
36
+ ): void {
37
+ const message = error instanceof Error ? error.message : "An error occurred";
38
+
39
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
40
+ console.error("[VideoGeneration] Error:", error);
41
+ }
42
+
43
+ showAlert("Error", `Video generation failed: ${message}`);
44
+ }
45
+
46
+ /**
47
+ * Show content moderation warning
48
+ */
49
+ export function showContentModerationWarning(
50
+ showAlert: VideoAlertFunction = noOpAlert,
51
+ reason?: string
52
+ ): void {
53
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
54
+ console.warn("[VideoGeneration] Content moderation warning:", reason);
55
+ }
56
+
57
+ showAlert(
58
+ "Content Warning",
59
+ reason || "Your content may not comply with our content policy. Please review and try again."
60
+ );
61
+ }
@@ -12,7 +12,7 @@ export interface AIGenScreenHeaderProps {
12
12
  readonly title: string;
13
13
  readonly description?: string;
14
14
  readonly navigationType?: NavigationButtonType;
15
- readonly onNavigationPress: () => void;
15
+ readonly onNavigationPress?: () => void;
16
16
  readonly headerContent?: ReactNode;
17
17
  readonly rightContent?: ReactNode;
18
18
  readonly titleType?: "headlineLarge" | "titleLarge";
@@ -62,13 +62,15 @@ export const AIGenScreenHeader: React.FC<AIGenScreenHeaderProps> = ({
62
62
  </View>
63
63
  <View style={styles.headerActions}>
64
64
  {rightContent}
65
- <TouchableOpacity
66
- onPress={onNavigationPress}
67
- style={buttonStyle}
68
- hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
69
- >
70
- <AtomicIcon name={iconName} size="md" color={iconColor} />
71
- </TouchableOpacity>
65
+ {onNavigationPress && (
66
+ <TouchableOpacity
67
+ onPress={onNavigationPress}
68
+ style={buttonStyle}
69
+ hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
70
+ >
71
+ <AtomicIcon name={iconName} size="md" color={iconColor} />
72
+ </TouchableOpacity>
73
+ )}
72
74
  </View>
73
75
  </View>
74
76
  {showDescription && description && (