@umituz/react-native-ai-generation-content 1.12.21 → 1.12.23

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 (81) hide show
  1. package/package.json +33 -15
  2. package/src/domains/content-moderation/infrastructure/services/content-moderation.service.ts +4 -32
  3. package/src/domains/content-moderation/infrastructure/services/moderators/base.moderator.ts +1 -1
  4. package/src/domains/face-detection/infrastructure/validators/faceValidator.ts +1 -1
  5. package/src/domains/face-detection/presentation/components/FaceValidationStatus.tsx +3 -3
  6. package/src/domains/feature-background/presentation/components/BackgroundFeature.tsx +5 -4
  7. package/src/domains/feature-background/presentation/components/ComparisonSlider.tsx +45 -51
  8. package/src/domains/feature-background/presentation/components/ErrorDisplay.tsx +5 -3
  9. package/src/domains/feature-background/presentation/components/ModeSelector.tsx +2 -2
  10. package/src/domains/feature-background/presentation/hooks/useBackgroundFeature.ts +3 -2
  11. package/src/domains/prompts/domain/entities/FuturePredictionConfig.ts +2 -1
  12. package/src/domains/prompts/domain/entities/GeneratedPrompt.ts +0 -1
  13. package/src/domains/prompts/domain/repositories/IAIPromptServices.ts +6 -12
  14. package/src/domains/prompts/infrastructure/repositories/PromptHistoryRepository.ts +42 -42
  15. package/src/domains/prompts/infrastructure/repositories/TemplateRepository.ts +42 -42
  16. package/src/domains/prompts/infrastructure/services/BackgroundRemovalService.ts +7 -7
  17. package/src/domains/prompts/infrastructure/services/ColorizationService.ts +7 -7
  18. package/src/domains/prompts/infrastructure/services/FaceSwapService.ts +19 -20
  19. package/src/domains/prompts/infrastructure/services/FuturePredictionService.ts +11 -31
  20. package/src/domains/prompts/infrastructure/services/ImageEnhancementService.ts +7 -7
  21. package/src/domains/prompts/infrastructure/services/PhotoRestorationService.ts +7 -7
  22. package/src/domains/prompts/infrastructure/services/PromptGenerationService.ts +13 -13
  23. package/src/domains/prompts/infrastructure/services/StyleTransferService.ts +8 -8
  24. package/src/domains/prompts/infrastructure/services/TextGenerationService.ts +7 -7
  25. package/src/domains/prompts/presentation/hooks/useAIServices.ts +30 -28
  26. package/src/domains/prompts/presentation/hooks/useFaceSwap.ts +1 -2
  27. package/src/domains/prompts/presentation/hooks/usePromptGeneration.ts +4 -5
  28. package/src/domains/prompts/presentation/hooks/useStyleTransfer.ts +1 -1
  29. package/src/domains/prompts/presentation/hooks/useTemplateRepository.ts +3 -3
  30. package/src/domains/prompts/presentation/theme/utils.ts +1 -1
  31. package/src/index.ts +0 -5
  32. package/src/infrastructure/utils/status-checker.util.ts +4 -4
  33. package/src/infrastructure/wrappers/synchronous-generation.wrapper.ts +3 -3
  34. package/src/presentation/components/result/GenerationResultContent.tsx +21 -22
  35. package/src/presentation/components/result/ResultActions.tsx +51 -52
  36. package/src/presentation/components/result/ResultHeader.tsx +24 -25
  37. package/src/presentation/components/result/ResultImageCard.tsx +19 -20
  38. package/src/presentation/components/result/ResultStoryCard.tsx +23 -24
  39. package/src/presentation/hooks/photo-generation.types.ts +4 -4
  40. package/src/presentation/hooks/usePhotoGeneration.ts +18 -13
  41. package/src/domains/creations/application/services/CreationsService.ts +0 -72
  42. package/src/domains/creations/domain/entities/Creation.ts +0 -54
  43. package/src/domains/creations/domain/entities/index.ts +0 -6
  44. package/src/domains/creations/domain/repositories/ICreationsRepository.ts +0 -25
  45. package/src/domains/creations/domain/repositories/index.ts +0 -5
  46. package/src/domains/creations/domain/services/ICreationsStorageService.ts +0 -13
  47. package/src/domains/creations/domain/value-objects/CreationsConfig.ts +0 -77
  48. package/src/domains/creations/domain/value-objects/index.ts +0 -12
  49. package/src/domains/creations/index.ts +0 -84
  50. package/src/domains/creations/infrastructure/adapters/createRepository.ts +0 -54
  51. package/src/domains/creations/infrastructure/adapters/index.ts +0 -5
  52. package/src/domains/creations/infrastructure/repositories/CreationsRepository.ts +0 -263
  53. package/src/domains/creations/infrastructure/repositories/index.ts +0 -8
  54. package/src/domains/creations/infrastructure/services/CreationsStorageService.ts +0 -48
  55. package/src/domains/creations/presentation/components/CreationCard.tsx +0 -196
  56. package/src/domains/creations/presentation/components/CreationDetail/DetailActions.tsx +0 -76
  57. package/src/domains/creations/presentation/components/CreationDetail/DetailHeader.tsx +0 -81
  58. package/src/domains/creations/presentation/components/CreationDetail/DetailImage.tsx +0 -41
  59. package/src/domains/creations/presentation/components/CreationDetail/DetailStory.tsx +0 -67
  60. package/src/domains/creations/presentation/components/CreationDetail/index.ts +0 -4
  61. package/src/domains/creations/presentation/components/CreationImageViewer.tsx +0 -101
  62. package/src/domains/creations/presentation/components/CreationThumbnail.tsx +0 -63
  63. package/src/domains/creations/presentation/components/CreationsGalleryEmptyState.tsx +0 -77
  64. package/src/domains/creations/presentation/components/CreationsGrid.tsx +0 -87
  65. package/src/domains/creations/presentation/components/CreationsHomeCard.tsx +0 -176
  66. package/src/domains/creations/presentation/components/EmptyState.tsx +0 -75
  67. package/src/domains/creations/presentation/components/FilterBottomSheet.tsx +0 -157
  68. package/src/domains/creations/presentation/components/FilterChips.tsx +0 -105
  69. package/src/domains/creations/presentation/components/GalleryHeader.tsx +0 -157
  70. package/src/domains/creations/presentation/components/index.ts +0 -20
  71. package/src/domains/creations/presentation/hooks/index.ts +0 -9
  72. package/src/domains/creations/presentation/hooks/useCreations.ts +0 -33
  73. package/src/domains/creations/presentation/hooks/useCreationsFilter.ts +0 -90
  74. package/src/domains/creations/presentation/hooks/useDeleteCreation.ts +0 -51
  75. package/src/domains/creations/presentation/hooks/useDeleteMultipleCreations.ts +0 -57
  76. package/src/domains/creations/presentation/hooks/useToggleFavorite.ts +0 -59
  77. package/src/domains/creations/presentation/screens/CreationDetailScreen.tsx +0 -71
  78. package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +0 -264
  79. package/src/domains/creations/presentation/screens/index.ts +0 -5
  80. package/src/domains/creations/presentation/utils/filterUtils.ts +0 -52
  81. package/src/domains/creations/types.d.ts +0 -107
@@ -3,7 +3,8 @@
3
3
  * Displays story text with quote styling
4
4
  */
5
5
 
6
- import React from "react";
6
+ import * as React from "react";
7
+ import { useMemo } from "react";
7
8
  import { View, StyleSheet } from "react-native";
8
9
  import {
9
10
  AtomicText,
@@ -17,28 +18,8 @@ export interface ResultStoryCardProps {
17
18
 
18
19
  export const ResultStoryCard: React.FC<ResultStoryCardProps> = ({ story }) => {
19
20
  const tokens = useAppDesignTokens();
20
- const styles = createStyles(tokens);
21
21
 
22
- return (
23
- <View style={styles.outer}>
24
- <LinearGradient
25
- colors={[`${tokens.colors.primary}15`, `${tokens.colors.primary}05`]}
26
- style={styles.container}
27
- >
28
- <AtomicText style={styles.quoteIcon}>&quot;</AtomicText>
29
- <AtomicText style={styles.text}>{story}</AtomicText>
30
- <View style={styles.quoteEnd}>
31
- <AtomicText style={[styles.quoteIcon, styles.quoteIconEnd]}>
32
- &quot;
33
- </AtomicText>
34
- </View>
35
- </LinearGradient>
36
- </View>
37
- );
38
- };
39
-
40
- const createStyles = (tokens: any) =>
41
- StyleSheet.create({
22
+ const styles = useMemo(() => StyleSheet.create({
42
23
  outer: {
43
24
  paddingHorizontal: 20,
44
25
  marginBottom: 20,
@@ -47,7 +28,7 @@ const createStyles = (tokens: any) =>
47
28
  padding: 20,
48
29
  borderRadius: 16,
49
30
  borderWidth: 1,
50
- borderColor: `${tokens.colors.primary}20`,
31
+ borderColor: tokens.colors.primaryContainer,
51
32
  },
52
33
  quoteIcon: {
53
34
  fontSize: 40,
@@ -71,4 +52,22 @@ const createStyles = (tokens: any) =>
71
52
  fontStyle: "italic",
72
53
  fontWeight: "500",
73
54
  },
74
- });
55
+ }), [tokens]);
56
+
57
+ return (
58
+ <View style={styles.outer}>
59
+ <LinearGradient
60
+ colors={[tokens.colors.primaryContainer, tokens.colors.surface]}
61
+ style={styles.container}
62
+ >
63
+ <AtomicText style={styles.quoteIcon}>&quot;</AtomicText>
64
+ <AtomicText style={styles.text}>{story}</AtomicText>
65
+ <View style={styles.quoteEnd}>
66
+ <AtomicText style={[styles.quoteIcon, styles.quoteIconEnd]}>
67
+ &quot;
68
+ </AtomicText>
69
+ </View>
70
+ </LinearGradient>
71
+ </View>
72
+ );
73
+ };
@@ -3,12 +3,12 @@
3
3
  * Generic types for photo-based AI generation workflows
4
4
  */
5
5
 
6
- export interface PhotoGenerationInput<TMetadata = any> {
6
+ export interface PhotoGenerationInput<TMetadata = unknown> {
7
7
  photos: Array<{ uri: string; base64: string }>;
8
8
  metadata?: TMetadata;
9
9
  }
10
10
 
11
- export interface PhotoGenerationResult<TResult = any> {
11
+ export interface PhotoGenerationResult<TResult = unknown> {
12
12
  success: boolean;
13
13
  data?: TResult;
14
14
  error?: PhotoGenerationError;
@@ -23,7 +23,7 @@ export interface PhotoGenerationError {
23
23
  export interface PhotoGenerationConfig<TInput, TResult, TSaveInput> {
24
24
  generate: (input: TInput) => Promise<TResult>;
25
25
  save?: (result: TResult, input: TInput) => Promise<TSaveInput>;
26
- buildMetadata?: (input: TInput) => Record<string, any>;
26
+ buildMetadata?: (input: TInput) => Record<string, unknown>;
27
27
  checkCredits?: () => Promise<boolean>;
28
28
  deductCredits?: () => Promise<void>;
29
29
  onSuccess?: (result: TResult) => void;
@@ -31,7 +31,7 @@ export interface PhotoGenerationConfig<TInput, TResult, TSaveInput> {
31
31
  onSaveComplete?: (saveResult: TSaveInput) => void;
32
32
  }
33
33
 
34
- export interface PhotoGenerationState<TResult = any> {
34
+ export interface PhotoGenerationState<TResult = unknown> {
35
35
  isGenerating: boolean;
36
36
  result: TResult | null;
37
37
  error: PhotoGenerationError | null;
@@ -18,7 +18,7 @@ export interface UsePhotoGenerationReturn<TInput, TResult> extends PhotoGenerati
18
18
  status: PhotoGenerationStatus;
19
19
  }
20
20
 
21
- export const usePhotoGeneration = <TInput, TResult, TSaveInput = any>(
21
+ export const usePhotoGeneration = <TInput, TResult, TSaveInput = unknown>(
22
22
  config: PhotoGenerationConfig<TInput, TResult, TSaveInput>,
23
23
  ): UsePhotoGenerationReturn<TInput, TResult> => {
24
24
  const {
@@ -58,7 +58,6 @@ export const usePhotoGeneration = <TInput, TResult, TSaveInput = any>(
58
58
  const generate = useCallback(
59
59
  async (input: TInput) => {
60
60
  if (isGeneratingRef.current) {
61
- if (__DEV__) console.warn("[usePhotoGeneration] Generation already in progress");
62
61
  return;
63
62
  }
64
63
 
@@ -98,7 +97,7 @@ export const usePhotoGeneration = <TInput, TResult, TSaveInput = any>(
98
97
  throw createError(
99
98
  "save_failed",
100
99
  "Failed to save result",
101
- saveError as Error,
100
+ saveError instanceof Error ? saveError : new Error(String(saveError)),
102
101
  );
103
102
  }
104
103
  }
@@ -109,9 +108,8 @@ export const usePhotoGeneration = <TInput, TResult, TSaveInput = any>(
109
108
  if (deductCredits) {
110
109
  try {
111
110
  await deductCredits();
112
- } catch (deductError) {
113
- if (__DEV__)
114
- console.error("[usePhotoGeneration] Credit deduction failed", deductError);
111
+ } catch {
112
+ // Silently fail credit deduction as generation succeeded
115
113
  }
116
114
  }
117
115
 
@@ -123,13 +121,20 @@ export const usePhotoGeneration = <TInput, TResult, TSaveInput = any>(
123
121
  });
124
122
  setStatus("success");
125
123
  onSuccess?.(result);
126
- } catch (error: any) {
127
- const generationError =
128
- error.type
129
- ? error
130
- : error.name === "ContentPolicyViolationError"
131
- ? createError("policy_violation", "Content policy violation", error)
132
- : createError("unknown", error.message || "Generation failed", error);
124
+ } catch (err: unknown) {
125
+ let generationError: PhotoGenerationError;
126
+
127
+ if (err && typeof err === "object" && "type" in err && "message" in err) {
128
+ generationError = err as PhotoGenerationError;
129
+ } else if (err instanceof Error) {
130
+ if (err.name === "ContentPolicyViolationError") {
131
+ generationError = createError("policy_violation", "Content policy violation", err);
132
+ } else {
133
+ generationError = createError("unknown", err.message || "Generation failed", err);
134
+ }
135
+ } else {
136
+ generationError = createError("unknown", "Generation failed");
137
+ }
133
138
 
134
139
  setState({
135
140
  isGenerating: false,
@@ -1,72 +0,0 @@
1
- import { serverTimestamp, addDoc, collection } from "firebase/firestore";
2
- import { generateUUID } from "@umituz/react-native-uuid";
3
- import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
4
- import type { ICreationsStorageService } from "../../domain/services/ICreationsStorageService";
5
- import type { CreationType } from "../../domain/value-objects";
6
- import { BaseRepository } from "@umituz/react-native-firebase";
7
-
8
- export interface CreateCreationDTO {
9
- userId: string;
10
- type: CreationType;
11
- prompt: string;
12
- metadata?: Record<string, any>;
13
- imageUri: string; // can be local file uri or base64
14
- aspectRatio?: number;
15
- }
16
-
17
- export class CreationsService extends BaseRepository {
18
- constructor(
19
- private readonly repository: ICreationsRepository,
20
- private readonly storageService: ICreationsStorageService,
21
- private readonly collectionName: string = "creations" // Default to generic name, app can override via repo
22
- ) {
23
- super();
24
- }
25
-
26
- async saveCreation(dto: CreateCreationDTO): Promise<string> {
27
- const db = this.getDb();
28
- if (!db) throw new Error("Firestore not initialized");
29
-
30
- try {
31
- const creationId = generateUUID();
32
-
33
- const imageUrl = await this.storageService.uploadCreationImage(
34
- dto.userId,
35
- creationId,
36
- dto.imageUri
37
- );
38
-
39
- await this.repository.create(dto.userId, {
40
- id: creationId,
41
- uri: imageUrl,
42
- type: dto.type.id,
43
- prompt: dto.prompt,
44
- metadata: dto.metadata,
45
- createdAt: new Date(),
46
- isShared: false,
47
- isFavorite: false,
48
- });
49
-
50
- return creationId;
51
- } catch (error) {
52
- console.error(error);
53
- throw error;
54
- }
55
- }
56
-
57
- async getCreation(userId: string, id: string): Promise<any> {
58
- return this.repository.getById(userId, id);
59
- }
60
-
61
- async updateCreation(
62
- userId: string,
63
- id: string,
64
- updates: { metadata?: Record<string, any> },
65
- ): Promise<boolean> {
66
- return this.repository.update(userId, id, updates);
67
- }
68
-
69
- async deleteCreation(userId: string, id: string): Promise<boolean> {
70
- return this.repository.delete(userId, id);
71
- }
72
- }
@@ -1,54 +0,0 @@
1
- /**
2
- * Creation Entity
3
- * Represents an AI-generated creation
4
- */
5
-
6
- export interface Creation {
7
- readonly id: string;
8
- readonly uri: string;
9
- readonly type: string;
10
- readonly prompt?: string;
11
- readonly metadata?: Record<string, any>;
12
- readonly originalUri?: string;
13
- readonly createdAt: Date;
14
- readonly isShared: boolean;
15
- readonly isFavorite: boolean;
16
- }
17
-
18
- export interface CreationDocument {
19
- readonly uri?: string;
20
- readonly prompt?: string;
21
- readonly metadata?: Record<string, any>;
22
- readonly originalImage?: string;
23
- readonly originalImageUrl?: string;
24
- readonly transformedImage?: string;
25
- readonly transformedImageUrl?: string;
26
- readonly transformationType?: string;
27
- readonly type?: string;
28
- readonly status?: string;
29
- readonly isShared: boolean;
30
- readonly isFavorite: boolean;
31
- readonly createdAt: FirebaseTimestamp | Date; // Allow Date for writing
32
- readonly completedAt?: FirebaseTimestamp | Date;
33
- }
34
-
35
- interface FirebaseTimestamp {
36
- toDate: () => Date;
37
- }
38
-
39
- export function mapDocumentToCreation(
40
- id: string,
41
- data: CreationDocument,
42
- ): Creation {
43
- return {
44
- id,
45
- uri: data.transformedImageUrl || data.transformedImage || data.uri || "",
46
- type: data.transformationType || data.type || "unknown",
47
- prompt: data.prompt,
48
- metadata: data.metadata,
49
- originalUri: data.originalImageUrl || data.originalImage,
50
- createdAt: (data.createdAt as any)?.toDate?.() || (data.createdAt instanceof Date ? data.createdAt : new Date()),
51
- isShared: data.isShared ?? false,
52
- isFavorite: data.isFavorite ?? false,
53
- };
54
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Domain Entities
3
- */
4
-
5
- export type { Creation, CreationDocument } from "./Creation";
6
- export { mapDocumentToCreation } from "./Creation";
@@ -1,25 +0,0 @@
1
- /**
2
- * Creations Repository Interface
3
- * Defines the contract for creations data access
4
- */
5
-
6
- import type { Creation } from "../entities/Creation";
7
-
8
- export interface ICreationsRepository {
9
- getAll(userId: string): Promise<Creation[]>;
10
- getById(userId: string, id: string): Promise<Creation | null>;
11
- create(userId: string, creation: Creation): Promise<void>;
12
- update(
13
- userId: string,
14
- id: string,
15
- updates: Partial<Creation>,
16
- ): Promise<boolean>;
17
- delete(userId: string, creationId: string): Promise<boolean>;
18
- deleteMultiple(userId: string, creationIds: string[]): Promise<boolean>;
19
- toggleFavorite(userId: string, creationId: string): Promise<boolean>;
20
- updateShared(
21
- userId: string,
22
- creationId: string,
23
- isShared: boolean,
24
- ): Promise<boolean>;
25
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Domain Repository Interfaces
3
- */
4
-
5
- export type { ICreationsRepository } from "./ICreationsRepository";
@@ -1,13 +0,0 @@
1
- export interface ICreationsStorageService {
2
- uploadCreationImage(
3
- userId: string,
4
- creationId: string,
5
- imageUri: string,
6
- mimeType?: string
7
- ): Promise<string>;
8
-
9
- deleteCreationImage(
10
- userId: string,
11
- creationId: string
12
- ): Promise<boolean>;
13
- }
@@ -1,77 +0,0 @@
1
- /**
2
- * Creations Configuration Value Object
3
- * Defines the configuration for creations feature
4
- */
5
-
6
- import type { Creation, CreationDocument } from "../entities/Creation";
7
-
8
- export interface CreationType {
9
- readonly id: string;
10
- readonly labelKey: string;
11
- readonly icon: string;
12
- }
13
-
14
- export interface CreationsTranslations {
15
- readonly title: string;
16
- readonly subtitle: string;
17
- readonly empty: string;
18
- readonly emptyDescription: string;
19
- readonly deleteTitle: string;
20
- readonly deleteMessage: string;
21
- readonly photoCount: string;
22
- readonly filterAll: string;
23
- readonly filterLabel: string;
24
- readonly filterTitle: string;
25
- }
26
-
27
- /**
28
- * Path builder function type
29
- * Allows apps to define custom Firestore path structures
30
- * @example
31
- * // Default: users/{userId}/creations
32
- * pathBuilder: (userId) => ["users", userId, "creations"]
33
- * // Alternative: creations/{userId}/items
34
- * pathBuilder: (userId) => ["creations", userId, "items"]
35
- */
36
- export type PathBuilder = (userId: string) => string[];
37
-
38
- /**
39
- * Document mapper function type
40
- * Allows apps to map their specific document structure to Creation
41
- */
42
- export type DocumentMapper = (id: string, data: CreationDocument) => Creation;
43
-
44
- import type { FilterCategory } from "@umituz/react-native-design-system";
45
-
46
- export interface CreationsConfig {
47
- readonly collectionName: string;
48
- readonly types: readonly CreationType[];
49
- readonly filterCategories?: readonly FilterCategory[];
50
- readonly translations: CreationsTranslations;
51
- readonly maxThumbnails?: number;
52
- readonly gridColumns?: number;
53
- readonly pathBuilder?: PathBuilder;
54
- readonly documentMapper?: DocumentMapper;
55
- readonly enableFiltering?: boolean;
56
- }
57
-
58
- export const DEFAULT_TRANSLATIONS: CreationsTranslations = {
59
- title: "creations.title",
60
- subtitle: "creations.subtitle",
61
- empty: "creations.empty",
62
- emptyDescription: "creations.emptyDescription",
63
- deleteTitle: "creations.deleteTitle",
64
- deleteMessage: "creations.deleteMessage",
65
- photoCount: "creations.photoCount",
66
- filterAll: "creations.filterAll",
67
- filterLabel: "common.filter",
68
- filterTitle: "common.filter",
69
- };
70
-
71
- export const DEFAULT_CONFIG: CreationsConfig = {
72
- collectionName: "creations",
73
- types: [],
74
- translations: DEFAULT_TRANSLATIONS,
75
- maxThumbnails: 4,
76
- gridColumns: 2,
77
- };
@@ -1,12 +0,0 @@
1
- /**
2
- * Domain Value Objects
3
- */
4
-
5
- export type {
6
- CreationType,
7
- CreationsTranslations,
8
- CreationsConfig,
9
- PathBuilder,
10
- DocumentMapper,
11
- } from "./CreationsConfig";
12
- export { DEFAULT_TRANSLATIONS, DEFAULT_CONFIG } from "./CreationsConfig";
@@ -1,84 +0,0 @@
1
- /**
2
- * @umituz/react-native-ai-creations
3
- *
4
- * AI-generated creations gallery with filtering, sharing, and management
5
- *
6
- * Architecture:
7
- * - Extends BaseRepository from @umituz/react-native-firestore
8
- * - Fully dynamic path structure (configurable per app)
9
- * - Fully dynamic document mapping (configurable per app)
10
- * - App-agnostic: Works with any app, no app-specific code
11
- *
12
- * This package is designed to be used across hundreds of apps.
13
- *
14
- * Usage:
15
- * import {
16
- * CreationsGalleryScreen,
17
- * CreationsHomeCard,
18
- * useCreations,
19
- * createCreationsRepository,
20
- * } from '@umituz/react-native-ai-creations';
21
- */
22
-
23
- // =============================================================================
24
- // DOMAIN LAYER - Entities
25
- // =============================================================================
26
-
27
- export type { Creation, CreationDocument } from "./domain/entities";
28
- export { mapDocumentToCreation } from "./domain/entities";
29
-
30
- // =============================================================================
31
- // DOMAIN LAYER - Value Objects
32
- // =============================================================================
33
-
34
- export type {
35
- CreationType,
36
- CreationsTranslations,
37
- CreationsConfig,
38
- PathBuilder,
39
- DocumentMapper,
40
- } from "./domain/value-objects";
41
- export { DEFAULT_TRANSLATIONS, DEFAULT_CONFIG } from "./domain/value-objects";
42
-
43
- // =============================================================================
44
- // DOMAIN LAYER - Repository Interface
45
- // =============================================================================
46
-
47
- export type { ICreationsRepository } from "./domain/repositories";
48
-
49
- // =============================================================================
50
- // INFRASTRUCTURE LAYER
51
- // =============================================================================
52
-
53
- export {
54
- CreationsRepository,
55
- type RepositoryOptions,
56
- } from "./infrastructure/repositories";
57
- export { CreationsStorageService } from "./infrastructure/services/CreationsStorageService";
58
- export { createCreationsRepository } from "./infrastructure/adapters";
59
- export { CreationsService } from "./application/services/CreationsService";
60
- export type { ICreationsStorageService } from "./domain/services/ICreationsStorageService";
61
-
62
- // =============================================================================
63
- // PRESENTATION LAYER - Hooks
64
- // =============================================================================
65
-
66
- export { useCreations } from "./presentation/hooks/useCreations";
67
- export { useDeleteCreation } from "./presentation/hooks/useDeleteCreation";
68
- export { useCreationsFilter } from "./presentation/hooks/useCreationsFilter";
69
-
70
- // =============================================================================
71
- // PRESENTATION LAYER - Components
72
- // =============================================================================
73
-
74
- export { CreationThumbnail } from "./presentation/components/CreationThumbnail";
75
- export { CreationCard } from "./presentation/components/CreationCard";
76
- export { CreationsHomeCard } from "./presentation/components/CreationsHomeCard";
77
- export { FilterChips } from "./presentation/components/FilterChips";
78
- export { EmptyState } from "./presentation/components/EmptyState";
79
-
80
- // =============================================================================
81
- // PRESENTATION LAYER - Screens
82
- // =============================================================================
83
-
84
- export { CreationsGalleryScreen } from "./presentation/screens/CreationsGalleryScreen";
@@ -1,54 +0,0 @@
1
- /**
2
- * Repository Factory
3
- * Creates repository instance with given configuration
4
- *
5
- * Architecture:
6
- * - Factory pattern for repository creation
7
- * - Supports dynamic path structure per app
8
- * - Supports custom document mapping per app
9
- * - App-agnostic: No Firestore instance needed (BaseRepository handles it)
10
- *
11
- * This factory is designed to be used across hundreds of apps.
12
- */
13
-
14
- import {
15
- CreationsRepository,
16
- type RepositoryOptions,
17
- } from "../repositories/CreationsRepository";
18
- import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
19
-
20
- /**
21
- * Creates a new CreationsRepository instance
22
- *
23
- * @param collectionName - Firestore collection name
24
- * @param options - Optional repository configuration
25
- * @returns ICreationsRepository instance
26
- *
27
- * @example
28
- * // Basic usage with default path (users/{userId}/photos)
29
- * const repo = createCreationsRepository("photos");
30
- *
31
- * @example
32
- * // Custom path structure
33
- * const repo = createCreationsRepository("creations", {
34
- * pathBuilder: (userId) => ["gallery", userId, "items"],
35
- * });
36
- *
37
- * @example
38
- * // Custom document mapper
39
- * const repo = createCreationsRepository("photos", {
40
- * documentMapper: (id, data) => ({
41
- * id,
42
- * uri: data.imageUrl,
43
- * type: data.category,
44
- * createdAt: data.timestamp?.toDate() || new Date(),
45
- * isShared: data.public ?? false,
46
- * }),
47
- * });
48
- */
49
- export function createCreationsRepository(
50
- collectionName: string,
51
- options?: RepositoryOptions,
52
- ): ICreationsRepository {
53
- return new CreationsRepository(collectionName, options);
54
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Infrastructure Adapters
3
- */
4
-
5
- export { createCreationsRepository } from "./createRepository";