@umituz/react-native-ai-generation-content 1.74.2 → 1.74.4

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.74.2",
3
+ "version": "1.74.4",
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",
@@ -93,7 +93,7 @@ export const WizardStepRenderer: React.FC<WizardStepRendererProps> = ({
93
93
  return renderPhotoUploadStep({ key: step.id, step, customData, onBack, onPhotoContinue, t, creditCost });
94
94
 
95
95
  case StepType.TEXT_INPUT:
96
- return renderTextInputStep({ key: step.id, step, customData, onBack, onPhotoContinue, t, alertMessages });
96
+ return renderTextInputStep({ key: step.id, step, customData, onBack, onPhotoContinue, t, alertMessages, creditCost });
97
97
 
98
98
  case StepType.FEATURE_SELECTION:
99
99
  return renderSelectionStep({ key: step.id, step, customData, onBack, onPhotoContinue, t, creditCost });
@@ -17,6 +17,8 @@ export interface TextInputStepProps {
17
17
  readonly onPhotoContinue: (stepId: string, image: UploadedImage) => void;
18
18
  readonly t: (key: string) => string;
19
19
  readonly alertMessages?: AlertMessages;
20
+ /** Calculated credit cost from parent */
21
+ readonly creditCost?: number;
20
22
  }
21
23
 
22
24
  export function renderTextInputStep({
@@ -26,6 +28,7 @@ export function renderTextInputStep({
26
28
  onPhotoContinue,
27
29
  t,
28
30
  alertMessages,
31
+ creditCost,
29
32
  }: TextInputStepProps): React.ReactElement {
30
33
  const textConfig = getTextInputConfig(step.config);
31
34
  const titleKey = textConfig?.titleKey ?? `wizard.steps.${step.id}.title`;
@@ -53,6 +56,7 @@ export function renderTextInputStep({
53
56
  multiline: textConfig?.multiline !== undefined ? textConfig.multiline : true,
54
57
  }}
55
58
  initialValue={existingText}
59
+ creditCost={creditCost}
56
60
  onBack={onBack}
57
61
  onContinue={(text) => {
58
62
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -17,7 +17,7 @@ import {
17
17
  AlertType,
18
18
  AlertMode,
19
19
  } from "@umituz/react-native-design-system";
20
- import { ContinueButton } from "../../../../../presentation/components/buttons";
20
+ import { WizardContinueButton } from "../components/WizardContinueButton";
21
21
  import { contentModerationService } from "../../../../../domains/content-moderation";
22
22
  import type { TextInputScreenProps } from "./TextInputScreen.types";
23
23
 
@@ -33,6 +33,7 @@ export const TextInputScreen: React.FC<TextInputScreenProps> = ({
33
33
  config,
34
34
  examplePrompts = [],
35
35
  initialValue = "",
36
+ creditCost,
36
37
  onBack,
37
38
  onContinue,
38
39
  }) => {
@@ -99,10 +100,11 @@ export const TextInputScreen: React.FC<TextInputScreenProps> = ({
99
100
  title=""
100
101
  onBackPress={onBack}
101
102
  rightElement={
102
- <ContinueButton
103
+ <WizardContinueButton
103
104
  label={translations.continueButton}
104
105
  canContinue={canContinue}
105
106
  onPress={handleContinue}
107
+ creditCost={creditCost}
106
108
  />
107
109
  }
108
110
  />
@@ -25,6 +25,8 @@ export interface TextInputScreenProps {
25
25
  readonly config?: TextInputScreenConfig;
26
26
  readonly examplePrompts?: string[];
27
27
  readonly initialValue?: string;
28
+ /** Calculated credit cost from parent */
29
+ readonly creditCost?: number;
28
30
  readonly onBack: () => void;
29
31
  readonly onContinue: (text: string) => void;
30
32
  }
@@ -14,7 +14,7 @@ import {
14
14
  HeroSection,
15
15
  NavigationHeader,
16
16
  } from "@umituz/react-native-design-system";
17
- import { ContinueButton } from "../../../../presentation/components/buttons";
17
+ import { WizardContinueButton } from "../../../../domains/generation/wizard/presentation/components/WizardContinueButton";
18
18
  import type { ScenarioData } from "../../domain/scenario.types";
19
19
 
20
20
  export interface ScenarioPreviewTranslations {
@@ -46,7 +46,7 @@ export const ScenarioPreviewScreen: React.FC<ScenarioPreviewScreenProps> = ({
46
46
  title=""
47
47
  onBackPress={onBack}
48
48
  rightElement={
49
- <ContinueButton
49
+ <WizardContinueButton
50
50
  label={translations.continueButton}
51
51
  canContinue={true}
52
52
  onPress={onContinue}
@@ -1,2 +1 @@
1
1
  export { GenerateButton, type GenerateButtonProps } from "./GenerateButton";
2
- export { ContinueButton, type ContinueButtonProps } from "./ContinueButton";
@@ -1,72 +0,0 @@
1
- /**
2
- * ContinueButton Component
3
- * Reusable continue button for wizard flows and forms
4
- */
5
-
6
- import React, { useMemo } from "react";
7
- import { TouchableOpacity, StyleSheet } from "react-native";
8
- import { useAppDesignTokens, AtomicText, AtomicIcon } from "@umituz/react-native-design-system";
9
-
10
- export interface ContinueButtonProps {
11
- readonly label: string;
12
- readonly canContinue: boolean;
13
- readonly onPress: () => void;
14
- readonly iconName?: string;
15
- readonly disabled?: boolean;
16
- }
17
-
18
- export const ContinueButton: React.FC<ContinueButtonProps> = ({
19
- label,
20
- canContinue,
21
- onPress,
22
- iconName = "arrow-forward",
23
- disabled = false,
24
- }) => {
25
- const tokens = useAppDesignTokens();
26
- const isEnabled = canContinue && !disabled;
27
-
28
- const buttonStyle = useMemo(() => [
29
- styles.button,
30
- {
31
- backgroundColor: isEnabled ? tokens.colors.primary : tokens.colors.surfaceVariant,
32
- opacity: isEnabled ? 1 : 0.5,
33
- },
34
- ], [isEnabled, tokens.colors.primary, tokens.colors.surfaceVariant]);
35
-
36
- const textStyle = useMemo(() => [
37
- styles.text,
38
- { color: isEnabled ? tokens.colors.onPrimary : tokens.colors.textSecondary },
39
- ], [isEnabled, tokens.colors.onPrimary, tokens.colors.textSecondary]);
40
-
41
- return (
42
- <TouchableOpacity
43
- onPress={onPress}
44
- activeOpacity={0.7}
45
- disabled={!isEnabled}
46
- style={buttonStyle}
47
- >
48
- <AtomicText type="bodyMedium" style={textStyle}>
49
- {label}
50
- </AtomicText>
51
- <AtomicIcon
52
- name={iconName}
53
- size="sm"
54
- color={isEnabled ? "onPrimary" : "textSecondary"}
55
- />
56
- </TouchableOpacity>
57
- );
58
- };
59
-
60
- const styles = StyleSheet.create({
61
- button: {
62
- flexDirection: "row",
63
- alignItems: "center",
64
- paddingHorizontal: 16,
65
- paddingVertical: 8,
66
- borderRadius: 999,
67
- },
68
- text: {
69
- fontWeight: "800",
70
- marginRight: 4,
71
- },
72
- });