@umituz/react-native-ai-generation-content 1.83.9 → 1.83.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/domain/constants/queue-status.constants.ts +0 -2
- package/src/domain/entities/flow-config-data.types.ts +0 -9
- package/src/domain/entities/flow-config.types.ts +2 -6
- package/src/domain/entities/flow-configuration.types.ts +1 -8
- package/src/domain/interfaces/app-services.interface.ts +2 -2
- package/src/domain/interfaces/index.ts +0 -8
- package/src/domains/background/infrastructure/services/job-poller.service.ts +0 -1
- package/src/domains/background/infrastructure/utils/result-validator.util.ts +0 -1
- package/src/domains/background/infrastructure/utils/status-checker.util.ts +0 -1
- package/src/domains/background/infrastructure/utils/status-extraction-helpers.ts +1 -1
- package/src/domains/content-moderation/infrastructure/utils/content-security.util.ts +1 -1
- package/src/domains/creations/domain/constants/creation-fields.constants.ts +1 -10
- package/src/domains/creations/domain/constants/creation-status.constants.ts +0 -20
- package/src/domains/creations/domain/constants/creation-validation.constants.ts +0 -12
- package/src/domains/creations/domain/constants/index.ts +3 -15
- package/src/domains/creations/domain/entities/index.ts +1 -1
- package/src/domains/creations/infrastructure/repositories/creation-update.operations.ts +0 -2
- package/src/domains/creations/infrastructure/repositories/creations-operations.ts +1 -1
- package/src/domains/creations/presentation/components/CreationCard.tsx +3 -3
- package/src/domains/creations/presentation/components/CreationImagePreview.tsx +1 -1
- package/src/domains/creations/presentation/components/CreationVideoPreview.tsx +1 -1
- package/src/domains/creations/presentation/components/CreationsFilterBar.tsx +0 -1
- package/src/domains/creations/presentation/components/GalleryEmptyStates.tsx +4 -4
- package/src/domains/creations/presentation/components/GalleryHeader.tsx +3 -1
- package/src/domains/creations/presentation/components/GalleryScreenHeader.tsx +1 -1
- package/src/domains/creations/presentation/components/index.ts +0 -23
- package/src/domains/creations/presentation/hooks/creation-validators.ts +4 -4
- package/src/domains/creations/presentation/hooks/filterHelpers.ts +5 -5
- package/src/domains/creations/presentation/hooks/useFilter.ts +2 -2
- package/src/domains/creations/presentation/hooks/useGalleryCallbacks.ts +1 -1
- package/src/domains/creations/presentation/hooks/useGalleryState.ts +2 -2
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +0 -1
- package/src/domains/creations/presentation/utils/filter-buttons.util.ts +2 -2
- package/src/domains/creations/presentation-exports.ts +5 -3
- package/src/domains/face-detection/presentation/components/FaceValidationStatus.tsx +1 -1
- package/src/domains/generation/infrastructure/executors/text-to-image-executor.helpers.ts +1 -1
- package/src/domains/generation/wizard/infrastructure/strategies/image-generation.strategy.ts +0 -2
- package/src/domains/generation/wizard/infrastructure/strategies/image-generation.types.ts +0 -4
- package/src/domains/generation/wizard/infrastructure/strategies/index.ts +0 -1
- package/src/domains/generation/wizard/infrastructure/strategies/shared/unified-prompt-builder.ts +1 -1
- package/src/domains/generation/wizard/infrastructure/strategies/video-generation.strategy.ts +0 -1
- package/src/domains/generation/wizard/infrastructure/strategies/video-generation.types.ts +2 -6
- package/src/domains/generation/wizard/infrastructure/strategies/wizard-strategy.constants.ts +0 -7
- package/src/domains/generation/wizard/infrastructure/strategies/wizard-strategy.factory.ts +1 -3
- package/src/domains/generation/wizard/infrastructure/utils/creation-persistence.util.ts +0 -5
- package/src/domains/generation/wizard/infrastructure/utils/index.ts +0 -3
- package/src/domains/generation/wizard/infrastructure/utils/primitive-extractors.ts +3 -3
- package/src/domains/generation/wizard/presentation/components/IndeterminateProgressBar.tsx +1 -1
- package/src/domains/generation/wizard/presentation/components/WizardContinueButton.tsx +1 -1
- package/src/domains/generation/wizard/presentation/components/WizardFlowContent.tsx +1 -1
- package/src/domains/generation/wizard/presentation/components/WizardStepRenderer.tsx +0 -2
- package/src/domains/generation/wizard/presentation/components/WizardStepRenderer.utils.ts +0 -7
- package/src/domains/generation/wizard/presentation/components/index.ts +0 -2
- package/src/domains/generation/wizard/presentation/components/step-renderers/renderPhotoUploadStep.tsx +1 -1
- package/src/domains/generation/wizard/presentation/components/step-renderers/renderPreviewStep.tsx +1 -1
- package/src/domains/generation/wizard/presentation/components/step-renderers/renderSelectionStep.tsx +1 -1
- package/src/domains/generation/wizard/presentation/components/step-renderers/renderTextInputStep.tsx +1 -1
- package/src/domains/generation/wizard/presentation/hooks/generationStateMachine.ts +2 -2
- package/src/domains/generation/wizard/presentation/hooks/useGenerationPhase.ts +1 -1
- package/src/domains/generation/wizard/presentation/hooks/usePhotoBlockingGeneration.ts +2 -2
- package/src/domains/generation/wizard/presentation/hooks/useWizardFlowHandlers.ts +1 -1
- package/src/domains/generation/wizard/presentation/screens/GeneratingScreen.tsx +1 -1
- package/src/domains/generation/wizard/presentation/screens/GenericPhotoUploadScreen.tsx +3 -3
- package/src/domains/generation/wizard/presentation/screens/SelectionScreen.tsx +0 -6
- package/src/domains/generation/wizard/presentation/screens/TextInputScreen.tsx +5 -3
- package/src/domains/generation/wizard/presentation/screens/index.ts +0 -13
- package/src/domains/generation/wizard/presentation/utilities/validateScenario.ts +0 -6
- package/src/domains/image-to-video/presentation/hooks/image-to-video-feature.types.ts +0 -8
- package/src/domains/image-to-video/presentation/index.ts +0 -4
- package/src/domains/result-preview/presentation/components/StarRatingPicker.tsx +1 -1
- package/src/domains/result-preview/presentation/types/result-preview.types.ts +0 -5
- package/src/domains/scenarios/configs/index.ts +1 -6
- package/src/domains/scenarios/configs/wizard-step-factories.ts +1 -1
- package/src/domains/scenarios/infrastructure/scenario-registry.ts +0 -9
- package/src/domains/scenarios/presentation/components/ScenarioContinueButton.tsx +1 -1
- package/src/domains/scenarios/presentation/hooks/useHierarchicalScenarios.ts +2 -2
- package/src/domains/scenarios/presentation/screens/HierarchicalScenarioListScreen.tsx +1 -1
- package/src/domains/scenarios/presentation/screens/ScenarioPreviewScreen.tsx +2 -2
- package/src/domains/shared/presentation/components/AutoSkipPreview.tsx +1 -1
- package/src/domains/shared/presentation/components/index.ts +0 -1
- package/src/domains/shared/presentation/utils/index.ts +0 -3
- package/src/domains/shared/presentation/utils/wizard-flow.utils.ts +2 -2
- package/src/domains/text-to-image/presentation/index.ts +0 -2
- package/src/domains/text-to-video/domain/types/component.types.ts +0 -6
- package/src/domains/text-to-video/domain/types/index.ts +0 -4
- package/src/domains/text-to-video/presentation/components/FrameSelector.tsx +97 -52
- package/src/domains/text-to-video/presentation/index.ts +0 -2
- package/src/exports/domain.ts +1 -1
- package/src/index.ts +25 -2
- package/src/infrastructure/config/index.ts +0 -2
- package/src/infrastructure/constants/index.ts +0 -6
- package/src/infrastructure/constants/polling.constants.ts +0 -21
- package/src/infrastructure/constants/validation.constants.ts +0 -30
- package/src/infrastructure/utils/error-classification.ts +1 -1
- package/src/infrastructure/utils/error-factory.ts +2 -2
- package/src/infrastructure/utils/index.ts +0 -9
- package/src/infrastructure/utils/message-extractor.ts +1 -20
- package/src/infrastructure/utils/progress.utils.ts +0 -37
- package/src/infrastructure/utils/provider-validator.util.ts +1 -1
- package/src/infrastructure/utils/url-extractor/index.ts +0 -5
- package/src/infrastructure/utils/url-extractor.util.ts +0 -11
- package/src/infrastructure/utils/video-helpers.ts +1 -1
- package/src/infrastructure/validation/ai-validator.ts +0 -28
- package/src/infrastructure/validation/entity-validator.ts +0 -34
- package/src/infrastructure/validation/input-validator.ts +2 -5
- package/src/infrastructure/validation/sanitizer.ts +0 -17
- package/src/presentation/components/AIGenerationConfig.tsx +3 -1
- package/src/presentation/components/GenerationProgressContent.styles.ts +0 -2
- package/src/presentation/components/PhotoUploadCard/PhotoUploadCard.tsx +0 -1
- package/src/presentation/components/ProgressCloseButton.tsx +1 -1
- package/src/presentation/components/ProgressDismissButton.tsx +1 -1
- package/src/presentation/components/ProgressHeader.tsx +1 -1
- package/src/presentation/components/ProgressHint.tsx +1 -1
- package/src/presentation/components/display/AIGenerationResult.tsx +6 -4
- package/src/presentation/components/display/index.ts +0 -1
- package/src/presentation/components/moderation/ModerationSummary.tsx +2 -2
- package/src/presentation/components/prompts/ExamplePrompts.tsx +2 -2
- package/src/presentation/components/result/ResultImageCard.tsx +39 -21
- package/src/presentation/components/result/ResultStoryCard.tsx +38 -15
- package/src/presentation/components/result/button-style.utils.ts +1 -1
- package/src/presentation/components/selectors/GridSelector.tsx +2 -2
- package/src/presentation/components/selectors/factories/aspect-ratio.factory.ts +0 -2
- package/src/presentation/components/selectors/factories/duration.factory.ts +0 -2
- package/src/presentation/components/selectors/factories/style.factory.ts +1 -1
- package/src/presentation/components/shared/ModelSelector.tsx +3 -1
- package/src/presentation/hooks/ai-feature-callbacks-auth.hooks.ts +2 -2
- package/src/presentation/hooks/ai-feature-callbacks-cost.hooks.ts +2 -2
- package/src/presentation/hooks/ai-feature-callbacks-execution.hooks.ts +2 -2
- package/src/presentation/hooks/generation/index.ts +0 -5
- package/src/presentation/hooks/generation/moderation-handler.ts +1 -1
- package/src/presentation/hooks/generation/types.ts +0 -12
- package/src/presentation/hooks/index.ts +0 -4
- package/src/presentation/hooks/useProgressDismiss.ts +1 -1
- package/src/presentation/layouts/types/layout-props.ts +1 -1
- package/src/domain/constants/index.ts +0 -2
- package/src/domain/entities/feature-flow-config.types.ts +0 -17
- package/src/domain/entities/scenario-step-config.types.ts +0 -32
- package/src/domain/entities/step-config.types.ts +0 -18
- package/src/domain/entities/step-definition.types.ts +0 -50
- package/src/domain/entities/step-input-config.types.ts +0 -36
- package/src/domain/entities/step-upload-config.types.ts +0 -17
- package/src/domains/background/domain/entities/index.ts +0 -1
- package/src/domains/background/domain/interfaces/index.ts +0 -1
- package/src/domains/content-moderation/infrastructure/utils/validators.util.ts +0 -51
- package/src/domains/creations/domain/constants/creation-errors.constants.ts +0 -27
- package/src/domains/creations/domain/constants/creation-query.constants.ts +0 -37
- package/src/domains/creations/domain/constants/creation-types.constants.ts +0 -45
- package/src/domains/creations/presentation/components/CreationImageViewer.tsx +0 -43
- package/src/domains/creations/presentation/components/CreationRating.tsx +0 -69
- package/src/domains/creations/presentation/components/CreationsGrid.tsx +0 -130
- package/src/domains/creations/presentation/components/FilterSheets.tsx +0 -63
- package/src/domains/creations/presentation/hooks/index.ts +0 -24
- package/src/domains/creations/presentation/hooks/useCreationRating.ts +0 -68
- package/src/domains/creations/presentation/screens/index.ts +0 -5
- package/src/domains/generation/infrastructure/flow/scenario-configs.ts +0 -54
- package/src/domains/generation/infrastructure/flow/step-builders.ts +0 -133
- package/src/domains/generation/wizard/infrastructure/strategies/video-generation.utils.ts +0 -42
- package/src/domains/generation/wizard/presentation/components/WizardHeader.tsx +0 -96
- package/src/domains/generation/wizard/presentation/components/step-renderers/index.ts +0 -8
- package/src/domains/generation/wizard/presentation/components/step-renderers/renderGeneratingStep.tsx +0 -24
- package/src/domains/generation/wizard/presentation/components/step-renderers/renderResultStep.tsx +0 -69
- package/src/domains/generation/wizard/presentation/utilities/index.ts +0 -1
- package/src/domains/prompts/infrastructure/services/base/index.ts +0 -6
- package/src/domains/prompts/infrastructure/services/base/prompt-service.base.ts +0 -112
- package/src/domains/result-preview/index.ts +0 -37
- package/src/domains/result-preview/presentation/components/GenerationErrorScreen.tsx +0 -109
- package/src/domains/result-preview/presentation/components/index.ts +0 -16
- package/src/domains/result-preview/presentation/hooks/index.ts +0 -5
- package/src/domains/result-preview/presentation/types/index.ts +0 -16
- package/src/domains/result-preview/presentation/types/result-data.types.ts +0 -35
- package/src/domains/text-to-image/presentation/screens/TextToImageWizardFlow.types.ts +0 -27
- package/src/domains/text-to-video/domain/types/action-component.types.ts +0 -15
- package/src/domains/text-to-video/domain/types/selector-component.types.ts +0 -31
- package/src/infrastructure/constants/content.constants.ts +0 -8
- package/src/infrastructure/constants/storage.constants.ts +0 -27
- package/src/infrastructure/http/api-client.types.ts +0 -17
- package/src/infrastructure/http/http-client-methods.ts +0 -73
- package/src/infrastructure/http/http-client.util.ts +0 -12
- package/src/infrastructure/http/http-fetch-handler.ts +0 -63
- package/src/infrastructure/http/http-methods.constants.ts +0 -23
- package/src/infrastructure/http/http-request-executor.ts +0 -49
- package/src/infrastructure/http/http-response-parser.ts +0 -65
- package/src/infrastructure/http/index.ts +0 -16
- package/src/infrastructure/http/query-string.util.ts +0 -40
- package/src/infrastructure/http/timeout.util.ts +0 -26
- package/src/infrastructure/logging/debug.util.ts +0 -51
- package/src/infrastructure/logging/index.ts +0 -6
- package/src/infrastructure/utils/content-validators.ts +0 -92
- package/src/infrastructure/utils/domain-guards.ts +0 -23
- package/src/infrastructure/utils/error-classifiers.ts +0 -23
- package/src/infrastructure/utils/error-handlers.ts +0 -53
- package/src/infrastructure/utils/error-retry.ts +0 -44
- package/src/infrastructure/utils/error-types.ts +0 -23
- package/src/infrastructure/utils/general-validators.ts +0 -64
- package/src/infrastructure/utils/id-validators.ts +0 -39
- package/src/infrastructure/utils/primitive-guards.ts +0 -66
- package/src/infrastructure/utils/structure-guards.ts +0 -75
- package/src/infrastructure/utils/type-guards.util.ts +0 -26
- package/src/infrastructure/utils/validation-types.ts +0 -8
- package/src/infrastructure/utils/validation.util.ts +0 -18
- package/src/shared/utils/index.ts +0 -6
|
@@ -12,6 +12,83 @@ import {
|
|
|
12
12
|
} from "@umituz/react-native-design-system";
|
|
13
13
|
import type { FrameSelectorProps } from "../../domain/types";
|
|
14
14
|
|
|
15
|
+
interface FrameContentProps {
|
|
16
|
+
frame: { url: string; order: number } | undefined;
|
|
17
|
+
imageStyle: object;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const FrameContent: React.FC<FrameContentProps> = ({ frame, imageStyle }) =>
|
|
21
|
+
frame ? (
|
|
22
|
+
<Image
|
|
23
|
+
source={{ uri: frame.url }}
|
|
24
|
+
style={imageStyle}
|
|
25
|
+
resizeMode="cover"
|
|
26
|
+
/>
|
|
27
|
+
) : (
|
|
28
|
+
<View style={placeholderStyle.container}>
|
|
29
|
+
<AtomicIcon name="image-outline" size="xl" color="secondary" />
|
|
30
|
+
</View>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const placeholderStyle = StyleSheet.create({
|
|
34
|
+
container: {
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
interface FrameActionsProps {
|
|
41
|
+
index: number;
|
|
42
|
+
onFrameChange: (index: number) => void;
|
|
43
|
+
onFrameDelete: (index: number) => void;
|
|
44
|
+
changeLabel: string;
|
|
45
|
+
deleteLabel: string;
|
|
46
|
+
gap: number;
|
|
47
|
+
buttonGap: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const FrameActions: React.FC<FrameActionsProps> = ({
|
|
51
|
+
index,
|
|
52
|
+
onFrameChange,
|
|
53
|
+
onFrameDelete,
|
|
54
|
+
changeLabel,
|
|
55
|
+
deleteLabel,
|
|
56
|
+
gap,
|
|
57
|
+
buttonGap,
|
|
58
|
+
}) => (
|
|
59
|
+
<View style={[frameActionStyles.actions, { gap }]}>
|
|
60
|
+
<TouchableOpacity
|
|
61
|
+
style={[frameActionStyles.actionButton, { gap: buttonGap }]}
|
|
62
|
+
onPress={() => onFrameChange(index)}
|
|
63
|
+
>
|
|
64
|
+
<AtomicIcon name="pencil-outline" size="xs" color="primary" />
|
|
65
|
+
<AtomicText type="labelSmall" color="primary">
|
|
66
|
+
{changeLabel}
|
|
67
|
+
</AtomicText>
|
|
68
|
+
</TouchableOpacity>
|
|
69
|
+
<TouchableOpacity
|
|
70
|
+
style={[frameActionStyles.actionButton, { gap: buttonGap }]}
|
|
71
|
+
onPress={() => onFrameDelete(index)}
|
|
72
|
+
>
|
|
73
|
+
<AtomicIcon name="trash-outline" size="xs" color="primary" />
|
|
74
|
+
<AtomicText type="labelSmall" color="primary">
|
|
75
|
+
{deleteLabel}
|
|
76
|
+
</AtomicText>
|
|
77
|
+
</TouchableOpacity>
|
|
78
|
+
</View>
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
const frameActionStyles = StyleSheet.create({
|
|
82
|
+
actions: {
|
|
83
|
+
flexDirection: "row",
|
|
84
|
+
justifyContent: "center",
|
|
85
|
+
},
|
|
86
|
+
actionButton: {
|
|
87
|
+
flexDirection: "row",
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
|
|
15
92
|
export const FrameSelector: React.FC<FrameSelectorProps> = ({
|
|
16
93
|
frames,
|
|
17
94
|
onFrameChange,
|
|
@@ -27,42 +104,6 @@ export const FrameSelector: React.FC<FrameSelectorProps> = ({
|
|
|
27
104
|
const startFrame = frames.find((f) => f.order === 0);
|
|
28
105
|
const endFrame = frames.find((f) => f.order === 1);
|
|
29
106
|
|
|
30
|
-
const renderFrameContent = (frame: typeof startFrame) =>
|
|
31
|
-
frame ? (
|
|
32
|
-
<Image
|
|
33
|
-
source={{ uri: frame.url }}
|
|
34
|
-
style={styles.image}
|
|
35
|
-
resizeMode="cover"
|
|
36
|
-
/>
|
|
37
|
-
) : (
|
|
38
|
-
<View style={styles.placeholder}>
|
|
39
|
-
<AtomicIcon name="image-outline" size="xl" color="secondary" />
|
|
40
|
-
</View>
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const renderActions = (index: number) => (
|
|
44
|
-
<View style={[styles.actions, { gap: tokens.spacing.md }]}>
|
|
45
|
-
<TouchableOpacity
|
|
46
|
-
style={[styles.actionButton, { gap: tokens.spacing.xs }]}
|
|
47
|
-
onPress={() => onFrameChange(index)}
|
|
48
|
-
>
|
|
49
|
-
<AtomicIcon name="pencil-outline" size="xs" color="primary" />
|
|
50
|
-
<AtomicText type="labelSmall" color="primary">
|
|
51
|
-
{changeLabel}
|
|
52
|
-
</AtomicText>
|
|
53
|
-
</TouchableOpacity>
|
|
54
|
-
<TouchableOpacity
|
|
55
|
-
style={[styles.actionButton, { gap: tokens.spacing.xs }]}
|
|
56
|
-
onPress={() => onFrameDelete(index)}
|
|
57
|
-
>
|
|
58
|
-
<AtomicIcon name="trash-outline" size="xs" color="primary" />
|
|
59
|
-
<AtomicText type="labelSmall" color="primary">
|
|
60
|
-
{deleteLabel}
|
|
61
|
-
</AtomicText>
|
|
62
|
-
</TouchableOpacity>
|
|
63
|
-
</View>
|
|
64
|
-
);
|
|
65
|
-
|
|
66
107
|
return (
|
|
67
108
|
<View style={[styles.container, { gap: tokens.spacing.md }, style]}>
|
|
68
109
|
<View style={[styles.frameContainer, { gap: tokens.spacing.sm }]}>
|
|
@@ -75,9 +116,17 @@ export const FrameSelector: React.FC<FrameSelectorProps> = ({
|
|
|
75
116
|
{ backgroundColor: tokens.colors.surface },
|
|
76
117
|
]}
|
|
77
118
|
>
|
|
78
|
-
{
|
|
119
|
+
<FrameContent frame={startFrame} imageStyle={styles.image} />
|
|
79
120
|
</View>
|
|
80
|
-
|
|
121
|
+
<FrameActions
|
|
122
|
+
index={0}
|
|
123
|
+
onFrameChange={onFrameChange}
|
|
124
|
+
onFrameDelete={onFrameDelete}
|
|
125
|
+
changeLabel={changeLabel}
|
|
126
|
+
deleteLabel={deleteLabel}
|
|
127
|
+
gap={tokens.spacing.md}
|
|
128
|
+
buttonGap={tokens.spacing.xs}
|
|
129
|
+
/>
|
|
81
130
|
</View>
|
|
82
131
|
|
|
83
132
|
<View style={styles.separatorContainer}>
|
|
@@ -98,9 +147,17 @@ export const FrameSelector: React.FC<FrameSelectorProps> = ({
|
|
|
98
147
|
{ backgroundColor: tokens.colors.surface },
|
|
99
148
|
]}
|
|
100
149
|
>
|
|
101
|
-
{
|
|
150
|
+
<FrameContent frame={endFrame} imageStyle={styles.image} />
|
|
102
151
|
</View>
|
|
103
|
-
|
|
152
|
+
<FrameActions
|
|
153
|
+
index={1}
|
|
154
|
+
onFrameChange={onFrameChange}
|
|
155
|
+
onFrameDelete={onFrameDelete}
|
|
156
|
+
changeLabel={changeLabel}
|
|
157
|
+
deleteLabel={deleteLabel}
|
|
158
|
+
gap={tokens.spacing.md}
|
|
159
|
+
buttonGap={tokens.spacing.xs}
|
|
160
|
+
/>
|
|
104
161
|
</View>
|
|
105
162
|
</View>
|
|
106
163
|
);
|
|
@@ -127,18 +184,6 @@ const styles = StyleSheet.create({
|
|
|
127
184
|
width: "100%",
|
|
128
185
|
height: "100%",
|
|
129
186
|
},
|
|
130
|
-
placeholder: {
|
|
131
|
-
alignItems: "center",
|
|
132
|
-
justifyContent: "center",
|
|
133
|
-
},
|
|
134
|
-
actions: {
|
|
135
|
-
flexDirection: "row",
|
|
136
|
-
justifyContent: "center",
|
|
137
|
-
},
|
|
138
|
-
actionButton: {
|
|
139
|
-
flexDirection: "row",
|
|
140
|
-
alignItems: "center",
|
|
141
|
-
},
|
|
142
187
|
separatorContainer: {
|
|
143
188
|
justifyContent: "center",
|
|
144
189
|
alignItems: "center",
|
package/src/exports/domain.ts
CHANGED
|
@@ -30,7 +30,7 @@ export { DEFAULT_POLLING_CONFIG, DEFAULT_QUEUE_CONFIG } from "../domain/entities
|
|
|
30
30
|
|
|
31
31
|
// Queue & Creation Status — canonical values used across all apps
|
|
32
32
|
export { QUEUE_STATUS, CREATION_STATUS } from "../domain/constants/queue-status.constants";
|
|
33
|
-
export type { QueueStatus
|
|
33
|
+
export type { QueueStatus } from "../domain/constants/queue-status.constants";
|
|
34
34
|
|
|
35
35
|
// Processing Modes
|
|
36
36
|
export type { ImageProcessingMode, ModeConfig, ModeCatalog } from "../domain/entities/processing-modes.types";
|
package/src/index.ts
CHANGED
|
@@ -47,5 +47,28 @@ export type { VideoModelConfig, ModelCapabilityOption } from "./domain/interface
|
|
|
47
47
|
// Wizard Config Builder (generates wizard steps from VideoModelConfig)
|
|
48
48
|
export { buildWizardConfigFromModelConfig } from "./domains/generation/wizard/utilities/build-wizard-config";
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
export {
|
|
51
|
+
VIDEO_DURATION, VIDEO_DURATION_OPTIONS, VIDEO_DURATION_OPTIONS_WITH_LABELS,
|
|
52
|
+
VIDEO_ASPECT_RATIO, VIDEO_ASPECT_RATIO_OPTIONS,
|
|
53
|
+
VIDEO_RESOLUTION, VIDEO_RESOLUTION_OPTIONS,
|
|
54
|
+
DEFAULT_MOTION_STRENGTH, DEFAULT_GUIDANCE_SCALE,
|
|
55
|
+
type VideoAspectRatio, type VideoResolution,
|
|
56
|
+
} from "./core/constants/video.constants";
|
|
57
|
+
export {
|
|
58
|
+
ASPECT_RATIO, DEFAULT_IMAGE_SIZES,
|
|
59
|
+
} from "./core/constants/aspect-ratio.constants";
|
|
60
|
+
export {
|
|
61
|
+
IMAGE_SIZE, DEFAULT_NUM_IMAGES, DEFAULT_IMAGE_GUIDANCE_SCALE,
|
|
62
|
+
} from "./core/constants/image.constants";
|
|
63
|
+
export {
|
|
64
|
+
ANIMATION_STYLE,
|
|
65
|
+
} from "./core/constants/animation.constants";
|
|
66
|
+
export * from "./core/constants/validation.constants";
|
|
67
|
+
export * from "./core/constants/preset-styles.constants";
|
|
68
|
+
export {
|
|
69
|
+
STYLE_OPTIONS,
|
|
70
|
+
} from "./core/constants/style-options.constants";
|
|
71
|
+
export {
|
|
72
|
+
DURATION_OPTIONS,
|
|
73
|
+
} from "./core/constants/duration-options.constants";
|
|
74
|
+
export * from "./core/constants/script-durations.constants";
|
|
@@ -8,29 +8,8 @@ import { env } from "../config/env.config";
|
|
|
8
8
|
/** Default polling interval for job status checks (milliseconds) */
|
|
9
9
|
export const DEFAULT_POLL_INTERVAL_MS = env.pollDefaultIntervalMs;
|
|
10
10
|
|
|
11
|
-
/** Gallery polling interval (slower than wizard) */
|
|
12
|
-
export const GALLERY_POLL_INTERVAL_MS = env.pollGalleryIntervalMs;
|
|
13
|
-
|
|
14
|
-
/** Maximum number of polling attempts before timeout */
|
|
15
|
-
export const DEFAULT_MAX_POLL_ATTEMPTS = env.pollMaxAttempts;
|
|
16
|
-
|
|
17
11
|
/** Maximum consecutive transient errors before aborting */
|
|
18
12
|
export const DEFAULT_MAX_CONSECUTIVE_ERRORS = env.pollMaxConsecutiveErrors;
|
|
19
13
|
|
|
20
14
|
/** Maximum total time for polling (milliseconds) */
|
|
21
15
|
export const DEFAULT_MAX_POLL_TIME_MS = env.pollMaxTimeMs;
|
|
22
|
-
|
|
23
|
-
/** Minimum backoff delay (milliseconds) */
|
|
24
|
-
export const MIN_BACKOFF_DELAY_MS = env.pollMinBackoffDelayMs;
|
|
25
|
-
|
|
26
|
-
/** Maximum backoff delay (milliseconds) */
|
|
27
|
-
export const MAX_BACKOFF_DELAY_MS = env.pollMaxBackoffDelayMs;
|
|
28
|
-
|
|
29
|
-
/** Exponential backoff base multiplier */
|
|
30
|
-
export const BACKOFF_MULTIPLIER = env.pollBackoffMultiplier;
|
|
31
|
-
|
|
32
|
-
/** Progress percentage to report when job completes */
|
|
33
|
-
export const COMPLETION_PROGRESS = 100;
|
|
34
|
-
|
|
35
|
-
/** Initial progress percentage */
|
|
36
|
-
export const INITIAL_PROGRESS = 0;
|
|
@@ -10,33 +10,3 @@ export const MAX_PROMPT_LENGTH = env.validationMaxPromptLength;
|
|
|
10
10
|
|
|
11
11
|
/** Minimum length for AI prompt text */
|
|
12
12
|
export const MIN_PROMPT_LENGTH = env.validationMinPromptLength;
|
|
13
|
-
|
|
14
|
-
/** Maximum length for user ID */
|
|
15
|
-
export const MAX_USER_ID_LENGTH = env.validationMaxUserIdLength;
|
|
16
|
-
|
|
17
|
-
/** Maximum length for creation ID */
|
|
18
|
-
export const MAX_CREATION_ID_LENGTH = env.validationMaxCreationIdLength;
|
|
19
|
-
|
|
20
|
-
/** Maximum base64 string length (before encoding) */
|
|
21
|
-
export const MAX_BASE64_SIZE_MB = env.validationMaxBase64SizeMb;
|
|
22
|
-
|
|
23
|
-
/** Maximum regex pattern length for validation */
|
|
24
|
-
export const MAX_PATTERN_LENGTH = env.validationMaxPatternLength;
|
|
25
|
-
|
|
26
|
-
/** Maximum duration for video generation (seconds) */
|
|
27
|
-
export const MAX_VIDEO_DURATION_SECONDS = env.validationMaxVideoDurationSeconds;
|
|
28
|
-
|
|
29
|
-
/** Minimum duration for video generation (seconds) */
|
|
30
|
-
export const MIN_VIDEO_DURATION_SECONDS = env.validationMinVideoDurationSeconds;
|
|
31
|
-
|
|
32
|
-
/** Maximum image file size (MB) */
|
|
33
|
-
export const MAX_IMAGE_SIZE_MB = env.validationMaxImageSizeMb;
|
|
34
|
-
|
|
35
|
-
/** Maximum URL length */
|
|
36
|
-
export const MAX_URL_LENGTH = env.validationMaxUrlLength;
|
|
37
|
-
|
|
38
|
-
/** Maximum number of images in multi-image generation */
|
|
39
|
-
export const MAX_MULTI_IMAGE_COUNT = env.validationMaxMultiImageCount;
|
|
40
|
-
|
|
41
|
-
/** Minimum number of images for multi-image generation */
|
|
42
|
-
export const MIN_MULTI_IMAGE_COUNT = env.validationMinMultiImageCount;
|
|
@@ -112,7 +112,7 @@ export function classifyError(error: unknown): AIErrorInfo {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
function isTransientError(error: unknown): boolean {
|
|
116
116
|
const info = classifyError(error);
|
|
117
117
|
return info.retryable ?? false;
|
|
118
118
|
}
|
|
@@ -11,9 +11,9 @@ export const GenerationErrorType = {
|
|
|
11
11
|
UNKNOWN: "unknown",
|
|
12
12
|
} as const;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
type GenerationErrorTypeValue = typeof GenerationErrorType[keyof typeof GenerationErrorType];
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
interface GenerationError extends Error {
|
|
17
17
|
errorType: GenerationErrorTypeValue;
|
|
18
18
|
translationKey: string;
|
|
19
19
|
}
|
|
@@ -3,14 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export * from "./error-classification";
|
|
6
|
-
export * from "./error-classifiers";
|
|
7
|
-
export * from "./error-handlers";
|
|
8
6
|
export * from "./error-factory";
|
|
9
|
-
export * from "./error-types";
|
|
10
7
|
export * from "./message-extractor";
|
|
11
8
|
export * from "./classifier-helpers";
|
|
12
9
|
export * from "./result-polling";
|
|
13
|
-
export * from "./validation.util";
|
|
14
10
|
export * from "../../domains/background/infrastructure/utils/polling-interval.util";
|
|
15
11
|
export * from "./progress-calculator.util";
|
|
16
12
|
export * from "./progress.utils";
|
|
@@ -24,8 +20,3 @@ export * from "./provider-validator.util";
|
|
|
24
20
|
export * from "./base64.util";
|
|
25
21
|
export * from "./video-result-extractor.util";
|
|
26
22
|
export * from "./id-generator.util";
|
|
27
|
-
|
|
28
|
-
// Export type guards (avoiding duplicate exports)
|
|
29
|
-
export { hasProperty, hasProperties } from "./structure-guards";
|
|
30
|
-
export { isObject, isNonEmptyString, isArray, isNumber, isFunction } from "./primitive-guards";
|
|
31
|
-
export { isCreationWithOutput, isWizardData } from "./domain-guards";
|
|
@@ -4,29 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { GenerationErrorType, isGenerationError } from "./error-factory";
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Safely extracts error message from unknown error type
|
|
9
|
-
* Generic utility for any error - no domain-specific logic
|
|
10
|
-
*/
|
|
11
|
-
export function getErrorMessage(error: unknown, prefix?: string): string {
|
|
12
|
-
let message = "An unknown error occurred";
|
|
13
|
-
|
|
14
|
-
if (error instanceof Error) {
|
|
15
|
-
message = error.message;
|
|
16
|
-
} else if (typeof error === "string") {
|
|
17
|
-
message = error;
|
|
18
|
-
} else if (error && typeof error === "object" && "message" in error) {
|
|
19
|
-
message = String((error as { message: unknown }).message);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return prefix ? `${prefix}: ${message}` : message;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
7
|
/**
|
|
27
8
|
* Get translation key from error (returns key if GenerationError, null otherwise)
|
|
28
9
|
*/
|
|
29
|
-
|
|
10
|
+
function getErrorTranslationKey(error: unknown): string | null {
|
|
30
11
|
if (isGenerationError(error)) {
|
|
31
12
|
return error.translationKey;
|
|
32
13
|
}
|
|
@@ -21,40 +21,3 @@ export function roundProgress(progress: number): number {
|
|
|
21
21
|
return Math.round(clampProgress(progress));
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* Formats progress as percentage string
|
|
26
|
-
* @param progress - Progress value
|
|
27
|
-
* @returns Formatted percentage string (e.g., "75%")
|
|
28
|
-
*/
|
|
29
|
-
export function formatProgressPercentage(progress: number): string {
|
|
30
|
-
return `${roundProgress(progress)}%`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Calculates progress percentage from current and total values
|
|
35
|
-
* @param current - Current value
|
|
36
|
-
* @param total - Total value
|
|
37
|
-
* @returns Progress percentage (0-100)
|
|
38
|
-
*/
|
|
39
|
-
export function calculateProgressPercentage(current: number, total: number): number {
|
|
40
|
-
if (total <= 0) return 0;
|
|
41
|
-
return clampProgress((current / total) * 100);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Maps job status to approximate progress percentage
|
|
46
|
-
* @param status - Job status string
|
|
47
|
-
* @returns Approximate progress percentage
|
|
48
|
-
*/
|
|
49
|
-
export function mapStatusToProgress(status: string): number {
|
|
50
|
-
const normalizedStatus = status.toLowerCase();
|
|
51
|
-
const statusMap: Record<string, number> = {
|
|
52
|
-
queued: 10,
|
|
53
|
-
in_queue: 15,
|
|
54
|
-
processing: 50,
|
|
55
|
-
in_progress: 60,
|
|
56
|
-
completed: 100,
|
|
57
|
-
failed: 0,
|
|
58
|
-
};
|
|
59
|
-
return statusMap[normalizedStatus] ?? 30;
|
|
60
|
-
}
|
|
@@ -8,7 +8,7 @@ import { cleanBase64 } from "./index";
|
|
|
8
8
|
import type { IAIProvider, VideoFeatureInputData, ImageFeatureInputData } from "../../domain/interfaces";
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
type ProviderValidationResult =
|
|
12
12
|
| { success: true; provider: IAIProvider }
|
|
13
13
|
| { success: false; error: string };
|
|
14
14
|
|
|
@@ -11,11 +11,6 @@ export { extractOutputUrls } from "./multi-extractor";
|
|
|
11
11
|
|
|
12
12
|
export { extractThumbnailUrl } from "./thumbnail-extractor";
|
|
13
13
|
|
|
14
|
-
export type { ExtractionRule } from "./extraction-rules";
|
|
15
|
-
export { IMAGE_EXTRACTION_RULES, VIDEO_EXTRACTION_RULES } from "./extraction-rules";
|
|
16
|
-
|
|
17
|
-
export { executeRules } from "./rule-executor";
|
|
18
|
-
|
|
19
14
|
export type { ImageResultExtractor } from "./image-result-extractor";
|
|
20
15
|
export { extractImageResult } from "./image-result-extractor";
|
|
21
16
|
|
|
@@ -11,15 +11,4 @@ export {
|
|
|
11
11
|
extractImageUrls,
|
|
12
12
|
extractOutputUrls,
|
|
13
13
|
extractThumbnailUrl,
|
|
14
|
-
extractImageResult,
|
|
15
|
-
extractVideoResult,
|
|
16
|
-
executeRules,
|
|
17
|
-
IMAGE_EXTRACTION_RULES,
|
|
18
|
-
VIDEO_EXTRACTION_RULES,
|
|
19
|
-
} from "./url-extractor";
|
|
20
|
-
|
|
21
|
-
export type {
|
|
22
|
-
ExtractionRule,
|
|
23
|
-
ImageResultExtractor,
|
|
24
|
-
VideoResultExtractor,
|
|
25
14
|
} from "./url-extractor";
|
|
@@ -11,7 +11,7 @@ export type VideoAlertFunction = (title: string, message: string) => void;
|
|
|
11
11
|
/**
|
|
12
12
|
* Navigation function type for success actions
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
type VideoNavigationFunction = () => void;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Default no-op alert function
|
|
@@ -61,31 +61,3 @@ export function validateImageData(input: unknown): ValidationResult {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
/**
|
|
65
|
-
* Validates video URL
|
|
66
|
-
*/
|
|
67
|
-
export function validateVideoUrl(input: unknown): ValidationResult {
|
|
68
|
-
if (typeof input !== "string") {
|
|
69
|
-
return { isValid: false, errors: ["Video URL must be a string"] };
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const urlResult = validateURL(input);
|
|
73
|
-
if (!urlResult.isValid) {
|
|
74
|
-
return urlResult;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const url = new URL(input) as URL & { pathname: string };
|
|
78
|
-
const validExtensions = [".mp4", ".mov", ".webm", ".gif"];
|
|
79
|
-
const hasValidExtension = validExtensions.some((ext) =>
|
|
80
|
-
url.pathname.toLowerCase().endsWith(ext)
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
if (!hasValidExtension) {
|
|
84
|
-
return {
|
|
85
|
-
isValid: false,
|
|
86
|
-
errors: ["Video URL must have a valid video extension"],
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return { isValid: true, errors: [] };
|
|
91
|
-
}
|
|
@@ -28,37 +28,3 @@ export function validateCreationId(input: unknown): ValidationResult {
|
|
|
28
28
|
return validateString(input, options);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
/**
|
|
32
|
-
* Validates scenario ID
|
|
33
|
-
*/
|
|
34
|
-
export function validateScenarioId(input: unknown): ValidationResult {
|
|
35
|
-
const options: StringValidationOptions = {
|
|
36
|
-
minLength: 1,
|
|
37
|
-
maxLength: 100,
|
|
38
|
-
pattern: /^[a-z0-9-]+$/,
|
|
39
|
-
};
|
|
40
|
-
return validateString(input, options);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Validates model name
|
|
45
|
-
*/
|
|
46
|
-
export function validateModelName(input: unknown): ValidationResult {
|
|
47
|
-
const options: StringValidationOptions = {
|
|
48
|
-
minLength: 1,
|
|
49
|
-
maxLength: 100,
|
|
50
|
-
};
|
|
51
|
-
return validateString(input, options);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Validates provider name
|
|
56
|
-
*/
|
|
57
|
-
export function validateProviderName(input: unknown): ValidationResult {
|
|
58
|
-
const options: StringValidationOptions = {
|
|
59
|
-
minLength: 1,
|
|
60
|
-
maxLength: 50,
|
|
61
|
-
pattern: /^[a-z0-9-]+$/,
|
|
62
|
-
};
|
|
63
|
-
return validateString(input, options);
|
|
64
|
-
}
|
|
@@ -16,7 +16,7 @@ export {
|
|
|
16
16
|
} from "./base-validator";
|
|
17
17
|
|
|
18
18
|
// Sanitizers
|
|
19
|
-
export { sanitizeString
|
|
19
|
+
export { sanitizeString } from "./sanitizer";
|
|
20
20
|
|
|
21
21
|
// Advanced validators
|
|
22
22
|
export {
|
|
@@ -27,13 +27,10 @@ export {
|
|
|
27
27
|
} from "./advanced-validator";
|
|
28
28
|
|
|
29
29
|
// AI validators
|
|
30
|
-
export { validateAIPrompt, validateImageData
|
|
30
|
+
export { validateAIPrompt, validateImageData } from "./ai-validator";
|
|
31
31
|
|
|
32
32
|
// Entity validators
|
|
33
33
|
export {
|
|
34
34
|
validateUserId,
|
|
35
35
|
validateCreationId,
|
|
36
|
-
validateScenarioId,
|
|
37
|
-
validateModelName,
|
|
38
|
-
validateProviderName,
|
|
39
36
|
} from "./entity-validator";
|
|
@@ -37,20 +37,3 @@ export function sanitizeString(input: unknown): string {
|
|
|
37
37
|
return sanitized.slice(0, 10000);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
/**
|
|
41
|
-
* Sanitizes object by removing dangerous properties
|
|
42
|
-
*/
|
|
43
|
-
export function sanitizeObject<T extends Record<string, unknown>>(input: T): T {
|
|
44
|
-
if (!input || typeof input !== "object") {
|
|
45
|
-
return input;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const sanitized = { ...input } as T;
|
|
49
|
-
const dangerousKeys = ["__proto__", "constructor", "prototype"];
|
|
50
|
-
|
|
51
|
-
for (const key of dangerousKeys) {
|
|
52
|
-
delete (sanitized as Record<string, unknown>)[key];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return sanitized;
|
|
56
|
-
}
|
|
@@ -14,11 +14,13 @@ export interface AIGenerationConfigProps extends Omit<AIGenerationFormProps, "is
|
|
|
14
14
|
readonly progress?: number;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
const EMPTY_IMAGES: { uri: string; previewUrl?: string }[] = [];
|
|
18
|
+
|
|
17
19
|
export const AIGenerationConfig: React.FC<AIGenerationConfigProps> = ({
|
|
18
20
|
heroTitle,
|
|
19
21
|
heroSubtitle,
|
|
20
22
|
heroIcon = "sparkles-outline",
|
|
21
|
-
images =
|
|
23
|
+
images = EMPTY_IMAGES,
|
|
22
24
|
isGenerating = false,
|
|
23
25
|
progress = 0,
|
|
24
26
|
...formProps
|
|
@@ -8,7 +8,7 @@ import { TouchableOpacity } from "react-native";
|
|
|
8
8
|
import { AtomicIcon } from "@umituz/react-native-design-system";
|
|
9
9
|
import { generationProgressContentStyles } from "./GenerationProgressContent.styles";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface ProgressCloseButtonProps {
|
|
12
12
|
onPress: () => void;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "@umituz/react-native-design-system";
|
|
12
12
|
import { generationProgressContentStyles } from "./GenerationProgressContent.styles";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface ProgressDismissButtonProps {
|
|
15
15
|
dismissLabel?: string;
|
|
16
16
|
dismissButtonColor?: string;
|
|
17
17
|
onDismiss: () => void;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "@umituz/react-native-design-system";
|
|
13
13
|
import { generationProgressContentStyles } from "./GenerationProgressContent.styles";
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
interface ProgressHeaderProps {
|
|
16
16
|
icon?: string;
|
|
17
17
|
title?: string;
|
|
18
18
|
message?: string;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "@umituz/react-native-design-system";
|
|
12
12
|
import { generationProgressContentStyles } from "./GenerationProgressContent.styles";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface ProgressHintProps {
|
|
15
15
|
hint?: string;
|
|
16
16
|
backgroundHint?: string;
|
|
17
17
|
hintColor?: string;
|