@umituz/react-native-ai-generation-content 1.58.0 → 1.58.1
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.58.
|
|
3
|
+
"version": "1.58.1",
|
|
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",
|
package/src/domains/generation/wizard/presentation/components/step-renderers/renderSelectionStep.tsx
CHANGED
|
@@ -26,8 +26,14 @@ export function renderSelectionStep({
|
|
|
26
26
|
const selectionConfig = getSelectionConfig(step.config);
|
|
27
27
|
const titleKey = selectionConfig?.titleKey ?? `wizard.steps.${step.id}.title`;
|
|
28
28
|
const subtitleKey = selectionConfig?.subtitleKey ?? `wizard.steps.${step.id}.subtitle`;
|
|
29
|
-
const existingValue = customData[step.id] as string | string[] | undefined;
|
|
30
29
|
const options = selectionConfig?.options ?? [];
|
|
30
|
+
const isRequired = step.required ?? true;
|
|
31
|
+
|
|
32
|
+
// Priority: existing value > config default > auto-select single option
|
|
33
|
+
const existingValue = customData[step.id] as string | string[] | undefined;
|
|
34
|
+
const configDefault = selectionConfig?.defaultValue;
|
|
35
|
+
const autoSelectValue = isRequired && options.length === 1 ? options[0].id : undefined;
|
|
36
|
+
const initialValue = existingValue ?? configDefault ?? autoSelectValue;
|
|
31
37
|
|
|
32
38
|
return (
|
|
33
39
|
<SelectionScreen
|
|
@@ -46,13 +52,12 @@ export function renderSelectionStep({
|
|
|
46
52
|
}))}
|
|
47
53
|
config={{
|
|
48
54
|
multiSelect: selectionConfig?.multiSelect ?? false,
|
|
49
|
-
required:
|
|
55
|
+
required: isRequired,
|
|
50
56
|
}}
|
|
51
|
-
initialValue={
|
|
57
|
+
initialValue={initialValue}
|
|
52
58
|
onBack={onBack}
|
|
53
59
|
onContinue={(value) => {
|
|
54
|
-
|
|
55
|
-
onPhotoContinue(step.id, { uri: String(value), selection: value, previewUrl: "" } as unknown as any);
|
|
60
|
+
onPhotoContinue(step.id, { uri: String(value), selection: value, previewUrl: "" } as UploadedImage);
|
|
56
61
|
}}
|
|
57
62
|
/>
|
|
58
63
|
);
|
|
@@ -115,7 +115,18 @@ export function useWizardFlowHandlers(props: UseWizardFlowHandlersProps) {
|
|
|
115
115
|
|
|
116
116
|
const handleNextStep = useCallback(() => {
|
|
117
117
|
const nextStepDef = flowSteps[currentStepIndex + 1];
|
|
118
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
119
|
+
console.log("[WizardFlowHandlers] handleNextStep", {
|
|
120
|
+
currentStepIndex,
|
|
121
|
+
nextStepType: nextStepDef?.type,
|
|
122
|
+
isGenerating: nextStepDef?.type === StepType.GENERATING,
|
|
123
|
+
hasOnGenerationStart: !!onGenerationStart,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
118
126
|
if (nextStepDef?.type === StepType.GENERATING && onGenerationStart) {
|
|
127
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
128
|
+
console.log("[WizardFlowHandlers] Calling onGenerationStart callback");
|
|
129
|
+
}
|
|
119
130
|
onGenerationStart(customData, nextStep);
|
|
120
131
|
return;
|
|
121
132
|
}
|