@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,396 +0,0 @@
|
|
|
1
|
-
# Upscaling Feature
|
|
2
|
-
|
|
3
|
-
Increase image resolution while maintaining quality using AI.
|
|
4
|
-
|
|
5
|
-
## 📍 Import Path
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
import { useUpscaleFeature } from '@umituz/react-native-ai-generation-content';
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
**Location**: `src/features/upscaling/`
|
|
12
|
-
|
|
13
|
-
## 🎯 Feature Purpose
|
|
14
|
-
|
|
15
|
-
Increase image resolution by 2x or 4x while maintaining and enhancing quality using AI. Removes noise and artifacts during the upscaling process.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## 📋 Usage Strategy
|
|
20
|
-
|
|
21
|
-
### When to Use This Feature
|
|
22
|
-
|
|
23
|
-
✅ **Use Cases:**
|
|
24
|
-
- Enhancing low-resolution photos
|
|
25
|
-
- Preparing images for print
|
|
26
|
-
- Improving image quality for presentations
|
|
27
|
-
- Upscaling for large format displays
|
|
28
|
-
- Increasing resolution for cropping
|
|
29
|
-
- Enhancing old digital photos
|
|
30
|
-
|
|
31
|
-
❌ **When NOT to Use:**
|
|
32
|
-
- Simple resizing without quality enhancement (use basic image resizing)
|
|
33
|
-
- Photo restoration with scratches (use Photo Restoration)
|
|
34
|
-
- Image sharpening only (use HD Touch Up)
|
|
35
|
-
- Artistic style changes (use Style Transfer)
|
|
36
|
-
|
|
37
|
-
### Implementation Strategy
|
|
38
|
-
|
|
39
|
-
1. **Select image** to upscale
|
|
40
|
-
2. **Choose scale factor** (2x or 4x)
|
|
41
|
-
3. **Select enhancement options** (denoise, enhance)
|
|
42
|
-
4. **Show file size warning** for 4x upscaling
|
|
43
|
-
5. **Display before/after comparison**
|
|
44
|
-
6. **Provide download in multiple formats**
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## ⚠️ Critical Rules (MUST FOLLOW)
|
|
49
|
-
|
|
50
|
-
### 1. Image Requirements
|
|
51
|
-
- **MUST** provide ONE image to upscale
|
|
52
|
-
- **MUST** use reasonable resolution (min 256x256)
|
|
53
|
-
- **MUST** consider file size limits (original < 10MB recommended)
|
|
54
|
-
- **MUST** use supported formats (JPEG, PNG, WebP)
|
|
55
|
-
- **MUST NOT** exceed output dimensions limits
|
|
56
|
-
|
|
57
|
-
### 2. Configuration
|
|
58
|
-
- **MUST** provide valid `userId` for tracking
|
|
59
|
-
- **MUST** specify `scaleFactor` (2 or 4)
|
|
60
|
-
- **MUST** implement `onError` callback
|
|
61
|
-
- **MUST** implement `onSelectImage` callback
|
|
62
|
-
- **MUST** warn about file size increase
|
|
63
|
-
|
|
64
|
-
### 3. State Management
|
|
65
|
-
- **MUST** check `isReady` before enabling upscale button
|
|
66
|
-
- **MUST** display progress during upscaling
|
|
67
|
-
- **MUST** handle very large file sizes (4x can be 16x larger)
|
|
68
|
-
- **MUST** display `error` state with clear messages
|
|
69
|
-
- **MUST** implement proper cleanup on unmount
|
|
70
|
-
|
|
71
|
-
### 4. Performance
|
|
72
|
-
- **MUST** warn about 4x file sizes (can be very large)
|
|
73
|
-
- **MUST** show progress indicator for long operations
|
|
74
|
-
- **MUST** implement timeout (180s for 4x upscaling)
|
|
75
|
-
- **MUST** allow users to cancel processing
|
|
76
|
-
- **MUST** cache results locally to avoid re-processing
|
|
77
|
-
|
|
78
|
-
### 5. User Experience
|
|
79
|
-
- **MUST** show before/after comparison
|
|
80
|
-
- **MUST** display estimated output file size
|
|
81
|
-
- **MUST** warn about processing time
|
|
82
|
-
- **MUST** provide quality settings
|
|
83
|
-
- **MUST** handle large result downloads
|
|
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 upscaling without user action
|
|
99
|
-
- Always require explicit "Upscale" button press
|
|
100
|
-
- Show preview before processing
|
|
101
|
-
|
|
102
|
-
3. **No Ignoring File Sizes**
|
|
103
|
-
- Never hide file size warnings for 4x upscaling
|
|
104
|
-
- Always display estimated output size
|
|
105
|
-
- Warn about download times
|
|
106
|
-
|
|
107
|
-
4. **No Unhandled Errors**
|
|
108
|
-
- Never ignore upscaling failures
|
|
109
|
-
- Always explain what went wrong
|
|
110
|
-
- Provide retry or alternative options
|
|
111
|
-
|
|
112
|
-
5. **No Memory Leaks**
|
|
113
|
-
- Never keep both original and 4x upscaled in memory
|
|
114
|
-
- Clean up temporary images
|
|
115
|
-
- Implement proper image disposal
|
|
116
|
-
|
|
117
|
-
6. **No Blocking UI**
|
|
118
|
-
- Never block main thread with image processing
|
|
119
|
-
- Always show progress indicator
|
|
120
|
-
- Allow cancellation of long operations
|
|
121
|
-
|
|
122
|
-
7. **No Quality Loss**
|
|
123
|
-
- Never compress upscaled image excessively
|
|
124
|
-
- Use appropriate quality settings
|
|
125
|
-
- Preserve enhancement benefits
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
## 🤖 AI Agent Directions
|
|
130
|
-
|
|
131
|
-
### For AI Code Generation Tools
|
|
132
|
-
|
|
133
|
-
When using this feature with AI code generation tools, follow these guidelines:
|
|
134
|
-
|
|
135
|
-
#### Prompt Template for AI Agents
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
You are implementing an image upscaling feature using @umituz/react-native-ai-generation-content.
|
|
139
|
-
|
|
140
|
-
REQUIREMENTS:
|
|
141
|
-
1. Import from: @umituz/react-native-ai-generation-content
|
|
142
|
-
2. Use the useUpscaleFeature hook
|
|
143
|
-
3. Select scale factor (2x or 4x)
|
|
144
|
-
4. Implement image selection UI
|
|
145
|
-
5. Validate image before upscaling
|
|
146
|
-
6. Show before/after comparison
|
|
147
|
-
7. Warn about file sizes (especially 4x)
|
|
148
|
-
8. Handle long processing times with progress
|
|
149
|
-
9. Implement proper error handling
|
|
150
|
-
10. Implement cleanup on unmount
|
|
151
|
-
|
|
152
|
-
CRITICAL RULES:
|
|
153
|
-
- MUST validate image before calling upscale()
|
|
154
|
-
- MUST warn about 4x file sizes (can be 16x larger)
|
|
155
|
-
- MUST show before/after comparison
|
|
156
|
-
- MUST handle very large result files
|
|
157
|
-
- MUST implement debouncing (300ms)
|
|
158
|
-
- MUST allow cancellation of long operations
|
|
159
|
-
|
|
160
|
-
CONFIGURATION:
|
|
161
|
-
- Provide valid userId (string)
|
|
162
|
-
- Set scaleFactor: 2 | 4 (2 = double, 4 = quadruple)
|
|
163
|
-
- Implement onSelectImage callback
|
|
164
|
-
- Implement onSaveImage callback
|
|
165
|
-
- Configure callbacks: onProcessingStart, onProcessingComplete, onError
|
|
166
|
-
|
|
167
|
-
UPSCALING OPTIONS:
|
|
168
|
-
- scaleFactor: 2 | 4 (resolution multiplier)
|
|
169
|
-
- enhance: boolean (improve details during upscaling)
|
|
170
|
-
- denoise: boolean (remove noise and artifacts)
|
|
171
|
-
|
|
172
|
-
STRICTLY FORBIDDEN:
|
|
173
|
-
- No missing image validation
|
|
174
|
-
- No auto-processing without user action
|
|
175
|
-
- No ignoring file size warnings
|
|
176
|
-
- No unhandled errors
|
|
177
|
-
- No memory leaks with large images
|
|
178
|
-
- No blocking UI
|
|
179
|
-
- No excessive compression of results
|
|
180
|
-
|
|
181
|
-
QUALITY CHECKLIST:
|
|
182
|
-
- [ ] Image selection implemented
|
|
183
|
-
- [ ] Scale factor selector (2x, 4x)
|
|
184
|
-
- [ ] File size warning displayed
|
|
185
|
-
- [ ] Before/after comparison view
|
|
186
|
-
- [ ] Progress indicator for long operations
|
|
187
|
-
- [ ] Error display with retry option
|
|
188
|
-
- [ ] Download with format options
|
|
189
|
-
- [ ] Cancellation capability
|
|
190
|
-
- [ ] Original image preserved
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
#### AI Implementation Checklist
|
|
194
|
-
|
|
195
|
-
Use this checklist when generating code:
|
|
196
|
-
|
|
197
|
-
- [ ] Feature imported from correct path
|
|
198
|
-
- [ ] Image selection implemented
|
|
199
|
-
- [ ] Scale factor selector added (2x, 4x)
|
|
200
|
-
- [ ] Validation before upscale()
|
|
201
|
-
- [ ] File size warning displayed
|
|
202
|
-
- [ ] Before/after comparison view
|
|
203
|
-
- [ ] Progress indicator during processing
|
|
204
|
-
- [ ] Error display with user-friendly message
|
|
205
|
-
- [ ] Download functionality for large files
|
|
206
|
-
- [ ] Cancellation button available
|
|
207
|
-
- [ ] Cleanup on unmount
|
|
208
|
-
- [ ] Original image preserved
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## 🛠️ Configuration Strategy
|
|
213
|
-
|
|
214
|
-
### Essential Configuration
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
// Required fields
|
|
218
|
-
{
|
|
219
|
-
userId: string
|
|
220
|
-
scaleFactor: 2 | 4
|
|
221
|
-
onSelectImage: () => 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. **Scale Factors**
|
|
235
|
-
- 2x: Double resolution (file size ~4x larger)
|
|
236
|
-
- 4x: Quadruple resolution (file size ~16x larger)
|
|
237
|
-
- Start with 2x, try 4x if needed
|
|
238
|
-
|
|
239
|
-
2. **Image Quality**
|
|
240
|
-
- Minimum input: 256x256 resolution
|
|
241
|
-
- Recommended input: 1024x1024 or higher
|
|
242
|
-
- Format: JPEG, PNG, or WebP
|
|
243
|
-
- Max input size: 10MB
|
|
244
|
-
|
|
245
|
-
3. **Performance Settings**
|
|
246
|
-
- Timeout: 180s for 4x upscaling
|
|
247
|
-
- Show progress for long operations
|
|
248
|
-
- Enable result caching
|
|
249
|
-
- Warn about download times
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
## 📊 State Management
|
|
254
|
-
|
|
255
|
-
### Feature States
|
|
256
|
-
|
|
257
|
-
**isReady**: boolean
|
|
258
|
-
- Image selected and validated
|
|
259
|
-
- Check before enabling upscale button
|
|
260
|
-
|
|
261
|
-
**isProcessing**: boolean
|
|
262
|
-
- Upscaling in progress
|
|
263
|
-
- Show loading/progress indicator
|
|
264
|
-
- Disable upscale button
|
|
265
|
-
|
|
266
|
-
**progress**: number (0-100)
|
|
267
|
-
- Upscaling progress percentage
|
|
268
|
-
- Update progress bar
|
|
269
|
-
|
|
270
|
-
**error**: string | null
|
|
271
|
-
- Error message if upscaling failed
|
|
272
|
-
- Display to user with clear message
|
|
273
|
-
|
|
274
|
-
**result**: {
|
|
275
|
-
imageUrl: string
|
|
276
|
-
originalImageUrl?: string
|
|
277
|
-
scaleFactor?: number
|
|
278
|
-
outputSize?: { width: number; height: number }
|
|
279
|
-
metadata?: any
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## 🎨 Best Practices
|
|
285
|
-
|
|
286
|
-
### Image Selection
|
|
287
|
-
|
|
288
|
-
1. **Input Quality**
|
|
289
|
-
- Good: Reasonable quality source images
|
|
290
|
-
- Bad: Extremely low resolution (<256px) or very compressed
|
|
291
|
-
|
|
292
|
-
2. **Scale Factor Choice**
|
|
293
|
-
- Start with 2x for most cases
|
|
294
|
-
- Use 4x for print or large displays
|
|
295
|
-
- Consider file size implications
|
|
296
|
-
|
|
297
|
-
3. **Enhancement Options**
|
|
298
|
-
- Enable enhance for better detail preservation
|
|
299
|
-
- Use denoise for noisy source images
|
|
300
|
-
- Both options recommended for best quality
|
|
301
|
-
|
|
302
|
-
### User Experience
|
|
303
|
-
|
|
304
|
-
1. **File Size Warnings**
|
|
305
|
-
- Clearly show estimated output file size
|
|
306
|
-
- Warn about download times for 4x
|
|
307
|
-
- Provide quality vs size options
|
|
308
|
-
|
|
309
|
-
2. **Progress Feedback**
|
|
310
|
-
- Show estimated time remaining
|
|
311
|
-
- Update progress regularly
|
|
312
|
-
- Allow cancellation for long operations
|
|
313
|
-
|
|
314
|
-
3. **Comparison Tools**
|
|
315
|
-
- Side-by-side comparison
|
|
316
|
-
- Zoom capability for detail inspection
|
|
317
|
-
- Pixel-level comparison (optional)
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
|
|
321
|
-
## 🐛 Common Pitfalls
|
|
322
|
-
|
|
323
|
-
### Quality Issues
|
|
324
|
-
|
|
325
|
-
❌ **Problem**: Upscaled image looks blurry
|
|
326
|
-
✅ **Solution**: Enable enhance option, try higher quality source
|
|
327
|
-
|
|
328
|
-
### File Size Issues
|
|
329
|
-
|
|
330
|
-
❌ **Problem**: 4x file too large to handle
|
|
331
|
-
✅ **Solution**: Warn users, allow 2x option, compress appropriately
|
|
332
|
-
|
|
333
|
-
### Performance Issues
|
|
334
|
-
|
|
335
|
-
❌ **Problem**: Very slow upscaling
|
|
336
|
-
✅ **Solution**: Show progress, allow cancellation, implement timeout
|
|
337
|
-
|
|
338
|
-
### Memory Issues
|
|
339
|
-
|
|
340
|
-
❌ **Problem**: App crashes with large upscales
|
|
341
|
-
✅ **Solution**: Clean up original image, stream download, optimize memory
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
## 📦 Related Components
|
|
346
|
-
|
|
347
|
-
Use these components from the library:
|
|
348
|
-
|
|
349
|
-
- **PhotoUploadCard**: Upload image interface
|
|
350
|
-
- **ResultDisplay**: Before/after comparison
|
|
351
|
-
- **ScaleFactorSelector**: Choose 2x or 4x
|
|
352
|
-
- **ProgressBar**: Progress display
|
|
353
|
-
- **ImageComparison**: Side-by-side comparison
|
|
354
|
-
|
|
355
|
-
Located at: `src/presentation/components/`
|
|
356
|
-
|
|
357
|
-
---
|
|
358
|
-
|
|
359
|
-
## 🔄 Migration Strategy
|
|
360
|
-
|
|
361
|
-
If migrating from previous implementation:
|
|
362
|
-
|
|
363
|
-
1. **Update imports** to new path
|
|
364
|
-
2. **Add scale factor selector** (2x, 4x)
|
|
365
|
-
3. **Implement file size warnings**
|
|
366
|
-
4. **Update state handling** for new structure
|
|
367
|
-
5. **Add before/after comparison**
|
|
368
|
-
6. **Test with large files**
|
|
369
|
-
|
|
370
|
-
---
|
|
371
|
-
|
|
372
|
-
## 📚 Additional Resources
|
|
373
|
-
|
|
374
|
-
- Main documentation: `/docs/`
|
|
375
|
-
- API reference: `/docs/api/`
|
|
376
|
-
- Examples: `/docs/examples/basic/upscaling/`
|
|
377
|
-
- Architecture: `/ARCHITECTURE.md`
|
|
378
|
-
|
|
379
|
-
---
|
|
380
|
-
|
|
381
|
-
**Last Updated**: 2025-01-08
|
|
382
|
-
**Version**: 2.0.0 (Strategy-based Documentation)
|
|
383
|
-
|
|
384
|
-
---
|
|
385
|
-
|
|
386
|
-
## 📝 Changelog
|
|
387
|
-
|
|
388
|
-
### v2.0.0 - 2025-01-08
|
|
389
|
-
- **BREAKING**: Documentation format changed to strategy-based
|
|
390
|
-
- Removed extensive code examples
|
|
391
|
-
- Added rules, prohibitions, and AI agent directions
|
|
392
|
-
- Focus on best practices and implementation guidance
|
|
393
|
-
- Added file size handling guidelines
|
|
394
|
-
|
|
395
|
-
### v1.0.0 - Initial Release
|
|
396
|
-
- Initial feature documentation
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./types";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./upscale.types";
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Upscale Feature Types
|
|
3
|
-
* Extends base image-to-image types with upscale-specific options
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type {
|
|
7
|
-
BaseImageResult,
|
|
8
|
-
BaseSingleImageState,
|
|
9
|
-
BaseImageTranslations,
|
|
10
|
-
SingleImageConfig,
|
|
11
|
-
} from "../../../image-to-image/domain/types";
|
|
12
|
-
|
|
13
|
-
export type UpscaleScaleFactor = 2 | 4 | 8;
|
|
14
|
-
|
|
15
|
-
export type UpscaleResult = BaseImageResult;
|
|
16
|
-
|
|
17
|
-
export type UpscaleFeatureState = BaseSingleImageState;
|
|
18
|
-
|
|
19
|
-
export type UpscaleTranslations = BaseImageTranslations;
|
|
20
|
-
|
|
21
|
-
export interface UpscaleFeatureConfig extends SingleImageConfig<UpscaleResult> {
|
|
22
|
-
defaultScaleFactor?: UpscaleScaleFactor;
|
|
23
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Upscaling Feature
|
|
3
|
-
* Provider-agnostic image upscaling feature
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Domain Types
|
|
7
|
-
export type {
|
|
8
|
-
UpscaleScaleFactor,
|
|
9
|
-
UpscaleResult,
|
|
10
|
-
UpscaleFeatureState,
|
|
11
|
-
UpscaleTranslations,
|
|
12
|
-
UpscaleFeatureConfig,
|
|
13
|
-
} from "./domain";
|
|
14
|
-
|
|
15
|
-
// Presentation Hooks
|
|
16
|
-
export { useUpscaleFeature, type UseUpscaleFeatureProps } from "./presentation";
|
|
17
|
-
|
|
18
|
-
// Presentation Components
|
|
19
|
-
export { UpscaleFeature, UpscaleResultView } from "./presentation";
|
|
20
|
-
export type { UpscaleFeatureProps, UpscaleResultViewProps } from "./presentation";
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comparison Slider Component
|
|
3
|
-
* Before/After comparison slider for upscaled images
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { memo, useState, useRef, useMemo } from "react";
|
|
8
|
-
import { View, StyleSheet, Image, PanResponder } from "react-native";
|
|
9
|
-
import {
|
|
10
|
-
AtomicText,
|
|
11
|
-
useAppDesignTokens,
|
|
12
|
-
useResponsive,
|
|
13
|
-
} from "@umituz/react-native-design-system";
|
|
14
|
-
|
|
15
|
-
export interface ComparisonSliderProps {
|
|
16
|
-
originalUri: string;
|
|
17
|
-
processedUri: string;
|
|
18
|
-
beforeLabel?: string;
|
|
19
|
-
afterLabel?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
|
|
23
|
-
function ComparisonSlider({
|
|
24
|
-
originalUri,
|
|
25
|
-
processedUri,
|
|
26
|
-
beforeLabel = "Before",
|
|
27
|
-
afterLabel = "After",
|
|
28
|
-
}) {
|
|
29
|
-
const tokens = useAppDesignTokens();
|
|
30
|
-
const { width: screenWidth, horizontalPadding } = useResponsive();
|
|
31
|
-
const [sliderPosition, setSliderPosition] = useState(50);
|
|
32
|
-
const containerWidth = useRef(screenWidth - horizontalPadding * 2);
|
|
33
|
-
|
|
34
|
-
const panResponder = useRef(
|
|
35
|
-
PanResponder.create({
|
|
36
|
-
onStartShouldSetPanResponder: () => true,
|
|
37
|
-
onMoveShouldSetPanResponder: () => true,
|
|
38
|
-
onPanResponderMove: (_, gestureState) => {
|
|
39
|
-
const newPosition =
|
|
40
|
-
((gestureState.moveX - 24) / containerWidth.current) * 100;
|
|
41
|
-
setSliderPosition(Math.max(5, Math.min(95, newPosition)));
|
|
42
|
-
},
|
|
43
|
-
})
|
|
44
|
-
).current;
|
|
45
|
-
|
|
46
|
-
const themedStyles = useMemo(
|
|
47
|
-
() =>
|
|
48
|
-
StyleSheet.create({
|
|
49
|
-
container: {
|
|
50
|
-
width: "100%",
|
|
51
|
-
aspectRatio: 1,
|
|
52
|
-
borderRadius: 20,
|
|
53
|
-
overflow: "hidden",
|
|
54
|
-
backgroundColor: tokens.colors.surfaceSecondary,
|
|
55
|
-
},
|
|
56
|
-
originalContainer: {
|
|
57
|
-
position: "absolute",
|
|
58
|
-
top: 0,
|
|
59
|
-
left: 0,
|
|
60
|
-
bottom: 0,
|
|
61
|
-
overflow: "hidden",
|
|
62
|
-
borderRightWidth: 3,
|
|
63
|
-
borderRightColor: tokens.colors.surface,
|
|
64
|
-
},
|
|
65
|
-
sliderHandle: {
|
|
66
|
-
position: "absolute",
|
|
67
|
-
top: "50%",
|
|
68
|
-
left: -20,
|
|
69
|
-
width: 40,
|
|
70
|
-
height: 40,
|
|
71
|
-
borderRadius: 20,
|
|
72
|
-
justifyContent: "center",
|
|
73
|
-
alignItems: "center",
|
|
74
|
-
marginTop: -20,
|
|
75
|
-
backgroundColor: tokens.colors.surface,
|
|
76
|
-
borderWidth: 3,
|
|
77
|
-
borderColor: tokens.colors.primary,
|
|
78
|
-
},
|
|
79
|
-
labelLeft: {
|
|
80
|
-
backgroundColor: tokens.colors.surface,
|
|
81
|
-
},
|
|
82
|
-
labelRight: {
|
|
83
|
-
backgroundColor: tokens.colors.primary,
|
|
84
|
-
},
|
|
85
|
-
}),
|
|
86
|
-
[tokens]
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<View
|
|
91
|
-
style={themedStyles.container}
|
|
92
|
-
onLayout={(e) => {
|
|
93
|
-
containerWidth.current = e.nativeEvent.layout.width;
|
|
94
|
-
}}
|
|
95
|
-
>
|
|
96
|
-
<View style={styles.imageContainer}>
|
|
97
|
-
<Image
|
|
98
|
-
source={{ uri: processedUri }}
|
|
99
|
-
style={styles.image}
|
|
100
|
-
resizeMode="cover"
|
|
101
|
-
/>
|
|
102
|
-
|
|
103
|
-
<View
|
|
104
|
-
style={[
|
|
105
|
-
themedStyles.originalContainer,
|
|
106
|
-
{ width: `${sliderPosition}%` },
|
|
107
|
-
]}
|
|
108
|
-
>
|
|
109
|
-
<Image
|
|
110
|
-
source={{ uri: originalUri }}
|
|
111
|
-
style={[styles.image, { width: containerWidth.current }]}
|
|
112
|
-
resizeMode="cover"
|
|
113
|
-
/>
|
|
114
|
-
</View>
|
|
115
|
-
|
|
116
|
-
<View
|
|
117
|
-
style={[styles.sliderLine, { left: `${sliderPosition}%` }]}
|
|
118
|
-
{...panResponder.panHandlers}
|
|
119
|
-
>
|
|
120
|
-
<View style={themedStyles.sliderHandle}>
|
|
121
|
-
<View style={styles.handleBars}>
|
|
122
|
-
<View
|
|
123
|
-
style={[
|
|
124
|
-
styles.handleBar,
|
|
125
|
-
{ backgroundColor: tokens.colors.primary },
|
|
126
|
-
]}
|
|
127
|
-
/>
|
|
128
|
-
<View
|
|
129
|
-
style={[
|
|
130
|
-
styles.handleBar,
|
|
131
|
-
{ backgroundColor: tokens.colors.primary },
|
|
132
|
-
]}
|
|
133
|
-
/>
|
|
134
|
-
</View>
|
|
135
|
-
</View>
|
|
136
|
-
</View>
|
|
137
|
-
|
|
138
|
-
<View
|
|
139
|
-
style={[styles.label, styles.labelLeft, themedStyles.labelLeft]}
|
|
140
|
-
>
|
|
141
|
-
<AtomicText type="labelSmall" style={{ color: tokens.colors.text }}>
|
|
142
|
-
{beforeLabel}
|
|
143
|
-
</AtomicText>
|
|
144
|
-
</View>
|
|
145
|
-
|
|
146
|
-
<View
|
|
147
|
-
style={[styles.label, styles.labelRight, themedStyles.labelRight]}
|
|
148
|
-
>
|
|
149
|
-
<AtomicText
|
|
150
|
-
type="labelSmall"
|
|
151
|
-
style={{ color: tokens.colors.onPrimary }}
|
|
152
|
-
>
|
|
153
|
-
{afterLabel}
|
|
154
|
-
</AtomicText>
|
|
155
|
-
</View>
|
|
156
|
-
</View>
|
|
157
|
-
</View>
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
const styles = StyleSheet.create({
|
|
163
|
-
imageContainer: {
|
|
164
|
-
flex: 1,
|
|
165
|
-
position: "relative",
|
|
166
|
-
},
|
|
167
|
-
image: {
|
|
168
|
-
width: "100%",
|
|
169
|
-
height: "100%",
|
|
170
|
-
},
|
|
171
|
-
sliderLine: {
|
|
172
|
-
position: "absolute",
|
|
173
|
-
top: 0,
|
|
174
|
-
bottom: 0,
|
|
175
|
-
width: 3,
|
|
176
|
-
marginLeft: -1.5,
|
|
177
|
-
},
|
|
178
|
-
handleBars: {
|
|
179
|
-
flexDirection: "row",
|
|
180
|
-
gap: 4,
|
|
181
|
-
},
|
|
182
|
-
handleBar: {
|
|
183
|
-
width: 3,
|
|
184
|
-
height: 16,
|
|
185
|
-
borderRadius: 2,
|
|
186
|
-
},
|
|
187
|
-
label: {
|
|
188
|
-
position: "absolute",
|
|
189
|
-
top: 12,
|
|
190
|
-
paddingHorizontal: 12,
|
|
191
|
-
paddingVertical: 6,
|
|
192
|
-
borderRadius: 16,
|
|
193
|
-
},
|
|
194
|
-
labelLeft: {
|
|
195
|
-
left: 12,
|
|
196
|
-
},
|
|
197
|
-
labelRight: {
|
|
198
|
-
right: 12,
|
|
199
|
-
},
|
|
200
|
-
});
|