@umituz/react-native-ai-generation-content 1.26.2 → 1.26.4
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 +3 -2
- package/src/domains/generation/application/feature-registry.ts +101 -0
- package/src/domains/generation/application/generation-strategy.factory.ts +128 -0
- package/src/domains/generation/domain/feature-config.types.ts +61 -0
- package/src/domains/generation/domain/generation.types.ts +74 -0
- package/src/domains/generation/index.ts +37 -0
- package/src/domains/generation/presentation/useAIGeneration.hook.ts +106 -0
- package/src/domains/wizard/infrastructure/strategies/wizard-strategy.factory.ts +3 -4
- package/src/index.ts +1 -25
- package/src/infrastructure/executors/executor-factory.ts +53 -0
- package/src/infrastructure/executors/image-executor.ts +133 -0
- package/src/infrastructure/executors/video-executor.ts +130 -0
- package/src/features/ai-hug/README.md +0 -438
- package/src/features/ai-hug/domain/index.ts +0 -5
- package/src/features/ai-hug/domain/types/ai-hug.types.ts +0 -25
- package/src/features/ai-hug/domain/types/index.ts +0 -7
- package/src/features/ai-hug/index.ts +0 -19
- package/src/features/ai-hug/presentation/components/AIHugFeature.tsx +0 -77
- package/src/features/ai-hug/presentation/components/index.ts +0 -2
- package/src/features/ai-hug/presentation/hooks/index.ts +0 -9
- package/src/features/ai-hug/presentation/hooks/useAIHugFeature.ts +0 -34
- package/src/features/ai-hug/presentation/index.ts +0 -6
- package/src/features/ai-kiss/README.md +0 -445
- package/src/features/ai-kiss/domain/index.ts +0 -5
- package/src/features/ai-kiss/domain/types/ai-kiss.types.ts +0 -25
- package/src/features/ai-kiss/domain/types/index.ts +0 -7
- package/src/features/ai-kiss/index.ts +0 -19
- package/src/features/ai-kiss/presentation/components/AIKissFeature.tsx +0 -77
- package/src/features/ai-kiss/presentation/components/index.ts +0 -2
- package/src/features/ai-kiss/presentation/hooks/index.ts +0 -9
- package/src/features/ai-kiss/presentation/hooks/useAIKissFeature.ts +0 -34
- package/src/features/ai-kiss/presentation/index.ts +0 -6
- package/src/features/anime-selfie/README.md +0 -396
- package/src/features/anime-selfie/domain/index.ts +0 -5
- package/src/features/anime-selfie/domain/types/anime-selfie.types.ts +0 -52
- package/src/features/anime-selfie/domain/types/index.ts +0 -8
- package/src/features/anime-selfie/index.ts +0 -20
- package/src/features/anime-selfie/presentation/components/AnimeSelfieFeature.tsx +0 -86
- package/src/features/anime-selfie/presentation/components/index.ts +0 -2
- package/src/features/anime-selfie/presentation/hooks/index.ts +0 -9
- package/src/features/anime-selfie/presentation/hooks/useAnimeSelfieFeature.ts +0 -59
- package/src/features/anime-selfie/presentation/index.ts +0 -6
- package/src/features/couple-future/README.md +0 -445
- package/src/features/couple-future/domain/types.ts +0 -63
- package/src/features/couple-future/domain/wizard-config.adapter.ts +0 -76
- package/src/features/couple-future/domain/wizard.types.ts +0 -121
- package/src/features/couple-future/index.ts +0 -83
- package/src/features/couple-future/infrastructure/coupleFeatureRegistry.ts +0 -76
- package/src/features/couple-future/infrastructure/couplePromptEnhancer.ts +0 -100
- package/src/features/couple-future/infrastructure/executor.ts +0 -188
- package/src/features/couple-future/infrastructure/generationUtils.ts +0 -228
- package/src/features/couple-future/presentation/components/ArtStyleSelector.tsx +0 -146
- package/src/features/couple-future/presentation/components/ArtistStyleSelector.tsx +0 -122
- package/src/features/couple-future/presentation/components/CoupleFutureWizard.tsx +0 -239
- package/src/features/couple-future/presentation/components/GeneratingStepContent.tsx +0 -86
- package/src/features/couple-future/presentation/components/RomanticMoodSelector.tsx +0 -147
- package/src/features/couple-future/presentation/components/WardrobeSelector.tsx +0 -141
- package/src/features/couple-future/presentation/components/index.ts +0 -12
- package/src/features/couple-future/presentation/hooks/useCoupleFutureFlow.ts +0 -166
- package/src/features/couple-future/presentation/hooks/useCoupleFutureFlow.types.ts +0 -69
- package/src/features/couple-future/presentation/hooks/useCoupleFutureHandlers.ts +0 -117
- package/src/features/couple-future/presentation/screens/CoupleFeatureScreen.tsx +0 -113
- package/src/features/face-swap/README.md +0 -431
- package/src/features/face-swap/domain/index.ts +0 -5
- package/src/features/face-swap/domain/types/face-swap.types.ts +0 -26
- package/src/features/face-swap/domain/types/index.ts +0 -7
- package/src/features/face-swap/index.ts +0 -19
- package/src/features/face-swap/presentation/components/FaceSwapFeature.tsx +0 -87
- package/src/features/face-swap/presentation/components/index.ts +0 -2
- package/src/features/face-swap/presentation/hooks/index.ts +0 -6
- package/src/features/face-swap/presentation/hooks/useFaceSwapFeature.ts +0 -35
- package/src/features/face-swap/presentation/index.ts +0 -6
- package/src/features/hd-touch-up/README.md +0 -396
- package/src/features/hd-touch-up/domain/index.ts +0 -1
- package/src/features/hd-touch-up/domain/types/hd-touch-up.types.ts +0 -62
- package/src/features/hd-touch-up/domain/types/index.ts +0 -9
- package/src/features/hd-touch-up/index.ts +0 -21
- package/src/features/hd-touch-up/presentation/components/HDTouchUpFeature.tsx +0 -86
- package/src/features/hd-touch-up/presentation/components/index.ts +0 -2
- package/src/features/hd-touch-up/presentation/hooks/index.ts +0 -1
- package/src/features/hd-touch-up/presentation/hooks/useHDTouchUpFeature.ts +0 -23
- package/src/features/hd-touch-up/presentation/index.ts +0 -2
- package/src/features/image-to-image/README.md +0 -459
- package/src/features/image-to-image/domain/index.ts +0 -1
- package/src/features/image-to-image/domain/types/base.types.ts +0 -48
- package/src/features/image-to-image/domain/types/index.ts +0 -1
- package/src/features/image-to-image/domain/types/partials/config.types.ts +0 -37
- package/src/features/image-to-image/domain/types/partials/hook.types.ts +0 -53
- package/src/features/image-to-image/domain/types/partials/metadata.types.ts +0 -32
- package/src/features/image-to-image/domain/types/partials/result.types.ts +0 -44
- package/src/features/image-to-image/domain/types/partials/state.types.ts +0 -34
- package/src/features/image-to-image/domain/types/partials/translation.types.ts +0 -57
- package/src/features/image-to-image/index.ts +0 -2
- package/src/features/image-to-image/presentation/hooks/index.ts +0 -3
- package/src/features/image-to-image/presentation/hooks/useDualImageFeature.ts +0 -204
- package/src/features/image-to-image/presentation/hooks/useImageWithPromptFeature.ts +0 -223
- package/src/features/image-to-image/presentation/hooks/useSingleImageFeature.ts +0 -166
- package/src/features/image-to-image/presentation/index.ts +0 -1
- package/src/features/image-to-video/README.md +0 -414
- package/src/features/image-to-video/domain/constants/animation.constants.ts +0 -47
- package/src/features/image-to-video/domain/constants/duration.constants.ts +0 -13
- package/src/features/image-to-video/domain/constants/form.constants.ts +0 -22
- package/src/features/image-to-video/domain/constants/index.ts +0 -23
- package/src/features/image-to-video/domain/constants/music.constants.ts +0 -53
- package/src/features/image-to-video/domain/index.ts +0 -5
- package/src/features/image-to-video/domain/types/animation.types.ts +0 -20
- package/src/features/image-to-video/domain/types/config.types.ts +0 -56
- package/src/features/image-to-video/domain/types/duration.types.ts +0 -11
- package/src/features/image-to-video/domain/types/form.types.ts +0 -35
- package/src/features/image-to-video/domain/types/image-to-video.types.ts +0 -122
- package/src/features/image-to-video/domain/types/index.ts +0 -39
- package/src/features/image-to-video/domain/types/music.types.ts +0 -21
- package/src/features/image-to-video/index.ts +0 -116
- package/src/features/image-to-video/infrastructure/index.ts +0 -1
- package/src/features/image-to-video/infrastructure/services/image-to-video-executor.ts +0 -154
- package/src/features/image-to-video/infrastructure/services/index.ts +0 -5
- package/src/features/image-to-video/presentation/components/AddMoreCard.tsx +0 -52
- package/src/features/image-to-video/presentation/components/AnimationStyleSelector.tsx +0 -135
- package/src/features/image-to-video/presentation/components/DurationSelector.tsx +0 -110
- package/src/features/image-to-video/presentation/components/EmptyGridState.tsx +0 -69
- package/src/features/image-to-video/presentation/components/GridImageItem.tsx +0 -64
- package/src/features/image-to-video/presentation/components/ImageSelectionGrid.styles.ts +0 -84
- package/src/features/image-to-video/presentation/components/ImageSelectionGrid.tsx +0 -77
- package/src/features/image-to-video/presentation/components/ImageSelectionGrid.types.ts +0 -18
- package/src/features/image-to-video/presentation/components/MusicMoodSelector.tsx +0 -181
- package/src/features/image-to-video/presentation/components/index.ts +0 -30
- package/src/features/image-to-video/presentation/hooks/index.ts +0 -27
- package/src/features/image-to-video/presentation/hooks/useFormState.ts +0 -116
- package/src/features/image-to-video/presentation/hooks/useGeneration.ts +0 -85
- package/src/features/image-to-video/presentation/hooks/useGenerationExecution.ts +0 -143
- package/src/features/image-to-video/presentation/hooks/useImageToVideoFeature.ts +0 -107
- package/src/features/image-to-video/presentation/hooks/useImageToVideoForm.ts +0 -119
- package/src/features/image-to-video/presentation/hooks/useImageToVideoValidation.ts +0 -46
- package/src/features/image-to-video/presentation/index.ts +0 -5
- package/src/features/love-message/domain/constants.ts +0 -162
- package/src/features/love-message/domain/types.ts +0 -58
- package/src/features/love-message/index.ts +0 -37
- package/src/features/love-message/infrastructure/persistence/PartnerProfileRepository.ts +0 -52
- package/src/features/love-message/infrastructure/prompts/messagePromptBuilder.ts +0 -109
- package/src/features/love-message/infrastructure/services/LoveMessageService.ts +0 -35
- package/src/features/love-message/presentation/components/CategoryGrid.tsx +0 -88
- package/src/features/love-message/presentation/components/DetailsInput.tsx +0 -74
- package/src/features/love-message/presentation/components/ExploreHeader.tsx +0 -67
- package/src/features/love-message/presentation/components/FieldInput.tsx +0 -83
- package/src/features/love-message/presentation/components/GeneratorHeader.tsx +0 -88
- package/src/features/love-message/presentation/components/LoveMessageHeroSection.tsx +0 -114
- package/src/features/love-message/presentation/components/MessageListItem.tsx +0 -77
- package/src/features/love-message/presentation/components/MessageResult.tsx +0 -105
- package/src/features/love-message/presentation/components/PartnerInput.tsx +0 -78
- package/src/features/love-message/presentation/components/ProgressDots.tsx +0 -48
- package/src/features/love-message/presentation/components/StepDetails.tsx +0 -23
- package/src/features/love-message/presentation/components/StepPartner.tsx +0 -116
- package/src/features/love-message/presentation/components/StepVibe.tsx +0 -30
- package/src/features/love-message/presentation/components/ToneSelector.tsx +0 -100
- package/src/features/love-message/presentation/components/TrendingSection.tsx +0 -130
- package/src/features/love-message/presentation/components/TypeSelector.tsx +0 -99
- package/src/features/love-message/presentation/hooks/useLoveMessageGenerator.ts +0 -114
- package/src/features/love-message/presentation/hooks/usePartnerProfile.ts +0 -43
- package/src/features/love-message/presentation/navigation/LoveMessageStack.tsx +0 -39
- package/src/features/love-message/presentation/screens/LoveMessageExploreScreen.tsx +0 -53
- package/src/features/love-message/presentation/screens/LoveMessageGeneratorScreen.tsx +0 -169
- package/src/features/love-message/presentation/screens/MessageListScreen.tsx +0 -127
- package/src/features/love-message/presentation/screens/PartnerProfileScreen.tsx +0 -119
- package/src/features/meme-generator/README.md +0 -408
- package/src/features/meme-generator/index.ts +0 -3
- package/src/features/meme-generator/infrastructure/services/MemeGenerationService.ts +0 -87
- package/src/features/meme-generator/presentation/components/MemeGeneratorFeature.tsx +0 -180
- package/src/features/meme-generator/presentation/components/index.ts +0 -2
- package/src/features/meme-generator/presentation/screens/MemeGeneratorScreen.tsx +0 -168
- package/src/features/meme-generator/presentation/screens/index.ts +0 -1
- package/src/features/partner-upload/domain/types.ts +0 -59
- package/src/features/partner-upload/index.ts +0 -30
- package/src/features/partner-upload/presentation/components/PartnerInfoInput.tsx +0 -112
- package/src/features/partner-upload/presentation/components/PhotoTips.tsx +0 -53
- package/src/features/partner-upload/presentation/components/index.ts +0 -4
- package/src/features/partner-upload/presentation/hooks/index.ts +0 -7
- package/src/features/partner-upload/presentation/hooks/usePartnerStep.ts +0 -130
- package/src/features/partner-upload/presentation/screens/PartnerStepScreen.tsx +0 -231
- package/src/features/partner-upload/presentation/screens/index.ts +0 -6
- package/src/features/photo-restoration/README.md +0 -399
- package/src/features/photo-restoration/domain/index.ts +0 -1
- package/src/features/photo-restoration/domain/types/index.ts +0 -9
- package/src/features/photo-restoration/domain/types/photo-restore.types.ts +0 -64
- package/src/features/photo-restoration/index.ts +0 -22
- package/src/features/photo-restoration/presentation/components/PhotoRestoreFeature.tsx +0 -88
- package/src/features/photo-restoration/presentation/components/PhotoRestoreResultView.tsx +0 -86
- package/src/features/photo-restoration/presentation/components/index.ts +0 -4
- package/src/features/photo-restoration/presentation/hooks/index.ts +0 -1
- package/src/features/photo-restoration/presentation/hooks/usePhotoRestoreFeature.ts +0 -23
- package/src/features/photo-restoration/presentation/index.ts +0 -2
- package/src/features/remove-background/README.md +0 -393
- package/src/features/remove-background/domain/index.ts +0 -5
- package/src/features/remove-background/domain/types/index.ts +0 -7
- package/src/features/remove-background/domain/types/remove-background.types.ts +0 -28
- package/src/features/remove-background/index.ts +0 -19
- package/src/features/remove-background/presentation/components/RemoveBackgroundFeature.tsx +0 -86
- package/src/features/remove-background/presentation/components/index.ts +0 -2
- package/src/features/remove-background/presentation/hooks/index.ts +0 -1
- package/src/features/remove-background/presentation/hooks/useRemoveBackgroundFeature.ts +0 -28
- package/src/features/remove-background/presentation/index.ts +0 -6
- package/src/features/remove-object/README.md +0 -405
- package/src/features/remove-object/domain/index.ts +0 -5
- package/src/features/remove-object/domain/types/index.ts +0 -7
- package/src/features/remove-object/domain/types/remove-object.types.ts +0 -54
- package/src/features/remove-object/index.ts +0 -23
- package/src/features/remove-object/presentation/components/RemoveObjectFeature.tsx +0 -136
- package/src/features/remove-object/presentation/components/index.ts +0 -2
- package/src/features/remove-object/presentation/hooks/index.ts +0 -9
- package/src/features/remove-object/presentation/hooks/useRemoveObjectFeature.ts +0 -221
- package/src/features/remove-object/presentation/index.ts +0 -6
- package/src/features/replace-background/README.md +0 -405
- package/src/features/replace-background/domain/types/index.ts +0 -7
- package/src/features/replace-background/domain/types/replace-background.types.ts +0 -33
- package/src/features/replace-background/index.ts +0 -23
- package/src/features/replace-background/presentation/components/ReplaceBackgroundFeature.tsx +0 -105
- package/src/features/replace-background/presentation/components/index.ts +0 -6
- package/src/features/replace-background/presentation/hooks/index.ts +0 -9
- package/src/features/replace-background/presentation/hooks/useReplaceBackgroundFeature.ts +0 -55
- package/src/features/scenarios/domain/types.ts +0 -147
- package/src/features/scenarios/index.ts +0 -64
- package/src/features/scenarios/presentation/components/InspirationChips.tsx +0 -82
- package/src/features/scenarios/presentation/components/MagicPromptHeadline.tsx +0 -79
- package/src/features/scenarios/presentation/components/ScenarioGrid.tsx +0 -224
- package/src/features/scenarios/presentation/components/ScenarioHeader.tsx +0 -55
- package/src/features/scenarios/presentation/components/StyleSelector.tsx +0 -119
- package/src/features/scenarios/presentation/components/index.ts +0 -18
- package/src/features/scenarios/presentation/containers/CategoryNavigationContainer.tsx +0 -178
- package/src/features/scenarios/presentation/screens/HierarchicalScenarioListScreen.tsx +0 -266
- package/src/features/scenarios/presentation/screens/MagicPromptScreen.tsx +0 -242
- package/src/features/scenarios/presentation/screens/MainCategoryScreen.tsx +0 -198
- package/src/features/scenarios/presentation/screens/ScenarioPreviewScreen.tsx +0 -164
- package/src/features/scenarios/presentation/screens/ScenarioSelectorScreen.tsx +0 -66
- package/src/features/scenarios/presentation/screens/SubCategoryScreen.tsx +0 -216
- package/src/features/script-generator/README.md +0 -433
- package/src/features/script-generator/domain/constants/index.ts +0 -10
- package/src/features/script-generator/domain/types/script.types.ts +0 -30
- package/src/features/script-generator/index.ts +0 -5
- package/src/features/script-generator/infrastructure/services/ScriptGenerationService.ts +0 -62
- package/src/features/script-generator/presentation/components/ScriptDisplay.tsx +0 -158
- package/src/features/script-generator/presentation/components/VideoTypeSelector.tsx +0 -102
- package/src/features/script-generator/presentation/components/index.ts +0 -2
- package/src/features/script-generator/presentation/hooks/index.ts +0 -1
- package/src/features/script-generator/presentation/hooks/useScriptGenerator.ts +0 -77
- package/src/features/shared/README.md +0 -311
- package/src/features/shared/dual-image-video/domain/types/dual-image-video.types.ts +0 -88
- package/src/features/shared/dual-image-video/domain/types/index.ts +0 -14
- package/src/features/shared/dual-image-video/index.ts +0 -17
- package/src/features/shared/dual-image-video/presentation/hooks/index.ts +0 -5
- package/src/features/shared/dual-image-video/presentation/hooks/useDualImageVideoFeature.ts +0 -185
- package/src/features/shared/index.ts +0 -6
- package/src/features/text-to-image/README.md +0 -394
- package/src/features/text-to-image/domain/constants/index.ts +0 -8
- package/src/features/text-to-image/domain/constants/options.constants.ts +0 -39
- package/src/features/text-to-image/domain/constants/styles.constants.ts +0 -34
- package/src/features/text-to-image/domain/index.ts +0 -7
- package/src/features/text-to-image/domain/types/config.types.ts +0 -75
- package/src/features/text-to-image/domain/types/form.types.ts +0 -58
- package/src/features/text-to-image/domain/types/index.ts +0 -38
- package/src/features/text-to-image/domain/types/text-to-image.types.ts +0 -58
- package/src/features/text-to-image/index.ts +0 -116
- package/src/features/text-to-image/infrastructure/index.ts +0 -1
- package/src/features/text-to-image/infrastructure/services/index.ts +0 -5
- package/src/features/text-to-image/infrastructure/services/text-to-image-executor.ts +0 -147
- package/src/features/text-to-image/presentation/components/index.ts +0 -30
- package/src/features/text-to-image/presentation/hooks/index.ts +0 -30
- package/src/features/text-to-image/presentation/hooks/useFormState.ts +0 -103
- package/src/features/text-to-image/presentation/hooks/useGeneration.ts +0 -139
- package/src/features/text-to-image/presentation/hooks/useTextToImageFeature.ts +0 -111
- package/src/features/text-to-image/presentation/hooks/useTextToImageForm.ts +0 -58
- package/src/features/text-to-image/presentation/index.ts +0 -7
- package/src/features/text-to-video/README.md +0 -412
- package/src/features/text-to-video/domain/index.ts +0 -1
- package/src/features/text-to-video/domain/types/callback.types.ts +0 -69
- package/src/features/text-to-video/domain/types/component.types.ts +0 -106
- package/src/features/text-to-video/domain/types/config.types.ts +0 -61
- package/src/features/text-to-video/domain/types/index.ts +0 -56
- package/src/features/text-to-video/domain/types/request.types.ts +0 -36
- package/src/features/text-to-video/domain/types/state.types.ts +0 -53
- package/src/features/text-to-video/index.ts +0 -68
- package/src/features/text-to-video/infrastructure/index.ts +0 -1
- package/src/features/text-to-video/infrastructure/services/index.ts +0 -5
- package/src/features/text-to-video/infrastructure/services/text-to-video-executor.ts +0 -141
- package/src/features/text-to-video/presentation/components/FrameSelector.tsx +0 -153
- package/src/features/text-to-video/presentation/components/GenerationTabs.tsx +0 -73
- package/src/features/text-to-video/presentation/components/HeroSection.tsx +0 -61
- package/src/features/text-to-video/presentation/components/HintCarousel.tsx +0 -96
- package/src/features/text-to-video/presentation/components/OptionsPanel.tsx +0 -121
- package/src/features/text-to-video/presentation/components/index.ts +0 -10
- package/src/features/text-to-video/presentation/hooks/index.ts +0 -17
- package/src/features/text-to-video/presentation/hooks/useTextToVideoFeature.ts +0 -225
- package/src/features/text-to-video/presentation/hooks/useTextToVideoForm.ts +0 -134
- package/src/features/text-to-video/presentation/index.ts +0 -7
- package/src/features/text-to-voice/README.md +0 -445
- package/src/features/text-to-voice/domain/index.ts +0 -1
- package/src/features/text-to-voice/domain/types/component.types.ts +0 -91
- package/src/features/text-to-voice/domain/types/config.types.ts +0 -34
- package/src/features/text-to-voice/domain/types/form.types.ts +0 -39
- package/src/features/text-to-voice/domain/types/generation.types.ts +0 -43
- package/src/features/text-to-voice/domain/types/index.ts +0 -38
- package/src/features/text-to-voice/index.ts +0 -53
- package/src/features/text-to-voice/infrastructure/index.ts +0 -1
- package/src/features/text-to-voice/infrastructure/services/index.ts +0 -4
- package/src/features/text-to-voice/infrastructure/services/text-to-voice-executor.ts +0 -103
- package/src/features/text-to-voice/presentation/components/TextToVoiceAudioPlayer.tsx +0 -81
- package/src/features/text-to-voice/presentation/components/index.ts +0 -7
- package/src/features/text-to-voice/presentation/hooks/index.ts +0 -6
- package/src/features/text-to-voice/presentation/hooks/useTextToVoiceForm.ts +0 -91
- package/src/features/text-to-voice/presentation/hooks/useTextToVoiceGeneration.ts +0 -116
- package/src/features/text-to-voice/presentation/index.ts +0 -2
- package/src/features/upscaling/README.md +0 -396
- package/src/features/upscaling/domain/index.ts +0 -1
- package/src/features/upscaling/domain/types/index.ts +0 -1
- package/src/features/upscaling/domain/types/upscale.types.ts +0 -23
- package/src/features/upscaling/index.ts +0 -20
- package/src/features/upscaling/presentation/components/ComparisonSlider.tsx +0 -200
- package/src/features/upscaling/presentation/components/UpscaleFeature.tsx +0 -89
- package/src/features/upscaling/presentation/components/UpscaleResultView.tsx +0 -98
- package/src/features/upscaling/presentation/components/index.ts +0 -6
- package/src/features/upscaling/presentation/hooks/index.ts +0 -1
- package/src/features/upscaling/presentation/hooks/useUpscaleFeature.ts +0 -28
- package/src/features/upscaling/presentation/index.ts +0 -2
- package/src/features/wizard/domain/types.ts +0 -154
- package/src/features/wizard/index.ts +0 -43
- package/src/features/wizard/presentation/components/AIFeatureWizard.tsx +0 -231
- package/src/features/wizard/presentation/components/AIGenerationWizard.tsx +0 -132
- package/src/features/wizard/presentation/hooks/useWizard.ts +0 -120
- package/src/features/wizard/presentation/store/useWizardStore.ts +0 -82
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PartnerStepScreen
|
|
3
|
-
* Generic partner/photo upload screen
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useMemo } from "react";
|
|
7
|
-
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
|
-
import {
|
|
9
|
-
useAppDesignTokens,
|
|
10
|
-
ScreenLayout,
|
|
11
|
-
AtomicText,
|
|
12
|
-
AtomicIcon,
|
|
13
|
-
NavigationHeader,
|
|
14
|
-
type DesignTokens,
|
|
15
|
-
} from "@umituz/react-native-design-system";
|
|
16
|
-
import { PhotoUploadCard } from "../../../../presentation/components";
|
|
17
|
-
import { FaceDetectionToggle } from "../../../../domains/face-detection";
|
|
18
|
-
import { PhotoTips } from "../components/PhotoTips";
|
|
19
|
-
import { PartnerInfoInput } from "../components/PartnerInfoInput";
|
|
20
|
-
import { usePartnerStep } from "../hooks/usePartnerStep";
|
|
21
|
-
import type { UploadedImage } from "../../domain/types";
|
|
22
|
-
|
|
23
|
-
export interface PartnerStepScreenTranslations {
|
|
24
|
-
readonly title: string;
|
|
25
|
-
readonly subtitle: string;
|
|
26
|
-
readonly continue: string;
|
|
27
|
-
readonly tapToUpload: string;
|
|
28
|
-
readonly selectPhoto: string;
|
|
29
|
-
readonly change: string;
|
|
30
|
-
readonly analyzing: string;
|
|
31
|
-
readonly faceDetectionLabel?: string;
|
|
32
|
-
readonly fileTooLarge: string;
|
|
33
|
-
readonly maxFileSize: string;
|
|
34
|
-
readonly error: string;
|
|
35
|
-
readonly uploadFailed: string;
|
|
36
|
-
readonly aiDisclosure?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface PartnerStepScreenConfig {
|
|
40
|
-
readonly showFaceDetection?: boolean;
|
|
41
|
-
readonly showNameInput?: boolean;
|
|
42
|
-
readonly showPhotoTips?: boolean;
|
|
43
|
-
readonly maxFileSizeMB?: number;
|
|
44
|
-
readonly maxNameLength?: number;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface PartnerStepScreenProps {
|
|
48
|
-
readonly translations: PartnerStepScreenTranslations;
|
|
49
|
-
readonly t: (key: string) => string;
|
|
50
|
-
readonly initialName?: string;
|
|
51
|
-
readonly config?: PartnerStepScreenConfig;
|
|
52
|
-
readonly faceDetectionEnabled?: boolean;
|
|
53
|
-
readonly onFaceDetectionToggle?: (enabled: boolean) => void;
|
|
54
|
-
readonly onBack: () => void;
|
|
55
|
-
readonly onContinue: (image: UploadedImage, name: string) => void;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const DEFAULT_CONFIG: PartnerStepScreenConfig = {
|
|
59
|
-
showFaceDetection: false,
|
|
60
|
-
showNameInput: false,
|
|
61
|
-
showPhotoTips: true,
|
|
62
|
-
maxFileSizeMB: 10,
|
|
63
|
-
maxNameLength: 30,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const PartnerStepScreen: React.FC<PartnerStepScreenProps> = ({
|
|
67
|
-
translations,
|
|
68
|
-
t,
|
|
69
|
-
initialName = "",
|
|
70
|
-
config = DEFAULT_CONFIG,
|
|
71
|
-
faceDetectionEnabled = false,
|
|
72
|
-
onFaceDetectionToggle,
|
|
73
|
-
onBack,
|
|
74
|
-
onContinue,
|
|
75
|
-
}) => {
|
|
76
|
-
const tokens = useAppDesignTokens();
|
|
77
|
-
|
|
78
|
-
const { image, name, setName, handlePickImage, canContinue } = usePartnerStep({
|
|
79
|
-
initialName,
|
|
80
|
-
config: { maxFileSizeMB: config.maxFileSizeMB },
|
|
81
|
-
translations: {
|
|
82
|
-
fileTooLarge: translations.fileTooLarge,
|
|
83
|
-
maxFileSize: translations.maxFileSize,
|
|
84
|
-
error: translations.error,
|
|
85
|
-
uploadFailed: translations.uploadFailed,
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
const handleContinuePress = () => {
|
|
90
|
-
if (!canContinue || !image) return;
|
|
91
|
-
onContinue(image, name);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const styles = useMemo(() => createStyles(tokens), [tokens]);
|
|
95
|
-
const showFaceDetection = config.showFaceDetection ?? false;
|
|
96
|
-
const showNameInput = config.showNameInput ?? false;
|
|
97
|
-
const showPhotoTips = config.showPhotoTips ?? true;
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<View style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}>
|
|
101
|
-
<NavigationHeader
|
|
102
|
-
title={translations.title}
|
|
103
|
-
onBackPress={onBack}
|
|
104
|
-
rightElement={
|
|
105
|
-
<TouchableOpacity
|
|
106
|
-
onPress={handleContinuePress}
|
|
107
|
-
activeOpacity={0.7}
|
|
108
|
-
disabled={!canContinue || !image}
|
|
109
|
-
style={[
|
|
110
|
-
styles.continueButton,
|
|
111
|
-
{
|
|
112
|
-
backgroundColor: canContinue && image ? tokens.colors.primary : tokens.colors.surfaceVariant,
|
|
113
|
-
opacity: canContinue && image ? 1 : 0.5,
|
|
114
|
-
},
|
|
115
|
-
]}
|
|
116
|
-
>
|
|
117
|
-
<AtomicText
|
|
118
|
-
type="bodyMedium"
|
|
119
|
-
style={[
|
|
120
|
-
styles.continueText,
|
|
121
|
-
{ color: canContinue && image ? tokens.colors.onPrimary : tokens.colors.textSecondary },
|
|
122
|
-
]}
|
|
123
|
-
>
|
|
124
|
-
{translations.continue}
|
|
125
|
-
</AtomicText>
|
|
126
|
-
<AtomicIcon
|
|
127
|
-
name="arrow-forward"
|
|
128
|
-
size="sm"
|
|
129
|
-
color={canContinue && image ? "onPrimary" : "textSecondary"}
|
|
130
|
-
/>
|
|
131
|
-
</TouchableOpacity>
|
|
132
|
-
}
|
|
133
|
-
/>
|
|
134
|
-
<ScreenLayout
|
|
135
|
-
edges={["left", "right"]}
|
|
136
|
-
backgroundColor="transparent"
|
|
137
|
-
scrollable={true}
|
|
138
|
-
keyboardAvoiding={true}
|
|
139
|
-
contentContainerStyle={styles.scrollContent}
|
|
140
|
-
hideScrollIndicator={true}
|
|
141
|
-
>
|
|
142
|
-
<AtomicText style={[styles.subtitle, { color: tokens.colors.textSecondary }]}>
|
|
143
|
-
{translations.subtitle}
|
|
144
|
-
</AtomicText>
|
|
145
|
-
|
|
146
|
-
{showPhotoTips && <PhotoTips t={t} />}
|
|
147
|
-
|
|
148
|
-
{showFaceDetection && onFaceDetectionToggle && (
|
|
149
|
-
<FaceDetectionToggle
|
|
150
|
-
isEnabled={faceDetectionEnabled}
|
|
151
|
-
onToggle={onFaceDetectionToggle}
|
|
152
|
-
label={translations.faceDetectionLabel ?? ""}
|
|
153
|
-
hidden={true}
|
|
154
|
-
/>
|
|
155
|
-
)}
|
|
156
|
-
|
|
157
|
-
<PhotoUploadCard
|
|
158
|
-
imageUri={image?.previewUrl || null}
|
|
159
|
-
onPress={handlePickImage}
|
|
160
|
-
isValidating={false}
|
|
161
|
-
isValid={null}
|
|
162
|
-
translations={{
|
|
163
|
-
tapToUpload: translations.tapToUpload,
|
|
164
|
-
selectPhoto: translations.selectPhoto,
|
|
165
|
-
change: translations.change,
|
|
166
|
-
analyzing: translations.analyzing,
|
|
167
|
-
}}
|
|
168
|
-
/>
|
|
169
|
-
|
|
170
|
-
{showNameInput && (
|
|
171
|
-
<PartnerInfoInput
|
|
172
|
-
t={t}
|
|
173
|
-
name={name}
|
|
174
|
-
onNameChange={setName}
|
|
175
|
-
showName={true}
|
|
176
|
-
maxNameLength={config.maxNameLength}
|
|
177
|
-
/>
|
|
178
|
-
)}
|
|
179
|
-
{translations.aiDisclosure && (
|
|
180
|
-
<View style={styles.disclosureContainer}>
|
|
181
|
-
<AtomicText
|
|
182
|
-
type="labelSmall"
|
|
183
|
-
style={[styles.disclosureText, { color: tokens.colors.textSecondary }]}
|
|
184
|
-
>
|
|
185
|
-
{translations.aiDisclosure}
|
|
186
|
-
</AtomicText>
|
|
187
|
-
</View>
|
|
188
|
-
)}
|
|
189
|
-
</ScreenLayout>
|
|
190
|
-
</View>
|
|
191
|
-
);
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
const createStyles = (tokens: DesignTokens) =>
|
|
195
|
-
StyleSheet.create({
|
|
196
|
-
container: {
|
|
197
|
-
flex: 1,
|
|
198
|
-
},
|
|
199
|
-
scrollContent: {
|
|
200
|
-
paddingBottom: 40,
|
|
201
|
-
},
|
|
202
|
-
subtitle: {
|
|
203
|
-
fontSize: 16,
|
|
204
|
-
textAlign: "center",
|
|
205
|
-
marginHorizontal: 24,
|
|
206
|
-
marginBottom: 24,
|
|
207
|
-
},
|
|
208
|
-
continueButton: {
|
|
209
|
-
flexDirection: "row",
|
|
210
|
-
alignItems: "center",
|
|
211
|
-
paddingHorizontal: tokens.spacing.md,
|
|
212
|
-
paddingVertical: tokens.spacing.xs,
|
|
213
|
-
borderRadius: tokens.borders.radius.full,
|
|
214
|
-
},
|
|
215
|
-
continueText: {
|
|
216
|
-
fontWeight: "800",
|
|
217
|
-
marginRight: 4,
|
|
218
|
-
},
|
|
219
|
-
disclosureContainer: {
|
|
220
|
-
marginTop: 24,
|
|
221
|
-
marginHorizontal: 24,
|
|
222
|
-
padding: 16,
|
|
223
|
-
borderRadius: 12,
|
|
224
|
-
backgroundColor: tokens.colors.surfaceVariant + "40",
|
|
225
|
-
},
|
|
226
|
-
disclosureText: {
|
|
227
|
-
textAlign: "center",
|
|
228
|
-
lineHeight: 18,
|
|
229
|
-
opacity: 0.8,
|
|
230
|
-
},
|
|
231
|
-
});
|
|
@@ -1,399 +0,0 @@
|
|
|
1
|
-
# Photo Restoration Feature
|
|
2
|
-
|
|
3
|
-
Restore and enhance old, blurry, or damaged photos using AI.
|
|
4
|
-
|
|
5
|
-
## 📍 Import Path
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
import { usePhotoRestoreFeature } from '@umituz/react-native-ai-generation-content';
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
**Location**: `src/features/photo-restoration/`
|
|
12
|
-
|
|
13
|
-
## 🎯 Feature Purpose
|
|
14
|
-
|
|
15
|
-
Repair and enhance damaged, old, or low-quality photographs using AI. Removes scratches, fixes blur, colorizes black & white photos, and restores facial details.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## 📋 Usage Strategy
|
|
20
|
-
|
|
21
|
-
### When to Use This Feature
|
|
22
|
-
|
|
23
|
-
✅ **Use Cases:**
|
|
24
|
-
- Restoring old family photographs
|
|
25
|
-
- Repairing scratched or torn photos
|
|
26
|
-
- Fixing blurry or out-of-focus images
|
|
27
|
-
- Colorizing black and white photos
|
|
28
|
-
- Enhancing vintage photograph quality
|
|
29
|
-
- Preserving historical images
|
|
30
|
-
|
|
31
|
-
❌ **When NOT to Use:**
|
|
32
|
-
- Simple brightness/contrast adjustments (use basic image editing)
|
|
33
|
-
- Background removal (use Remove Background feature)
|
|
34
|
-
- Face swapping (use Face Swap feature)
|
|
35
|
-
- artistic style changes (use Style Transfer)
|
|
36
|
-
|
|
37
|
-
### Implementation Strategy
|
|
38
|
-
|
|
39
|
-
1. **Select restoration type** (auto or specific)
|
|
40
|
-
2. **Upload photo** with clear issues visible
|
|
41
|
-
3. **Preview before/after** comparison
|
|
42
|
-
4. **Allow re-processing** with different settings
|
|
43
|
-
5. **Save high-resolution result**
|
|
44
|
-
6. **Provide quality feedback** mechanism
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## ⚠️ Critical Rules (MUST FOLLOW)
|
|
49
|
-
|
|
50
|
-
### 1. Image Requirements
|
|
51
|
-
- **MUST** provide ONE image to restore
|
|
52
|
-
- **MUST** use high-quality scan (min 1024x1024 recommended)
|
|
53
|
-
- **MUST** ensure photo has visible issues to fix
|
|
54
|
-
- **MUST** use supported formats (JPEG, PNG)
|
|
55
|
-
- **MUST NOT** exceed file size limits (20MB max)
|
|
56
|
-
|
|
57
|
-
### 2. Configuration
|
|
58
|
-
- **MUST** provide valid `userId` for tracking
|
|
59
|
-
- **MUST** specify `restorationType` (auto or specific)
|
|
60
|
-
- **MUST** implement `onError` callback
|
|
61
|
-
- **MUST** implement `onSelectPhoto` callback
|
|
62
|
-
- **MUST** handle all restoration states
|
|
63
|
-
|
|
64
|
-
### 3. State Management
|
|
65
|
-
- **MUST** check `isReady` before enabling restore button
|
|
66
|
-
- **MUST** display progress during restoration
|
|
67
|
-
- **MUST** handle long processing times (show progress)
|
|
68
|
-
- **MUST** display `error` state with clear messages
|
|
69
|
-
- **MUST** implement proper cleanup on unmount
|
|
70
|
-
|
|
71
|
-
### 4. Performance
|
|
72
|
-
- **MUST** implement image compression before upload
|
|
73
|
-
- **MUST** show progress indicator for long operations
|
|
74
|
-
- **MUST** cache restored images locally
|
|
75
|
-
- **MUST** allow users to cancel processing
|
|
76
|
-
- **MUST NOT** restore multiple images simultaneously
|
|
77
|
-
|
|
78
|
-
### 5. User Experience
|
|
79
|
-
- **MUST** provide before/after comparison
|
|
80
|
-
- **MUST** allow re-processing with different settings
|
|
81
|
-
- **MUST** show estimated processing time
|
|
82
|
-
- **MUST** handle restoration failures gracefully
|
|
83
|
-
- **MUST** provide download/share options
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## 🚫 Prohibitions (MUST AVOID)
|
|
88
|
-
|
|
89
|
-
### Strictly Forbidden
|
|
90
|
-
|
|
91
|
-
❌ **NEVER** do the following:
|
|
92
|
-
|
|
93
|
-
1. **No Missing Images**
|
|
94
|
-
- Always validate image is selected
|
|
95
|
-
- Never call process() without image
|
|
96
|
-
|
|
97
|
-
2. **No Auto-Processing**
|
|
98
|
-
- Never start restoration without user action
|
|
99
|
-
- Always require explicit "Restore" button press
|
|
100
|
-
- Provide clear preview before processing
|
|
101
|
-
|
|
102
|
-
3. **No Hardcoded Credentials**
|
|
103
|
-
- Never store API keys in component files
|
|
104
|
-
- Use environment variables or secure storage
|
|
105
|
-
|
|
106
|
-
4. **No Unhandled Errors**
|
|
107
|
-
- Never ignore restoration failures
|
|
108
|
-
- Always explain what went wrong
|
|
109
|
-
- Provide retry or alternative options
|
|
110
|
-
|
|
111
|
-
5. **No Memory Leaks**
|
|
112
|
-
- Never store large original and restored images simultaneously
|
|
113
|
-
- Clean up temporary images
|
|
114
|
-
- Implement proper image disposal
|
|
115
|
-
|
|
116
|
-
6. **No Blocking UI**
|
|
117
|
-
- Never block main thread with image processing
|
|
118
|
-
- Always show progress indicator
|
|
119
|
-
- Allow cancellation of long operations
|
|
120
|
-
|
|
121
|
-
7. **No Loss of Original**
|
|
122
|
-
- Never overwrite original photo
|
|
123
|
-
- Always keep original for comparison
|
|
124
|
-
- Store both versions separately
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
## 🤖 AI Agent Directions
|
|
129
|
-
|
|
130
|
-
### For AI Code Generation Tools
|
|
131
|
-
|
|
132
|
-
When using this feature with AI code generation tools, follow these guidelines:
|
|
133
|
-
|
|
134
|
-
#### Prompt Template for AI Agents
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
You are implementing a photo restoration feature using @umituz/react-native-ai-generation-content.
|
|
138
|
-
|
|
139
|
-
REQUIREMENTS:
|
|
140
|
-
1. Import from: @umituz/react-native-ai-generation-content
|
|
141
|
-
2. Use the usePhotoRestoreFeature hook
|
|
142
|
-
3. Select restoration type (auto or specific)
|
|
143
|
-
4. Implement photo selection UI
|
|
144
|
-
5. Validate photo before restoration
|
|
145
|
-
6. Show before/after comparison
|
|
146
|
-
7. Handle long processing times with progress
|
|
147
|
-
8. Implement proper error handling
|
|
148
|
-
9. Allow re-processing with different settings
|
|
149
|
-
10. Implement cleanup on unmount
|
|
150
|
-
|
|
151
|
-
CRITICAL RULES:
|
|
152
|
-
- MUST validate photo before calling restore()
|
|
153
|
-
- MUST show before/after comparison
|
|
154
|
-
- MUST never overwrite original photo
|
|
155
|
-
- MUST handle long processing times
|
|
156
|
-
- MUST allow re-processing
|
|
157
|
-
- MUST implement debouncing (300ms)
|
|
158
|
-
|
|
159
|
-
CONFIGURATION:
|
|
160
|
-
- Provide valid userId (string)
|
|
161
|
-
- Set restorationType: 'auto' | 'scratches' | 'blur' | 'colorize' | 'all'
|
|
162
|
-
- Implement onSelectPhoto callback
|
|
163
|
-
- Implement onSaveResult callback
|
|
164
|
-
- Configure callbacks: onProcessingStart, onProcessingComplete, onError
|
|
165
|
-
|
|
166
|
-
RESTORATION OPTIONS:
|
|
167
|
-
- removeScratches: boolean (remove scratches and tears)
|
|
168
|
-
- fixBlur: boolean (fix blurry photos)
|
|
169
|
-
- colorize: boolean (add color to B&W photos)
|
|
170
|
-
- enhanceFaces: boolean (restore facial details)
|
|
171
|
-
- adjustContrast: boolean (improve contrast and brightness)
|
|
172
|
-
|
|
173
|
-
STRICTLY FORBIDDEN:
|
|
174
|
-
- No missing photo validation
|
|
175
|
-
- No auto-processing without user action
|
|
176
|
-
- No hardcoded API keys
|
|
177
|
-
- No unhandled errors
|
|
178
|
-
- No memory leaks
|
|
179
|
-
- No overwriting original photo
|
|
180
|
-
- No blocking UI
|
|
181
|
-
|
|
182
|
-
QUALITY CHECKLIST:
|
|
183
|
-
- [ ] Photo selection implemented
|
|
184
|
-
- [ ] Restoration type selector
|
|
185
|
-
- [ ] Before/after comparison view
|
|
186
|
-
- [ ] Progress indicator for long operations
|
|
187
|
-
- [ ] Error display with retry option
|
|
188
|
-
- [ ] Re-processing with different settings
|
|
189
|
-
- [ ] Download/share functionality
|
|
190
|
-
- [ ] Original photo preserved
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
#### AI Implementation Checklist
|
|
194
|
-
|
|
195
|
-
Use this checklist when generating code:
|
|
196
|
-
|
|
197
|
-
- [ ] Feature imported from correct path
|
|
198
|
-
- [ ] Photo selection implemented
|
|
199
|
-
- [ ] Restoration type selector added
|
|
200
|
-
- [ ] Validation before restore()
|
|
201
|
-
- [ ] Before/after comparison view
|
|
202
|
-
- [ ] Progress indicator during processing
|
|
203
|
-
- [ ] Error display with user-friendly message
|
|
204
|
-
- [ ] Re-processing option available
|
|
205
|
-
- [ ] Original photo preserved
|
|
206
|
-
- [ ] Download/share buttons
|
|
207
|
-
- [ ] Cleanup on unmount
|
|
208
|
-
- [ ] Image compression configured
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## 🛠️ Configuration Strategy
|
|
213
|
-
|
|
214
|
-
### Essential Configuration
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
// Required fields
|
|
218
|
-
{
|
|
219
|
-
userId: string
|
|
220
|
-
restorationType: 'auto' | 'scratches' | 'blur' | 'colorize' | 'all'
|
|
221
|
-
onSelectPhoto: () => Promise<string | null>
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// Optional callbacks
|
|
225
|
-
{
|
|
226
|
-
onProcessingStart?: () => void
|
|
227
|
-
onProcessingComplete?: (result) => void
|
|
228
|
-
onError?: (error: string) => void
|
|
229
|
-
}
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### Recommended Settings
|
|
233
|
-
|
|
234
|
-
1. **Restoration Types**
|
|
235
|
-
- Auto: Let AI detect issues (recommended for most cases)
|
|
236
|
-
- Scratches: Remove scratches, tears, stains
|
|
237
|
-
- Blur: Fix blurry or out-of-focus images
|
|
238
|
-
- Colorize: Add color to black & white photos
|
|
239
|
-
- All: Apply all restoration techniques
|
|
240
|
-
|
|
241
|
-
2. **Image Quality**
|
|
242
|
-
- Minimum scan: 1024x1024 resolution
|
|
243
|
-
- Recommended: 2048x2048 or higher
|
|
244
|
-
- Format: JPEG or PNG
|
|
245
|
-
- Max size: 20MB
|
|
246
|
-
|
|
247
|
-
3. **Performance Settings**
|
|
248
|
-
- Compress images before upload
|
|
249
|
-
- Show progress for long operations
|
|
250
|
-
- Implement timeout (120s default)
|
|
251
|
-
- Enable result caching
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
## 📊 State Management
|
|
256
|
-
|
|
257
|
-
### Feature States
|
|
258
|
-
|
|
259
|
-
**isReady**: boolean
|
|
260
|
-
- Photo selected and validated
|
|
261
|
-
- Check before enabling restore button
|
|
262
|
-
|
|
263
|
-
**isProcessing**: boolean
|
|
264
|
-
- Restoration in progress
|
|
265
|
-
- Show loading/progress indicator
|
|
266
|
-
- Disable restore button
|
|
267
|
-
|
|
268
|
-
**progress**: number (0-100)
|
|
269
|
-
- Restoration progress percentage
|
|
270
|
-
- Update progress bar
|
|
271
|
-
|
|
272
|
-
**error**: string | null
|
|
273
|
-
- Error message if restoration failed
|
|
274
|
-
- Display to user with clear message
|
|
275
|
-
|
|
276
|
-
**result**: {
|
|
277
|
-
imageUrl: string
|
|
278
|
-
originalImageUrl?: string
|
|
279
|
-
restorationType?: string
|
|
280
|
-
metadata?: any
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
## 🎨 Best Practices
|
|
286
|
-
|
|
287
|
-
### Photo Selection
|
|
288
|
-
|
|
289
|
-
1. **Scan Quality**
|
|
290
|
-
- Good: High-resolution scan (300 DPI or higher)
|
|
291
|
-
- Bad: Low-quality photo of photo
|
|
292
|
-
|
|
293
|
-
2. **Lighting**
|
|
294
|
-
- Good: Even, well-lit scans
|
|
295
|
-
- Bad: Harsh shadows or glare
|
|
296
|
-
|
|
297
|
-
3. **Damage Assessment**
|
|
298
|
-
- Start with auto mode to detect issues
|
|
299
|
-
- Use specific restoration for targeted fixes
|
|
300
|
-
|
|
301
|
-
4. **Multiple Restorations**
|
|
302
|
-
- Some photos benefit from multiple passes
|
|
303
|
-
- Allow re-processing with different settings
|
|
304
|
-
|
|
305
|
-
### User Experience
|
|
306
|
-
|
|
307
|
-
1. **Before/After Comparison**
|
|
308
|
-
- Show side-by-side comparison
|
|
309
|
-
- Add slider or toggle for easy comparison
|
|
310
|
-
- Zoom capability for detail inspection
|
|
311
|
-
|
|
312
|
-
2. **Progress Feedback**
|
|
313
|
-
- Show estimated time remaining
|
|
314
|
-
- Update progress regularly
|
|
315
|
-
- Allow cancellation
|
|
316
|
-
|
|
317
|
-
3. **Quality Options**
|
|
318
|
-
- Offer multiple restoration types
|
|
319
|
-
- Show examples of each type
|
|
320
|
-
- Recommend best option
|
|
321
|
-
|
|
322
|
-
---
|
|
323
|
-
|
|
324
|
-
## 🐛 Common Pitfalls
|
|
325
|
-
|
|
326
|
-
### Quality Issues
|
|
327
|
-
|
|
328
|
-
❌ **Problem**: Poor restoration quality
|
|
329
|
-
✅ **Solution**: Use higher resolution scans, try different restoration types
|
|
330
|
-
|
|
331
|
-
### Performance Issues
|
|
332
|
-
|
|
333
|
-
❌ **Problem**: Very slow processing
|
|
334
|
-
✅ **Solution**: Compress images, show progress, allow cancellation
|
|
335
|
-
|
|
336
|
-
### User Confusion
|
|
337
|
-
|
|
338
|
-
❌ **Problem**: Users don't see improvement
|
|
339
|
-
✅ **Solution**: Provide before/after comparison, zoom capability
|
|
340
|
-
|
|
341
|
-
### Memory Issues
|
|
342
|
-
|
|
343
|
-
❌ **Problem**: App crashes with large images
|
|
344
|
-
✅ **Solution**: Compress images, implement streaming, clean up properly
|
|
345
|
-
|
|
346
|
-
---
|
|
347
|
-
|
|
348
|
-
## 📦 Related Components
|
|
349
|
-
|
|
350
|
-
Use these components from the library:
|
|
351
|
-
|
|
352
|
-
- **PhotoUploadCard**: Upload photo interface
|
|
353
|
-
- **ResultDisplay**: Before/after comparison
|
|
354
|
-
- **RestorationTypeSelector**: Choose restoration type
|
|
355
|
-
- **ProgressBar**: Progress display
|
|
356
|
-
- **ImageComparison**: Side-by-side comparison
|
|
357
|
-
|
|
358
|
-
Located at: `src/presentation/components/`
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
## 🔄 Migration Strategy
|
|
363
|
-
|
|
364
|
-
If migrating from previous implementation:
|
|
365
|
-
|
|
366
|
-
1. **Update imports** to new path
|
|
367
|
-
2. **Add restoration type selector**
|
|
368
|
-
3. **Implement before/after comparison**
|
|
369
|
-
4. **Update state handling** for new structure
|
|
370
|
-
5. **Add re-processing capability**
|
|
371
|
-
6. **Test all restoration types**
|
|
372
|
-
|
|
373
|
-
---
|
|
374
|
-
|
|
375
|
-
## 📚 Additional Resources
|
|
376
|
-
|
|
377
|
-
- Main documentation: `/docs/`
|
|
378
|
-
- API reference: `/docs/api/`
|
|
379
|
-
- Examples: `/docs/examples/basic/photo-restoration/`
|
|
380
|
-
- Architecture: `/ARCHITECTURE.md`
|
|
381
|
-
|
|
382
|
-
---
|
|
383
|
-
|
|
384
|
-
**Last Updated**: 2025-01-08
|
|
385
|
-
**Version**: 2.0.0 (Strategy-based Documentation)
|
|
386
|
-
|
|
387
|
-
---
|
|
388
|
-
|
|
389
|
-
## 📝 Changelog
|
|
390
|
-
|
|
391
|
-
### v2.0.0 - 2025-01-08
|
|
392
|
-
- **BREAKING**: Documentation format changed to strategy-based
|
|
393
|
-
- Removed extensive code examples
|
|
394
|
-
- Added rules, prohibitions, and AI agent directions
|
|
395
|
-
- Focus on best practices and implementation guidance
|
|
396
|
-
- Added before/after comparison guidelines
|
|
397
|
-
|
|
398
|
-
### v1.0.0 - Initial Release
|
|
399
|
-
- Initial feature documentation
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./types";
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Photo Restore Feature Types
|
|
3
|
-
* Request, Result, Config types for photo restoration
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export interface PhotoRestoreOptions {
|
|
7
|
-
fixScratches?: boolean;
|
|
8
|
-
enhanceFaces?: boolean;
|
|
9
|
-
colorize?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface PhotoRestoreRequest {
|
|
13
|
-
imageUri: string;
|
|
14
|
-
imageBase64?: string;
|
|
15
|
-
userId: string;
|
|
16
|
-
options?: PhotoRestoreOptions;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface PhotoRestoreResult {
|
|
20
|
-
success: boolean;
|
|
21
|
-
imageUrl?: string;
|
|
22
|
-
imageBase64?: string;
|
|
23
|
-
error?: string;
|
|
24
|
-
requestId?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface PhotoRestoreFeatureState {
|
|
28
|
-
imageUri: string | null;
|
|
29
|
-
processedUrl: string | null;
|
|
30
|
-
isProcessing: boolean;
|
|
31
|
-
progress: number;
|
|
32
|
-
error: string | null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface PhotoRestoreTranslations {
|
|
36
|
-
uploadTitle: string;
|
|
37
|
-
uploadSubtitle: string;
|
|
38
|
-
uploadChange: string;
|
|
39
|
-
uploadAnalyzing: string;
|
|
40
|
-
description: string;
|
|
41
|
-
processingText: string;
|
|
42
|
-
processButtonText: string;
|
|
43
|
-
successText: string;
|
|
44
|
-
saveButtonText: string;
|
|
45
|
-
tryAnotherText: string;
|
|
46
|
-
beforeLabel?: string;
|
|
47
|
-
afterLabel?: string;
|
|
48
|
-
compareHint?: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export type PhotoRestoreResultExtractor = (
|
|
52
|
-
result: unknown,
|
|
53
|
-
) => string | undefined;
|
|
54
|
-
|
|
55
|
-
export interface PhotoRestoreFeatureConfig {
|
|
56
|
-
featureType: "photo-restore";
|
|
57
|
-
creditCost?: number;
|
|
58
|
-
extractResult?: PhotoRestoreResultExtractor;
|
|
59
|
-
prepareImage: (imageUri: string) => Promise<string>;
|
|
60
|
-
onImageSelect?: (uri: string) => void;
|
|
61
|
-
onProcessingStart?: (data: { creationId: string; imageUri: string }) => void;
|
|
62
|
-
onProcessingComplete?: (result: PhotoRestoreResult & { creationId?: string }) => void;
|
|
63
|
-
onError?: (error: string, creationId?: string) => void;
|
|
64
|
-
}
|