@umituz/react-native-ai-generation-content 1.83.60 → 1.83.62

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.60",
3
+ "version": "1.83.62",
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",
@@ -3,7 +3,7 @@
3
3
  * Filters scenarios by sub-category with memoized calculations
4
4
  */
5
5
 
6
- import { useMemo, useEffect } from "react";
6
+ import { useMemo } from "react";
7
7
  import type { ScenarioData } from "../../domain/scenario.types";
8
8
  import type { SubCategory } from "../../domain/category.types";
9
9
 
@@ -30,42 +30,14 @@ export function useHierarchicalScenarios({
30
30
 
31
31
  const filteredScenarios = useMemo(() => {
32
32
  if (!subCategory) {
33
- if (typeof __DEV__ !== "undefined" && __DEV__) {
34
- console.log("[useHierarchicalScenarios] No subCategory found", {
35
- subCategoryId,
36
- subCategoriesCount: subCategories.length,
37
- });
38
- }
39
33
  return [];
40
34
  }
41
35
 
42
- const filtered = scenarios.filter((scenario) => {
36
+ return scenarios.filter((scenario) => {
43
37
  if (!scenario.category) return false;
44
38
  return subCategory.scenarioCategories?.includes(scenario.category) ?? false;
45
39
  });
46
-
47
- if (typeof __DEV__ !== "undefined" && __DEV__) {
48
- console.log("[useHierarchicalScenarios] Filtered scenarios", {
49
- subCategoryId: subCategory.id,
50
- scenarioCategories: subCategory.scenarioCategories,
51
- totalScenarios: scenarios.length,
52
- filteredCount: filtered.length,
53
- sampleScenarioCategories: scenarios.slice(0, 5).map((s) => s.category),
54
- });
55
- }
56
-
57
- return filtered;
58
- }, [scenarios, subCategory, subCategoryId, subCategories]);
59
-
60
- useEffect(() => {
61
- if (typeof __DEV__ !== "undefined" && __DEV__) {
62
- console.log("[useHierarchicalScenarios] State changed", {
63
- subCategoryId,
64
- hasSubCategory: !!subCategory,
65
- filteredScenariosCount: filteredScenarios.length,
66
- });
67
- }
68
- }, [subCategoryId, subCategory, filteredScenarios]);
40
+ }, [scenarios, subCategory]);
69
41
 
70
42
  return { subCategory, filteredScenarios };
71
43
  }
@@ -35,13 +35,6 @@ export interface GenerationConfigProviderProps {
35
35
  export const GenerationConfigProvider: React.FC<
36
36
  GenerationConfigProviderProps
37
37
  > = ({ children, models }) => {
38
- if (typeof __DEV__ !== "undefined" && __DEV__) {
39
- const configuredModels = Object.entries(models)
40
- .filter(([, value]) => !!value)
41
- .map(([key]) => key);
42
- console.log("[GenerationConfigProvider] Models:", configuredModels);
43
- }
44
-
45
38
  const getModel = useCallback((featureType: keyof GenerationModels): string => {
46
39
  const model = models[featureType];
47
40
  if (!model) {
@@ -35,10 +35,9 @@ export const useGenerationOrchestrator = <TInput, TResult>(
35
35
  // callers pass inline functions (which create new references every render).
36
36
  const onSuccessRef = useRef(onSuccess);
37
37
  const onErrorRef = useRef(onError);
38
- useEffect(() => {
39
- onSuccessRef.current = onSuccess;
40
- onErrorRef.current = onError;
41
- });
38
+ // Update refs in render body (not useEffect) so they're always in sync — no 1-frame delay
39
+ onSuccessRef.current = onSuccess;
40
+ onErrorRef.current = onError;
42
41
 
43
42
  const offlineStore = useOfflineStore();
44
43
  const { showError, showSuccess } = useAlert();