@umituz/react-native-video-editor 1.1.66 → 1.1.68
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 +12 -1
- package/src/presentation/components/generic/Selector.tsx +21 -16
- package/src/presentation/components/subtitle/SubtitleModal.tsx +0 -1
- package/src/presentation/hooks/generic/use-layer-form.hook.ts +5 -5
- package/src/presentation/hooks/useImageLayerForm.ts +3 -0
- package/src/presentation/hooks/useTextLayerForm.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-video-editor",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.68",
|
|
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",
|
|
@@ -42,8 +42,18 @@
|
|
|
42
42
|
"expo-image": ">=1.0.0",
|
|
43
43
|
"react": ">=18.2.0",
|
|
44
44
|
"react-native": ">=0.74.0",
|
|
45
|
+
"react-native-gesture-handler": ">=2.0.0",
|
|
46
|
+
"react-native-reanimated": ">=3.0.0",
|
|
45
47
|
"zustand": ">=4.0.0"
|
|
46
48
|
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"react-native-gesture-handler": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
53
|
+
"react-native-reanimated": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
47
57
|
"devDependencies": {
|
|
48
58
|
"@gorhom/bottom-sheet": "^5.2.8",
|
|
49
59
|
"@types/react": "~19.1.10",
|
|
@@ -64,6 +74,7 @@
|
|
|
64
74
|
"react": "19.1.0",
|
|
65
75
|
"react-native": "0.81.5",
|
|
66
76
|
"react-native-gesture-handler": "^2.30.0",
|
|
77
|
+
"react-native-reanimated": "^3.16.0",
|
|
67
78
|
"typescript": "~5.9.2"
|
|
68
79
|
},
|
|
69
80
|
"publishConfig": {
|
|
@@ -28,22 +28,27 @@ export interface SelectorProps<T = string> {
|
|
|
28
28
|
testID?: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const SelectorItem = React.memo<{ item
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
|
@@ -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<
|
|
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[
|
|
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
|
},
|