@adminide-stack/yantra-mobile 12.0.125-alpha.0 → 12.0.125
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/lib/features/canvas/AudioEditorExperience.js +207 -109
- package/lib/features/canvas/AudioEditorExperience.js.map +1 -1
- package/lib/features/canvas/CanvasAgentChatPane.js +87 -72
- package/lib/features/canvas/CanvasAgentChatPane.js.map +1 -1
- package/lib/features/canvas/CanvasBoardsGrid.js +494 -387
- package/lib/features/canvas/CanvasBoardsGrid.js.map +1 -1
- package/lib/features/canvas/CanvasChatResultCard.js +78 -59
- package/lib/features/canvas/CanvasChatResultCard.js.map +1 -1
- package/lib/features/canvas/CanvasEditToolsPanel.js +126 -84
- package/lib/features/canvas/CanvasEditToolsPanel.js.map +1 -1
- package/lib/features/canvas/CanvasExperience.js +108 -126
- package/lib/features/canvas/CanvasExperience.js.map +1 -1
- package/lib/features/canvas/CanvasGeneratePanel.js +178 -166
- package/lib/features/canvas/CanvasGeneratePanel.js.map +1 -1
- package/lib/features/canvas/CanvasLibrarySheet.js +119 -123
- package/lib/features/canvas/CanvasLibrarySheet.js.map +1 -1
- package/lib/features/canvas/CanvasLooksPanel.js +113 -89
- package/lib/features/canvas/CanvasLooksPanel.js.map +1 -1
- package/lib/features/canvas/CanvasModelPicker.js +79 -79
- package/lib/features/canvas/CanvasModelPicker.js.map +1 -1
- package/lib/features/canvas/CanvasTasksPanel.js +193 -128
- package/lib/features/canvas/CanvasTasksPanel.js.map +1 -1
- package/lib/features/canvas/CanvasTemplatesPanel.js +106 -94
- package/lib/features/canvas/CanvasTemplatesPanel.js.map +1 -1
- package/lib/features/canvas/CanvasToolDock.js +195 -127
- package/lib/features/canvas/CanvasToolDock.js.map +1 -1
- package/lib/features/canvas/FrameExtractorExperience.js +163 -100
- package/lib/features/canvas/FrameExtractorExperience.js.map +1 -1
- package/lib/features/canvas/GeneratorReferenceSlots.js +132 -69
- package/lib/features/canvas/GeneratorReferenceSlots.js.map +1 -1
- package/lib/features/canvas/ImageEditorExperience.js +278 -209
- package/lib/features/canvas/ImageEditorExperience.js.map +1 -1
- package/lib/features/canvas/InfluencerStudioExperience.js +167 -125
- package/lib/features/canvas/InfluencerStudioExperience.js.map +1 -1
- package/lib/features/canvas/MoodboardExperience.js +102 -85
- package/lib/features/canvas/MoodboardExperience.js.map +1 -1
- package/lib/features/canvas/NativeCanvasViewer.js +203 -192
- package/lib/features/canvas/NativeCanvasViewer.js.map +1 -1
- package/lib/features/canvas/PromoContextFields.js +125 -92
- package/lib/features/canvas/PromoContextFields.js.map +1 -1
- package/lib/features/canvas/SetStudioExperience.js +225 -143
- package/lib/features/canvas/SetStudioExperience.js.map +1 -1
- package/lib/features/canvas/VideoClipsExperience.js +126 -92
- package/lib/features/canvas/VideoClipsExperience.js.map +1 -1
- package/lib/features/canvas/VideoEditExperience.js +154 -142
- package/lib/features/canvas/VideoEditExperience.js.map +1 -1
- package/lib/features/canvas/VideoEditorExperience.js +551 -492
- package/lib/features/canvas/VideoEditorExperience.js.map +1 -1
- package/lib/features/canvas/VideoGeneratorExperience.js +284 -131
- package/lib/features/canvas/VideoGeneratorExperience.js.map +1 -1
- package/lib/features/canvas/canvasTasks.js +7 -3
- package/lib/features/canvas/canvasTasks.js.map +1 -1
- package/lib/features/canvas/canvasTheme.js +265 -0
- package/lib/features/canvas/canvasTheme.js.map +1 -0
- package/lib/features/canvas/canvasUi.js +381 -0
- package/lib/features/canvas/canvasUi.js.map +1 -0
- package/lib/features/canvas/recorder/CameraRecorderExperience.js +109 -52
- package/lib/features/canvas/recorder/CameraRecorderExperience.js.map +1 -1
- package/lib/features/canvas/serverTasks.js +1 -1
- package/lib/features/canvas/serverTasks.js.map +1 -1
- package/lib/features/canvas/set/SetViewportWebView.js +1 -1
- package/lib/features/canvas/set/SetViewportWebView.js.map +1 -1
- package/lib/features/canvas/videoEditor/BlurBoxOverlay.js +8 -7
- package/lib/features/canvas/videoEditor/BlurBoxOverlay.js.map +1 -1
- package/lib/features/canvas/videoEditor/ExportTaskCard.js +44 -41
- package/lib/features/canvas/videoEditor/ExportTaskCard.js.map +1 -1
- package/lib/features/canvas/videoEditor/agent/AgentCutPane.js +50 -45
- package/lib/features/canvas/videoEditor/agent/AgentCutPane.js.map +1 -1
- package/lib/features/canvas/videoEditor/exportTask.js +3 -2
- package/lib/features/canvas/videoEditor/exportTask.js.map +1 -1
- package/lib/features/canvas/videoEditor/formWidgets.js +116 -64
- package/lib/features/canvas/videoEditor/formWidgets.js.map +1 -1
- package/lib/features/canvas/videoEditor/produce/ProduceVideoSheet.js +77 -63
- package/lib/features/canvas/videoEditor/produce/ProduceVideoSheet.js.map +1 -1
- package/lib/features/canvas/videoEditor/tools/ToolsDrawer.js +95 -79
- package/lib/features/canvas/videoEditor/tools/ToolsDrawer.js.map +1 -1
- package/lib/features/design/DesignEditorExperience.js +241 -160
- package/lib/features/design/DesignEditorExperience.js.map +1 -1
- package/lib/features/design/DesignExperience.js +300 -143
- package/lib/features/design/DesignExperience.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/buildFragments.js +3 -2
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/components/PublishSheet.js +1 -1
- package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
- package/lib/features/webbuilder/webbuilderPrompts.js +2 -5
- package/lib/features/webbuilder/webbuilderPrompts.js.map +1 -1
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js +120 -0
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js.map +1 -0
- package/lib/screens/WebBuilderNative/useRestoredSandboxes.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +26 -4
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/lib/screens/WebBuilderNative/webbuilderTransport.js +110 -7
- package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useMemo,useState,useRef,useEffect}from'react';import {View,Text,StyleSheet,ActivityIndicator,ScrollView,TextInput}from'react-native';import {useSafeInsets}from'./withRemoteSafeArea.js';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Image}from'expo-image';import {useKeyboardLiftHeight,KeyboardAwareScreen,KeyboardComposerDock,COMPOSER_INPUT_NATIVE_ID}from'../../components/KeyboardComposerDock.js';import {dismissKeyboard}from'../../utils/keyboardController.js';import {resultUrl,friendlyMediaError,generationImageUrl,generationMediaUrl}from'./videoEditor/mediaActions.js';import {unwrapProxyUrl}from'./videoEditor/remoteMediaClient.js';import {STATIC_VIDEO_MODELS,normalizeModels,promptAudioModels,videoDurationOptions,buildVideoGenerateParams}from'./generationModels.js';import {DEFAULT_PROMO_PRESET,lookupPromoPreset,defaultNarration,EMPTY_PROMO_CONTEXT,defaultPromoQuality,PROMO_PRESETS,PROMO_DURATIONS,PROMO_PLAYBOOKS,PROMO_ASPECT_RATIOS,designPromoProject,PROMO_CONNECTOR,producePromoVideo}from'./promoVideo.js';import {PromoContextFields,PromoProductionFields}from'./PromoContextFields.js';import {useCanvasTheme,themedStyles}from'./canvasTheme.js';import {Pressable,pressedStyle,Segmented,RADIUS,SPACE,HIT,TYPE}from'./canvasUi.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -17,6 +17,9 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
const HSCROLL = {
|
|
21
|
+
flexGrow: 0
|
|
22
|
+
};
|
|
20
23
|
const ASPECTS = ["16:9", "9:16", "1:1"];
|
|
21
24
|
function VideoGeneratorExperience({
|
|
22
25
|
mode = "video",
|
|
@@ -28,6 +31,8 @@ function VideoGeneratorExperience({
|
|
|
28
31
|
onGenerated,
|
|
29
32
|
onPromoDesigned
|
|
30
33
|
}) {
|
|
34
|
+
const theme = useCanvasTheme();
|
|
35
|
+
const styles = useMemo(() => makeStyles(theme), [theme]);
|
|
31
36
|
const imageReference = (mode === "video" || mode === "promo") && (item == null ? void 0 : item.type) === "image" ? unwrapProxyUrl(item.src) : null;
|
|
32
37
|
const [referenceUrl, setReferenceUrl] = useState(imageReference);
|
|
33
38
|
const [videoSourceUrl, setVideoSourceUrl] = useState(restyle && (item == null ? void 0 : item.type) === "video" ? unwrapProxyUrl(item.src) : null);
|
|
@@ -78,7 +83,7 @@ function VideoGeneratorExperience({
|
|
|
78
83
|
setReferenceUrl(resultUrl(result, "YANTRA_VIDEO_EDIT_THUMBNAIL"));
|
|
79
84
|
}).catch((err) => {
|
|
80
85
|
if (cancelled) return;
|
|
81
|
-
setNotice(`Could not capture a still from this clip
|
|
86
|
+
setNotice(`Could not capture a still from this clip, so generating without a reference.
|
|
82
87
|
|
|
83
88
|
${err instanceof Error ? err.message : String(err)}`.slice(0, 280));
|
|
84
89
|
}).finally(() => {
|
|
@@ -121,7 +126,7 @@ ${err instanceof Error ? err.message : String(err)}`.slice(0, 280));
|
|
|
121
126
|
const text = prompt.trim();
|
|
122
127
|
if (!text || busy || capturing) return;
|
|
123
128
|
if (!runAction) {
|
|
124
|
-
setNotice("Generation needs the host connector
|
|
129
|
+
setNotice("Generation needs the host connector, which this host has not wired up.");
|
|
125
130
|
return;
|
|
126
131
|
}
|
|
127
132
|
setBusy(true);
|
|
@@ -178,23 +183,23 @@ ${err instanceof Error ? err.message : String(err)}`.slice(0, 280));
|
|
|
178
183
|
});
|
|
179
184
|
};
|
|
180
185
|
const title = mode === "image" ? "Create image" : mode === "audio" ? "Create audio" : mode === "promo" ? "Marketing video" : restyle ? "Restyle this clip" : (item == null ? void 0 : item.type) === "video" ? "Continue this clip" : "Create video";
|
|
181
|
-
const hint = mode === "image" ? "Describe the image you want on this board." : mode === "audio" ? "Describe the audio you want on this board." : mode === "promo" ? (item == null ? void 0 : item.type) === "video" ? "This clip is the footage. Describe the promo you want cut from it." : "Describe the marketing video
|
|
186
|
+
const hint = mode === "image" ? "Describe the image you want on this board." : mode === "audio" ? "Describe the audio you want on this board." : mode === "promo" ? (item == null ? void 0 : item.type) === "video" ? "This clip is the footage. Describe the promo you want cut from it." : "Describe the marketing video: brand, offer, and who it is for." : restyle ? "This footage is the source. Describe how it should look after the restyle." : (item == null ? void 0 : item.type) === "video" ? "The new clip starts from a still of this video. Describe what happens next." : (item == null ? void 0 : item.type) === "image" ? "This image is the reference. Describe the motion you want." : "Describe the video you want on this board.";
|
|
182
187
|
const stageIcon = mode === "image" ? "image-outline" : mode === "audio" ? "microphone-outline" : mode === "promo" ? "bullhorn-outline" : "video-outline";
|
|
183
188
|
return /* @__PURE__ */ jsxs(KeyboardAwareScreen, { style: styles.root, testID: "media-generator", children: [
|
|
184
189
|
/* @__PURE__ */ jsxs(View, { style: styles.header, children: [
|
|
185
190
|
/* @__PURE__ */ jsx(Pressable, { onPress: () => {
|
|
186
191
|
dismissKeyboard();
|
|
187
192
|
onClose();
|
|
188
|
-
}, hitSlop:
|
|
193
|
+
}, hitSlop: 4, style: ({
|
|
194
|
+
pressed
|
|
195
|
+
}) => [styles.headerButton, pressedStyle(pressed)], accessibilityRole: "button", accessibilityLabel: "Close", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "close", size: 20, color: theme.foreground }) }),
|
|
189
196
|
/* @__PURE__ */ jsx(Text, { style: styles.headerTitle, children: title }),
|
|
190
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
191
|
-
width: 22
|
|
192
|
-
} })
|
|
197
|
+
/* @__PURE__ */ jsx(View, { style: styles.headerSpacer })
|
|
193
198
|
] }),
|
|
194
|
-
/* @__PURE__ */ jsxs(Pressable, { style: styles.stage, onPress: dismissKeyboard, accessible: false, children: [
|
|
199
|
+
/* @__PURE__ */ jsxs(Pressable, { style: [styles.stage, mode === "promo" && styles.stageCompact], onPress: dismissKeyboard, accessible: false, children: [
|
|
195
200
|
referenceUrl ? /* @__PURE__ */ jsx(Image, { source: {
|
|
196
201
|
uri: referenceUrl
|
|
197
|
-
}, style: StyleSheet.absoluteFill, contentFit: "contain" }) : /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: stageIcon, size:
|
|
202
|
+
}, style: StyleSheet.absoluteFill, contentFit: "contain" }) : /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: stageIcon, size: 48, color: "rgba(255,255,255,0.22)" }),
|
|
198
203
|
(busy || capturing) && /* @__PURE__ */ jsxs(View, { style: styles.busyVeil, children: [
|
|
199
204
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: "#F7F7FA" }),
|
|
200
205
|
/* @__PURE__ */ jsx(Text, { style: styles.busyLabel, children: capturing ? "Capturing frame\u2026" : promoProgress || `Generating ${mode === "promo" ? "promo" : mode}\u2026` })
|
|
@@ -206,51 +211,93 @@ ${err instanceof Error ? err.message : String(err)}`.slice(0, 280));
|
|
|
206
211
|
frameSec.toFixed(1),
|
|
207
212
|
"s"
|
|
208
213
|
] }),
|
|
209
|
-
/* @__PURE__ */ jsx(View, { style: styles.aspectRow, children: [0.5, 1, 2, 3, 5].map((sec) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setFrameSec(sec), style:
|
|
214
|
+
/* @__PURE__ */ jsx(View, { style: styles.aspectRow, children: [0.5, 1, 2, 3, 5].map((sec) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setFrameSec(sec), style: ({
|
|
215
|
+
pressed
|
|
216
|
+
}) => [styles.chip, frameSec === sec && styles.chipOn, pressedStyle(pressed)], children: /* @__PURE__ */ jsxs(Text, { style: [styles.chipLabel, frameSec === sec && styles.chipLabelOn], children: [
|
|
210
217
|
sec,
|
|
211
218
|
"s"
|
|
212
219
|
] }) }, sec)) })
|
|
213
220
|
] }) : null,
|
|
214
221
|
keyboardOpen ? null : /* @__PURE__ */ jsx(Pressable, { onPress: dismissKeyboard, accessible: false, children: /* @__PURE__ */ jsx(Text, { style: styles.hint, children: hint }) }),
|
|
215
|
-
mode === "promo" && !keyboardOpen ?
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
222
|
+
mode === "promo" && !keyboardOpen ? (
|
|
223
|
+
// Promo has many settings: they scroll in their own region, grouped and labelled,
|
|
224
|
+
// so the wall of chips becomes a short form.
|
|
225
|
+
/* @__PURE__ */ jsxs(ScrollView, { style: styles.promoScroll, contentContainerStyle: styles.promoBlock, keyboardShouldPersistTaps: "handled", children: [
|
|
226
|
+
/* @__PURE__ */ jsx(Text, { style: styles.groupLabel, children: "Format" }),
|
|
227
|
+
/* @__PURE__ */ jsx(ScrollView, { style: HSCROLL, horizontal: true, showsHorizontalScrollIndicator: false, contentContainerStyle: styles.railRow, children: PROMO_PRESETS.map((preset) => {
|
|
228
|
+
const on = promoPreset === preset.id;
|
|
229
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress: () => {
|
|
230
|
+
setPromoPreset(preset.id);
|
|
231
|
+
setPromoDuration(preset.defaultDurationSeconds);
|
|
232
|
+
setPromoNarration(defaultNarration(preset.id));
|
|
233
|
+
setPromoQuality(defaultPromoQuality(preset.id));
|
|
234
|
+
}, style: ({
|
|
235
|
+
pressed
|
|
236
|
+
}) => [styles.presetCard, on && styles.presetCardOn, pressedStyle(pressed)], accessibilityRole: "button", accessibilityState: {
|
|
237
|
+
selected: on
|
|
238
|
+
}, children: [
|
|
239
|
+
/* @__PURE__ */ jsxs(View, { style: styles.presetHead, children: [
|
|
240
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.presetName, on && styles.presetNameOn], numberOfLines: 1, children: preset.name }),
|
|
241
|
+
on ? /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "check-circle", size: 16, color: theme.background }) : null
|
|
242
|
+
] }),
|
|
243
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.presetDesc, on && styles.presetDescOn], numberOfLines: 3, children: preset.description })
|
|
244
|
+
] }, preset.id);
|
|
245
|
+
}) }),
|
|
246
|
+
/* @__PURE__ */ jsx(View, { style: styles.groupRow, children: /* @__PURE__ */ jsxs(View, { style: styles.groupCol, children: [
|
|
247
|
+
/* @__PURE__ */ jsx(Text, { style: styles.groupLabel, children: "Length" }),
|
|
248
|
+
/* @__PURE__ */ jsx(Segmented, { options: PROMO_DURATIONS.map((secs) => ({
|
|
249
|
+
id: String(secs),
|
|
250
|
+
label: `${secs}s`
|
|
251
|
+
})), value: String(promoDuration), onChange: (id) => setPromoDuration(Number(id)), style: styles.padded })
|
|
252
|
+
] }) }),
|
|
253
|
+
/* @__PURE__ */ jsx(Text, { style: styles.groupLabel, children: "Style" }),
|
|
254
|
+
/* @__PURE__ */ jsx(ScrollView, { style: HSCROLL, horizontal: true, showsHorizontalScrollIndicator: false, contentContainerStyle: styles.railRow, children: PROMO_PLAYBOOKS.map((p) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setPromoPlaybook(p.id), style: ({
|
|
255
|
+
pressed
|
|
256
|
+
}) => [styles.chip, promoPlaybook === p.id && styles.chipOn, pressedStyle(pressed)], accessibilityRole: "button", children: /* @__PURE__ */ jsx(Text, { style: [styles.chipLabel, promoPlaybook === p.id && styles.chipLabelOn], children: p.name }) }, p.id || "default")) }),
|
|
257
|
+
/* @__PURE__ */ jsx(Text, { style: styles.groupLabel, children: "Extras" }),
|
|
258
|
+
/* @__PURE__ */ jsx(View, { style: styles.railRowWrap, children: [["Captions", promoCaptions, () => setPromoCaptions((v) => !v)], ["Narration", promoNarration, () => setPromoNarration((v) => !v)]].map(([label, on, toggle]) => /* @__PURE__ */ jsxs(Pressable, { onPress: toggle, style: ({
|
|
259
|
+
pressed
|
|
260
|
+
}) => [styles.chip, styles.toggleChip, on && styles.chipOn, pressedStyle(pressed)], accessibilityRole: "switch", accessibilityState: {
|
|
261
|
+
checked: on
|
|
262
|
+
}, children: [
|
|
263
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: on ? "check" : "plus", size: 16, color: on ? theme.background : theme.mutedForeground }),
|
|
264
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.chipLabel, on && styles.chipLabelOn], children: label })
|
|
265
|
+
] }, label)) }),
|
|
266
|
+
/* @__PURE__ */ jsxs(View, { style: styles.promoFields, children: [
|
|
267
|
+
/* @__PURE__ */ jsx(PromoContextFields, { value: promoContext, onChange: (patch) => setPromoContext((prev) => __spreadValues(__spreadValues({}, prev), patch)), logoUrl: promoLogoUrl, onPickLogo: (item == null ? void 0 : item.type) === "image" ? () => setPromoLogoUrl(unwrapProxyUrl(item.src)) : void 0, onClearLogo: () => setPromoLogoUrl(null) }),
|
|
268
|
+
/* @__PURE__ */ jsx(PromoProductionFields, __spreadValues({ quality: promoQuality, onQuality: setPromoQuality, narrator: promoNarrator, onNarrator: setPromoNarrator, useCases: promoUseCases, onUseCases: setPromoUseCases }, onPromoDesigned && !lookupPromoPreset(promoPreset).produceOnly ? {
|
|
269
|
+
designModel: promoDesignModel,
|
|
270
|
+
onDesignModel: setPromoDesignModel
|
|
271
|
+
} : {}))
|
|
272
|
+
] })
|
|
273
|
+
] })
|
|
274
|
+
) : null,
|
|
275
|
+
mode !== "promo" && models.length > 0 && !keyboardOpen ? /* @__PURE__ */ jsx(ScrollView, { style: HSCROLL, horizontal: true, showsHorizontalScrollIndicator: false, contentContainerStyle: styles.aspectRow, children: models.map((model) => {
|
|
238
276
|
const blocked = Boolean(videoSourceUrl) && !model.supportsVideoInput;
|
|
239
|
-
return /* @__PURE__ */ jsx(Pressable, { onPress: () => !blocked && setSelectedModel(model.id), disabled: blocked, style:
|
|
277
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress: () => !blocked && setSelectedModel(model.id), disabled: blocked, style: ({
|
|
278
|
+
pressed
|
|
279
|
+
}) => [styles.chip, selectedModel === model.id && styles.chipOn, blocked && styles.chipBlocked, pressedStyle(pressed && !blocked)], accessibilityRole: "button", children: /* @__PURE__ */ jsx(Text, { style: [styles.chipLabel, selectedModel === model.id && styles.chipLabelOn, blocked && styles.chipLabelBlocked], numberOfLines: 1, children: model.label || model.id }) }, model.id);
|
|
240
280
|
}) }) : null,
|
|
241
281
|
mode === "video" && durationChoices.length > 0 && !keyboardOpen ? /* @__PURE__ */ jsxs(View, { style: styles.aspectRow, children: [
|
|
242
|
-
/* @__PURE__ */ jsx(Pressable, { onPress: () => setVideoDuration(0), style:
|
|
243
|
-
|
|
282
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: () => setVideoDuration(0), style: ({
|
|
283
|
+
pressed
|
|
284
|
+
}) => [styles.chip, videoDuration === 0 && styles.chipOn, pressedStyle(pressed)], accessibilityRole: "button", children: /* @__PURE__ */ jsx(Text, { style: [styles.chipLabel, videoDuration === 0 && styles.chipLabelOn], children: (selectedModelInfo == null ? void 0 : selectedModelInfo.defaultDurationSeconds) ? `Auto (${selectedModelInfo.defaultDurationSeconds}s)` : "Auto" }) }),
|
|
285
|
+
durationChoices.map((secs) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setVideoDuration(secs), style: ({
|
|
286
|
+
pressed
|
|
287
|
+
}) => [styles.chip, videoDuration === secs && styles.chipOn, pressedStyle(pressed)], accessibilityRole: "button", children: /* @__PURE__ */ jsxs(Text, { style: [styles.chipLabel, videoDuration === secs && styles.chipLabelOn], children: [
|
|
244
288
|
secs,
|
|
245
289
|
"s"
|
|
246
290
|
] }) }, secs))
|
|
247
291
|
] }) : null,
|
|
248
|
-
mode !== "audio" ? /* @__PURE__ */ jsx(View, { style: styles.
|
|
292
|
+
mode !== "audio" ? /* @__PURE__ */ jsx(View, { style: styles.segmentRow, children: /* @__PURE__ */ jsx(Segmented, { options: (mode === "promo" ? PROMO_ASPECT_RATIOS : ASPECTS).map((value) => ({
|
|
293
|
+
id: value,
|
|
294
|
+
label: value
|
|
295
|
+
})), value: aspect, onChange: (value) => setAspect(value), style: styles.segmented }) }) : null,
|
|
249
296
|
/* @__PURE__ */ jsx(KeyboardComposerDock, { closedInset: insets.bottom, onSwipeUp: () => {
|
|
250
297
|
var _a;
|
|
251
298
|
return (_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
252
|
-
}, children: /* @__PURE__ */
|
|
253
|
-
/* @__PURE__ */ jsx(TextInput, { ref: inputRef, nativeID: COMPOSER_INPUT_NATIVE_ID, value: prompt, onChangeText: setPrompt, placeholder: mode === "image" ? "Describe the image\u2026" : mode === "audio" ? "Describe the audio\u2026" : mode === "promo" ? "Describe the promo\u2026" : "Describe the video\u2026", placeholderTextColor:
|
|
299
|
+
}, children: /* @__PURE__ */ jsx(View, { style: styles.composer, children: /* @__PURE__ */ jsxs(View, { style: styles.composerField, children: [
|
|
300
|
+
/* @__PURE__ */ jsx(TextInput, { ref: inputRef, nativeID: COMPOSER_INPUT_NATIVE_ID, value: prompt, onChangeText: setPrompt, placeholder: mode === "image" ? "Describe the image\u2026" : mode === "audio" ? "Describe the audio\u2026" : mode === "promo" ? "Describe the promo\u2026" : "Describe the video\u2026", placeholderTextColor: theme.mutedForeground, style: styles.input, multiline: true, editable: !busy }),
|
|
254
301
|
mode === "promo" && onPromoDesigned && !lookupPromoPreset(promoPreset).produceOnly ? /* @__PURE__ */ jsx(Pressable, { onPress: () => {
|
|
255
302
|
if (!runAction || busy || !prompt.trim()) return;
|
|
256
303
|
setBusy(true);
|
|
@@ -271,163 +318,269 @@ ${err instanceof Error ? err.message : String(err)}`.slice(0, 280));
|
|
|
271
318
|
} : {}), promoDesignModel ? {
|
|
272
319
|
model: promoDesignModel
|
|
273
320
|
} : {})).then((designed) => onPromoDesigned(designed)).catch((err) => setNotice(friendlyMediaError(err, "promo design"))).finally(() => setBusy(false));
|
|
274
|
-
}, disabled: busy || capturing || !prompt.trim(), style:
|
|
275
|
-
|
|
276
|
-
|
|
321
|
+
}, disabled: busy || capturing || !prompt.trim(), style: ({
|
|
322
|
+
pressed
|
|
323
|
+
}) => [styles.designSend, (!prompt.trim() || busy || capturing) && styles.sendDisabled, pressedStyle(pressed && !busy)], accessibilityRole: "button", accessibilityLabel: "Design editable cut", children: /* @__PURE__ */ jsx(Text, { style: styles.designSendLabel, children: "Design" }) }) : null,
|
|
324
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: generate, disabled: busy || capturing || !prompt.trim(), style: ({
|
|
325
|
+
pressed
|
|
326
|
+
}) => [styles.send, (!prompt.trim() || busy || capturing) && styles.sendDisabled, pressedStyle(pressed && !busy)], accessibilityRole: "button", accessibilityLabel: `Generate ${mode}`, children: busy ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.primaryForeground }) : /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "arrow-up", size: 20, color: theme.primaryForeground }) })
|
|
327
|
+
] }) }) }),
|
|
277
328
|
notice ? /* @__PURE__ */ jsxs(View, { style: styles.notice, children: [
|
|
278
329
|
/* @__PURE__ */ jsx(Text, { style: styles.noticeText, children: notice }),
|
|
279
330
|
/* @__PURE__ */ jsx(Pressable, { onPress: () => setNotice(null), hitSlop: 8, children: /* @__PURE__ */ jsx(Text, { style: styles.noticeDismiss, children: "OK" }) })
|
|
280
331
|
] }) : null
|
|
281
332
|
] });
|
|
282
333
|
}
|
|
283
|
-
const
|
|
334
|
+
const makeStyles = themedStyles((theme) => StyleSheet.create({
|
|
284
335
|
root: {
|
|
285
336
|
flex: 1,
|
|
286
|
-
backgroundColor:
|
|
337
|
+
backgroundColor: theme.background
|
|
287
338
|
},
|
|
288
339
|
header: {
|
|
289
340
|
flexDirection: "row",
|
|
290
341
|
alignItems: "center",
|
|
291
342
|
justifyContent: "space-between",
|
|
292
|
-
paddingHorizontal:
|
|
293
|
-
paddingVertical:
|
|
343
|
+
paddingHorizontal: SPACE.md,
|
|
344
|
+
paddingVertical: SPACE.sm
|
|
294
345
|
},
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
346
|
+
headerButton: {
|
|
347
|
+
width: 40,
|
|
348
|
+
height: 40,
|
|
349
|
+
borderRadius: 20,
|
|
350
|
+
alignItems: "center",
|
|
351
|
+
justifyContent: "center",
|
|
352
|
+
backgroundColor: theme.card
|
|
353
|
+
},
|
|
354
|
+
headerSpacer: {
|
|
355
|
+
width: 40
|
|
299
356
|
},
|
|
357
|
+
headerTitle: __spreadProps(__spreadValues({}, TYPE.title), {
|
|
358
|
+
color: theme.foreground
|
|
359
|
+
}),
|
|
300
360
|
stage: {
|
|
301
361
|
flex: 1,
|
|
302
|
-
marginHorizontal:
|
|
303
|
-
|
|
304
|
-
|
|
362
|
+
marginHorizontal: SPACE.lg,
|
|
363
|
+
marginTop: SPACE.xs,
|
|
364
|
+
borderRadius: RADIUS.xl,
|
|
365
|
+
backgroundColor: "#0F0F12",
|
|
366
|
+
// media stage stays dark
|
|
305
367
|
overflow: "hidden",
|
|
306
368
|
alignItems: "center",
|
|
307
369
|
justifyContent: "center"
|
|
308
370
|
},
|
|
371
|
+
// Promo's settings need the height; its stage is a strip that still shows a reference or progress.
|
|
372
|
+
stageCompact: {
|
|
373
|
+
flex: 0,
|
|
374
|
+
height: 120
|
|
375
|
+
},
|
|
376
|
+
promoScroll: {
|
|
377
|
+
flex: 1
|
|
378
|
+
},
|
|
379
|
+
groupLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
380
|
+
color: theme.mutedForeground,
|
|
381
|
+
paddingHorizontal: SPACE.lg,
|
|
382
|
+
marginTop: SPACE.lg,
|
|
383
|
+
marginBottom: SPACE.sm
|
|
384
|
+
}),
|
|
385
|
+
groupRow: {
|
|
386
|
+
flexDirection: "row"
|
|
387
|
+
},
|
|
388
|
+
groupCol: {
|
|
389
|
+
flex: 1
|
|
390
|
+
},
|
|
391
|
+
padded: {
|
|
392
|
+
marginHorizontal: SPACE.lg
|
|
393
|
+
},
|
|
394
|
+
railRow: {
|
|
395
|
+
paddingHorizontal: SPACE.lg,
|
|
396
|
+
gap: SPACE.sm
|
|
397
|
+
},
|
|
398
|
+
railRowWrap: {
|
|
399
|
+
flexDirection: "row",
|
|
400
|
+
flexWrap: "wrap",
|
|
401
|
+
gap: SPACE.sm,
|
|
402
|
+
paddingHorizontal: SPACE.lg
|
|
403
|
+
},
|
|
404
|
+
toggleChip: {
|
|
405
|
+
flexDirection: "row",
|
|
406
|
+
alignItems: "center",
|
|
407
|
+
gap: SPACE.xs + 2
|
|
408
|
+
},
|
|
409
|
+
presetCard: {
|
|
410
|
+
width: 176,
|
|
411
|
+
minHeight: 96,
|
|
412
|
+
padding: SPACE.md,
|
|
413
|
+
borderRadius: RADIUS.lg,
|
|
414
|
+
backgroundColor: theme.card,
|
|
415
|
+
gap: SPACE.xs
|
|
416
|
+
},
|
|
417
|
+
presetCardOn: {
|
|
418
|
+
backgroundColor: theme.foreground
|
|
419
|
+
},
|
|
420
|
+
presetHead: {
|
|
421
|
+
flexDirection: "row",
|
|
422
|
+
alignItems: "center",
|
|
423
|
+
justifyContent: "space-between",
|
|
424
|
+
gap: SPACE.xs
|
|
425
|
+
},
|
|
426
|
+
presetName: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
427
|
+
fontSize: 14,
|
|
428
|
+
color: theme.foreground,
|
|
429
|
+
flexShrink: 1
|
|
430
|
+
}),
|
|
431
|
+
presetNameOn: {
|
|
432
|
+
color: theme.background
|
|
433
|
+
},
|
|
434
|
+
presetDesc: __spreadProps(__spreadValues({}, TYPE.caption), {
|
|
435
|
+
fontWeight: "400",
|
|
436
|
+
lineHeight: 16,
|
|
437
|
+
color: theme.mutedForeground
|
|
438
|
+
}),
|
|
439
|
+
presetDescOn: {
|
|
440
|
+
color: theme.isDark ? "#3f3f46" : "#d4d4d8"
|
|
441
|
+
},
|
|
442
|
+
promoFields: {
|
|
443
|
+
paddingHorizontal: SPACE.lg,
|
|
444
|
+
paddingTop: SPACE.lg,
|
|
445
|
+
paddingBottom: SPACE.xl
|
|
446
|
+
},
|
|
309
447
|
busyVeil: __spreadProps(__spreadValues({}, StyleSheet.absoluteFillObject), {
|
|
310
448
|
alignItems: "center",
|
|
311
449
|
justifyContent: "center",
|
|
312
|
-
gap:
|
|
450
|
+
gap: SPACE.md,
|
|
313
451
|
backgroundColor: "rgba(10, 10, 12, 0.55)"
|
|
314
452
|
}),
|
|
315
|
-
busyLabel: {
|
|
316
|
-
color: "#
|
|
317
|
-
|
|
318
|
-
},
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
paddingHorizontal:
|
|
323
|
-
paddingTop:
|
|
324
|
-
},
|
|
453
|
+
busyLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
454
|
+
color: "#fafafa"
|
|
455
|
+
}),
|
|
456
|
+
hint: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
457
|
+
fontSize: 14,
|
|
458
|
+
lineHeight: 20,
|
|
459
|
+
color: theme.mutedForeground,
|
|
460
|
+
paddingHorizontal: SPACE.xl - 4,
|
|
461
|
+
paddingTop: SPACE.md + 2
|
|
462
|
+
}),
|
|
325
463
|
frameScrub: {
|
|
326
|
-
paddingTop:
|
|
327
|
-
gap:
|
|
328
|
-
},
|
|
329
|
-
frameScrubLabel: {
|
|
330
|
-
color: "#9A9AA5",
|
|
331
|
-
fontSize: 11,
|
|
332
|
-
paddingHorizontal: 18
|
|
464
|
+
paddingTop: SPACE.md,
|
|
465
|
+
gap: SPACE.xs
|
|
333
466
|
},
|
|
467
|
+
frameScrubLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
468
|
+
color: theme.foreground,
|
|
469
|
+
paddingHorizontal: SPACE.lg
|
|
470
|
+
}),
|
|
334
471
|
promoBlock: {
|
|
335
|
-
|
|
472
|
+
paddingBottom: SPACE.lg
|
|
336
473
|
},
|
|
337
474
|
aspectRow: {
|
|
338
475
|
flexDirection: "row",
|
|
339
476
|
flexWrap: "wrap",
|
|
340
|
-
gap:
|
|
341
|
-
paddingHorizontal:
|
|
342
|
-
paddingTop:
|
|
477
|
+
gap: SPACE.sm - 2,
|
|
478
|
+
paddingHorizontal: SPACE.lg,
|
|
479
|
+
paddingTop: SPACE.md - 2
|
|
480
|
+
},
|
|
481
|
+
segmentRow: {
|
|
482
|
+
paddingHorizontal: SPACE.lg,
|
|
483
|
+
paddingTop: SPACE.md
|
|
484
|
+
},
|
|
485
|
+
segmented: {
|
|
486
|
+
flexGrow: 0,
|
|
487
|
+
alignSelf: "flex-start"
|
|
343
488
|
},
|
|
344
489
|
chip: {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
490
|
+
minHeight: 36,
|
|
491
|
+
justifyContent: "center",
|
|
492
|
+
paddingHorizontal: SPACE.md + 2,
|
|
493
|
+
borderRadius: RADIUS.pill,
|
|
494
|
+
backgroundColor: theme.card
|
|
349
495
|
},
|
|
350
496
|
chipOn: {
|
|
351
|
-
backgroundColor:
|
|
497
|
+
backgroundColor: theme.foreground
|
|
352
498
|
},
|
|
353
499
|
chipBlocked: {
|
|
354
500
|
opacity: 0.4
|
|
355
501
|
},
|
|
356
|
-
chipLabel: {
|
|
357
|
-
color:
|
|
358
|
-
|
|
359
|
-
fontWeight: "500"
|
|
360
|
-
},
|
|
502
|
+
chipLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
503
|
+
color: theme.foreground
|
|
504
|
+
}),
|
|
361
505
|
chipLabelOn: {
|
|
362
|
-
color:
|
|
506
|
+
color: theme.background
|
|
363
507
|
},
|
|
364
508
|
chipLabelBlocked: {
|
|
365
|
-
color:
|
|
509
|
+
color: theme.mutedForeground
|
|
366
510
|
},
|
|
511
|
+
// The keyboard dock does not stretch its child: without a width the row collapses to the send button.
|
|
367
512
|
composer: {
|
|
513
|
+
alignSelf: "stretch",
|
|
514
|
+
width: "100%",
|
|
515
|
+
paddingHorizontal: SPACE.lg,
|
|
516
|
+
paddingTop: SPACE.md,
|
|
517
|
+
paddingBottom: SPACE.sm
|
|
518
|
+
},
|
|
519
|
+
composerField: {
|
|
368
520
|
flexDirection: "row",
|
|
369
521
|
alignItems: "flex-end",
|
|
370
|
-
gap:
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
522
|
+
gap: SPACE.sm,
|
|
523
|
+
minHeight: 56,
|
|
524
|
+
paddingLeft: SPACE.lg,
|
|
525
|
+
paddingRight: SPACE.sm - 2,
|
|
526
|
+
paddingVertical: SPACE.sm - 2,
|
|
527
|
+
borderRadius: RADIUS.xl,
|
|
528
|
+
backgroundColor: theme.card,
|
|
529
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
530
|
+
borderColor: theme.border
|
|
374
531
|
},
|
|
375
532
|
input: {
|
|
376
533
|
flex: 1,
|
|
377
|
-
minHeight:
|
|
378
|
-
maxHeight:
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
fontSize: 15
|
|
534
|
+
minHeight: HIT,
|
|
535
|
+
maxHeight: 132,
|
|
536
|
+
paddingTop: SPACE.md - 1,
|
|
537
|
+
paddingBottom: SPACE.md - 1,
|
|
538
|
+
color: theme.foreground,
|
|
539
|
+
fontSize: 15,
|
|
540
|
+
lineHeight: 21
|
|
385
541
|
},
|
|
386
542
|
send: {
|
|
387
|
-
width:
|
|
388
|
-
height:
|
|
389
|
-
borderRadius:
|
|
390
|
-
backgroundColor:
|
|
543
|
+
width: HIT,
|
|
544
|
+
height: HIT,
|
|
545
|
+
borderRadius: HIT / 2,
|
|
546
|
+
backgroundColor: theme.primary,
|
|
391
547
|
alignItems: "center",
|
|
392
548
|
justifyContent: "center"
|
|
393
549
|
},
|
|
394
550
|
designSend: {
|
|
395
|
-
paddingHorizontal:
|
|
396
|
-
height:
|
|
397
|
-
borderRadius:
|
|
398
|
-
backgroundColor:
|
|
551
|
+
paddingHorizontal: SPACE.md + 2,
|
|
552
|
+
height: HIT,
|
|
553
|
+
borderRadius: HIT / 2,
|
|
554
|
+
backgroundColor: theme.isDark ? theme.secondary : theme.surface,
|
|
399
555
|
alignItems: "center",
|
|
400
556
|
justifyContent: "center"
|
|
401
557
|
},
|
|
402
|
-
designSendLabel: {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
color: "#9a3412"
|
|
406
|
-
},
|
|
558
|
+
designSendLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
559
|
+
color: theme.foreground
|
|
560
|
+
}),
|
|
407
561
|
sendDisabled: {
|
|
408
562
|
opacity: 0.4
|
|
409
563
|
},
|
|
410
564
|
notice: {
|
|
411
565
|
position: "absolute",
|
|
412
|
-
left:
|
|
413
|
-
right:
|
|
414
|
-
bottom:
|
|
566
|
+
left: SPACE.lg,
|
|
567
|
+
right: SPACE.lg,
|
|
568
|
+
bottom: SPACE.xl,
|
|
415
569
|
flexDirection: "row",
|
|
416
570
|
alignItems: "center",
|
|
417
|
-
gap:
|
|
418
|
-
paddingHorizontal:
|
|
419
|
-
paddingVertical:
|
|
420
|
-
borderRadius:
|
|
421
|
-
backgroundColor:
|
|
571
|
+
gap: SPACE.md,
|
|
572
|
+
paddingHorizontal: SPACE.lg,
|
|
573
|
+
paddingVertical: SPACE.md,
|
|
574
|
+
borderRadius: RADIUS.lg,
|
|
575
|
+
backgroundColor: theme.foreground
|
|
422
576
|
},
|
|
423
|
-
noticeText: {
|
|
577
|
+
noticeText: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
578
|
+
fontSize: 14,
|
|
424
579
|
flex: 1,
|
|
425
|
-
color:
|
|
426
|
-
|
|
427
|
-
},
|
|
428
|
-
|
|
429
|
-
color:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
});export{VideoGeneratorExperience};//# sourceMappingURL=VideoGeneratorExperience.js.map
|
|
580
|
+
color: theme.background
|
|
581
|
+
}),
|
|
582
|
+
noticeDismiss: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
583
|
+
fontSize: 14,
|
|
584
|
+
color: theme.background
|
|
585
|
+
})
|
|
586
|
+
}));export{VideoGeneratorExperience};//# sourceMappingURL=VideoGeneratorExperience.js.map
|