@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.
Files changed (200) hide show
  1. package/package.json +1 -1
  2. package/src/domain/constants/queue-status.constants.ts +0 -2
  3. package/src/domain/entities/flow-config-data.types.ts +0 -9
  4. package/src/domain/entities/flow-config.types.ts +2 -6
  5. package/src/domain/entities/flow-configuration.types.ts +1 -8
  6. package/src/domain/interfaces/app-services.interface.ts +2 -2
  7. package/src/domain/interfaces/index.ts +0 -8
  8. package/src/domains/background/infrastructure/services/job-poller.service.ts +0 -1
  9. package/src/domains/background/infrastructure/utils/result-validator.util.ts +0 -1
  10. package/src/domains/background/infrastructure/utils/status-checker.util.ts +0 -1
  11. package/src/domains/background/infrastructure/utils/status-extraction-helpers.ts +1 -1
  12. package/src/domains/content-moderation/infrastructure/utils/content-security.util.ts +1 -1
  13. package/src/domains/creations/domain/constants/creation-fields.constants.ts +1 -10
  14. package/src/domains/creations/domain/constants/creation-status.constants.ts +0 -20
  15. package/src/domains/creations/domain/constants/creation-validation.constants.ts +0 -12
  16. package/src/domains/creations/domain/constants/index.ts +3 -15
  17. package/src/domains/creations/domain/entities/index.ts +1 -1
  18. package/src/domains/creations/infrastructure/repositories/creation-update.operations.ts +0 -2
  19. package/src/domains/creations/infrastructure/repositories/creations-operations.ts +1 -1
  20. package/src/domains/creations/presentation/components/CreationCard.tsx +3 -3
  21. package/src/domains/creations/presentation/components/CreationImagePreview.tsx +1 -1
  22. package/src/domains/creations/presentation/components/CreationVideoPreview.tsx +1 -1
  23. package/src/domains/creations/presentation/components/CreationsFilterBar.tsx +0 -1
  24. package/src/domains/creations/presentation/components/GalleryEmptyStates.tsx +4 -4
  25. package/src/domains/creations/presentation/components/GalleryHeader.tsx +3 -1
  26. package/src/domains/creations/presentation/components/GalleryScreenHeader.tsx +1 -1
  27. package/src/domains/creations/presentation/components/index.ts +0 -23
  28. package/src/domains/creations/presentation/hooks/creation-validators.ts +4 -4
  29. package/src/domains/creations/presentation/hooks/filterHelpers.ts +5 -5
  30. package/src/domains/creations/presentation/hooks/useFilter.ts +2 -2
  31. package/src/domains/creations/presentation/hooks/useGalleryCallbacks.ts +1 -1
  32. package/src/domains/creations/presentation/hooks/useGalleryState.ts +2 -2
  33. package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +0 -1
  34. package/src/domains/creations/presentation/utils/filter-buttons.util.ts +2 -2
  35. package/src/domains/creations/presentation-exports.ts +5 -3
  36. package/src/domains/face-detection/presentation/components/FaceValidationStatus.tsx +1 -1
  37. package/src/domains/generation/infrastructure/executors/text-to-image-executor.helpers.ts +1 -1
  38. package/src/domains/generation/wizard/infrastructure/strategies/image-generation.strategy.ts +0 -2
  39. package/src/domains/generation/wizard/infrastructure/strategies/image-generation.types.ts +0 -4
  40. package/src/domains/generation/wizard/infrastructure/strategies/index.ts +0 -1
  41. package/src/domains/generation/wizard/infrastructure/strategies/shared/unified-prompt-builder.ts +1 -1
  42. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.strategy.ts +0 -1
  43. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.types.ts +2 -6
  44. package/src/domains/generation/wizard/infrastructure/strategies/wizard-strategy.constants.ts +0 -7
  45. package/src/domains/generation/wizard/infrastructure/strategies/wizard-strategy.factory.ts +1 -3
  46. package/src/domains/generation/wizard/infrastructure/utils/creation-persistence.util.ts +0 -5
  47. package/src/domains/generation/wizard/infrastructure/utils/index.ts +0 -3
  48. package/src/domains/generation/wizard/infrastructure/utils/primitive-extractors.ts +3 -3
  49. package/src/domains/generation/wizard/presentation/components/IndeterminateProgressBar.tsx +1 -1
  50. package/src/domains/generation/wizard/presentation/components/WizardContinueButton.tsx +1 -1
  51. package/src/domains/generation/wizard/presentation/components/WizardFlowContent.tsx +1 -1
  52. package/src/domains/generation/wizard/presentation/components/WizardStepRenderer.tsx +0 -2
  53. package/src/domains/generation/wizard/presentation/components/WizardStepRenderer.utils.ts +0 -7
  54. package/src/domains/generation/wizard/presentation/components/index.ts +0 -2
  55. package/src/domains/generation/wizard/presentation/components/step-renderers/renderPhotoUploadStep.tsx +1 -1
  56. package/src/domains/generation/wizard/presentation/components/step-renderers/renderPreviewStep.tsx +1 -1
  57. package/src/domains/generation/wizard/presentation/components/step-renderers/renderSelectionStep.tsx +1 -1
  58. package/src/domains/generation/wizard/presentation/components/step-renderers/renderTextInputStep.tsx +1 -1
  59. package/src/domains/generation/wizard/presentation/hooks/generationStateMachine.ts +2 -2
  60. package/src/domains/generation/wizard/presentation/hooks/useGenerationPhase.ts +1 -1
  61. package/src/domains/generation/wizard/presentation/hooks/usePhotoBlockingGeneration.ts +2 -2
  62. package/src/domains/generation/wizard/presentation/hooks/useWizardFlowHandlers.ts +1 -1
  63. package/src/domains/generation/wizard/presentation/screens/GeneratingScreen.tsx +1 -1
  64. package/src/domains/generation/wizard/presentation/screens/GenericPhotoUploadScreen.tsx +3 -3
  65. package/src/domains/generation/wizard/presentation/screens/SelectionScreen.tsx +0 -6
  66. package/src/domains/generation/wizard/presentation/screens/TextInputScreen.tsx +5 -3
  67. package/src/domains/generation/wizard/presentation/screens/index.ts +0 -13
  68. package/src/domains/generation/wizard/presentation/utilities/validateScenario.ts +0 -6
  69. package/src/domains/image-to-video/presentation/hooks/image-to-video-feature.types.ts +0 -8
  70. package/src/domains/image-to-video/presentation/index.ts +0 -4
  71. package/src/domains/result-preview/presentation/components/StarRatingPicker.tsx +1 -1
  72. package/src/domains/result-preview/presentation/types/result-preview.types.ts +0 -5
  73. package/src/domains/scenarios/configs/index.ts +1 -6
  74. package/src/domains/scenarios/configs/wizard-step-factories.ts +1 -1
  75. package/src/domains/scenarios/infrastructure/scenario-registry.ts +0 -9
  76. package/src/domains/scenarios/presentation/components/ScenarioContinueButton.tsx +1 -1
  77. package/src/domains/scenarios/presentation/hooks/useHierarchicalScenarios.ts +2 -2
  78. package/src/domains/scenarios/presentation/screens/HierarchicalScenarioListScreen.tsx +1 -1
  79. package/src/domains/scenarios/presentation/screens/ScenarioPreviewScreen.tsx +2 -2
  80. package/src/domains/shared/presentation/components/AutoSkipPreview.tsx +1 -1
  81. package/src/domains/shared/presentation/components/index.ts +0 -1
  82. package/src/domains/shared/presentation/utils/index.ts +0 -3
  83. package/src/domains/shared/presentation/utils/wizard-flow.utils.ts +2 -2
  84. package/src/domains/text-to-image/presentation/index.ts +0 -2
  85. package/src/domains/text-to-video/domain/types/component.types.ts +0 -6
  86. package/src/domains/text-to-video/domain/types/index.ts +0 -4
  87. package/src/domains/text-to-video/presentation/components/FrameSelector.tsx +97 -52
  88. package/src/domains/text-to-video/presentation/index.ts +0 -2
  89. package/src/infrastructure/config/index.ts +0 -2
  90. package/src/infrastructure/constants/index.ts +0 -6
  91. package/src/infrastructure/constants/polling.constants.ts +0 -21
  92. package/src/infrastructure/constants/validation.constants.ts +0 -30
  93. package/src/infrastructure/utils/error-classification.ts +1 -1
  94. package/src/infrastructure/utils/error-factory.ts +2 -2
  95. package/src/infrastructure/utils/index.ts +0 -9
  96. package/src/infrastructure/utils/message-extractor.ts +1 -20
  97. package/src/infrastructure/utils/progress.utils.ts +0 -37
  98. package/src/infrastructure/utils/provider-validator.util.ts +1 -1
  99. package/src/infrastructure/utils/url-extractor/index.ts +0 -5
  100. package/src/infrastructure/utils/url-extractor.util.ts +0 -11
  101. package/src/infrastructure/utils/video-helpers.ts +1 -1
  102. package/src/infrastructure/validation/ai-validator.ts +0 -28
  103. package/src/infrastructure/validation/entity-validator.ts +0 -34
  104. package/src/infrastructure/validation/input-validator.ts +2 -5
  105. package/src/infrastructure/validation/sanitizer.ts +0 -17
  106. package/src/presentation/components/AIGenerationConfig.tsx +3 -1
  107. package/src/presentation/components/GenerationProgressContent.styles.ts +0 -2
  108. package/src/presentation/components/PhotoUploadCard/PhotoUploadCard.tsx +0 -1
  109. package/src/presentation/components/ProgressCloseButton.tsx +1 -1
  110. package/src/presentation/components/ProgressDismissButton.tsx +1 -1
  111. package/src/presentation/components/ProgressHeader.tsx +1 -1
  112. package/src/presentation/components/ProgressHint.tsx +1 -1
  113. package/src/presentation/components/display/AIGenerationResult.tsx +6 -4
  114. package/src/presentation/components/display/index.ts +0 -1
  115. package/src/presentation/components/moderation/ModerationSummary.tsx +2 -2
  116. package/src/presentation/components/prompts/ExamplePrompts.tsx +2 -2
  117. package/src/presentation/components/result/ResultImageCard.tsx +39 -21
  118. package/src/presentation/components/result/ResultStoryCard.tsx +38 -15
  119. package/src/presentation/components/result/button-style.utils.ts +1 -1
  120. package/src/presentation/components/selectors/GridSelector.tsx +2 -2
  121. package/src/presentation/components/selectors/factories/aspect-ratio.factory.ts +0 -2
  122. package/src/presentation/components/selectors/factories/duration.factory.ts +0 -2
  123. package/src/presentation/components/selectors/factories/style.factory.ts +1 -1
  124. package/src/presentation/components/shared/ModelSelector.tsx +3 -1
  125. package/src/presentation/hooks/ai-feature-callbacks-auth.hooks.ts +2 -2
  126. package/src/presentation/hooks/ai-feature-callbacks-cost.hooks.ts +2 -2
  127. package/src/presentation/hooks/ai-feature-callbacks-execution.hooks.ts +2 -2
  128. package/src/presentation/hooks/generation/index.ts +0 -5
  129. package/src/presentation/hooks/generation/moderation-handler.ts +1 -1
  130. package/src/presentation/hooks/generation/types.ts +0 -12
  131. package/src/presentation/hooks/index.ts +0 -4
  132. package/src/presentation/hooks/useProgressDismiss.ts +1 -1
  133. package/src/presentation/layouts/types/layout-props.ts +1 -1
  134. package/src/domain/constants/index.ts +0 -2
  135. package/src/domain/entities/feature-flow-config.types.ts +0 -17
  136. package/src/domain/entities/scenario-step-config.types.ts +0 -32
  137. package/src/domain/entities/step-config.types.ts +0 -18
  138. package/src/domain/entities/step-definition.types.ts +0 -50
  139. package/src/domain/entities/step-input-config.types.ts +0 -36
  140. package/src/domain/entities/step-upload-config.types.ts +0 -17
  141. package/src/domains/background/domain/entities/index.ts +0 -1
  142. package/src/domains/background/domain/interfaces/index.ts +0 -1
  143. package/src/domains/content-moderation/infrastructure/utils/validators.util.ts +0 -51
  144. package/src/domains/creations/domain/constants/creation-errors.constants.ts +0 -27
  145. package/src/domains/creations/domain/constants/creation-query.constants.ts +0 -37
  146. package/src/domains/creations/domain/constants/creation-types.constants.ts +0 -45
  147. package/src/domains/creations/presentation/components/CreationImageViewer.tsx +0 -43
  148. package/src/domains/creations/presentation/components/CreationRating.tsx +0 -69
  149. package/src/domains/creations/presentation/components/CreationsGrid.tsx +0 -130
  150. package/src/domains/creations/presentation/components/FilterSheets.tsx +0 -63
  151. package/src/domains/creations/presentation/hooks/index.ts +0 -24
  152. package/src/domains/creations/presentation/hooks/useCreationRating.ts +0 -68
  153. package/src/domains/creations/presentation/screens/index.ts +0 -5
  154. package/src/domains/generation/infrastructure/flow/scenario-configs.ts +0 -54
  155. package/src/domains/generation/infrastructure/flow/step-builders.ts +0 -133
  156. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.utils.ts +0 -42
  157. package/src/domains/generation/wizard/presentation/components/WizardHeader.tsx +0 -96
  158. package/src/domains/generation/wizard/presentation/components/step-renderers/index.ts +0 -8
  159. package/src/domains/generation/wizard/presentation/components/step-renderers/renderGeneratingStep.tsx +0 -24
  160. package/src/domains/generation/wizard/presentation/components/step-renderers/renderResultStep.tsx +0 -69
  161. package/src/domains/generation/wizard/presentation/utilities/index.ts +0 -1
  162. package/src/domains/prompts/infrastructure/services/base/index.ts +0 -6
  163. package/src/domains/prompts/infrastructure/services/base/prompt-service.base.ts +0 -112
  164. package/src/domains/result-preview/index.ts +0 -37
  165. package/src/domains/result-preview/presentation/components/GenerationErrorScreen.tsx +0 -109
  166. package/src/domains/result-preview/presentation/components/index.ts +0 -16
  167. package/src/domains/result-preview/presentation/hooks/index.ts +0 -5
  168. package/src/domains/result-preview/presentation/types/index.ts +0 -16
  169. package/src/domains/result-preview/presentation/types/result-data.types.ts +0 -35
  170. package/src/domains/text-to-image/presentation/screens/TextToImageWizardFlow.types.ts +0 -27
  171. package/src/domains/text-to-video/domain/types/action-component.types.ts +0 -15
  172. package/src/domains/text-to-video/domain/types/selector-component.types.ts +0 -31
  173. package/src/infrastructure/constants/content.constants.ts +0 -8
  174. package/src/infrastructure/constants/storage.constants.ts +0 -27
  175. package/src/infrastructure/http/api-client.types.ts +0 -17
  176. package/src/infrastructure/http/http-client-methods.ts +0 -73
  177. package/src/infrastructure/http/http-client.util.ts +0 -12
  178. package/src/infrastructure/http/http-fetch-handler.ts +0 -63
  179. package/src/infrastructure/http/http-methods.constants.ts +0 -23
  180. package/src/infrastructure/http/http-request-executor.ts +0 -49
  181. package/src/infrastructure/http/http-response-parser.ts +0 -65
  182. package/src/infrastructure/http/index.ts +0 -16
  183. package/src/infrastructure/http/query-string.util.ts +0 -40
  184. package/src/infrastructure/http/timeout.util.ts +0 -26
  185. package/src/infrastructure/logging/debug.util.ts +0 -51
  186. package/src/infrastructure/logging/index.ts +0 -6
  187. package/src/infrastructure/utils/content-validators.ts +0 -92
  188. package/src/infrastructure/utils/domain-guards.ts +0 -23
  189. package/src/infrastructure/utils/error-classifiers.ts +0 -23
  190. package/src/infrastructure/utils/error-handlers.ts +0 -53
  191. package/src/infrastructure/utils/error-retry.ts +0 -44
  192. package/src/infrastructure/utils/error-types.ts +0 -23
  193. package/src/infrastructure/utils/general-validators.ts +0 -64
  194. package/src/infrastructure/utils/id-validators.ts +0 -39
  195. package/src/infrastructure/utils/primitive-guards.ts +0 -66
  196. package/src/infrastructure/utils/structure-guards.ts +0 -75
  197. package/src/infrastructure/utils/type-guards.util.ts +0 -26
  198. package/src/infrastructure/utils/validation-types.ts +0 -8
  199. package/src/infrastructure/utils/validation.util.ts +0 -18
  200. package/src/shared/utils/index.ts +0 -6
@@ -1,45 +0,0 @@
1
- /**
2
- * Creation Type Discriminators
3
- *
4
- * Used for polymorphic behavior based on creation type.
5
- * Each type may have different metadata structure.
6
- *
7
- * @module CreationTypesConstants
8
- */
9
-
10
- /**
11
- * Creation type discriminators
12
- */
13
- export const CREATION_TYPES = {
14
- /** Baby face prediction generation */
15
- BABY_PREDICTION: "baby-prediction" as const,
16
-
17
- /** Text-to-video generation */
18
- TEXT_TO_VIDEO: "text-to-video" as const,
19
-
20
- /** Image generation */
21
- IMAGE_GENERATION: "image-generation" as const,
22
- } as const;
23
-
24
- /** Union type of all creation types */
25
- export type CreationTypeValue =
26
- typeof CREATION_TYPES[keyof typeof CREATION_TYPES];
27
-
28
- /**
29
- * Type guard for creation type values
30
- * @param value - Value to check
31
- * @returns True if value is a valid creation type
32
- */
33
- export function isCreationType(
34
- value: unknown
35
- ): value is CreationTypeValue {
36
- return (
37
- typeof value === "string" &&
38
- Object.values(CREATION_TYPES).includes(
39
- value as CreationTypeValue
40
- )
41
- );
42
- }
43
-
44
- // Freeze to prevent mutations
45
- Object.freeze(CREATION_TYPES);
@@ -1,43 +0,0 @@
1
- import React, { useCallback } from "react";
2
- import { ImageGallery } from "@umituz/react-native-design-system";
3
- import type { Creation } from "../../domain/entities/Creation";
4
-
5
- interface CreationImageViewerProps {
6
- readonly creations: Creation[];
7
- readonly visible: boolean;
8
- readonly index: number;
9
- readonly enableEditing?: boolean;
10
- readonly onDismiss: () => void;
11
- readonly onIndexChange: (index: number) => void;
12
- readonly onImageEdit?: (uri: string, creationId: string) => void | Promise<void>;
13
- readonly selectedCreationId?: string;
14
- }
15
-
16
- export const CreationImageViewer: React.FC<CreationImageViewerProps> = ({
17
- creations,
18
- visible,
19
- index,
20
- enableEditing = false,
21
- onDismiss,
22
- onIndexChange,
23
- onImageEdit,
24
- }: CreationImageViewerProps) => {
25
- const handleImageChange = useCallback(async (uri: string, idx: number) => {
26
- const creation = creations[idx];
27
- if (creation && onImageEdit) {
28
- await onImageEdit(uri, creation.id);
29
- }
30
- }, [creations, onImageEdit]);
31
-
32
- return (
33
- <ImageGallery
34
- images={creations.map((c) => ({ uri: c.uri }))}
35
- visible={visible}
36
- index={index}
37
- onDismiss={onDismiss}
38
- onIndexChange={onIndexChange}
39
- enableEditing={enableEditing}
40
- onImageChange={onImageEdit ? handleImageChange : undefined}
41
- />
42
- );
43
- };
@@ -1,69 +0,0 @@
1
- import React from "react";
2
- import { View, TouchableOpacity, StyleSheet } from "react-native";
3
- import { AtomicIcon, AtomicText, useAppDesignTokens } from "@umituz/react-native-design-system";
4
-
5
- export interface CreationRatingProps {
6
- readonly rating: number;
7
- readonly max?: number;
8
- readonly size?: number;
9
- readonly onRate?: (rating: number) => void;
10
- readonly readonly?: boolean;
11
- }
12
-
13
- export const CreationRating: React.FC<CreationRatingProps> = ({
14
- rating,
15
- max = 5,
16
- size = 32,
17
- onRate,
18
- readonly = false,
19
- }: CreationRatingProps) => {
20
- const tokens = useAppDesignTokens();
21
-
22
- return (
23
- <View style={styles.container}>
24
- <View style={styles.stars}>
25
- {Array.from({ length: max }).map((_, i) => {
26
- const isFilled = i < rating;
27
- return (
28
- <TouchableOpacity
29
- key={i}
30
- onPress={() => onRate?.(i + 1)}
31
- activeOpacity={0.7}
32
- disabled={readonly}
33
- style={styles.star}
34
- >
35
- <AtomicIcon
36
- name={isFilled ? "star" : "star-outline"}
37
- customSize={size}
38
- customColor={isFilled ? tokens.colors.primary : tokens.colors.textTertiary}
39
- />
40
- </TouchableOpacity>
41
- );
42
- })}
43
- </View>
44
- {!readonly && rating > 0 && (
45
- <AtomicText type="bodySmall" color="textSecondary" style={styles.valueText}>
46
- {rating} / {max}
47
- </AtomicText>
48
- )}
49
- </View>
50
- );
51
- };
52
-
53
- const styles = StyleSheet.create({
54
- container: {
55
- alignItems: "center",
56
- paddingVertical: 12,
57
- },
58
- stars: {
59
- flexDirection: "row",
60
- gap: 8,
61
- },
62
- star: {
63
- padding: 2,
64
- },
65
- valueText: {
66
- marginTop: 8,
67
- fontWeight: "600",
68
- },
69
- });
@@ -1,130 +0,0 @@
1
- /**
2
- * CreationsGrid Component
3
- * Grid/list of creation cards with refresh support
4
- */
5
-
6
- import React, { useCallback } from "react";
7
- import {
8
- FlatList,
9
- RefreshControl,
10
- StyleSheet,
11
- type ViewStyle,
12
- } from "react-native";
13
- import {
14
- useAppDesignTokens,
15
- type DesignTokens,
16
- } from "@umituz/react-native-design-system";
17
- import { CreationCard, type CreationCardData } from "./CreationCard";
18
-
19
- interface CreationsGridProps<T extends CreationCardData> {
20
- /** Array of creations to display */
21
- readonly creations: T[];
22
- /** Loading state for refresh indicator */
23
- readonly isLoading: boolean;
24
- /** Pull to refresh handler */
25
- readonly onRefresh: () => void;
26
- /** Press handler */
27
- readonly onPress?: (creation: T) => void;
28
- /** Download handler */
29
- readonly onDownload?: (creation: T) => Promise<void>;
30
- /** Share handler */
31
- readonly onShare?: (creation: T) => Promise<void>;
32
- /** Delete handler */
33
- readonly onDelete?: (creation: T) => void;
34
- /** Favorite handler */
35
- readonly onFavorite?: (creation: T) => void;
36
- /** Post to feed handler */
37
- readonly onPostToFeed?: (creation: T) => void;
38
- /** Date formatter */
39
- readonly formatDate?: (date: Date) => string;
40
- /** Can post to feed */
41
- readonly canPostToFeed?: boolean;
42
- /** Content container style */
43
- readonly contentContainerStyle?: ViewStyle;
44
- /** Empty state component */
45
- readonly ListEmptyComponent?: React.ReactElement | null;
46
- /** Header component */
47
- readonly ListHeaderComponent?:
48
- | React.ComponentType<unknown>
49
- | React.ReactElement
50
- | null;
51
- }
52
-
53
- export function CreationsGrid<T extends CreationCardData>({
54
- creations,
55
- isLoading,
56
- onRefresh,
57
- onPress,
58
- onDownload,
59
- onShare,
60
- onDelete,
61
- onFavorite,
62
- onPostToFeed,
63
- formatDate,
64
- canPostToFeed = false,
65
- contentContainerStyle,
66
- ListEmptyComponent,
67
- ListHeaderComponent,
68
- }: CreationsGridProps<T>) {
69
- const tokens = useAppDesignTokens();
70
- const styles = useStyles(tokens);
71
-
72
- const renderItem = useCallback(
73
- ({ item }: { item: T }) => (
74
- <CreationCard
75
- creation={item}
76
- callbacks={{
77
- onPress: onPress ? () => onPress(item) : undefined,
78
- onDownload: onDownload ? () => onDownload(item) : undefined,
79
- onShare: onShare ? () => onShare(item) : undefined,
80
- onDelete: onDelete ? () => onDelete(item) : undefined,
81
- onFavorite: onFavorite ? () => onFavorite(item) : undefined,
82
- onPostToFeed: onPostToFeed ? () => onPostToFeed(item) : undefined,
83
- }}
84
- formatDate={formatDate}
85
- canPostToFeed={canPostToFeed}
86
- />
87
- ),
88
- [
89
- onPress,
90
- onDownload,
91
- onShare,
92
- onDelete,
93
- onFavorite,
94
- onPostToFeed,
95
- formatDate,
96
- canPostToFeed,
97
- ]
98
- );
99
-
100
- return (
101
- <FlatList
102
- data={creations}
103
- renderItem={renderItem}
104
- keyExtractor={(item: T) => item.id}
105
- ListHeaderComponent={ListHeaderComponent}
106
- ListEmptyComponent={ListEmptyComponent}
107
- contentContainerStyle={[
108
- styles.list,
109
- contentContainerStyle,
110
- (!creations || creations.length === 0) && { flexGrow: 1 },
111
- ]}
112
- showsVerticalScrollIndicator={false}
113
- refreshControl={
114
- <RefreshControl
115
- refreshing={isLoading}
116
- onRefresh={onRefresh}
117
- tintColor={tokens.colors.primary}
118
- />
119
- }
120
- />
121
- );
122
- }
123
-
124
- const useStyles = (tokens: DesignTokens) =>
125
- StyleSheet.create({
126
- list: {
127
- padding: tokens.spacing.md,
128
- paddingBottom: 100,
129
- },
130
- });
@@ -1,63 +0,0 @@
1
- /**
2
- * Filter Sheets Components
3
- * Modal-based filter sheets for status and media type filtering
4
- */
5
-
6
- import React from "react";
7
- import { FilterSheet } from "@umituz/react-native-design-system";
8
- import type { FilterOption } from "../../domain/types/creation-filter";
9
-
10
- interface FilterSheetConfig {
11
- readonly visible: boolean;
12
- readonly onClose: () => void;
13
- readonly options: FilterOption[];
14
- readonly selectedId: string;
15
- readonly onSelect: (id: string) => void;
16
- readonly onClear: () => void;
17
- readonly title: string;
18
- readonly clearLabel?: string;
19
- }
20
-
21
- export const StatusFilterSheet: React.FC<FilterSheetConfig> = ({
22
- visible,
23
- onClose,
24
- options,
25
- selectedId,
26
- onSelect,
27
- onClear,
28
- title,
29
- clearLabel
30
- }: FilterSheetConfig) => (
31
- <FilterSheet
32
- visible={visible}
33
- onClose={onClose}
34
- options={options}
35
- selectedIds={[selectedId]}
36
- onFilterPress={onSelect}
37
- onClearFilters={onClear}
38
- title={title}
39
- clearLabel={clearLabel}
40
- />
41
- );
42
-
43
- export const MediaFilterSheet: React.FC<FilterSheetConfig> = ({
44
- visible,
45
- onClose,
46
- options,
47
- selectedId,
48
- onSelect,
49
- onClear,
50
- title,
51
- clearLabel
52
- }: FilterSheetConfig) => (
53
- <FilterSheet
54
- visible={visible}
55
- onClose={onClose}
56
- options={options}
57
- selectedIds={[selectedId]}
58
- onFilterPress={onSelect}
59
- onClearFilters={onClear}
60
- title={title}
61
- clearLabel={clearLabel}
62
- />
63
- );
@@ -1,24 +0,0 @@
1
- /**
2
- * Presentation Hooks
3
- */
4
-
5
- export { useCreations } from "./useCreations";
6
- export { useDeleteCreation } from "./useDeleteCreation";
7
- export { useCreationsFilter } from "./useCreationsFilter";
8
- export { useAdvancedFilter } from "./useAdvancedFilter";
9
- export type {
10
- FilterableCreation,
11
- UseAdvancedFilterProps,
12
- UseAdvancedFilterReturn,
13
- } from "./advancedFilter.types";
14
- export { useFilter } from "./useFilter";
15
- export type { UseFilterProps, UseFilterReturn } from "./useFilter";
16
- export { useGalleryFilters } from "./useGalleryFilters";
17
- export { useCreationPersistence } from "./useCreationPersistence";
18
- export { useCreationRating } from "./useCreationRating";
19
- export type {
20
- UseCreationPersistenceConfig,
21
- UseCreationPersistenceReturn,
22
- BaseProcessingStartData,
23
- BaseProcessingResult,
24
- } from "./useCreationPersistence";
@@ -1,68 +0,0 @@
1
- /**
2
- * useCreationRating Hook
3
- * Handles rating of creations
4
- * Realtime listener handles UI updates automatically
5
- */
6
-
7
- import { useState, useCallback } from "react";
8
- import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
9
-
10
-
11
- interface UseCreationRatingProps {
12
- readonly userId: string | null;
13
- readonly repository: ICreationsRepository;
14
- }
15
-
16
- interface RatingVariables {
17
- readonly id: string;
18
- readonly rating: number;
19
- readonly description?: string;
20
- }
21
-
22
- interface UseCreationRatingReturn {
23
- readonly mutate: (variables: RatingVariables) => void;
24
- readonly mutateAsync: (variables: RatingVariables) => Promise<boolean>;
25
- readonly isPending: boolean;
26
- }
27
-
28
- export function useCreationRating({
29
- userId,
30
- repository,
31
- }: UseCreationRatingProps): UseCreationRatingReturn {
32
- const [isPending, setIsPending] = useState(false);
33
-
34
- const mutateAsync = useCallback(
35
- async ({ id, rating, description }: RatingVariables): Promise<boolean> => {
36
- if (!userId) return false;
37
-
38
- setIsPending(true);
39
- try {
40
- if (typeof __DEV__ !== "undefined" && __DEV__) {
41
- console.log("[useCreationRating] Rating:", { id, rating });
42
- }
43
- const result = await repository.rate(userId, id, rating, description);
44
- if (typeof __DEV__ !== "undefined" && __DEV__) {
45
- console.log("[useCreationRating] Rate result:", result);
46
- }
47
- return result;
48
- } catch (error) {
49
- if (typeof __DEV__ !== "undefined" && __DEV__) {
50
- console.error("[useCreationRating] Error:", error);
51
- }
52
- return false;
53
- } finally {
54
- setIsPending(false);
55
- }
56
- },
57
- [userId, repository],
58
- );
59
-
60
- const mutate = useCallback(
61
- (variables: RatingVariables): void => {
62
- void mutateAsync(variables);
63
- },
64
- [mutateAsync],
65
- );
66
-
67
- return { mutate, mutateAsync, isPending };
68
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Presentation Screens
3
- */
4
-
5
- export { CreationsGalleryScreen } from "./CreationsGalleryScreen";
@@ -1,54 +0,0 @@
1
- /**
2
- * Scenario Configurations
3
- * Pre-defined step configurations for common scenarios
4
- */
5
-
6
- import type { ScenarioStepConfig } from "../../../../domain/entities/step-config.types";
7
-
8
- export const SCENARIO_CONFIGS: Record<string, ScenarioStepConfig> = {
9
- "image-to-video": {
10
- photoUploads: {
11
- count: 1,
12
- labels: ["Your Photo"],
13
- showFaceDetection: false,
14
- },
15
- styleSelection: {
16
- enabled: true,
17
- required: true,
18
- },
19
- durationSelection: {
20
- enabled: true,
21
- required: true,
22
- },
23
- },
24
- "text-to-video": {
25
- textInput: {
26
- enabled: true,
27
- required: true,
28
- minLength: 10,
29
- maxLength: 500,
30
- },
31
- styleSelection: {
32
- enabled: true,
33
- required: true,
34
- },
35
- durationSelection: {
36
- enabled: true,
37
- required: true,
38
- },
39
- },
40
- "advanced-generation": {
41
- photoUploads: {
42
- count: 1,
43
- labels: ["Base Image"],
44
- },
45
- textInput: {
46
- enabled: true,
47
- required: false,
48
- },
49
- styleSelection: {
50
- enabled: true,
51
- required: true,
52
- },
53
- },
54
- };
@@ -1,133 +0,0 @@
1
- /**
2
- * Step Builders
3
- * Functions for building step definitions from configuration
4
- */
5
-
6
- import { StepType } from "../../../../domain/entities/flow-config.types";
7
- import type {
8
- ScenarioStepConfig,
9
- DynamicStepDefinition,
10
- PhotoUploadStepConfig,
11
- } from "../../../../domain/entities/step-config.types";
12
-
13
- /**
14
- * Build steps from scenario configuration
15
- */
16
- export const buildStepsFromScenario = (
17
- config: ScenarioStepConfig,
18
- ): DynamicStepDefinition[] => {
19
- const steps: DynamicStepDefinition[] = [];
20
-
21
- if (config.photoUploads && config.photoUploads.count > 0) {
22
- for (let i = 0; i < config.photoUploads.count; i++) {
23
- const photoConfig: PhotoUploadStepConfig = {
24
- id: `PHOTO_UPLOAD_${i}`,
25
- label: config.photoUploads.labels?.[i] || `Photo ${i + 1}`,
26
- showFaceDetection: config.photoUploads.showFaceDetection ?? false,
27
- showNameInput: config.photoUploads.showNameInput ?? false,
28
- showPhotoTips: true,
29
- required: true,
30
- };
31
-
32
- steps.push({
33
- id: `PHOTO_UPLOAD_${i}`,
34
- type: StepType.PARTNER_UPLOAD,
35
- config: photoConfig,
36
- required: true,
37
- });
38
- }
39
- }
40
-
41
- if (config.textInput?.enabled) {
42
- steps.push({
43
- id: "TEXT_INPUT",
44
- type: StepType.TEXT_INPUT,
45
- config: {
46
- id: "TEXT_INPUT",
47
- minLength: config.textInput.minLength ?? 0,
48
- maxLength: config.textInput.maxLength ?? 500,
49
- required: config.textInput.required ?? false,
50
- },
51
- required: config.textInput.required ?? false,
52
- });
53
- }
54
-
55
- if (config.styleSelection?.enabled) {
56
- steps.push({
57
- id: "STYLE_SELECTION",
58
- type: StepType.FEATURE_SELECTION,
59
- config: {
60
- id: "STYLE_SELECTION",
61
- styles: config.styleSelection.styles ?? [],
62
- required: config.styleSelection.required ?? false,
63
- },
64
- required: config.styleSelection.required ?? false,
65
- });
66
- }
67
-
68
- if (config.durationSelection?.enabled) {
69
- steps.push({
70
- id: "DURATION_SELECTION",
71
- type: StepType.FEATURE_SELECTION,
72
- config: {
73
- id: "DURATION_SELECTION",
74
- durations: config.durationSelection.durations ?? [4, 8, 12],
75
- required: config.durationSelection.required ?? false,
76
- },
77
- required: config.durationSelection.required ?? false,
78
- });
79
- }
80
-
81
- return steps;
82
- };
83
-
84
- /**
85
- * Build steps with conditional navigation
86
- */
87
- export const buildStepsWithNavigation = (
88
- baseSteps: DynamicStepDefinition[],
89
- ): DynamicStepDefinition[] => {
90
- return baseSteps.map((step, index) => {
91
- if (!step.nextStep && index < baseSteps.length - 1) {
92
- return {
93
- ...step,
94
- nextStep: baseSteps[index + 1].id,
95
- };
96
- }
97
- return step;
98
- });
99
- };
100
-
101
- /**
102
- * Get next step ID based on configuration and state
103
- */
104
- export const resolveNextStep = (
105
- currentStepId: string,
106
- steps: readonly DynamicStepDefinition[],
107
- context: {
108
- readonly values: Record<string, unknown>;
109
- readonly completedSteps: readonly string[];
110
- },
111
- ): string | null => {
112
- const currentStep = steps.find((s) => s.id === currentStepId);
113
- if (!currentStep) return null;
114
-
115
- if (typeof currentStep.nextStep === "function") {
116
- return currentStep.nextStep({
117
- values: context.values,
118
- currentStepId,
119
- completedSteps: context.completedSteps,
120
- });
121
- }
122
-
123
- if (typeof currentStep.nextStep === "string") {
124
- return currentStep.nextStep;
125
- }
126
-
127
- const currentIndex = steps.findIndex((s) => s.id === currentStepId);
128
- if (currentIndex >= 0 && currentIndex < steps.length - 1) {
129
- return steps[currentIndex + 1].id;
130
- }
131
-
132
- return null;
133
- };
@@ -1,42 +0,0 @@
1
- /**
2
- * Video Generation Utilities
3
- * Video-specific utility functions
4
- */
5
-
6
- import type { VideoFeatureType } from "../../../../../domain/interfaces";
7
- import type { WizardScenarioData } from "../../presentation/hooks/wizard-generation.types";
8
- import { VIDEO_FEATURE_PATTERNS } from "./wizard-strategy.constants";
9
-
10
-
11
- /**
12
- * Determines the video feature type from scenario
13
- * Priority: featureType (app-controlled) > pattern matching > default
14
- */
15
- export function getVideoFeatureType(scenario: WizardScenarioData): VideoFeatureType {
16
- const { id, featureType } = scenario;
17
-
18
- // Primary: Use featureType from main app (package-driven design)
19
- if (featureType) {
20
- if (typeof __DEV__ !== "undefined" && __DEV__) {
21
- console.log("[VideoUtils] Using featureType from app", { id, featureType });
22
- }
23
- return featureType;
24
- }
25
-
26
- // Fallback: Pattern matching
27
- const lowerId = id.toLowerCase();
28
- for (const [pattern, type] of Object.entries(VIDEO_FEATURE_PATTERNS)) {
29
- if (lowerId.includes(pattern)) {
30
- if (typeof __DEV__ !== "undefined" && __DEV__) {
31
- console.log("[VideoUtils] Pattern match", { id, pattern, type });
32
- }
33
- return type;
34
- }
35
- }
36
-
37
- // Default: text-to-video
38
- if (typeof __DEV__ !== "undefined" && __DEV__) {
39
- console.log("[VideoUtils] Default to text-to-video", { id });
40
- }
41
- return "text-to-video";
42
- }