@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.
- package/package.json +1 -2
- package/src/features/audio-generation/domain/entities.ts +39 -0
- package/src/features/audio-generation/index.ts +2 -0
- package/src/features/audio-generation/presentation/hooks.ts +39 -0
- package/src/{domains/feature-background → features/background}/presentation/components/ComparisonSlider.tsx +2 -2
- package/src/{domains/feature-background → features/background}/presentation/components/ErrorDisplay.tsx +1 -1
- package/src/{domains/feature-background → features/background}/presentation/components/FeatureHeader.tsx +1 -1
- package/src/{domains/feature-background → features/background}/presentation/components/GenerateButton.tsx +1 -1
- package/src/{domains/feature-background → features/background}/presentation/components/ImagePicker.tsx +1 -1
- package/src/{domains/feature-background → features/background}/presentation/components/ProcessingModal.tsx +2 -2
- package/src/{domains/feature-background → features/background}/presentation/components/PromptInput.tsx +5 -5
- package/src/{domains/feature-background → features/background}/presentation/components/ResultDisplay.tsx +2 -2
- package/src/features/colorization/domain/entities.ts +46 -0
- package/src/features/colorization/index.ts +2 -0
- package/src/features/colorization/presentation/hooks.ts +39 -0
- package/src/features/face-swap/domain/entities.ts +48 -0
- package/src/features/face-swap/index.ts +2 -0
- package/src/features/face-swap/presentation/hooks.ts +41 -0
- package/src/features/future-prediction/domain/entities.ts +45 -0
- package/src/features/future-prediction/index.ts +2 -0
- package/src/features/future-prediction/presentation/hooks.ts +39 -0
- package/src/features/image-captioning/domain/entities.ts +47 -0
- package/src/features/image-captioning/index.ts +2 -0
- package/src/features/image-captioning/presentation/hooks.ts +39 -0
- package/src/features/inpainting/domain/entities.ts +58 -0
- package/src/features/inpainting/index.ts +2 -0
- package/src/features/inpainting/presentation/hooks.ts +39 -0
- package/src/features/photo-restoration/domain/entities.ts +48 -0
- package/src/features/photo-restoration/index.ts +2 -0
- package/src/features/photo-restoration/presentation/hooks.ts +39 -0
- package/src/features/sketch-to-image/domain/entities.ts +47 -0
- package/src/features/sketch-to-image/index.ts +2 -0
- package/src/features/sketch-to-image/presentation/hooks.ts +39 -0
- package/src/features/style-transfer/domain/entities.ts +52 -0
- package/src/features/style-transfer/index.ts +2 -0
- package/src/features/style-transfer/presentation/hooks.ts +39 -0
- package/src/features/text-to-image/domain/entities.ts +58 -0
- package/src/features/text-to-image/index.ts +2 -0
- package/src/features/text-to-image/presentation/hooks.ts +39 -0
- package/src/features/text-to-video/domain/entities.ts +52 -0
- package/src/features/text-to-video/index.ts +2 -0
- package/src/features/text-to-video/presentation/hooks.ts +39 -0
- package/src/features/upscaling/domain/entities.ts +42 -0
- package/src/features/upscaling/index.ts +2 -0
- package/src/features/upscaling/presentation/hooks.ts +39 -0
- package/src/index.ts +3 -2
- package/src/presentation/hooks/photo-generation.types.ts +9 -0
- package/src/presentation/hooks/usePhotoGeneration.ts +12 -0
- /package/src/{domains/feature-background → features/background}/domain/entities/background.types.ts +0 -0
- /package/src/{domains/feature-background → features/background}/domain/entities/component.types.ts +0 -0
- /package/src/{domains/feature-background → features/background}/domain/entities/config.types.ts +0 -0
- /package/src/{domains/feature-background → features/background}/domain/entities/index.ts +0 -0
- /package/src/{domains/feature-background → features/background}/index.ts +0 -0
- /package/src/{domains/feature-background → features/background}/infrastructure/constants/index.ts +0 -0
- /package/src/{domains/feature-background → features/background}/infrastructure/constants/prompts.constants.ts +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/BackgroundFeature.tsx +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/ModeSelector.tsx +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/components/index.ts +0 -0
- /package/src/{domains/feature-background → features/background}/presentation/hooks/index.ts +0 -0
- /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;
|
/package/src/{domains/feature-background → features/background}/domain/entities/background.types.ts
RENAMED
|
File without changes
|
/package/src/{domains/feature-background → features/background}/domain/entities/component.types.ts
RENAMED
|
File without changes
|
/package/src/{domains/feature-background → features/background}/domain/entities/config.types.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{domains/feature-background → features/background}/infrastructure/constants/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{domains/feature-background → features/background}/presentation/components/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|