@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
package/src/domains/generation/wizard/infrastructure/strategies/video-generation.strategy.ts
CHANGED
|
@@ -14,7 +14,6 @@ import { validatePhotoCount, validateWizardVideoInput } from "./video-generation
|
|
|
14
14
|
import { executeVideoGeneration, submitVideoGenerationToQueue } from "./video-generation.executor";
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
export type { WizardVideoInput, WizardVideoResult, CreateVideoStrategyOptions } from "./video-generation.types";
|
|
18
17
|
|
|
19
18
|
export async function buildVideoInput(
|
|
20
19
|
wizardData: Record<string, unknown>,
|
|
@@ -21,10 +21,6 @@ export interface WizardVideoInput {
|
|
|
21
21
|
readonly resolution?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export interface WizardVideoResult {
|
|
25
|
-
readonly videoUrl: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
24
|
export interface CreateVideoStrategyOptions {
|
|
29
25
|
readonly scenario: WizardScenarioData;
|
|
30
26
|
/** Model configuration - encapsulates all model-specific behavior */
|
|
@@ -34,7 +30,7 @@ export interface CreateVideoStrategyOptions {
|
|
|
34
30
|
readonly creditCost: number;
|
|
35
31
|
}
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
interface PhotoValidationResult {
|
|
38
34
|
isValid: boolean;
|
|
39
35
|
errorKey?: string;
|
|
40
36
|
}
|
|
@@ -67,7 +63,7 @@ export function validatePhotoCount(
|
|
|
67
63
|
* Type guard for WizardVideoInput
|
|
68
64
|
* Validates runtime input and provides type safety
|
|
69
65
|
*/
|
|
70
|
-
|
|
66
|
+
function isWizardVideoInput(input: unknown): input is WizardVideoInput {
|
|
71
67
|
if (!input || typeof input !== "object") {
|
|
72
68
|
return false;
|
|
73
69
|
}
|
package/src/domains/generation/wizard/infrastructure/strategies/wizard-strategy.constants.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Centralized configuration values for wizard-based generation
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { VideoFeatureType } from "../../../../../domain/interfaces";
|
|
7
6
|
import { env } from "../../../../../infrastructure/config/env.config";
|
|
8
7
|
|
|
9
8
|
/** Generation timeout in milliseconds */
|
|
@@ -26,12 +25,6 @@ export const MODEL_INPUT_DEFAULTS = {
|
|
|
26
25
|
enableSafetyChecker: false,
|
|
27
26
|
} as const;
|
|
28
27
|
|
|
29
|
-
/** Video feature type patterns for scenario detection */
|
|
30
|
-
export const VIDEO_FEATURE_PATTERNS: Record<string, VideoFeatureType> = {
|
|
31
|
-
"text-to-video": "text-to-video",
|
|
32
|
-
"image-to-video": "image-to-video",
|
|
33
|
-
};
|
|
34
|
-
|
|
35
28
|
/** Default prompts for image processing features (no user input needed) */
|
|
36
29
|
export const IMAGE_PROCESSING_PROMPTS: Record<string, string> = {
|
|
37
30
|
upscale: "Enhance and upscale this image to higher resolution with improved details and clarity",
|
|
@@ -14,9 +14,7 @@ import { createVideoStrategy, buildVideoInput } from "./video-generation.strateg
|
|
|
14
14
|
// Types
|
|
15
15
|
// ============================================================================
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export interface CreateWizardStrategyOptions {
|
|
17
|
+
interface CreateWizardStrategyOptions {
|
|
20
18
|
readonly scenario: WizardScenarioData;
|
|
21
19
|
/** Model configuration - encapsulates all model-specific behavior */
|
|
22
20
|
readonly modelConfig?: VideoModelConfig;
|
|
@@ -7,9 +7,4 @@
|
|
|
7
7
|
* - Infrastructure: Save/update operations, factory
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
export type {
|
|
11
|
-
CreationPersistenceConfig,
|
|
12
|
-
ProcessingCreationData,
|
|
13
|
-
CompletedCreationData,
|
|
14
|
-
} from "./creation-persistence.types";
|
|
15
10
|
export { createCreationPersistence, type CreationPersistence } from "./creation-persistence-factory";
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
/**
|
|
11
11
|
* Check if value is a non-null object
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
function isObject(value: unknown): value is Record<string, unknown> {
|
|
14
14
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Check if object has a specific property
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
function hasProperty<K extends string>(
|
|
21
21
|
obj: Record<string, unknown>,
|
|
22
22
|
key: K,
|
|
23
23
|
): obj is Record<K, unknown> {
|
|
@@ -34,7 +34,7 @@ export function hasProperty<K extends string>(
|
|
|
34
34
|
* - Object with text field: { text: "my text" }
|
|
35
35
|
* - Object with uri field (fallback): { uri: "my text" }
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
function extractString(value: unknown): string | undefined {
|
|
38
38
|
if (typeof value === "string") {
|
|
39
39
|
return value;
|
|
40
40
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React, { useState, useEffect, useRef } from "react";
|
|
8
8
|
import { View, StyleSheet } from "react-native";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface IndeterminateProgressBarProps {
|
|
11
11
|
readonly backgroundColor: string;
|
|
12
12
|
readonly fillColor: string;
|
|
13
13
|
}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type IconName,
|
|
15
15
|
} from "@umituz/react-native-design-system";
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
interface WizardContinueButtonProps {
|
|
18
18
|
readonly canContinue: boolean;
|
|
19
19
|
readonly onPress: () => void;
|
|
20
20
|
readonly label: string;
|
|
@@ -22,7 +22,7 @@ import { StarRatingPicker } from "../../../../result-preview/presentation/compon
|
|
|
22
22
|
import type { CreditCalculatorFn } from "../../domain/types/credit-calculation.types";
|
|
23
23
|
import type { VideoModelConfig } from "../../../../../domain/interfaces/video-model-config.types";
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface WizardFlowContentProps {
|
|
26
26
|
readonly featureConfig: WizardFeatureConfig;
|
|
27
27
|
readonly scenario?: WizardScenarioData;
|
|
28
28
|
readonly validatedScenario: WizardScenarioData;
|
|
@@ -14,8 +14,6 @@ import { renderTextInputStep } from "./step-renderers/renderTextInputStep";
|
|
|
14
14
|
import { renderSelectionStep } from "./step-renderers/renderSelectionStep";
|
|
15
15
|
import type { WizardStepRendererProps } from "./WizardStepRenderer.types";
|
|
16
16
|
|
|
17
|
-
export type { WizardStepRendererProps } from "./WizardStepRenderer.types";
|
|
18
|
-
|
|
19
17
|
export const WizardStepRenderer: React.FC<WizardStepRendererProps> = ({
|
|
20
18
|
step,
|
|
21
19
|
scenario,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
WizardStepConfig,
|
|
3
3
|
TextInputStepConfig,
|
|
4
|
-
PhotoUploadStepConfig,
|
|
5
4
|
SelectionStepConfig,
|
|
6
5
|
} from "../../domain/entities/wizard-step.types";
|
|
7
6
|
import type { UploadedImage } from "../../../../../presentation/hooks/generation/useAIGenerateState";
|
|
@@ -30,12 +29,6 @@ export function getTextInputConfig(config: unknown): TextInputStepConfig | undef
|
|
|
30
29
|
return undefined;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
export function getPhotoUploadConfig(config: unknown): PhotoUploadStepConfig | undefined {
|
|
34
|
-
if (!isRecord(config)) return undefined;
|
|
35
|
-
if (config.type === "photo_upload") return config as unknown as PhotoUploadStepConfig;
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
32
|
export function getUploadedImage(data: unknown): UploadedImage | undefined {
|
|
40
33
|
if (isUploadedImage(data)) return data;
|
|
41
34
|
return undefined;
|
|
@@ -8,7 +8,7 @@ import { getWizardStepConfig, getUploadedImage } from "../WizardStepRenderer.uti
|
|
|
8
8
|
import type { StepDefinition } from "../../../../../../domain/entities/flow-config.types";
|
|
9
9
|
import type { UploadedImage } from "../../../../../../presentation/hooks/generation/useAIGenerateState";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface PhotoUploadStepProps {
|
|
12
12
|
readonly key?: string;
|
|
13
13
|
readonly step: StepDefinition;
|
|
14
14
|
readonly customData: Record<string, unknown>;
|
package/src/domains/generation/wizard/presentation/components/step-renderers/renderPreviewStep.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { ScenarioPreviewScreen } from "../../../../../scenarios/presentation/scr
|
|
|
7
7
|
import type { ScenarioData } from "../../../../../scenarios/domain/scenario.types";
|
|
8
8
|
import type { StepDefinition } from "../../../../../../domain/entities/flow-config.types";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface PreviewStepProps {
|
|
11
11
|
readonly step: StepDefinition;
|
|
12
12
|
readonly scenario: ScenarioData | undefined;
|
|
13
13
|
readonly onNext: () => void;
|
package/src/domains/generation/wizard/presentation/components/step-renderers/renderSelectionStep.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import { getSelectionConfig, getSelectionValue } from "../WizardStepRenderer.uti
|
|
|
8
8
|
import type { StepDefinition } from "../../../../../../domain/entities/flow-config.types";
|
|
9
9
|
import type { UploadedImage } from "../../../../../../presentation/hooks/generation/useAIGenerateState";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface SelectionStepProps {
|
|
12
12
|
readonly key?: string;
|
|
13
13
|
readonly step: StepDefinition;
|
|
14
14
|
readonly customData: Record<string, unknown>;
|
package/src/domains/generation/wizard/presentation/components/step-renderers/renderTextInputStep.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import type { StepDefinition } from "../../../../../../domain/entities/flow-conf
|
|
|
9
9
|
import type { UploadedImage } from "../../../../../../presentation/hooks/generation/useAIGenerateState";
|
|
10
10
|
import type { AlertMessages } from "../../../../../../presentation/hooks/generation/types";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
interface TextInputStepProps {
|
|
13
13
|
readonly key?: string;
|
|
14
14
|
readonly step: StepDefinition;
|
|
15
15
|
readonly customData: Record<string, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type GenerationStatus = "IDLE" | "PREPARING" | "GENERATING" | "ERROR" | "COMPLETED";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface GenerationState {
|
|
4
4
|
status: GenerationStatus;
|
|
5
5
|
error?: string;
|
|
6
6
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useState, useEffect, useRef } from "react";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
type GenerationPhase = "queued" | "processing" | "finalizing";
|
|
12
12
|
|
|
13
13
|
interface UseGenerationPhaseOptions {
|
|
14
14
|
/** Time in ms before transitioning from "queued" to "processing" (default: 5000) */
|
|
@@ -14,7 +14,7 @@ import type { WizardScenarioData } from "./wizard-generation.types";
|
|
|
14
14
|
import type { AlertMessages } from "../../../../../presentation/hooks/generation/types";
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
interface UsePhotoBlockingGenerationProps {
|
|
18
18
|
readonly userId?: string;
|
|
19
19
|
readonly scenario: WizardScenarioData;
|
|
20
20
|
readonly persistence: CreationPersistence;
|
|
@@ -26,7 +26,7 @@ export interface UsePhotoBlockingGenerationProps {
|
|
|
26
26
|
readonly onCreditsExhausted?: () => void;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
interface UsePhotoBlockingGenerationReturn {
|
|
30
30
|
readonly isGenerating: boolean;
|
|
31
31
|
readonly startGeneration: (input: unknown, prompt: string) => Promise<void>;
|
|
32
32
|
}
|
|
@@ -7,7 +7,7 @@ import { isCreation } from "./typeGuards";
|
|
|
7
7
|
import { classifyError } from "../../../../../infrastructure/utils/error-classification";
|
|
8
8
|
import type { GenerationErrorInfo } from "../components/WizardFlow.types";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface UseWizardFlowHandlersProps {
|
|
11
11
|
readonly currentStepIndex: number;
|
|
12
12
|
readonly flowSteps: StepDefinition[];
|
|
13
13
|
readonly customData: Record<string, unknown>;
|
|
@@ -11,7 +11,7 @@ import { useAppDesignTokens, AtomicText, ScreenLayout } from "@umituz/react-nati
|
|
|
11
11
|
import { useGenerationPhase } from "../hooks/useGenerationPhase";
|
|
12
12
|
import { IndeterminateProgressBar } from "../components/IndeterminateProgressBar";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface GeneratingScreenProps {
|
|
15
15
|
readonly progress: number;
|
|
16
16
|
readonly scenario?: {
|
|
17
17
|
readonly id: string;
|
|
@@ -22,7 +22,7 @@ import type { UploadedImage } from "../../../../../presentation/hooks/generation
|
|
|
22
22
|
import { usePhotoUploadState, type PhotoUploadError } from "../hooks/usePhotoUploadState";
|
|
23
23
|
import { WizardContinueButton } from "../components/WizardContinueButton";
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface PhotoUploadScreenTranslations {
|
|
26
26
|
readonly title: string;
|
|
27
27
|
readonly subtitle: string;
|
|
28
28
|
readonly continue: string;
|
|
@@ -37,12 +37,12 @@ export interface PhotoUploadScreenTranslations {
|
|
|
37
37
|
readonly aiDisclosure?: string;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
interface PhotoUploadScreenConfig {
|
|
41
41
|
readonly showPhotoTips?: boolean;
|
|
42
42
|
readonly maxFileSizeMB?: number;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
interface PhotoUploadScreenProps {
|
|
46
46
|
readonly translations: PhotoUploadScreenTranslations;
|
|
47
47
|
readonly t: (key: string) => string;
|
|
48
48
|
readonly config?: PhotoUploadScreenConfig;
|
|
@@ -16,12 +16,6 @@ import {
|
|
|
16
16
|
import type { SelectionScreenProps, SelectionOption } from "./SelectionScreen.types";
|
|
17
17
|
import { WizardContinueButton } from "../components/WizardContinueButton";
|
|
18
18
|
|
|
19
|
-
export type {
|
|
20
|
-
SelectionOption,
|
|
21
|
-
SelectionScreenTranslations,
|
|
22
|
-
SelectionScreenConfig,
|
|
23
|
-
SelectionScreenProps,
|
|
24
|
-
} from "./SelectionScreen.types";
|
|
25
19
|
|
|
26
20
|
|
|
27
21
|
export const SelectionScreen: React.FC<SelectionScreenProps> = ({
|
|
@@ -27,11 +27,13 @@ export type {
|
|
|
27
27
|
TextInputScreenProps,
|
|
28
28
|
} from "./TextInputScreen.types";
|
|
29
29
|
|
|
30
|
+
const EMPTY_EXAMPLE_PROMPTS: string[] = [];
|
|
31
|
+
|
|
30
32
|
export const TextInputScreen: React.FC<TextInputScreenProps> = ({
|
|
31
33
|
stepId: _stepId,
|
|
32
34
|
translations,
|
|
33
35
|
config,
|
|
34
|
-
examplePrompts =
|
|
36
|
+
examplePrompts = EMPTY_EXAMPLE_PROMPTS,
|
|
35
37
|
initialValue = "",
|
|
36
38
|
creditCost,
|
|
37
39
|
onBack,
|
|
@@ -146,9 +148,9 @@ export const TextInputScreen: React.FC<TextInputScreenProps> = ({
|
|
|
146
148
|
<AtomicText type="labelLarge" color="textSecondary" style={styles.examplesTitle}>
|
|
147
149
|
{translations.examplesTitle}
|
|
148
150
|
</AtomicText>
|
|
149
|
-
{examplePrompts.slice(0, 4).map((example
|
|
151
|
+
{examplePrompts.slice(0, 4).map((example) => (
|
|
150
152
|
<AtomicButton
|
|
151
|
-
key={
|
|
153
|
+
key={example}
|
|
152
154
|
variant="outline"
|
|
153
155
|
size="sm"
|
|
154
156
|
onPress={() => handleExampleSelect(example)}
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
export { GeneratingScreen } from "./GeneratingScreen";
|
|
2
|
-
export { GenericPhotoUploadScreen } from "./GenericPhotoUploadScreen";
|
|
3
|
-
export type {
|
|
4
|
-
PhotoUploadScreenTranslations,
|
|
5
|
-
PhotoUploadScreenConfig,
|
|
6
|
-
PhotoUploadScreenProps,
|
|
7
|
-
} from "./GenericPhotoUploadScreen";
|
|
8
2
|
export { TextInputScreen } from "./TextInputScreen";
|
|
9
3
|
export type {
|
|
10
4
|
TextInputScreenTranslations,
|
|
11
5
|
TextInputScreenConfig,
|
|
12
6
|
TextInputScreenProps,
|
|
13
7
|
} from "./TextInputScreen";
|
|
14
|
-
export { SelectionScreen } from "./SelectionScreen";
|
|
15
|
-
export type {
|
|
16
|
-
SelectionOption,
|
|
17
|
-
SelectionScreenTranslations,
|
|
18
|
-
SelectionScreenConfig,
|
|
19
|
-
SelectionScreenProps,
|
|
20
|
-
} from "./SelectionScreen";
|
|
@@ -7,12 +7,6 @@
|
|
|
7
7
|
import type { WizardScenarioData } from "../hooks/useWizardGeneration";
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
export interface ScenarioValidationResult {
|
|
11
|
-
isValid: boolean;
|
|
12
|
-
error?: string;
|
|
13
|
-
scenario?: WizardScenarioData;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
10
|
/**
|
|
17
11
|
* Validates scenario data for wizard generation
|
|
18
12
|
* aiPrompt is optional - for TEXT_INPUT scenarios, prompt comes from wizard data
|
|
@@ -11,7 +11,6 @@ import type {
|
|
|
11
11
|
ImageToVideoGenerateParams,
|
|
12
12
|
} from "../../domain/types";
|
|
13
13
|
export { DEFAULT_ALERT_MESSAGES } from "../../../../presentation/constants/alert-messages";
|
|
14
|
-
export { generateCreationId } from "../../../../infrastructure/utils/id-generator.util";
|
|
15
14
|
|
|
16
15
|
export const INITIAL_STATE: ImageToVideoFeatureState = {
|
|
17
16
|
imageUri: null,
|
|
@@ -39,11 +38,4 @@ export interface UseImageToVideoFeatureReturn {
|
|
|
39
38
|
canGenerate: boolean;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
export interface VideoGenerationInput {
|
|
43
|
-
imageUri: string;
|
|
44
|
-
imageBase64: string;
|
|
45
|
-
motionPrompt: string;
|
|
46
|
-
options?: Omit<ImageToVideoGenerateParams, "imageUri" | "motionPrompt">;
|
|
47
|
-
creationId: string;
|
|
48
|
-
}
|
|
49
41
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
useAppDesignTokens,
|
|
13
13
|
} from "@umituz/react-native-design-system";
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
interface StarRatingPickerProps {
|
|
16
16
|
visible: boolean;
|
|
17
17
|
onClose: () => void;
|
|
18
18
|
onRate: (rating: number, description: string) => void;
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export { WizardInputType } from "./wizard-input.types";
|
|
6
|
-
export type { WizardConfigOptions
|
|
6
|
+
export type { WizardConfigOptions } from "./wizard-input.types";
|
|
7
7
|
|
|
8
8
|
export { detectWizardInputType, SCENARIO_TO_WIZARD_INPUT_MAP } from "./wizard-input-detector";
|
|
9
9
|
|
|
10
|
-
export { CONFIG_FACTORIES, getConfigFactory } from "./wizard-step-factories";
|
|
11
10
|
|
|
12
11
|
export {
|
|
13
12
|
getScenarioWizardConfig,
|
|
@@ -15,7 +14,3 @@ export {
|
|
|
15
14
|
hasExplicitConfig,
|
|
16
15
|
getScenarioWizardInputType,
|
|
17
16
|
} from "./wizard-config-resolver";
|
|
18
|
-
|
|
19
|
-
// Pre-built Wizard Configs
|
|
20
|
-
export { TEXT_TO_VIDEO_WIZARD_CONFIG } from "../../generation/wizard/configs/text-to-video.config";
|
|
21
|
-
export { TEXT_TO_IMAGE_WIZARD_CONFIG } from "../../generation/wizard/configs/text-to-image.config";
|
|
@@ -101,7 +101,7 @@ function createDualImageFaceConfig(scenarioId: string): WizardFeatureConfig {
|
|
|
101
101
|
/**
|
|
102
102
|
* Registry of config factories by input type
|
|
103
103
|
*/
|
|
104
|
-
|
|
104
|
+
const CONFIG_FACTORIES: Record<WizardInputType, WizardConfigFactory> = {
|
|
105
105
|
[WizardInputType.DUAL_IMAGE]: createDualImageConfig,
|
|
106
106
|
[WizardInputType.SINGLE_IMAGE]: createSingleImageConfig,
|
|
107
107
|
[WizardInputType.TEXT_INPUT]: createTextInputConfig,
|
|
@@ -89,12 +89,3 @@ export const isScenariosConfigured = (): boolean => {
|
|
|
89
89
|
export const getAllConfiguredScenarios = (): readonly ConfiguredScenario[] => {
|
|
90
90
|
return Array.from(state.scenarios.values());
|
|
91
91
|
};
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Reset registry (for testing)
|
|
95
|
-
*/
|
|
96
|
-
export const resetScenarioRegistry = (): void => {
|
|
97
|
-
state.scenarios.clear();
|
|
98
|
-
state.defaultOutputType = "video";
|
|
99
|
-
state.isConfigured = false;
|
|
100
|
-
};
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
useResponsive,
|
|
14
14
|
} from "@umituz/react-native-design-system";
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
interface ScenarioContinueButtonProps {
|
|
17
17
|
readonly canContinue: boolean;
|
|
18
18
|
readonly onPress: () => void;
|
|
19
19
|
readonly label: string;
|
|
@@ -7,13 +7,13 @@ import { useMemo, useEffect } from "react";
|
|
|
7
7
|
import type { ScenarioData } from "../../domain/scenario.types";
|
|
8
8
|
import type { SubCategory } from "../../domain/category.types";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface UseHierarchicalScenariosProps {
|
|
11
11
|
readonly subCategoryId: string;
|
|
12
12
|
readonly subCategories: readonly SubCategory[];
|
|
13
13
|
readonly scenarios: readonly ScenarioData[];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
interface UseHierarchicalScenariosResult {
|
|
17
17
|
readonly subCategory: SubCategory | undefined;
|
|
18
18
|
readonly filteredScenarios: readonly ScenarioData[];
|
|
19
19
|
}
|
|
@@ -21,7 +21,7 @@ import type { SubCategory } from "../../domain/category.types";
|
|
|
21
21
|
import { useHierarchicalScenarios } from "../hooks/useHierarchicalScenarios";
|
|
22
22
|
import { ScenarioContinueButton } from "../components/ScenarioContinueButton";
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
interface HierarchicalScenarioListScreenProps {
|
|
25
25
|
readonly subCategoryId: string;
|
|
26
26
|
readonly subCategories: readonly SubCategory[];
|
|
27
27
|
readonly scenarios: readonly ScenarioData[];
|
|
@@ -17,12 +17,12 @@ import {
|
|
|
17
17
|
import { WizardContinueButton } from "../../../../domains/generation/wizard/presentation/components/WizardContinueButton";
|
|
18
18
|
import type { ScenarioData } from "../../domain/scenario.types";
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
interface ScenarioPreviewTranslations {
|
|
21
21
|
readonly continueButton: string;
|
|
22
22
|
readonly whatToExpect: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface ScenarioPreviewScreenProps {
|
|
26
26
|
readonly scenario: ScenarioData;
|
|
27
27
|
readonly translations: ScenarioPreviewTranslations;
|
|
28
28
|
readonly onBack: () => void;
|
|
@@ -6,9 +6,6 @@ export {
|
|
|
6
6
|
createDefaultAlerts,
|
|
7
7
|
createScenarioData,
|
|
8
8
|
useWizardFlowHandlers,
|
|
9
|
-
type WizardFlowConfig,
|
|
10
|
-
type UseWizardFlowHandlersOptions,
|
|
11
9
|
} from "./wizard-flow.utils";
|
|
12
10
|
|
|
13
11
|
export { AutoSkipPreview } from "../components/AutoSkipPreview";
|
|
14
|
-
export type { AutoSkipPreviewProps } from "../components/AutoSkipPreview";
|
|
@@ -23,7 +23,7 @@ export function createDefaultAlerts(t: (key: string) => string): AlertMessages {
|
|
|
23
23
|
/**
|
|
24
24
|
* Configuration for wizard flow utilities
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
interface WizardFlowConfig {
|
|
27
27
|
readonly id: string;
|
|
28
28
|
readonly outputType: "image" | "video";
|
|
29
29
|
readonly inputType: "text" | "single" | "dual";
|
|
@@ -50,7 +50,7 @@ export function createScenarioData(
|
|
|
50
50
|
/**
|
|
51
51
|
* Hook for wizard flow handlers
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
interface UseWizardFlowHandlersOptions {
|
|
54
54
|
readonly requireFeature: (proceed: () => void) => void;
|
|
55
55
|
readonly onGenerationComplete?: () => void;
|
|
56
56
|
readonly onBack: () => void;
|
|
@@ -5,12 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
export type { GenerationTabsProps, FrameSelectorProps } from "./tab-component.types";
|
|
7
7
|
export type { OptionsPanelProps, HeroSectionProps } from "./panel-component.types";
|
|
8
|
-
export type {
|
|
9
|
-
StyleSelectorProps,
|
|
10
|
-
AspectRatioSelectorProps,
|
|
11
|
-
DurationSelectorProps,
|
|
12
|
-
} from "./selector-component.types";
|
|
13
|
-
export type { GenerateButtonProps } from "./action-component.types";
|
|
14
8
|
export type {
|
|
15
9
|
HintCarouselProps,
|
|
16
10
|
HintItem,
|