@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
@@ -59,9 +59,9 @@ export const ModerationSummary: React.FC<ModerationSummaryProps> = ({
59
59
  )}
60
60
  {contentWarnings && contentWarnings.length > 0 && (
61
61
  <View style={styles.warningsContainer}>
62
- {contentWarnings.map((warning, index) => (
62
+ {contentWarnings.map((warning) => (
63
63
  <AtomicText
64
- key={`${warning}-${index}`}
64
+ key={warning}
65
65
  type="labelSmall"
66
66
  style={[styles.warningText, { color: tokens.colors.textSecondary }]}
67
67
  >
@@ -48,9 +48,9 @@ export const ExamplePrompts: React.FC<ExamplePromptsProps> = ({
48
48
  contentContainerStyle={styles.scrollContent}
49
49
  style={styles.scrollView}
50
50
  >
51
- {prompts.map((prompt, index) => (
51
+ {prompts.map((prompt) => (
52
52
  <TouchableOpacity
53
- key={`prompt-${index}`}
53
+ key={prompt}
54
54
  style={[
55
55
  styles.card,
56
56
  {
@@ -14,6 +14,34 @@ import {
14
14
  import type { ResultImageConfig } from "../../types/result-config.types";
15
15
  import { DEFAULT_RESULT_CONFIG } from "../../types/result-config.types";
16
16
 
17
+ interface ImageBadgeProps {
18
+ badgeIcon: string;
19
+ badgeStyle?: string;
20
+ badgeText: string;
21
+ style: object;
22
+ textStyle: object;
23
+ primaryColor: string;
24
+ inverseColor: string;
25
+ }
26
+
27
+ const ImageBadge: React.FC<ImageBadgeProps> = ({
28
+ badgeIcon,
29
+ badgeStyle,
30
+ badgeText,
31
+ style,
32
+ textStyle,
33
+ primaryColor,
34
+ inverseColor,
35
+ }) => {
36
+ const iconColor = badgeStyle === "light" ? primaryColor : inverseColor;
37
+ return (
38
+ <View style={style}>
39
+ <AtomicIcon name={badgeIcon} size="xs" customColor={iconColor} />
40
+ <AtomicText style={textStyle}>{badgeText}</AtomicText>
41
+ </View>
42
+ );
43
+ };
44
+
17
45
  export interface ResultImageCardProps {
18
46
  imageUrl: string;
19
47
  badgeText: string;
@@ -92,26 +120,6 @@ export const ResultImageCard: React.FC<ResultImageCardProps> = ({
92
120
  [tokens, cfg, badgePosition, badgeBackground],
93
121
  );
94
122
 
95
- const renderBadge = () => {
96
- if (!cfg.showBadge) return null;
97
-
98
- const iconColor =
99
- cfg.badgeStyle === "light"
100
- ? tokens.colors.primary
101
- : tokens.colors.textInverse;
102
-
103
- return (
104
- <View style={styles.badge}>
105
- <AtomicIcon
106
- name={cfg.badgeIcon ?? "sparkles"}
107
- size="xs"
108
- customColor={iconColor}
109
- />
110
- <AtomicText style={styles.badgeText}>{badgeText}</AtomicText>
111
- </View>
112
- );
113
- };
114
-
115
123
  return (
116
124
  <View style={styles.container}>
117
125
  <View style={styles.frame}>
@@ -120,7 +128,17 @@ export const ResultImageCard: React.FC<ResultImageCardProps> = ({
120
128
  style={styles.image}
121
129
  resizeMode="cover"
122
130
  />
123
- {renderBadge()}
131
+ {cfg.showBadge && (
132
+ <ImageBadge
133
+ badgeIcon={cfg.badgeIcon ?? "sparkles"}
134
+ badgeStyle={cfg.badgeStyle}
135
+ badgeText={badgeText}
136
+ style={styles.badge}
137
+ textStyle={styles.badgeText}
138
+ primaryColor={tokens.colors.primary}
139
+ inverseColor={tokens.colors.textInverse}
140
+ />
141
+ )}
124
142
  </View>
125
143
  </View>
126
144
  );
@@ -13,6 +13,34 @@ import {
13
13
  import type { ResultStoryConfig } from "../../types/result-config.types";
14
14
  import { DEFAULT_RESULT_CONFIG } from "../../types/result-config.types";
15
15
 
16
+ interface StoryContentProps {
17
+ story: string;
18
+ showQuotes?: boolean;
19
+ quoteIconStyle: object;
20
+ quoteEndStyle: object;
21
+ quoteIconEndStyle: object;
22
+ textStyle: object;
23
+ }
24
+
25
+ const StoryContent: React.FC<StoryContentProps> = ({
26
+ story,
27
+ showQuotes,
28
+ quoteIconStyle,
29
+ quoteEndStyle,
30
+ quoteIconEndStyle,
31
+ textStyle,
32
+ }) => (
33
+ <>
34
+ {showQuotes && <AtomicText style={quoteIconStyle}>&quot;</AtomicText>}
35
+ <AtomicText style={textStyle}>{story}</AtomicText>
36
+ {showQuotes && (
37
+ <View style={quoteEndStyle}>
38
+ <AtomicText style={[quoteIconStyle, quoteIconEndStyle]}>&quot;</AtomicText>
39
+ </View>
40
+ )}
41
+ </>
42
+ );
43
+
16
44
  export interface ResultStoryCardProps {
17
45
  story: string;
18
46
  config?: ResultStoryConfig;
@@ -90,23 +118,18 @@ export const ResultStoryCard: React.FC<ResultStoryCardProps> = ({
90
118
  [tokens, cfg, containerStyle],
91
119
  );
92
120
 
93
- const renderContent = () => (
94
- <>
95
- {cfg.showQuotes && <AtomicText style={styles.quoteIcon}>&quot;</AtomicText>}
96
- <AtomicText style={styles.text}>{story}</AtomicText>
97
- {cfg.showQuotes && (
98
- <View style={styles.quoteEnd}>
99
- <AtomicText style={[styles.quoteIcon, styles.quoteIconEnd]}>
100
- &quot;
101
- </AtomicText>
102
- </View>
103
- )}
104
- </>
105
- );
106
-
107
121
  return (
108
122
  <View style={styles.outer}>
109
- <View style={styles.container}>{renderContent()}</View>
123
+ <View style={styles.container}>
124
+ <StoryContent
125
+ story={story}
126
+ showQuotes={cfg.showQuotes}
127
+ quoteIconStyle={styles.quoteIcon}
128
+ quoteEndStyle={styles.quoteEnd}
129
+ quoteIconEndStyle={styles.quoteIconEnd}
130
+ textStyle={styles.text}
131
+ />
132
+ </View>
110
133
  </View>
111
134
  );
112
135
  };
@@ -5,7 +5,7 @@
5
5
 
6
6
  import type { DesignTokens } from "@umituz/react-native-design-system";
7
7
 
8
- export interface ButtonStyle {
8
+ interface ButtonStyle {
9
9
  backgroundColor: string;
10
10
  color: string;
11
11
  textColor: string;
@@ -48,11 +48,11 @@ export function GridSelector<T>({
48
48
  </AtomicText>
49
49
  )}
50
50
  <View style={styles.grid}>
51
- {options.map((option, index) => {
51
+ {options.map((option) => {
52
52
  const isSelected = selectedValue === option.value;
53
53
  return (
54
54
  <TouchableOpacity
55
- key={`${option.label}-${index}`}
55
+ key={String(option.value)}
56
56
  style={[
57
57
  styles.card,
58
58
  {
@@ -52,5 +52,3 @@ export const createAspectRatioOptions = (
52
52
  * Default aspect ratio IDs (no translation needed)
53
53
  */
54
54
  export const ASPECT_RATIO_IDS = ["16:9", "9:16", "1:1"] as const;
55
-
56
- export type AspectRatioId = (typeof ASPECT_RATIO_IDS)[number];
@@ -29,5 +29,3 @@ export const createDurationOptions = (
29
29
  * Common duration values (seconds)
30
30
  */
31
31
  export const COMMON_DURATIONS = [4, 8, 12, 16] as const;
32
-
33
- export type CommonDuration = (typeof COMMON_DURATIONS)[number];
@@ -5,7 +5,7 @@
5
5
 
6
6
  import type { StyleOption } from "../types";
7
7
 
8
- export interface StyleTranslation {
8
+ interface StyleTranslation {
9
9
  name: string;
10
10
  description?: string;
11
11
  }
@@ -47,13 +47,15 @@ export interface ModelSelectorProps {
47
47
  * ModelSelector - Orchestrates trigger and modal components
48
48
  * Following SOLID principles: Single Responsibility
49
49
  */
50
+ const EMPTY_TRANSLATIONS: ModelSelectorProps["translations"] = {};
51
+
50
52
  export const ModelSelector: React.FC<ModelSelectorProps> = ({
51
53
  models,
52
54
  selectedModel,
53
55
  onSelectModel,
54
56
  label,
55
57
  isLoading = false,
56
- translations = {},
58
+ translations = EMPTY_TRANSLATIONS,
57
59
  }) => {
58
60
  const [isOpen, setIsOpen] = useState(false);
59
61
 
@@ -5,13 +5,13 @@
5
5
 
6
6
  import { useCallback } from "react";
7
7
 
8
- export interface UseAuthCallbacksParams {
8
+ interface UseAuthCallbacksParams {
9
9
  isAuth: boolean;
10
10
  userId: string | null;
11
11
  showAuthModal: (callback?: () => void) => void;
12
12
  }
13
13
 
14
- export interface AuthCallbacks {
14
+ interface AuthCallbacks {
15
15
  isAuthenticated: () => boolean;
16
16
  onAuthRequired: () => void;
17
17
  onAuthCheck: () => boolean;
@@ -5,13 +5,13 @@
5
5
 
6
6
  import { useCallback } from "react";
7
7
 
8
- export interface UseCostCallbacksParams {
8
+ interface UseCostCallbacksParams {
9
9
  creditBalance: number;
10
10
  creditCostPerUnit: number;
11
11
  openPaywall: () => void;
12
12
  }
13
13
 
14
- export interface CostCallbacks {
14
+ interface CostCallbacks {
15
15
  canAfford: (cost: number) => boolean;
16
16
  calculateCost: (multiplier?: number, _model?: string | null) => number;
17
17
  onCreditsRequired: (cost?: number) => void;
@@ -6,7 +6,7 @@
6
6
  import { useCallback } from "react";
7
7
  import type { AIFeatureGenerationResult } from "./ai-feature-callbacks.types";
8
8
 
9
- export interface UseExecutionCallbackParams<TRequest, TResult> {
9
+ interface UseExecutionCallbackParams<TRequest, TResult> {
10
10
  executor: (request: TRequest) => Promise<{
11
11
  success: boolean;
12
12
  data?: TResult;
@@ -19,7 +19,7 @@ export interface UseExecutionCallbackParams<TRequest, TResult> {
19
19
  onError?: (error: string) => void;
20
20
  }
21
21
 
22
- export interface ExecutionCallbacks<TRequest> {
22
+ interface ExecutionCallbacks<TRequest> {
23
23
  executeGeneration: (request: TRequest) => Promise<AIFeatureGenerationResult>;
24
24
  }
25
25
 
@@ -22,11 +22,6 @@ export type {
22
22
  GenerationErrorType,
23
23
  AlertMessages,
24
24
  UseGenerationOrchestratorReturn,
25
- ModerationCallbacks,
26
- ModerationResult,
27
- LifecycleConfig,
28
- GenerationErrorConfig,
29
- GenerationErrorTranslations,
30
25
  } from "./types";
31
26
 
32
27
  export type {
@@ -6,7 +6,7 @@
6
6
  import { createGenerationError, parseError, getAlertMessage } from "./errors";
7
7
  import type { GenerationError, ModerationCallbacks, AlertMessages } from "./types";
8
8
 
9
- export interface ModerationHandlerParams<TInput, TResult> {
9
+ interface ModerationHandlerParams<TInput, TResult> {
10
10
  readonly input: TInput;
11
11
  readonly moderation: ModerationCallbacks | undefined;
12
12
  readonly alertMessages: AlertMessages;
@@ -84,15 +84,3 @@ export interface UseGenerationOrchestratorReturn<TInput, TResult> {
84
84
  readonly error: GenerationError | null;
85
85
  }
86
86
 
87
- export interface GenerationErrorConfig {
88
- readonly showCreditInfo?: boolean;
89
- readonly iconName?: string;
90
- readonly iconSize?: number;
91
- }
92
-
93
- export interface GenerationErrorTranslations {
94
- readonly title: string;
95
- readonly tryAgain: string;
96
- readonly chooseAnother: string;
97
- readonly noCreditCharged: string;
98
- }
@@ -22,8 +22,6 @@ export type {
22
22
  GenerationErrorType,
23
23
  AlertMessages,
24
24
  UseGenerationOrchestratorReturn,
25
- GenerationErrorConfig,
26
- GenerationErrorTranslations,
27
25
  SingleImageInput,
28
26
  DualImageInput,
29
27
  ImageGenerationInput,
@@ -72,5 +70,3 @@ export type {
72
70
  export { useAIGenerateState, AIGenerateStep } from "./generation/useAIGenerateState";
73
71
  export type { UploadedImage } from "./generation/useAIGenerateState";
74
72
 
75
- export { useProgressDismiss } from "./useProgressDismiss";
76
- export type { UseProgressDismissResult } from "./useProgressDismiss";
@@ -6,7 +6,7 @@
6
6
 
7
7
  import { useState, useEffect, useCallback } from "react";
8
8
 
9
- export interface UseProgressDismissResult {
9
+ interface UseProgressDismissResult {
10
10
  /** Whether the progress overlay has been dismissed by user */
11
11
  isProgressDismissed: boolean;
12
12
  /** Dismisses the progress overlay */
@@ -54,7 +54,7 @@ export interface BaseDualImageHookReturn {
54
54
  * Base interface for all layout props
55
55
  * Contains common properties shared across all feature layouts
56
56
  */
57
- export interface BaseFeatureLayoutProps {
57
+ interface BaseFeatureLayoutProps {
58
58
  /** UI translations */
59
59
  translations: BaseLayoutTranslations & Partial<PhotoUploadTranslations>;
60
60
  /** Progress screen translations */
@@ -1,2 +0,0 @@
1
- export * from "./processing-modes.constants";
2
- export * from "./queue-status.constants";
@@ -1,17 +0,0 @@
1
- /**
2
- * Feature Flow Configuration Types
3
- */
4
-
5
- import type { DynamicStepDefinition } from "./step-definition.types";
6
-
7
- /**
8
- * Feature Flow Configuration
9
- * Defines complete flow for a feature/scenario
10
- */
11
- export interface FeatureFlowConfig {
12
- readonly id: string;
13
- readonly name: string;
14
- readonly steps: readonly DynamicStepDefinition[];
15
- readonly initialStepId?: string;
16
- readonly onComplete?: (data: Record<string, unknown>) => void | Promise<void>;
17
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * Scenario Step Configuration Types
3
- * Simplified config for scenario-based flows
4
- */
5
-
6
- /**
7
- * Scenario Step Configuration
8
- */
9
- export interface ScenarioStepConfig {
10
- readonly photoUploads?: {
11
- readonly count: number;
12
- readonly labels?: readonly string[];
13
- readonly showFaceDetection?: boolean;
14
- readonly showNameInput?: boolean;
15
- };
16
- readonly textInput?: {
17
- readonly enabled: boolean;
18
- readonly required?: boolean;
19
- readonly minLength?: number;
20
- readonly maxLength?: number;
21
- };
22
- readonly styleSelection?: {
23
- readonly enabled: boolean;
24
- readonly required?: boolean;
25
- readonly styles?: readonly string[];
26
- };
27
- readonly durationSelection?: {
28
- readonly enabled: boolean;
29
- readonly required?: boolean;
30
- readonly durations?: readonly number[];
31
- };
32
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * Dynamic Step Configuration Types - Barrel Export
3
- * Configuration-driven wizard flow system
4
- */
5
-
6
- export type { PhotoUploadStepConfig } from "./step-upload-config.types";
7
- export type {
8
- TextInputStepConfig,
9
- StyleSelectionStepConfig,
10
- DurationSelectionStepConfig,
11
- } from "./step-input-config.types";
12
- export type {
13
- NextStepDecision,
14
- DynamicStepDefinition,
15
- BuiltStep,
16
- } from "./step-definition.types";
17
- export type { FeatureFlowConfig } from "./feature-flow-config.types";
18
- export type { ScenarioStepConfig } from "./scenario-step-config.types";
@@ -1,50 +0,0 @@
1
- /**
2
- * Step Definition Types
3
- */
4
-
5
- import type { StepType } from "./flow-config.types";
6
- import type { PhotoUploadStepConfig } from "./step-upload-config.types";
7
- import type {
8
- TextInputStepConfig,
9
- StyleSelectionStepConfig,
10
- DurationSelectionStepConfig,
11
- } from "./step-input-config.types";
12
-
13
- /**
14
- * Next Step Decision Function
15
- * Evaluates current state and determines next step
16
- */
17
- export type NextStepDecision = (context: {
18
- readonly values: Record<string, unknown>;
19
- readonly currentStepId: string;
20
- readonly completedSteps: readonly string[];
21
- }) => string | null;
22
-
23
- /**
24
- * Step Definition with Configuration
25
- */
26
- export interface DynamicStepDefinition {
27
- readonly id: string;
28
- readonly type: StepType;
29
- readonly enabled?: boolean;
30
- readonly required?: boolean;
31
- readonly config?:
32
- | PhotoUploadStepConfig
33
- | TextInputStepConfig
34
- | StyleSelectionStepConfig
35
- | DurationSelectionStepConfig
36
- | Record<string, unknown>;
37
- readonly nextStep?: string | NextStepDecision;
38
- readonly skipIf?: (context: { readonly values: Record<string, unknown> }) => boolean;
39
- }
40
-
41
- /**
42
- * Step Builder Result
43
- */
44
- export interface BuiltStep {
45
- readonly id: string;
46
- readonly type: StepType;
47
- readonly config: Record<string, unknown>;
48
- readonly required: boolean;
49
- readonly nextStep?: string | NextStepDecision;
50
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * Input Step Configuration Types
3
- */
4
-
5
- /**
6
- * Text Input Step Config
7
- */
8
- export interface TextInputStepConfig {
9
- readonly id: string;
10
- readonly titleKey?: string;
11
- readonly placeholderKey?: string;
12
- readonly minLength?: number;
13
- readonly maxLength?: number;
14
- readonly required?: boolean;
15
- }
16
-
17
- /**
18
- * Style Selection Step Config
19
- */
20
- export interface StyleSelectionStepConfig {
21
- readonly id: string;
22
- readonly titleKey?: string;
23
- readonly styles: readonly string[];
24
- readonly required?: boolean;
25
- }
26
-
27
- /**
28
- * Duration Selection Step Config
29
- */
30
- export interface DurationSelectionStepConfig {
31
- readonly id: string;
32
- readonly titleKey?: string;
33
- readonly durations: readonly number[];
34
- readonly defaultDuration?: number;
35
- readonly required?: boolean;
36
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * Photo Upload Step Configuration Types
3
- */
4
-
5
- /**
6
- * Photo Upload Step Config
7
- */
8
- export interface PhotoUploadStepConfig {
9
- readonly id: string;
10
- readonly label?: string;
11
- readonly titleKey?: string;
12
- readonly subtitleKey?: string;
13
- readonly showFaceDetection?: boolean;
14
- readonly showNameInput?: boolean;
15
- readonly showPhotoTips?: boolean;
16
- readonly required?: boolean;
17
- }
@@ -1 +0,0 @@
1
- export * from "./job.types";
@@ -1 +0,0 @@
1
- export * from "./provider-job-manager.interface";
@@ -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);