@umituz/react-native-ai-generation-content 1.83.10 → 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/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.83.
|
|
3
|
+
"version": "1.83.11",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -16,15 +16,6 @@ export interface CreditGateConfig {
|
|
|
16
16
|
readonly onCreditsAvailable?: () => void;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/** Partner Configuration */
|
|
20
|
-
export interface PartnerConfig {
|
|
21
|
-
readonly partnerId: "A" | "B" | "single";
|
|
22
|
-
readonly showNameInput?: boolean;
|
|
23
|
-
readonly showFaceDetection?: boolean;
|
|
24
|
-
readonly showPhotoTips?: boolean;
|
|
25
|
-
readonly maxNameLength?: number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
19
|
/** Visual Style Option */
|
|
29
20
|
export interface FlowVisualStyleData {
|
|
30
21
|
readonly id: string;
|
|
@@ -3,19 +3,15 @@
|
|
|
3
3
|
* Generic multi-step flow system for AI generation
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export { StepType, type GateResult, type
|
|
6
|
+
export { StepType, type GateResult, type StepDefinition } from "./flow-step.types";
|
|
7
7
|
export type {
|
|
8
8
|
AuthGateConfig,
|
|
9
9
|
CreditGateConfig,
|
|
10
|
-
PartnerConfig,
|
|
11
|
-
FlowVisualStyleData,
|
|
12
10
|
FlowUploadedImageData,
|
|
13
11
|
} from "./flow-config-data.types";
|
|
14
|
-
export type { FlowState
|
|
12
|
+
export type { FlowState } from "./flow-state.types";
|
|
15
13
|
export type { FlowActions } from "./flow-actions.types";
|
|
16
14
|
export type {
|
|
17
15
|
FlowCallbacks,
|
|
18
|
-
FlowDataProvider,
|
|
19
16
|
FlowConfiguration,
|
|
20
|
-
FlowFeatures,
|
|
21
17
|
} from "./flow-configuration.types";
|
|
@@ -17,7 +17,7 @@ export interface FlowCallbacks {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/** Flow Data Provider - App provides data */
|
|
20
|
-
|
|
20
|
+
interface FlowDataProvider {
|
|
21
21
|
readonly categories?: readonly unknown[];
|
|
22
22
|
readonly scenarios?: readonly unknown[];
|
|
23
23
|
readonly visualStyles?: readonly FlowVisualStyleData[];
|
|
@@ -35,10 +35,3 @@ export interface FlowConfiguration {
|
|
|
35
35
|
readonly userId?: string;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/** Flow Features */
|
|
39
|
-
export interface FlowFeatures {
|
|
40
|
-
readonly categorySelection: boolean;
|
|
41
|
-
readonly partnerCount: 0 | 1 | 2;
|
|
42
|
-
readonly textInput: boolean;
|
|
43
|
-
readonly scenarioSelection: boolean;
|
|
44
|
-
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Metadata types for credit cost calculation
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
interface CreditCostMetadata {
|
|
11
11
|
readonly model?: string;
|
|
12
12
|
readonly duration?: number;
|
|
13
13
|
readonly resolution?: string;
|
|
@@ -105,7 +105,7 @@ export interface IAuthService {
|
|
|
105
105
|
/**
|
|
106
106
|
* Analytics event data
|
|
107
107
|
*/
|
|
108
|
-
|
|
108
|
+
interface AnalyticsEventData {
|
|
109
109
|
readonly [key: string]: string | number | boolean | null | undefined;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -6,13 +6,5 @@
|
|
|
6
6
|
export * from "./ai-provider.interface";
|
|
7
7
|
export * from "./app-services.interface";
|
|
8
8
|
|
|
9
|
-
// Interface Segregation - Split provider interfaces
|
|
10
|
-
export type { IAIProviderLifecycle } from "./provider-lifecycle.interface";
|
|
11
|
-
export type { IAIProviderCapabilities } from "./provider-capabilities.interface";
|
|
12
|
-
export type { IAIProviderJobManager } from "../../domains/background/domain/interfaces/provider-job-manager.interface";
|
|
13
|
-
export type { IAIProviderExecutor } from "./provider-executor.interface";
|
|
14
|
-
export type { IAIProviderImageFeatures } from "./provider-image-features.interface";
|
|
15
|
-
export type { IAIProviderVideoFeatures } from "./provider-video-features.interface";
|
|
16
|
-
|
|
17
9
|
// Video Model Configuration
|
|
18
10
|
export type { VideoModelConfig, ModelCapabilityOption } from "./video-model-config.types";
|
|
@@ -8,6 +8,5 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
export type { StatusCheckResult } from "./status-checker.types";
|
|
11
|
-
export { hasProperty, safeString } from "./status-extraction-helpers";
|
|
12
11
|
export { checkStatusForErrors } from "./status-error-detector";
|
|
13
12
|
export { isJobComplete, isJobProcessing, isJobFailed } from "./status-predicates";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* HTML entity encoding detection
|
|
8
8
|
* More reliable than regex for detecting encoded malicious content
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
function containsHTMLEntities(content: string): boolean {
|
|
11
11
|
const htmlEntities = [
|
|
12
12
|
/</gi, />/gi, /"/gi, /&/gi, /'/gi,
|
|
13
13
|
/&#\d+;/gi, /&#x[0-9a-fA-F]+;/gi,
|
|
@@ -52,7 +52,7 @@ export const CREATION_FIELDS = {
|
|
|
52
52
|
} as const;
|
|
53
53
|
|
|
54
54
|
/** Union type of all field names */
|
|
55
|
-
|
|
55
|
+
type CreationFieldName =
|
|
56
56
|
typeof CREATION_FIELDS[keyof typeof CREATION_FIELDS];
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -79,15 +79,6 @@ export const UPDATABLE_FIELDS: ReadonlyArray<CreationFieldName> = [
|
|
|
79
79
|
CREATION_FIELDS.DURATION_MS,
|
|
80
80
|
] as const;
|
|
81
81
|
|
|
82
|
-
/**
|
|
83
|
-
* Type guard for updatable fields
|
|
84
|
-
*/
|
|
85
|
-
export function isUpdatableField(
|
|
86
|
-
field: string
|
|
87
|
-
): field is CreationFieldName {
|
|
88
|
-
return UPDATABLE_FIELDS.includes(field as CreationFieldName);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
82
|
// Freeze to prevent mutations
|
|
92
83
|
Object.freeze(CREATION_FIELDS);
|
|
93
84
|
Object.freeze(UPDATABLE_FIELDS);
|
|
@@ -22,25 +22,5 @@ export const CREATION_STATUS = {
|
|
|
22
22
|
FAILED: "failed" as const,
|
|
23
23
|
} as const;
|
|
24
24
|
|
|
25
|
-
/** Union type of all valid status values */
|
|
26
|
-
export type CreationStatusValue =
|
|
27
|
-
typeof CREATION_STATUS[keyof typeof CREATION_STATUS];
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Type guard for creation status values
|
|
31
|
-
* @param value - Value to check
|
|
32
|
-
* @returns True if value is a valid creation status
|
|
33
|
-
*/
|
|
34
|
-
export function isCreationStatus(
|
|
35
|
-
value: unknown
|
|
36
|
-
): value is CreationStatusValue {
|
|
37
|
-
return (
|
|
38
|
-
typeof value === "string" &&
|
|
39
|
-
Object.values(CREATION_STATUS).includes(
|
|
40
|
-
value as CreationStatusValue
|
|
41
|
-
)
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
25
|
// Freeze to prevent mutations
|
|
46
26
|
Object.freeze(CREATION_STATUS);
|
|
@@ -44,17 +44,5 @@ export const CREATION_VALIDATION = {
|
|
|
44
44
|
] as const,
|
|
45
45
|
} as const;
|
|
46
46
|
|
|
47
|
-
/** Union type of valid URI protocols */
|
|
48
|
-
export type ValidUriProtocol =
|
|
49
|
-
typeof CREATION_VALIDATION.VALID_URI_PROTOCOLS[number];
|
|
50
|
-
|
|
51
|
-
/** Union type of valid image MIME types */
|
|
52
|
-
export type ValidImageMime =
|
|
53
|
-
typeof CREATION_VALIDATION.VALID_IMAGE_MIMES[number];
|
|
54
|
-
|
|
55
|
-
/** Union type of valid video MIME types */
|
|
56
|
-
export type ValidVideoMime =
|
|
57
|
-
typeof CREATION_VALIDATION.VALID_VIDEO_MIMES[number];
|
|
58
|
-
|
|
59
47
|
// Freeze to prevent mutations
|
|
60
48
|
Object.freeze(CREATION_VALIDATION);
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Creation Domain Constants - Modular Exports
|
|
3
|
-
*
|
|
4
|
-
* All constants follow 100-line rule for maintainability.
|
|
5
|
-
* Each module has single responsibility.
|
|
6
3
|
*/
|
|
7
4
|
|
|
8
|
-
// Status constants
|
|
5
|
+
// Status constants
|
|
9
6
|
export * from "./creation-status.constants";
|
|
10
7
|
|
|
11
|
-
// Field name constants
|
|
8
|
+
// Field name constants
|
|
12
9
|
export * from "./creation-fields.constants";
|
|
13
10
|
|
|
14
|
-
// Validation rule constants
|
|
11
|
+
// Validation rule constants
|
|
15
12
|
export * from "./creation-validation.constants";
|
|
16
|
-
|
|
17
|
-
// Type discriminator constants (45 lines)
|
|
18
|
-
export * from "./creation-types.constants";
|
|
19
|
-
|
|
20
|
-
// Error code constants (35 lines)
|
|
21
|
-
export * from "./creation-errors.constants";
|
|
22
|
-
|
|
23
|
-
// Query & collection constants (40 lines)
|
|
24
|
-
export * from "./creation-query.constants";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export { createCreation } from "./creation-create.operations";
|
|
7
|
-
export { updateCreation
|
|
7
|
+
export { updateCreation } from "./creation-update.operations";
|
|
8
8
|
export {
|
|
9
9
|
deleteCreation,
|
|
10
10
|
hardDeleteCreation,
|
|
@@ -19,9 +19,11 @@ import type { CreationCardProps } from "./CreationCard.types";
|
|
|
19
19
|
import type { CreationTypeId } from "../../domain/types";
|
|
20
20
|
import { getPreviewUrl, getCreationTitle } from "../../domain/utils";
|
|
21
21
|
|
|
22
|
+
const EMPTY_CALLBACKS: CreationCardProps["callbacks"] = {};
|
|
23
|
+
|
|
22
24
|
export function CreationCard({
|
|
23
25
|
creation,
|
|
24
|
-
callbacks =
|
|
26
|
+
callbacks = EMPTY_CALLBACKS,
|
|
25
27
|
showBadges = true,
|
|
26
28
|
showActions = true,
|
|
27
29
|
statusText,
|
|
@@ -156,5 +158,3 @@ export function CreationCard({
|
|
|
156
158
|
</TouchableOpacity>
|
|
157
159
|
);
|
|
158
160
|
}
|
|
159
|
-
|
|
160
|
-
export type { CreationCardProps, CreationCardData, CreationCardCallbacks } from "./CreationCard.types";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import type { CreationStatus, CreationTypeId } from "../../domain/types";
|
|
16
16
|
import { isInProgress, getTypeIcon } from "../../domain/utils";
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
interface CreationImagePreviewProps {
|
|
19
19
|
/** Preview image URL */
|
|
20
20
|
readonly uri?: string | null;
|
|
21
21
|
/** Creation status */
|
|
@@ -14,7 +14,7 @@ import type { CreationStatus, CreationTypeId } from "../../domain/types";
|
|
|
14
14
|
import { isInProgress } from "../../domain/utils";
|
|
15
15
|
import { shouldShowThumbnail } from "../../domain/utils/preview-helpers";
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
interface CreationVideoPreviewProps {
|
|
18
18
|
/** Thumbnail image URL (optional) */
|
|
19
19
|
readonly thumbnailUrl?: string | null;
|
|
20
20
|
/** Video URL (for display purposes only) */
|
|
@@ -45,9 +45,9 @@ function CreationCardSkeleton({ tokens }: { tokens: DesignTokens }) {
|
|
|
45
45
|
</View>
|
|
46
46
|
{/* Action buttons skeleton */}
|
|
47
47
|
<View style={styles.actions}>
|
|
48
|
-
{[1, 2, 3, 4].map((
|
|
48
|
+
{[1, 2, 3, 4].map((id) => (
|
|
49
49
|
<AtomicSkeleton
|
|
50
|
-
key={
|
|
50
|
+
key={id}
|
|
51
51
|
pattern="custom"
|
|
52
52
|
custom={[{ width: 36, height: 36, borderRadius: 18 }]}
|
|
53
53
|
/>
|
|
@@ -76,8 +76,8 @@ export function GalleryEmptyStates({
|
|
|
76
76
|
if (isLoading && (!creations || creations?.length === 0)) {
|
|
77
77
|
return (
|
|
78
78
|
<View style={styles.skeletonContainer}>
|
|
79
|
-
{[1, 2, 3].map((
|
|
80
|
-
<CreationCardSkeleton key={
|
|
79
|
+
{[1, 2, 3].map((id: number) => (
|
|
80
|
+
<CreationCardSkeleton key={id} tokens={tokens} />
|
|
81
81
|
))}
|
|
82
82
|
</View>
|
|
83
83
|
);
|
|
@@ -20,11 +20,13 @@ interface GalleryHeaderProps {
|
|
|
20
20
|
readonly style?: ViewStyle;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
const EMPTY_FILTER_BUTTONS: FilterButtonConfig[] = [];
|
|
24
|
+
|
|
23
25
|
export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
24
26
|
title,
|
|
25
27
|
count,
|
|
26
28
|
countLabel,
|
|
27
|
-
filterButtons =
|
|
29
|
+
filterButtons = EMPTY_FILTER_BUTTONS,
|
|
28
30
|
showFilter = true,
|
|
29
31
|
style,
|
|
30
32
|
}: GalleryHeaderProps) => {
|
|
@@ -7,7 +7,7 @@ import React, { useMemo } from "react";
|
|
|
7
7
|
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
8
|
import { useAppDesignTokens, AtomicIcon, AtomicText, type DesignTokens } from "@umituz/react-native-design-system";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface GalleryScreenHeaderProps {
|
|
11
11
|
readonly title: string;
|
|
12
12
|
readonly onBack: () => void;
|
|
13
13
|
}
|
|
@@ -3,33 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
// Core Components
|
|
6
|
-
export { CreationPreview } from "./CreationPreview";
|
|
7
|
-
export { CreationImagePreview, type CreationImagePreviewProps } from "./CreationImagePreview";
|
|
8
|
-
export { CreationVideoPreview, type CreationVideoPreviewProps } from "./CreationVideoPreview";
|
|
9
|
-
export { CreationBadges } from "./CreationBadges";
|
|
10
|
-
export { CreationActions, type CreationAction } from "./CreationActions";
|
|
11
6
|
export {
|
|
12
7
|
CreationCard,
|
|
13
|
-
type CreationCardData,
|
|
14
|
-
type CreationCardCallbacks,
|
|
15
8
|
} from "./CreationCard";
|
|
16
|
-
export { CreationThumbnail } from "./CreationThumbnail";
|
|
17
|
-
|
|
18
|
-
// Filter Components
|
|
19
|
-
export { FilterChips } from "./FilterChips";
|
|
20
|
-
export {
|
|
21
|
-
CreationsFilterBar,
|
|
22
|
-
createMediaFilterButtons,
|
|
23
|
-
createStatusFilterButtons,
|
|
24
|
-
type FilterButton,
|
|
25
|
-
} from "./CreationsFilterBar";
|
|
26
|
-
export { StatusFilterSheet, MediaFilterSheet } from "./FilterSheets";
|
|
27
9
|
|
|
28
10
|
// Gallery Components
|
|
29
11
|
export { GalleryHeader } from "./GalleryHeader";
|
|
30
|
-
export { EmptyState } from "./EmptyState";
|
|
31
12
|
export { GalleryEmptyStates } from "./GalleryEmptyStates";
|
|
32
|
-
export { CreationsHomeCard } from "./CreationsHomeCard";
|
|
33
|
-
export { CreationRating } from "./CreationRating";
|
|
34
|
-
export { CreationsGrid } from "./CreationsGrid";
|
|
35
|
-
export { PendingJobsSection, type PendingJobsSectionProps } from "./PendingJobsSection";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
interface ValidationResult {
|
|
19
19
|
isValid: boolean;
|
|
20
20
|
error?: string;
|
|
21
21
|
}
|
|
@@ -23,7 +23,7 @@ export interface ValidationResult {
|
|
|
23
23
|
/**
|
|
24
24
|
* Validates that at least one URL is present
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
function validateHasUrl(
|
|
27
27
|
imageUrl?: string,
|
|
28
28
|
videoUrl?: string
|
|
29
29
|
): ValidationResult {
|
|
@@ -39,7 +39,7 @@ export function validateHasUrl(
|
|
|
39
39
|
/**
|
|
40
40
|
* Validates URI protocol
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
function validateUriProtocol(uri: string): ValidationResult {
|
|
43
43
|
const hasValidProtocol = CREATION_VALIDATION.VALID_URI_PROTOCOLS.some(
|
|
44
44
|
(protocol) => uri.startsWith(protocol)
|
|
45
45
|
);
|
|
@@ -57,7 +57,7 @@ export function validateUriProtocol(uri: string): ValidationResult {
|
|
|
57
57
|
/**
|
|
58
58
|
* Validates URI length
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
function validateUriLength(uri: string): ValidationResult {
|
|
61
61
|
if (uri.length > CREATION_VALIDATION.MAX_URI_LENGTH) {
|
|
62
62
|
return {
|
|
63
63
|
isValid: false,
|
|
@@ -9,7 +9,7 @@ import type { CreationCategory, CreationTypeId } from "../../domain/types";
|
|
|
9
9
|
import type { FilterableCreation } from "./advancedFilter.types";
|
|
10
10
|
import { normalizeDateToTimestamp, compareDates } from "../../../../shared/utils/date";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function filterByType<T extends FilterableCreation>(
|
|
13
13
|
creations: T[],
|
|
14
14
|
filterType: string | undefined,
|
|
15
15
|
): T[] {
|
|
@@ -25,7 +25,7 @@ export function filterByType<T extends FilterableCreation>(
|
|
|
25
25
|
return creations.filter((c) => c.type === filterType);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
function filterByStatus<T extends FilterableCreation>(
|
|
29
29
|
creations: T[],
|
|
30
30
|
status: string | undefined,
|
|
31
31
|
): T[] {
|
|
@@ -33,7 +33,7 @@ export function filterByStatus<T extends FilterableCreation>(
|
|
|
33
33
|
return creations.filter((c) => c.status === status);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
function filterBySearch<T extends FilterableCreation>(
|
|
37
37
|
creations: T[],
|
|
38
38
|
searchQuery: string | undefined,
|
|
39
39
|
): T[] {
|
|
@@ -47,7 +47,7 @@ export function filterBySearch<T extends FilterableCreation>(
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
function filterByDateRange<T extends FilterableCreation>(
|
|
51
51
|
creations: T[],
|
|
52
52
|
startDate: number | undefined,
|
|
53
53
|
endDate: number | undefined,
|
|
@@ -71,7 +71,7 @@ export function filterByDateRange<T extends FilterableCreation>(
|
|
|
71
71
|
return result;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
function sortCreations<T extends FilterableCreation>(
|
|
75
75
|
creations: T[],
|
|
76
76
|
sortField: CreationFilter["sortField"],
|
|
77
77
|
sortOrder: CreationFilter["sortOrder"],
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
import { useState, useCallback, useMemo } from "react";
|
|
9
9
|
import type { FilterOption } from "../../domain/types/creation-filter";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface UseFilterProps {
|
|
12
12
|
readonly options: FilterOption[];
|
|
13
13
|
readonly t: (key: string) => string;
|
|
14
14
|
readonly defaultId?: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
interface UseFilterReturn {
|
|
18
18
|
readonly selectedId: string;
|
|
19
19
|
readonly filterOptions: FilterOption[];
|
|
20
20
|
readonly hasActiveFilter: boolean;
|
|
@@ -10,7 +10,7 @@ import type { Creation } from "../../domain/entities/Creation";
|
|
|
10
10
|
import type { CreationsConfig } from "../../domain/value-objects/CreationsConfig";
|
|
11
11
|
import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
interface UseGalleryCallbacksProps {
|
|
14
14
|
readonly userId: string | null;
|
|
15
15
|
readonly repository: ICreationsRepository;
|
|
16
16
|
readonly config: CreationsConfig;
|
|
@@ -7,12 +7,12 @@ import { useState, useEffect, useRef, useMemo } from "react";
|
|
|
7
7
|
import type { Creation } from "../../domain/entities/Creation";
|
|
8
8
|
import { getPreviewUrl } from "../../domain/utils";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface GalleryStateOptions {
|
|
11
11
|
initialCreationId?: string;
|
|
12
12
|
creations: Creation[] | undefined;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
interface GalleryStateReturn {
|
|
16
16
|
selectedCreation: Creation | null;
|
|
17
17
|
showRatingPicker: boolean;
|
|
18
18
|
selectedImageUrl: string | undefined;
|
|
@@ -21,7 +21,6 @@ import type { Creation } from "../../domain/entities/Creation";
|
|
|
21
21
|
import type { CreationsGalleryScreenProps } from "./creations-gallery.types";
|
|
22
22
|
import { creationsGalleryStyles as styles } from "./creations-gallery.styles";
|
|
23
23
|
|
|
24
|
-
export type { CreationsGalleryScreenProps } from "./creations-gallery.types";
|
|
25
24
|
|
|
26
25
|
export function CreationsGalleryScreen({
|
|
27
26
|
userId,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Creates filter buttons for the gallery screen
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
interface FilterButton {
|
|
7
7
|
readonly id: string;
|
|
8
8
|
readonly label: string;
|
|
9
9
|
readonly icon: string;
|
|
@@ -11,7 +11,7 @@ export interface FilterButton {
|
|
|
11
11
|
readonly onPress: () => void;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface FilterButtonsConfig {
|
|
15
15
|
readonly showStatusFilter: boolean;
|
|
16
16
|
readonly showMediaFilter: boolean;
|
|
17
17
|
readonly statusFilterActive: boolean;
|
|
@@ -29,9 +29,11 @@ export {
|
|
|
29
29
|
} from "./presentation/components/CreationActions";
|
|
30
30
|
export {
|
|
31
31
|
CreationCard,
|
|
32
|
-
type CreationCardData,
|
|
33
|
-
type CreationCardCallbacks,
|
|
34
32
|
} from "./presentation/components/CreationCard";
|
|
33
|
+
export type {
|
|
34
|
+
CreationCardData,
|
|
35
|
+
CreationCardCallbacks,
|
|
36
|
+
} from "./presentation/components/CreationCard.types";
|
|
35
37
|
export { CreationThumbnail } from "./presentation/components/CreationThumbnail";
|
|
36
38
|
|
|
37
39
|
// Filter Components
|
|
@@ -40,8 +42,8 @@ export {
|
|
|
40
42
|
CreationsFilterBar,
|
|
41
43
|
createMediaFilterButtons,
|
|
42
44
|
createStatusFilterButtons,
|
|
43
|
-
type FilterButton,
|
|
44
45
|
} from "./presentation/components/CreationsFilterBar";
|
|
46
|
+
export type { FilterButton } from "./presentation/components/CreationsFilterBar.types";
|
|
45
47
|
|
|
46
48
|
// Gallery Components
|
|
47
49
|
export { CreationsHomeCard } from "./presentation/components/CreationsHomeCard";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import type { FaceValidationState } from "../../domain/entities/FaceDetection";
|
|
17
17
|
import { isValidFace } from "../../infrastructure/validators/faceValidator";
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
interface FaceValidationLabels {
|
|
20
20
|
analyzing: string;
|
|
21
21
|
error: string;
|
|
22
22
|
success: string;
|
|
@@ -32,7 +32,7 @@ export function buildModelInput(input: TextToImageInput): Record<string, unknown
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
function extractImagesFromObject(obj: Record<string, unknown>): string[] {
|
|
36
36
|
if (!Array.isArray(obj.images)) {
|
|
37
37
|
return [];
|
|
38
38
|
}
|
package/src/domains/generation/wizard/infrastructure/strategies/image-generation.strategy.ts
CHANGED
|
@@ -12,8 +12,6 @@ import { extractPhotosAsBase64 } from "./shared/photo-extraction.utils";
|
|
|
12
12
|
import { executeImageGeneration } from "./image-generation.executor";
|
|
13
13
|
import type { WizardImageInput, CreateImageStrategyOptions } from "./image-generation.types";
|
|
14
14
|
|
|
15
|
-
// Re-export types for external use
|
|
16
|
-
export type { WizardImageInput, WizardImageResult, CreateImageStrategyOptions } from "./image-generation.types";
|
|
17
15
|
|
|
18
16
|
// ============================================================================
|
|
19
17
|
// Input Builder
|
|
@@ -19,10 +19,6 @@ export interface WizardImageInput {
|
|
|
19
19
|
readonly promptType?: ScenarioPromptType;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export interface WizardImageResult {
|
|
23
|
-
readonly imageUrl: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
22
|
export interface CreateImageStrategyOptions {
|
|
27
23
|
readonly scenario: WizardScenarioData;
|
|
28
24
|
readonly collectionName?: string;
|
package/src/domains/generation/wizard/infrastructure/strategies/shared/unified-prompt-builder.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { createMultiPersonPrompt } from "../../../../../prompts/domain/entities/MultiPersonPromptStructure";
|
|
9
9
|
import { createPhotorealisticPrompt } from "../../../../../prompts/domain/base/creators";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface BuildPromptOptions {
|
|
12
12
|
/** Base scenario prompt (aiPrompt from scenario config) */
|
|
13
13
|
readonly basePrompt: string;
|
|
14
14
|
/** Number of photos/people in generation */
|