@umituz/react-native-ai-generation-content 1.83.10 → 1.83.12

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 (201) 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 +24 -19
  32. package/src/domains/creations/presentation/hooks/useGalleryState.ts +2 -2
  33. package/src/domains/creations/presentation/hooks/useProcessingJobsPoller.ts +24 -15
  34. package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +0 -1
  35. package/src/domains/creations/presentation/utils/filter-buttons.util.ts +2 -2
  36. package/src/domains/creations/presentation-exports.ts +5 -3
  37. package/src/domains/face-detection/presentation/components/FaceValidationStatus.tsx +1 -1
  38. package/src/domains/generation/infrastructure/executors/text-to-image-executor.helpers.ts +1 -1
  39. package/src/domains/generation/wizard/infrastructure/strategies/image-generation.strategy.ts +0 -2
  40. package/src/domains/generation/wizard/infrastructure/strategies/image-generation.types.ts +0 -4
  41. package/src/domains/generation/wizard/infrastructure/strategies/index.ts +0 -1
  42. package/src/domains/generation/wizard/infrastructure/strategies/shared/unified-prompt-builder.ts +1 -1
  43. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.strategy.ts +0 -1
  44. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.types.ts +2 -6
  45. package/src/domains/generation/wizard/infrastructure/strategies/wizard-strategy.constants.ts +0 -7
  46. package/src/domains/generation/wizard/infrastructure/strategies/wizard-strategy.factory.ts +1 -3
  47. package/src/domains/generation/wizard/infrastructure/utils/creation-persistence.util.ts +0 -5
  48. package/src/domains/generation/wizard/infrastructure/utils/index.ts +0 -3
  49. package/src/domains/generation/wizard/infrastructure/utils/primitive-extractors.ts +3 -3
  50. package/src/domains/generation/wizard/presentation/components/IndeterminateProgressBar.tsx +1 -1
  51. package/src/domains/generation/wizard/presentation/components/WizardContinueButton.tsx +1 -1
  52. package/src/domains/generation/wizard/presentation/components/WizardFlowContent.tsx +1 -1
  53. package/src/domains/generation/wizard/presentation/components/WizardStepRenderer.tsx +0 -2
  54. package/src/domains/generation/wizard/presentation/components/WizardStepRenderer.utils.ts +0 -7
  55. package/src/domains/generation/wizard/presentation/components/index.ts +0 -2
  56. package/src/domains/generation/wizard/presentation/components/step-renderers/renderPhotoUploadStep.tsx +1 -1
  57. package/src/domains/generation/wizard/presentation/components/step-renderers/renderPreviewStep.tsx +1 -1
  58. package/src/domains/generation/wizard/presentation/components/step-renderers/renderSelectionStep.tsx +1 -1
  59. package/src/domains/generation/wizard/presentation/components/step-renderers/renderTextInputStep.tsx +1 -1
  60. package/src/domains/generation/wizard/presentation/hooks/generationStateMachine.ts +2 -2
  61. package/src/domains/generation/wizard/presentation/hooks/useGenerationPhase.ts +1 -1
  62. package/src/domains/generation/wizard/presentation/hooks/usePhotoBlockingGeneration.ts +2 -2
  63. package/src/domains/generation/wizard/presentation/hooks/useWizardFlowHandlers.ts +1 -1
  64. package/src/domains/generation/wizard/presentation/screens/GeneratingScreen.tsx +1 -1
  65. package/src/domains/generation/wizard/presentation/screens/GenericPhotoUploadScreen.tsx +3 -3
  66. package/src/domains/generation/wizard/presentation/screens/SelectionScreen.tsx +0 -6
  67. package/src/domains/generation/wizard/presentation/screens/TextInputScreen.tsx +5 -3
  68. package/src/domains/generation/wizard/presentation/screens/index.ts +0 -13
  69. package/src/domains/generation/wizard/presentation/utilities/validateScenario.ts +0 -6
  70. package/src/domains/image-to-video/presentation/hooks/image-to-video-feature.types.ts +0 -8
  71. package/src/domains/image-to-video/presentation/index.ts +0 -4
  72. package/src/domains/result-preview/presentation/components/StarRatingPicker.tsx +1 -1
  73. package/src/domains/result-preview/presentation/types/result-preview.types.ts +0 -5
  74. package/src/domains/scenarios/configs/index.ts +1 -6
  75. package/src/domains/scenarios/configs/wizard-step-factories.ts +1 -1
  76. package/src/domains/scenarios/infrastructure/scenario-registry.ts +0 -9
  77. package/src/domains/scenarios/presentation/components/ScenarioContinueButton.tsx +1 -1
  78. package/src/domains/scenarios/presentation/hooks/useHierarchicalScenarios.ts +2 -2
  79. package/src/domains/scenarios/presentation/screens/HierarchicalScenarioListScreen.tsx +1 -1
  80. package/src/domains/scenarios/presentation/screens/ScenarioPreviewScreen.tsx +2 -2
  81. package/src/domains/shared/presentation/components/AutoSkipPreview.tsx +1 -1
  82. package/src/domains/shared/presentation/components/index.ts +0 -1
  83. package/src/domains/shared/presentation/utils/index.ts +0 -3
  84. package/src/domains/shared/presentation/utils/wizard-flow.utils.ts +2 -2
  85. package/src/domains/text-to-image/presentation/index.ts +0 -2
  86. package/src/domains/text-to-video/domain/types/component.types.ts +0 -6
  87. package/src/domains/text-to-video/domain/types/index.ts +0 -4
  88. package/src/domains/text-to-video/presentation/components/FrameSelector.tsx +97 -52
  89. package/src/domains/text-to-video/presentation/index.ts +0 -2
  90. package/src/infrastructure/config/index.ts +0 -2
  91. package/src/infrastructure/constants/index.ts +0 -6
  92. package/src/infrastructure/constants/polling.constants.ts +0 -21
  93. package/src/infrastructure/constants/validation.constants.ts +0 -30
  94. package/src/infrastructure/utils/error-classification.ts +1 -1
  95. package/src/infrastructure/utils/error-factory.ts +2 -2
  96. package/src/infrastructure/utils/index.ts +0 -9
  97. package/src/infrastructure/utils/message-extractor.ts +1 -20
  98. package/src/infrastructure/utils/progress.utils.ts +0 -37
  99. package/src/infrastructure/utils/provider-validator.util.ts +1 -1
  100. package/src/infrastructure/utils/url-extractor/index.ts +0 -5
  101. package/src/infrastructure/utils/url-extractor.util.ts +0 -11
  102. package/src/infrastructure/utils/video-helpers.ts +1 -1
  103. package/src/infrastructure/validation/ai-validator.ts +0 -28
  104. package/src/infrastructure/validation/entity-validator.ts +0 -34
  105. package/src/infrastructure/validation/input-validator.ts +2 -5
  106. package/src/infrastructure/validation/sanitizer.ts +0 -17
  107. package/src/presentation/components/AIGenerationConfig.tsx +3 -1
  108. package/src/presentation/components/GenerationProgressContent.styles.ts +0 -2
  109. package/src/presentation/components/PhotoUploadCard/PhotoUploadCard.tsx +0 -1
  110. package/src/presentation/components/ProgressCloseButton.tsx +1 -1
  111. package/src/presentation/components/ProgressDismissButton.tsx +1 -1
  112. package/src/presentation/components/ProgressHeader.tsx +1 -1
  113. package/src/presentation/components/ProgressHint.tsx +1 -1
  114. package/src/presentation/components/display/AIGenerationResult.tsx +6 -4
  115. package/src/presentation/components/display/index.ts +0 -1
  116. package/src/presentation/components/moderation/ModerationSummary.tsx +2 -2
  117. package/src/presentation/components/prompts/ExamplePrompts.tsx +2 -2
  118. package/src/presentation/components/result/ResultImageCard.tsx +39 -21
  119. package/src/presentation/components/result/ResultStoryCard.tsx +38 -15
  120. package/src/presentation/components/result/button-style.utils.ts +1 -1
  121. package/src/presentation/components/selectors/GridSelector.tsx +2 -2
  122. package/src/presentation/components/selectors/factories/aspect-ratio.factory.ts +0 -2
  123. package/src/presentation/components/selectors/factories/duration.factory.ts +0 -2
  124. package/src/presentation/components/selectors/factories/style.factory.ts +1 -1
  125. package/src/presentation/components/shared/ModelSelector.tsx +3 -1
  126. package/src/presentation/hooks/ai-feature-callbacks-auth.hooks.ts +2 -2
  127. package/src/presentation/hooks/ai-feature-callbacks-cost.hooks.ts +2 -2
  128. package/src/presentation/hooks/ai-feature-callbacks-execution.hooks.ts +2 -2
  129. package/src/presentation/hooks/generation/index.ts +0 -5
  130. package/src/presentation/hooks/generation/moderation-handler.ts +1 -1
  131. package/src/presentation/hooks/generation/types.ts +0 -12
  132. package/src/presentation/hooks/index.ts +0 -4
  133. package/src/presentation/hooks/useProgressDismiss.ts +1 -1
  134. package/src/presentation/layouts/types/layout-props.ts +1 -1
  135. package/src/domain/constants/index.ts +0 -2
  136. package/src/domain/entities/feature-flow-config.types.ts +0 -17
  137. package/src/domain/entities/scenario-step-config.types.ts +0 -32
  138. package/src/domain/entities/step-config.types.ts +0 -18
  139. package/src/domain/entities/step-definition.types.ts +0 -50
  140. package/src/domain/entities/step-input-config.types.ts +0 -36
  141. package/src/domain/entities/step-upload-config.types.ts +0 -17
  142. package/src/domains/background/domain/entities/index.ts +0 -1
  143. package/src/domains/background/domain/interfaces/index.ts +0 -1
  144. package/src/domains/content-moderation/infrastructure/utils/validators.util.ts +0 -51
  145. package/src/domains/creations/domain/constants/creation-errors.constants.ts +0 -27
  146. package/src/domains/creations/domain/constants/creation-query.constants.ts +0 -37
  147. package/src/domains/creations/domain/constants/creation-types.constants.ts +0 -45
  148. package/src/domains/creations/presentation/components/CreationImageViewer.tsx +0 -43
  149. package/src/domains/creations/presentation/components/CreationRating.tsx +0 -69
  150. package/src/domains/creations/presentation/components/CreationsGrid.tsx +0 -130
  151. package/src/domains/creations/presentation/components/FilterSheets.tsx +0 -63
  152. package/src/domains/creations/presentation/hooks/index.ts +0 -24
  153. package/src/domains/creations/presentation/hooks/useCreationRating.ts +0 -68
  154. package/src/domains/creations/presentation/screens/index.ts +0 -5
  155. package/src/domains/generation/infrastructure/flow/scenario-configs.ts +0 -54
  156. package/src/domains/generation/infrastructure/flow/step-builders.ts +0 -133
  157. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.utils.ts +0 -42
  158. package/src/domains/generation/wizard/presentation/components/WizardHeader.tsx +0 -96
  159. package/src/domains/generation/wizard/presentation/components/step-renderers/index.ts +0 -8
  160. package/src/domains/generation/wizard/presentation/components/step-renderers/renderGeneratingStep.tsx +0 -24
  161. package/src/domains/generation/wizard/presentation/components/step-renderers/renderResultStep.tsx +0 -69
  162. package/src/domains/generation/wizard/presentation/utilities/index.ts +0 -1
  163. package/src/domains/prompts/infrastructure/services/base/index.ts +0 -6
  164. package/src/domains/prompts/infrastructure/services/base/prompt-service.base.ts +0 -112
  165. package/src/domains/result-preview/index.ts +0 -37
  166. package/src/domains/result-preview/presentation/components/GenerationErrorScreen.tsx +0 -109
  167. package/src/domains/result-preview/presentation/components/index.ts +0 -16
  168. package/src/domains/result-preview/presentation/hooks/index.ts +0 -5
  169. package/src/domains/result-preview/presentation/types/index.ts +0 -16
  170. package/src/domains/result-preview/presentation/types/result-data.types.ts +0 -35
  171. package/src/domains/text-to-image/presentation/screens/TextToImageWizardFlow.types.ts +0 -27
  172. package/src/domains/text-to-video/domain/types/action-component.types.ts +0 -15
  173. package/src/domains/text-to-video/domain/types/selector-component.types.ts +0 -31
  174. package/src/infrastructure/constants/content.constants.ts +0 -8
  175. package/src/infrastructure/constants/storage.constants.ts +0 -27
  176. package/src/infrastructure/http/api-client.types.ts +0 -17
  177. package/src/infrastructure/http/http-client-methods.ts +0 -73
  178. package/src/infrastructure/http/http-client.util.ts +0 -12
  179. package/src/infrastructure/http/http-fetch-handler.ts +0 -63
  180. package/src/infrastructure/http/http-methods.constants.ts +0 -23
  181. package/src/infrastructure/http/http-request-executor.ts +0 -49
  182. package/src/infrastructure/http/http-response-parser.ts +0 -65
  183. package/src/infrastructure/http/index.ts +0 -16
  184. package/src/infrastructure/http/query-string.util.ts +0 -40
  185. package/src/infrastructure/http/timeout.util.ts +0 -26
  186. package/src/infrastructure/logging/debug.util.ts +0 -51
  187. package/src/infrastructure/logging/index.ts +0 -6
  188. package/src/infrastructure/utils/content-validators.ts +0 -92
  189. package/src/infrastructure/utils/domain-guards.ts +0 -23
  190. package/src/infrastructure/utils/error-classifiers.ts +0 -23
  191. package/src/infrastructure/utils/error-handlers.ts +0 -53
  192. package/src/infrastructure/utils/error-retry.ts +0 -44
  193. package/src/infrastructure/utils/error-types.ts +0 -23
  194. package/src/infrastructure/utils/general-validators.ts +0 -64
  195. package/src/infrastructure/utils/id-validators.ts +0 -39
  196. package/src/infrastructure/utils/primitive-guards.ts +0 -66
  197. package/src/infrastructure/utils/structure-guards.ts +0 -75
  198. package/src/infrastructure/utils/type-guards.util.ts +0 -26
  199. package/src/infrastructure/utils/validation-types.ts +0 -8
  200. package/src/infrastructure/utils/validation.util.ts +0 -18
  201. package/src/shared/utils/index.ts +0 -6
@@ -1,51 +0,0 @@
1
- /**
2
- * Content Moderation Validators
3
- * Reusable validation functions for content moderation
4
- */
5
-
6
- /**
7
- * Validates that content is not empty and is a string
8
- */
9
- export function validateContentPresence(content: unknown): boolean {
10
- return Boolean(content && typeof content === "string");
11
- }
12
-
13
- /**
14
- * Validates content length against maximum
15
- */
16
- export function validateContentLength(content: string, maxLength: number): boolean {
17
- return content.length <= maxLength;
18
- }
19
-
20
- /**
21
- * Validates URI protocol
22
- */
23
- export function validateUriProtocol(uri: string, allowedProtocols: readonly string[]): boolean {
24
- const lowerUri = uri.toLowerCase();
25
- return allowedProtocols.some((protocol) => lowerUri.startsWith(protocol));
26
- }
27
-
28
- /**
29
- * Validates URI
30
- */
31
- export function validateUri(
32
- uri: string,
33
- options: {
34
- maxLength?: number;
35
- allowedProtocols?: readonly string[];
36
- } = {}
37
- ): { isValid: boolean; error?: { type: string; message: string } } {
38
- if (!validateContentPresence(uri)) {
39
- return { isValid: false, error: { type: "empty-uri", message: "empty URI" } };
40
- }
41
-
42
- if (options.maxLength && !validateContentLength(uri, options.maxLength)) {
43
- return { isValid: false, error: { type: "uri-too-long", message: "URI too long" } };
44
- }
45
-
46
- if (options.allowedProtocols && !validateUriProtocol(uri, options.allowedProtocols)) {
47
- return { isValid: false, error: { type: "invalid-protocol", message: "invalid protocol" } };
48
- }
49
-
50
- return { isValid: true };
51
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * Creation Error Codes
3
- *
4
- * Domain exception codes for client-side error handling.
5
- * Each code represents a specific error scenario.
6
- *
7
- * @module CreationErrorsConstants
8
- */
9
-
10
- /**
11
- * Error codes for domain exceptions
12
- */
13
- export const CREATION_ERROR_CODES = {
14
- NOT_FOUND: "CREATION_NOT_FOUND" as const,
15
- VALIDATION_FAILED: "CREATION_VALIDATION_FAILED" as const,
16
- INVALID_STATE_TRANSITION: "CREATION_INVALID_STATE_TRANSITION" as const,
17
- PERSISTENCE_FAILED: "CREATION_PERSISTENCE_FAILED" as const,
18
- INVALID_URI: "CREATION_INVALID_URI" as const,
19
- INVALID_OUTPUT: "CREATION_INVALID_OUTPUT" as const,
20
- } as const;
21
-
22
- /** Union type of all error codes */
23
- export type CreationErrorCode =
24
- typeof CREATION_ERROR_CODES[keyof typeof CREATION_ERROR_CODES];
25
-
26
- // Freeze to prevent mutations
27
- Object.freeze(CREATION_ERROR_CODES);
@@ -1,37 +0,0 @@
1
- /**
2
- * Creation Query Configuration
3
- *
4
- * Firestore query optimization settings.
5
- * Controls pagination, caching, and performance.
6
- *
7
- * @module CreationQueryConstants
8
- */
9
-
10
- /**
11
- * Firestore query configuration
12
- */
13
- export const CREATION_QUERY_CONFIG = {
14
- /** Default page size for pagination */
15
- DEFAULT_PAGE_SIZE: 20,
16
-
17
- /** Maximum page size (prevent memory issues) */
18
- MAX_PAGE_SIZE: 100,
19
-
20
- /** Cache TTL in milliseconds (5 minutes) */
21
- CACHE_TTL_MS: 5 * 60 * 1000,
22
-
23
- /** Include metadata changes in snapshots */
24
- INCLUDE_METADATA_CHANGES: false,
25
- } as const;
26
-
27
- /**
28
- * Collection names
29
- */
30
- export const CREATION_COLLECTIONS = {
31
- ROOT: "creations" as const,
32
- USERS: "users" as const,
33
- } as const;
34
-
35
- // Freeze to prevent mutations
36
- Object.freeze(CREATION_QUERY_CONFIG);
37
- Object.freeze(CREATION_COLLECTIONS);
@@ -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
- };