@umituz/react-native-ai-generation-content 1.41.9 → 1.41.12

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.41.9",
3
+ "version": "1.41.12",
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",
@@ -76,27 +76,23 @@ export function useAIFeatureGate(
76
76
  return hasCredits;
77
77
  }, [isAuthenticated, isPremium, hasCredits]);
78
78
 
79
- // Wrapped requireFeature with error handling
79
+ // Wrapped requireFeature with optional callbacks
80
80
  const requireFeature = useCallback(
81
- async (action: () => void | Promise<void>): Promise<void> => {
82
- try {
83
- requireFeatureFromPackage(async () => {
84
- try {
85
- await action();
86
- onSuccess?.();
87
- } catch (error) {
88
- const errorObj =
89
- error instanceof Error ? error : new Error(String(error));
90
- onError?.(errorObj);
91
- throw error;
92
- }
93
- });
94
- } catch (error) {
95
- const errorObj =
96
- error instanceof Error ? error : new Error(String(error));
97
- onError?.(errorObj);
98
- throw error;
99
- }
81
+ (action: () => void | Promise<void>): void => {
82
+ requireFeatureFromPackage(() => {
83
+ const result = action();
84
+ if (result instanceof Promise) {
85
+ result
86
+ .then(() => onSuccess?.())
87
+ .catch((error) => {
88
+ const errorObj =
89
+ error instanceof Error ? error : new Error(String(error));
90
+ onError?.(errorObj);
91
+ });
92
+ } else {
93
+ onSuccess?.();
94
+ }
95
+ });
100
96
  },
101
97
  [requireFeatureFromPackage, onSuccess, onError],
102
98
  );
@@ -30,7 +30,7 @@ export interface AIFeatureGateReturn {
30
30
  * Function to execute protected feature
31
31
  * Handles all access control checks (auth, premium, credits, paywall)
32
32
  */
33
- requireFeature: (action: () => void | Promise<void>) => Promise<void>;
33
+ requireFeature: (action: () => void | Promise<void>) => void;
34
34
 
35
35
  /**
36
36
  * Whether user can access this feature (all checks passed)
@@ -20,7 +20,7 @@ export const SCENARIO_TO_WIZARD_INPUT_MAP: Record<ScenarioInputType, WizardInput
20
20
  * Only matches generic I/O patterns
21
21
  */
22
22
  const INPUT_PATTERNS: Record<WizardInputType, readonly RegExp[]> = {
23
- [WizardInputType.DUAL_IMAGE]: [/ai-kiss/i, /ai-hug/i, /couple/i, /dual/i],
23
+ [WizardInputType.DUAL_IMAGE]: [/kiss/i, /hug/i, /embrace/i, /couple/i, /dual/i, /partner/i],
24
24
  [WizardInputType.SINGLE_IMAGE]: [
25
25
  /^image-to-video$/i,
26
26
  /upscale/i,
@@ -46,6 +46,7 @@ export {
46
46
  export {
47
47
  WizardInputType,
48
48
  detectWizardInputType,
49
+ SCENARIO_TO_WIZARD_INPUT_MAP,
49
50
  getScenarioWizardConfig,
50
51
  hasExplicitConfig,
51
52
  getScenarioWizardInputType,