@umituz/react-native-ai-generation-content 1.83.15 → 1.83.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.83.15",
3
+ "version": "1.83.17",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -15,11 +15,11 @@ import { CreationActions } from "./CreationActions";
15
15
  import { CreationCardMeta } from "./CreationCardMeta";
16
16
  import { useCreationCardActions } from "./useCreationCardActions";
17
17
  import { useCreationDateFormatter } from "./CreationCard.utils";
18
- import type { CreationCardProps } from "./CreationCard.types";
18
+ import type { CreationCardProps, CreationCardCallbacks } from "./CreationCard.types";
19
19
  import type { CreationTypeId } from "../../domain/types";
20
20
  import { getPreviewUrl, getCreationTitle } from "../../domain/utils";
21
21
 
22
- const EMPTY_CALLBACKS: CreationCardProps["callbacks"] = {};
22
+ const EMPTY_CALLBACKS: CreationCardCallbacks = {};
23
23
 
24
24
  export function CreationCard({
25
25
  creation,
@@ -40,8 +40,8 @@ export function CreationCard({
40
40
  if (__DEV__) {
41
41
  console.log("[CreationCard] RENDER", {
42
42
  creationId: creation.id,
43
- hasOnPress: !!callbacks.onPress,
44
- callbacksKeys: Object.keys(callbacks),
43
+ hasOnPress: !!callbacks?.onPress,
44
+ callbacksKeys: callbacks ? Object.keys(callbacks) : [],
45
45
  status: creation.status,
46
46
  type: creation.type,
47
47
  output: creation.output,
@@ -54,7 +54,7 @@ export function CreationCard({
54
54
  const title = titleText || getCreationTitle(creation.prompt, creation.type as CreationTypeId);
55
55
  const formattedDate = useCreationDateFormatter(creation.createdAt, formatDate);
56
56
  const actions = useCreationCardActions({
57
- callbacks,
57
+ callbacks: callbacks ?? EMPTY_CALLBACKS,
58
58
  creation,
59
59
  isSharing,
60
60
  isDownloadAvailable,
@@ -65,10 +65,10 @@ export function CreationCard({
65
65
  if (__DEV__) {
66
66
  console.log("[CreationCard] handlePress TRIGGERED", {
67
67
  creationId: creation.id,
68
- hasOnPress: !!callbacks.onPress,
68
+ hasOnPress: !!callbacks?.onPress,
69
69
  });
70
70
  }
71
- callbacks.onPress?.(creation);
71
+ callbacks?.onPress?.(creation);
72
72
  }, [callbacks, creation]);
73
73
 
74
74
  const styles = useMemo(
@@ -109,7 +109,7 @@ export function CreationCard({
109
109
  }
110
110
  }, [creation.id]);
111
111
 
112
- const isDisabled = !callbacks.onPress;
112
+ const isDisabled = !callbacks?.onPress;
113
113
 
114
114
  if (__DEV__ && isDisabled) {
115
115
  console.log("[CreationCard] WARNING: Card is DISABLED - onPress is falsy");
@@ -120,7 +120,7 @@ export function CreationCard({
120
120
  style={styles.card}
121
121
  onPress={handlePress}
122
122
  onPressIn={handlePressIn}
123
- activeOpacity={callbacks.onPress ? 0.7 : 1}
123
+ activeOpacity={callbacks?.onPress ? 0.7 : 1}
124
124
  disabled={isDisabled}
125
125
  >
126
126
  <View style={styles.previewContainer} pointerEvents="box-none">