@umituz/react-native-ai-generation-content 1.17.38 → 1.17.39
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 +1 -1
- package/src/features/script-generator/domain/types/script.types.ts +24 -0
- package/src/features/script-generator/index.ts +2 -0
- package/src/features/script-generator/presentation/components/ScriptDisplay.tsx +159 -0
- package/src/features/script-generator/presentation/components/index.ts +1 -0
- package/src/index.ts +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Script Generator Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface ScriptSection {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly type: "hook" | "intro" | "main" | "transition" | "cta";
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly content: string;
|
|
10
|
+
readonly duration: number; // in seconds
|
|
11
|
+
readonly notes?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ScriptGenerationRequest {
|
|
15
|
+
readonly topic: string;
|
|
16
|
+
readonly videoType: string;
|
|
17
|
+
readonly duration: number;
|
|
18
|
+
readonly targetAudience?: string;
|
|
19
|
+
readonly keyPoints?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ScriptGenerationResponse {
|
|
23
|
+
readonly script: readonly ScriptSection[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ScriptDisplay Component
|
|
3
|
+
* Generic display for AI-generated scripts with sections, durations and types.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
|
+
import {
|
|
9
|
+
AtomicText,
|
|
10
|
+
AtomicIcon,
|
|
11
|
+
useAppDesignTokens,
|
|
12
|
+
} from "@umituz/react-native-design-system";
|
|
13
|
+
import type { ScriptSection } from "../domain/types/script.types";
|
|
14
|
+
|
|
15
|
+
export interface ScriptDisplayProps {
|
|
16
|
+
readonly script: readonly ScriptSection[];
|
|
17
|
+
readonly onUseScript: () => void;
|
|
18
|
+
readonly title?: string;
|
|
19
|
+
readonly useButtonText?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const ScriptDisplay: React.FC<ScriptDisplayProps> = ({
|
|
23
|
+
script,
|
|
24
|
+
onUseScript,
|
|
25
|
+
title = "Generated Script",
|
|
26
|
+
useButtonText = "Use This Script",
|
|
27
|
+
}) => {
|
|
28
|
+
const tokens = useAppDesignTokens();
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View style={styles.container}>
|
|
32
|
+
<View style={styles.header}>
|
|
33
|
+
<AtomicText
|
|
34
|
+
type="bodyLarge"
|
|
35
|
+
style={[styles.headerTitle, { color: tokens.colors.textPrimary }]}
|
|
36
|
+
>
|
|
37
|
+
📝 {title}
|
|
38
|
+
</AtomicText>
|
|
39
|
+
<TouchableOpacity onPress={onUseScript}>
|
|
40
|
+
<AtomicIcon name="Check" size="md" color="primary" />
|
|
41
|
+
</TouchableOpacity>
|
|
42
|
+
</View>
|
|
43
|
+
|
|
44
|
+
{script.map((section) => (
|
|
45
|
+
<View
|
|
46
|
+
key={section.id}
|
|
47
|
+
style={[
|
|
48
|
+
styles.section,
|
|
49
|
+
{ backgroundColor: tokens.colors.surface },
|
|
50
|
+
]}
|
|
51
|
+
>
|
|
52
|
+
<View style={styles.sectionHeader}>
|
|
53
|
+
<AtomicText
|
|
54
|
+
type="bodyMedium"
|
|
55
|
+
style={{ color: tokens.colors.primary, fontWeight: "600" }}
|
|
56
|
+
>
|
|
57
|
+
{section.title} ({section.duration}s)
|
|
58
|
+
</AtomicText>
|
|
59
|
+
<View
|
|
60
|
+
style={[
|
|
61
|
+
styles.badge,
|
|
62
|
+
{ backgroundColor: tokens.colors.primary + "20" },
|
|
63
|
+
]}
|
|
64
|
+
>
|
|
65
|
+
<AtomicText
|
|
66
|
+
type="labelSmall"
|
|
67
|
+
style={{ color: tokens.colors.primary }}
|
|
68
|
+
>
|
|
69
|
+
{section.type.toUpperCase()}
|
|
70
|
+
</AtomicText>
|
|
71
|
+
</View>
|
|
72
|
+
</View>
|
|
73
|
+
<AtomicText
|
|
74
|
+
type="bodySmall"
|
|
75
|
+
style={{
|
|
76
|
+
color: tokens.colors.textPrimary,
|
|
77
|
+
marginTop: 8,
|
|
78
|
+
lineHeight: 22,
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
{section.content}
|
|
82
|
+
</AtomicText>
|
|
83
|
+
{section.notes && ( section.notes.length > 0) && (
|
|
84
|
+
<AtomicText
|
|
85
|
+
type="labelSmall"
|
|
86
|
+
style={{
|
|
87
|
+
color: tokens.colors.textSecondary,
|
|
88
|
+
marginTop: 8,
|
|
89
|
+
fontStyle: "italic",
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
💡 {section.notes}
|
|
93
|
+
</AtomicText>
|
|
94
|
+
)}
|
|
95
|
+
</View>
|
|
96
|
+
))}
|
|
97
|
+
|
|
98
|
+
<TouchableOpacity
|
|
99
|
+
style={[
|
|
100
|
+
styles.useButton,
|
|
101
|
+
{ backgroundColor: tokens.colors.primary },
|
|
102
|
+
]}
|
|
103
|
+
onPress={onUseScript}
|
|
104
|
+
>
|
|
105
|
+
<AtomicIcon name="Check" size="md" color="onSurface" />
|
|
106
|
+
<AtomicText
|
|
107
|
+
type="bodyLarge"
|
|
108
|
+
style={styles.useButtonText}
|
|
109
|
+
>
|
|
110
|
+
{useButtonText}
|
|
111
|
+
</AtomicText>
|
|
112
|
+
</TouchableOpacity>
|
|
113
|
+
</View>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const styles = StyleSheet.create({
|
|
118
|
+
container: {
|
|
119
|
+
padding: 16,
|
|
120
|
+
width: "100%",
|
|
121
|
+
},
|
|
122
|
+
header: {
|
|
123
|
+
flexDirection: "row",
|
|
124
|
+
alignItems: "center",
|
|
125
|
+
justifyContent: "space-between",
|
|
126
|
+
marginBottom: 16,
|
|
127
|
+
},
|
|
128
|
+
headerTitle: {
|
|
129
|
+
fontWeight: "700",
|
|
130
|
+
},
|
|
131
|
+
section: {
|
|
132
|
+
padding: 16,
|
|
133
|
+
borderRadius: 12,
|
|
134
|
+
marginBottom: 12,
|
|
135
|
+
},
|
|
136
|
+
sectionHeader: {
|
|
137
|
+
flexDirection: "row",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
justifyContent: "space-between",
|
|
140
|
+
},
|
|
141
|
+
badge: {
|
|
142
|
+
paddingHorizontal: 8,
|
|
143
|
+
paddingVertical: 4,
|
|
144
|
+
borderRadius: 6,
|
|
145
|
+
},
|
|
146
|
+
useButton: {
|
|
147
|
+
flexDirection: "row",
|
|
148
|
+
alignItems: "center",
|
|
149
|
+
justifyContent: "center",
|
|
150
|
+
padding: 18,
|
|
151
|
+
borderRadius: 16,
|
|
152
|
+
marginTop: 16,
|
|
153
|
+
},
|
|
154
|
+
useButtonText: {
|
|
155
|
+
color: "#FFFFFF",
|
|
156
|
+
fontWeight: "700",
|
|
157
|
+
marginLeft: 12,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ScriptDisplay";
|
package/src/index.ts
CHANGED
|
@@ -414,6 +414,8 @@ export * from "./features/replace-background";
|
|
|
414
414
|
// =============================================================================
|
|
415
415
|
|
|
416
416
|
export * from "./features/upscaling";
|
|
417
|
+
export * from "./features/script-generator";
|
|
418
|
+
|
|
417
419
|
|
|
418
420
|
// =============================================================================
|
|
419
421
|
// FEATURES - Photo Restoration
|