@umituz/react-native-video-editor 1.1.65 → 1.1.67

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-video-editor",
3
- "version": "1.1.65",
3
+ "version": "1.1.67",
4
4
  "description": "Professional video editor with layer-based timeline, text/image/shape/audio/animation layers, and export functionality",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -28,22 +28,27 @@ export interface SelectorProps<T = string> {
28
28
  testID?: string;
29
29
  }
30
30
 
31
- const SelectorItem = React.memo<{ item: SelectorItem; isSelected: boolean; onSelect: () => void; styles: any; icon: boolean; colorPreview: boolean }>(
32
- ({ item, isSelected, onSelect, styles, icon, colorPreview }) => (
33
- <TouchableOpacity
34
- style={[styles.item, isSelected && styles.itemSelected, item.disabled && styles.itemDisabled]}
35
- onPress={onSelect}
36
- disabled={item.disabled}
37
- accessibilityRole="button"
38
- accessibilityState={{ selected: isSelected }}
39
- accessibilityLabel={item.label}
40
- >
41
- {colorPreview && item.color && <View style={[styles.colorPreview, { backgroundColor: item.color }]} />}
42
- {icon && item.icon && <AtomicIcon name={item.icon} size="sm" color="textPrimary" />}
43
- <AtomicText type="labelSmall" style={styles.label} color={isSelected ? "primary" : "textPrimary"}>{item.label}</AtomicText>
44
- </TouchableOpacity>
45
- )
46
- );
31
+ const SelectorItem = React.memo(<T,>({ item, isSelected, onSelect, styles, icon, colorPreview }: {
32
+ item: SelectorItem<T>;
33
+ isSelected: boolean;
34
+ onSelect: () => void;
35
+ styles: any;
36
+ icon: boolean;
37
+ colorPreview: boolean;
38
+ }) => (
39
+ <TouchableOpacity
40
+ style={[styles.item, isSelected && styles.itemSelected, item.disabled && styles.itemDisabled]}
41
+ onPress={onSelect}
42
+ disabled={item.disabled}
43
+ accessibilityRole="button"
44
+ accessibilityState={{ selected: isSelected }}
45
+ accessibilityLabel={item.label}
46
+ >
47
+ {colorPreview && item.color && <View style={[styles.colorPreview, { backgroundColor: item.color }]} />}
48
+ {icon && item.icon && <AtomicIcon name={item.icon} size="sm" color="textPrimary" />}
49
+ <AtomicText type="labelSmall" style={styles.label} color={isSelected ? "primary" : "textPrimary"}>{item.label}</AtomicText>
50
+ </TouchableOpacity>
51
+ ));
47
52
 
48
53
  SelectorItem.displayName = "SelectorItem";
49
54
 
@@ -55,7 +55,6 @@ export const SubtitleModal: React.FC<SubtitleModalProps> = ({
55
55
  paddingHorizontal: tokens.spacing.md,
56
56
  paddingTop: tokens.spacing.md,
57
57
  paddingBottom: tokens.spacing.xl,
58
- maxHeight: "90%" as const,
59
58
  },
60
59
  handle: {
61
60
  width: 36,
@@ -17,7 +17,7 @@ export type ValidatorFn<T, K extends keyof T = keyof T> = (value: T[K]) => strin
17
17
  */
18
18
  export interface UseLayerFormConfig<T extends Record<string, unknown>> {
19
19
  initialValues: Partial<T>;
20
- validators?: Record<string, (value: unknown) => string | null>;
20
+ validators?: Partial<Record<keyof T, (value: unknown) => string | null>>;
21
21
  buildData: (formState: T) => Partial<Layer> | Partial<ImageLayer> | Partial<TextLayer>;
22
22
  }
23
23
 
@@ -72,10 +72,10 @@ export function useLayerForm<T extends Record<string, unknown>, R = Partial<Laye
72
72
 
73
73
  const validateField = useCallback(
74
74
  <K extends keyof T>(field: K): string | null => {
75
- const validator = validators[String(field)];
75
+ const validator = validators[field as keyof typeof validators];
76
76
  if (!validator) return null;
77
77
 
78
- const error = validator(formState[field]);
78
+ const error = (validator as (value: unknown) => string | null)(formState[field]);
79
79
  setErrors((prev) => ({
80
80
  ...prev,
81
81
  [field]: error,
@@ -91,9 +91,9 @@ export function useLayerForm<T extends Record<string, unknown>, R = Partial<Laye
91
91
  const newErrors: Partial<Record<keyof T, string | null>> = {};
92
92
 
93
93
  for (const field in validators) {
94
- const validator = validators[field];
94
+ const validator = validators[field as keyof typeof validators];
95
95
  if (validator) {
96
- const error = validator(formState[field as keyof T]);
96
+ const error = (validator as (value: unknown) => string | null)(formState[field as keyof T]);
97
97
  if (error) {
98
98
  newErrors[field as keyof T] = error;
99
99
  hasError = true;
@@ -36,6 +36,9 @@ export function useImageLayerForm(
36
36
  if (!value || (typeof value === "string" && value.trim().length === 0)) {
37
37
  return "Image URI is required";
38
38
  }
39
+ if (typeof value !== "string") {
40
+ return "Image URI must be a string";
41
+ }
39
42
  return null;
40
43
  },
41
44
  },
@@ -52,6 +52,9 @@ export function useTextLayerForm(
52
52
  if (!value || (typeof value === "string" && value.trim().length === 0)) {
53
53
  return "Text content is required";
54
54
  }
55
+ if (typeof value !== "string") {
56
+ return "Text content must be a string";
57
+ }
55
58
  return null;
56
59
  },
57
60
  },