@umituz/react-native-ai-generation-content 1.12.23 → 1.12.25

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.
Files changed (60) hide show
  1. package/package.json +1 -2
  2. package/src/features/audio-generation/domain/entities.ts +39 -0
  3. package/src/features/audio-generation/index.ts +2 -0
  4. package/src/features/audio-generation/presentation/hooks.ts +39 -0
  5. package/src/{domains/feature-background → features/background}/presentation/components/ComparisonSlider.tsx +2 -2
  6. package/src/{domains/feature-background → features/background}/presentation/components/ErrorDisplay.tsx +1 -1
  7. package/src/{domains/feature-background → features/background}/presentation/components/FeatureHeader.tsx +1 -1
  8. package/src/{domains/feature-background → features/background}/presentation/components/GenerateButton.tsx +1 -1
  9. package/src/{domains/feature-background → features/background}/presentation/components/ImagePicker.tsx +1 -1
  10. package/src/{domains/feature-background → features/background}/presentation/components/ProcessingModal.tsx +2 -2
  11. package/src/{domains/feature-background → features/background}/presentation/components/PromptInput.tsx +5 -5
  12. package/src/{domains/feature-background → features/background}/presentation/components/ResultDisplay.tsx +2 -2
  13. package/src/features/colorization/domain/entities.ts +46 -0
  14. package/src/features/colorization/index.ts +2 -0
  15. package/src/features/colorization/presentation/hooks.ts +39 -0
  16. package/src/features/face-swap/domain/entities.ts +48 -0
  17. package/src/features/face-swap/index.ts +2 -0
  18. package/src/features/face-swap/presentation/hooks.ts +41 -0
  19. package/src/features/future-prediction/domain/entities.ts +45 -0
  20. package/src/features/future-prediction/index.ts +2 -0
  21. package/src/features/future-prediction/presentation/hooks.ts +39 -0
  22. package/src/features/image-captioning/domain/entities.ts +47 -0
  23. package/src/features/image-captioning/index.ts +2 -0
  24. package/src/features/image-captioning/presentation/hooks.ts +39 -0
  25. package/src/features/inpainting/domain/entities.ts +58 -0
  26. package/src/features/inpainting/index.ts +2 -0
  27. package/src/features/inpainting/presentation/hooks.ts +39 -0
  28. package/src/features/photo-restoration/domain/entities.ts +48 -0
  29. package/src/features/photo-restoration/index.ts +2 -0
  30. package/src/features/photo-restoration/presentation/hooks.ts +39 -0
  31. package/src/features/sketch-to-image/domain/entities.ts +47 -0
  32. package/src/features/sketch-to-image/index.ts +2 -0
  33. package/src/features/sketch-to-image/presentation/hooks.ts +39 -0
  34. package/src/features/style-transfer/domain/entities.ts +52 -0
  35. package/src/features/style-transfer/index.ts +2 -0
  36. package/src/features/style-transfer/presentation/hooks.ts +39 -0
  37. package/src/features/text-to-image/domain/entities.ts +58 -0
  38. package/src/features/text-to-image/index.ts +2 -0
  39. package/src/features/text-to-image/presentation/hooks.ts +39 -0
  40. package/src/features/text-to-video/domain/entities.ts +52 -0
  41. package/src/features/text-to-video/index.ts +2 -0
  42. package/src/features/text-to-video/presentation/hooks.ts +39 -0
  43. package/src/features/upscaling/domain/entities.ts +42 -0
  44. package/src/features/upscaling/index.ts +2 -0
  45. package/src/features/upscaling/presentation/hooks.ts +39 -0
  46. package/src/index.ts +3 -2
  47. package/src/presentation/hooks/photo-generation.types.ts +9 -0
  48. package/src/presentation/hooks/usePhotoGeneration.ts +12 -0
  49. /package/src/{domains/feature-background → features/background}/domain/entities/background.types.ts +0 -0
  50. /package/src/{domains/feature-background → features/background}/domain/entities/component.types.ts +0 -0
  51. /package/src/{domains/feature-background → features/background}/domain/entities/config.types.ts +0 -0
  52. /package/src/{domains/feature-background → features/background}/domain/entities/index.ts +0 -0
  53. /package/src/{domains/feature-background → features/background}/index.ts +0 -0
  54. /package/src/{domains/feature-background → features/background}/infrastructure/constants/index.ts +0 -0
  55. /package/src/{domains/feature-background → features/background}/infrastructure/constants/prompts.constants.ts +0 -0
  56. /package/src/{domains/feature-background → features/background}/presentation/components/BackgroundFeature.tsx +0 -0
  57. /package/src/{domains/feature-background → features/background}/presentation/components/ModeSelector.tsx +0 -0
  58. /package/src/{domains/feature-background → features/background}/presentation/components/index.ts +0 -0
  59. /package/src/{domains/feature-background → features/background}/presentation/hooks/index.ts +0 -0
  60. /package/src/{domains/feature-background → features/background}/presentation/hooks/useBackgroundFeature.ts +0 -0
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { useState, useCallback, useRef } from "react";
7
7
  import { useOfflineStore } from "@umituz/react-native-offline";
8
+ import { useAlert } from "@umituz/react-native-design-system";
8
9
  import type {
9
10
  PhotoGenerationConfig,
10
11
  PhotoGenerationState,
@@ -29,6 +30,7 @@ export const usePhotoGeneration = <TInput, TResult, TSaveInput = unknown>(
29
30
  onSuccess,
30
31
  onError,
31
32
  onSaveComplete,
33
+ alertMessages,
32
34
  } = config;
33
35
 
34
36
  const [state, setState] = useState<PhotoGenerationState<TResult>>({
@@ -41,6 +43,7 @@ export const usePhotoGeneration = <TInput, TResult, TSaveInput = unknown>(
41
43
  const [status, setStatus] = useState<PhotoGenerationStatus>("idle");
42
44
  const isGeneratingRef = useRef(false);
43
45
  const offlineStore = useOfflineStore();
46
+ const { showError } = useAlert();
44
47
 
45
48
  const createError = useCallback(
46
49
  (
@@ -143,6 +146,15 @@ export const usePhotoGeneration = <TInput, TResult, TSaveInput = unknown>(
143
146
  progress: 0,
144
147
  });
145
148
  setStatus("error");
149
+
150
+ const errorMessage =
151
+ generationError.type === "network_error" ? alertMessages.networkError :
152
+ generationError.type === "policy_violation" ? alertMessages.policyViolation :
153
+ generationError.type === "save_failed" ? alertMessages.saveFailed :
154
+ generationError.type === "credit_failed" ? alertMessages.creditFailed :
155
+ alertMessages.unknown;
156
+
157
+ showError("Error", errorMessage);
146
158
  onError?.(generationError);
147
159
  } finally {
148
160
  isGeneratingRef.current = false;