@adminide-stack/yantra-mobile 12.0.125-alpha.1 → 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,Fragment}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useMemo,useState,useRef,useEffect}from'react';import {View,ScrollView,Text,TextInput,ActivityIndicator,StyleSheet}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {resultUrl,friendlyMediaError,generationImageUrl,generationMediaUrl}from'./videoEditor/mediaActions.js';import {unwrapProxyUrl}from'./videoEditor/remoteMediaClient.js';import {STATIC_IMAGE_MODELS,normalizeModels,promptAudioModels,STATIC_VIDEO_MODELS,generationCapabilities,videoReferenceCap,modelThatReadsImages,videoDurationOptions,buildVideoGenerateParams}from'./generationModels.js';import {MAX_REFERENCE_IMAGES,PROMO_MAX_REFERENCES,addReference,imageLaneCall}from'./generatorReferences.js';import {modelForCommand,parseCommandLine,matchCommands,laneForCommand,findCommand,missingFor,MISSING_LABEL,VIDEO_INPUT_MODEL,commandPrompt}from'./generatorCommands.js';import {ReferenceStrip,StillRoleSwitch,FrameSlot}from'./GeneratorReferenceSlots.js';import {CanvasTemplatesPanel}from'./CanvasTemplatesPanel.js';import {nearestAspect}from'./studioLooks.js';import {ensureFetchableMediaUrls,ensureFetchableMediaUrl}from'./mediaUrls.js';import {DEFAULT_PROMO_PRESET,EMPTY_PROMO_CONTEXT,defaultPromoQuality,PROMO_PRESETS,PROMO_DURATIONS,PROMO_ASPECT_RATIOS,PROMO_PLAYBOOKS,lookupPromoPreset,designPromoProject,PROMO_CONNECTOR}from'./promoVideo.js';import {PromoContextFields,PromoProductionFields}from'./PromoContextFields.js';import {startPromoTask}from'./canvasTasks.js';import {CLIP_COUNT_CHOICES,CLIP_ASPECT_RATIOS,CLIP_RESOLUTIONS,buildClipRunParams,parseClipRunResult}from'./videoClips.js';import {NativeDictationBar}from'../audio-input/NativeDictationBar.js';import {useCanvasTheme,themedStyles}from'./canvasTheme.js';import {Segmented,Pressable,pressedStyle,SPACE,RADIUS,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;
|
|
@@ -55,6 +55,8 @@ function CanvasGeneratePanel({
|
|
|
55
55
|
onPromoQueued,
|
|
56
56
|
pickStill
|
|
57
57
|
}) {
|
|
58
|
+
const theme = useCanvasTheme();
|
|
59
|
+
const styles = useMemo(() => makeStyles(theme), [theme]);
|
|
58
60
|
const [mode, setMode] = useState("image");
|
|
59
61
|
const [prompt, setPrompt] = useState("");
|
|
60
62
|
const [aspect, setAspect] = useState("16:9");
|
|
@@ -208,7 +210,7 @@ function CanvasGeneratePanel({
|
|
|
208
210
|
return;
|
|
209
211
|
}
|
|
210
212
|
if (!runAction) {
|
|
211
|
-
setNotice("Generation needs the host connector
|
|
213
|
+
setNotice("Generation needs the host connector, which this host has not wired up.");
|
|
212
214
|
return;
|
|
213
215
|
}
|
|
214
216
|
if (mode === "clips") {
|
|
@@ -245,7 +247,7 @@ function CanvasGeneratePanel({
|
|
|
245
247
|
if (lane !== mode) {
|
|
246
248
|
pendingCommand.current = cmd;
|
|
247
249
|
switchMode(lane);
|
|
248
|
-
setNotice(`Switched to ${lane} for ${cmd.label}
|
|
250
|
+
setNotice(`Switched to ${lane} for ${cmd.label}. Check the inputs and press Generate.`);
|
|
249
251
|
return;
|
|
250
252
|
}
|
|
251
253
|
const missing = missingFor(cmd, lane, has);
|
|
@@ -299,7 +301,7 @@ function CanvasGeneratePanel({
|
|
|
299
301
|
} : {})
|
|
300
302
|
}).then(() => {
|
|
301
303
|
onPromoQueued == null ? void 0 : onPromoQueued();
|
|
302
|
-
setNotice("Production queued
|
|
304
|
+
setNotice("Production queued. Track it under More > Tasks");
|
|
303
305
|
return "";
|
|
304
306
|
}) : (async () => {
|
|
305
307
|
const first = startFrame && !footage && videoCaps.canStartFrame ? await ensureFetchableMediaUrl(runAction, startFrame) : void 0;
|
|
@@ -330,49 +332,53 @@ function CanvasGeneratePanel({
|
|
|
330
332
|
const canGo = mode === "slides" || mode === "clips" ? clipUrl.trim().length > 0 || mode === "slides" : prompt.trim().length > 0;
|
|
331
333
|
return /* @__PURE__ */ jsxs(View, { style: styles.root, children: [
|
|
332
334
|
/* @__PURE__ */ jsxs(ScrollView, { keyboardShouldPersistTaps: "handled", contentContainerStyle: styles.body, children: [
|
|
333
|
-
/* @__PURE__ */ jsx(
|
|
334
|
-
const on = mode === tab.id;
|
|
335
|
-
return /* @__PURE__ */ jsxs(Pressable, { onPress: () => switchMode(tab.id), style: [styles.tab, on && styles.tabOn], children: [
|
|
336
|
-
on ? /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: tab.icon, size: 14, color: "#9a3412" }) : null,
|
|
337
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.tabLabel, on && styles.tabLabelOn], children: tab.label })
|
|
338
|
-
] }, tab.id);
|
|
339
|
-
}) }),
|
|
335
|
+
/* @__PURE__ */ jsx(Segmented, { options: MODES, value: mode, onChange: switchMode, style: styles.tabs }),
|
|
340
336
|
mode === "video" && (seedItem == null ? void 0 : seedItem.type) === "video" && !restyle ? /* @__PURE__ */ jsxs(View, { style: styles.frameBox, children: [
|
|
341
337
|
/* @__PURE__ */ jsxs(Text, { style: styles.hint, children: [
|
|
342
338
|
"Continuation frame \xB7 ",
|
|
343
339
|
frameSec.toFixed(1),
|
|
344
340
|
"s"
|
|
345
341
|
] }),
|
|
346
|
-
/* @__PURE__ */ jsx(View, { style: styles.pills, children: [0.5, 1, 2, 3, 5].map((sec) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setFrameSec(sec), style:
|
|
342
|
+
/* @__PURE__ */ jsx(View, { style: styles.pills, children: [0.5, 1, 2, 3, 5].map((sec) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setFrameSec(sec), style: ({
|
|
343
|
+
pressed
|
|
344
|
+
}) => [styles.pill, frameSec === sec && styles.pillOn, pressedStyle(pressed)], children: /* @__PURE__ */ jsxs(Text, { style: [styles.pillLabel, frameSec === sec && styles.pillLabelOn], children: [
|
|
347
345
|
sec,
|
|
348
346
|
"s"
|
|
349
347
|
] }) }, sec)) })
|
|
350
348
|
] }) : null,
|
|
351
349
|
mode === "image" || mode === "video" || mode === "audio" ? /* @__PURE__ */ jsxs(View, { style: styles.pills, children: [
|
|
352
|
-
/* @__PURE__ */ jsxs(Pressable, { onPress: () => setShowModels((v) => !v), style:
|
|
353
|
-
|
|
350
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: () => setShowModels((v) => !v), style: ({
|
|
351
|
+
pressed
|
|
352
|
+
}) => [styles.pill, pressedStyle(pressed)], children: [
|
|
353
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "auto-fix", size: 14, color: theme.mutedForeground }),
|
|
354
354
|
/* @__PURE__ */ jsx(Text, { style: styles.pillLabel, numberOfLines: 1, children: (modelInfo == null ? void 0 : modelInfo.label) || selectedModel || "Model\u2026" }),
|
|
355
|
-
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-down", size: 14, color:
|
|
355
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-down", size: 14, color: theme.mutedForeground })
|
|
356
356
|
] }),
|
|
357
357
|
mode !== "audio" ? /* @__PURE__ */ jsxs(Pressable, { onPress: () => {
|
|
358
358
|
const i = aspectChoices.indexOf(aspect);
|
|
359
359
|
setAspect(aspectChoices[(i < 0 ? 0 : i + 1) % aspectChoices.length]);
|
|
360
|
-
}, style:
|
|
361
|
-
|
|
360
|
+
}, style: ({
|
|
361
|
+
pressed
|
|
362
|
+
}) => [styles.pill, pressedStyle(pressed)], children: [
|
|
363
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "rectangle-outline", size: 14, color: theme.mutedForeground }),
|
|
362
364
|
/* @__PURE__ */ jsx(Text, { style: styles.pillLabel, children: aspect }),
|
|
363
|
-
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-down", size: 14, color:
|
|
365
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-down", size: 14, color: theme.mutedForeground })
|
|
364
366
|
] }) : null,
|
|
365
367
|
durations.length > 0 ? /* @__PURE__ */ jsxs(Pressable, { onPress: () => {
|
|
366
368
|
const opts = [0, ...durations];
|
|
367
369
|
const i = opts.indexOf(videoDuration);
|
|
368
370
|
setVideoDuration(opts[(i + 1) % opts.length]);
|
|
369
|
-
}, style:
|
|
370
|
-
|
|
371
|
+
}, style: ({
|
|
372
|
+
pressed
|
|
373
|
+
}) => [styles.pill, pressedStyle(pressed)], children: [
|
|
374
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "clock-outline", size: 14, color: theme.mutedForeground }),
|
|
371
375
|
/* @__PURE__ */ jsx(Text, { style: styles.pillLabel, children: videoDuration ? `${videoDuration}s` : "Auto" })
|
|
372
376
|
] }) : null,
|
|
373
|
-
/* @__PURE__ */ jsxs(Pressable, { onPress: () => setTemplatesOpen((v) => !v), style:
|
|
374
|
-
|
|
375
|
-
|
|
377
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: () => setTemplatesOpen((v) => !v), style: ({
|
|
378
|
+
pressed
|
|
379
|
+
}) => [styles.pill, templatesOpen && styles.pillOn, pressedStyle(pressed)], accessibilityRole: "button", accessibilityLabel: "Browse prompt templates", children: [
|
|
380
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "view-grid-outline", size: 14, color: templatesOpen ? theme.background : theme.foreground }),
|
|
381
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.pillLabel, templatesOpen && styles.pillLabelOn], children: "Templates" })
|
|
376
382
|
] })
|
|
377
383
|
] }) : null,
|
|
378
384
|
templatesOpen && (mode === "image" || mode === "video" || mode === "audio") ? /* @__PURE__ */ jsx(CanvasTemplatesPanel, { open: true, runAction, defaultLane: mode, onPick: (template) => {
|
|
@@ -392,25 +398,37 @@ function CanvasGeneratePanel({
|
|
|
392
398
|
videoCaps.canStartFrame ? /* @__PURE__ */ jsx(FrameSlot, { label: "First frame", dot: "#10b981", url: startFrame, busy: picking === "startFrame", onPick: pickInto("startFrame"), onClear: () => setStartFrame(null) }) : null,
|
|
393
399
|
videoCaps.canEndFrame ? /* @__PURE__ */ jsx(FrameSlot, { label: "Last frame", dot: "#f43f5e", url: endFrame, busy: picking === "endFrame", onPick: pickInto("endFrame"), onClear: () => setEndFrame(null) }) : null
|
|
394
400
|
] }),
|
|
395
|
-
/* @__PURE__ */ jsx(ReferenceStrip, { label: "Other references", hint: "Keep a look, character or product
|
|
401
|
+
/* @__PURE__ */ jsx(ReferenceStrip, { label: "Other references", hint: "Keep a look, character or product, without opening on it", urls: videoRefs.slice(0, refCap), cap: refCap, busy: picking === "videoReference", onPick: pickInto("videoReference"), onRemove: (url) => setVideoRefs((p) => p.filter((u) => u !== url)) })
|
|
396
402
|
] }) : null,
|
|
397
|
-
showModels && models.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles.menu, children: models.map((m) => /* @__PURE__ */
|
|
403
|
+
showModels && models.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles.menu, children: models.map((m) => /* @__PURE__ */ jsxs(Pressable, { onPress: () => {
|
|
398
404
|
setSelectedModel(m.id);
|
|
399
405
|
setShowModels(false);
|
|
400
|
-
}, style:
|
|
406
|
+
}, style: ({
|
|
407
|
+
pressed
|
|
408
|
+
}) => [styles.menuRow, m.id === selectedModel && styles.menuRowOn, pressedStyle(pressed)], children: [
|
|
409
|
+
/* @__PURE__ */ jsx(Text, { style: styles.menuLabel, numberOfLines: 1, children: m.label || m.id }),
|
|
410
|
+
m.id === selectedModel ? /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "check", size: 18, color: theme.foreground }) : null
|
|
411
|
+
] }, m.id)) }) : null,
|
|
401
412
|
mode === "promo" ? /* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, style: styles.hScroll, contentContainerStyle: styles.pills, children: PROMO_PRESETS.map((p) => /* @__PURE__ */ jsx(Pressable, { onPress: () => {
|
|
402
413
|
setPromoPreset(p.id);
|
|
403
414
|
setPromoDuration(p.defaultDurationSeconds);
|
|
404
415
|
setPromoQuality(defaultPromoQuality(p.id));
|
|
405
|
-
}, style:
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
416
|
+
}, style: ({
|
|
417
|
+
pressed
|
|
418
|
+
}) => [styles.pill, promoPreset === p.id && styles.pillOn, pressedStyle(pressed)], children: /* @__PURE__ */ jsx(Text, { style: [styles.pillLabel, promoPreset === p.id && styles.pillLabelOn], children: p.name }) }, p.id)) }) : null,
|
|
419
|
+
mode === "promo" ? /* @__PURE__ */ jsx(View, { style: styles.pills, children: PROMO_DURATIONS.map((s) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setPromoDuration(s), style: ({
|
|
420
|
+
pressed
|
|
421
|
+
}) => [styles.pill, promoDuration === s && styles.pillOn, pressedStyle(pressed)], children: /* @__PURE__ */ jsxs(Text, { style: [styles.pillLabel, promoDuration === s && styles.pillLabelOn], children: [
|
|
422
|
+
s,
|
|
423
|
+
"s"
|
|
424
|
+
] }) }, s)) }) : null,
|
|
425
|
+
mode === "promo" ? /* @__PURE__ */ jsx(Segmented, { options: PROMO_ASPECT_RATIOS.map((value) => ({
|
|
426
|
+
id: value,
|
|
427
|
+
label: value
|
|
428
|
+
})), value: aspect, onChange: setAspect, style: styles.segmented }) : null,
|
|
429
|
+
mode === "promo" ? /* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, style: styles.hScroll, contentContainerStyle: styles.pills, children: PROMO_PLAYBOOKS.map((p) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setPromoPlaybook(p.id), style: ({
|
|
430
|
+
pressed
|
|
431
|
+
}) => [styles.pill, promoPlaybook === p.id && styles.pillOn, pressedStyle(pressed)], children: /* @__PURE__ */ jsx(Text, { style: [styles.pillLabel, promoPlaybook === p.id && styles.pillLabelOn], children: p.name }) }, p.id || "default")) }) : null,
|
|
414
432
|
mode === "promo" ? /* @__PURE__ */ jsx(PromoContextFields, { value: promoContext, onChange: (patch) => setPromoContext((prev) => __spreadValues(__spreadValues({}, prev), patch)), logoUrl: promoLogoUrl, onPickLogo: (seedItem == null ? void 0 : seedItem.type) === "image" ? () => setPromoLogoUrl(unwrapProxyUrl(seedItem.src)) : void 0, onClearLogo: () => setPromoLogoUrl(null) }) : null,
|
|
415
433
|
mode === "promo" ? /* @__PURE__ */ jsx(ReferenceStrip, { label: "Reference images", hint: "Product shots or stills the promo should feature", urls: promoRefs, cap: PROMO_MAX_REFERENCES, busy: picking === "promoReference", onPick: pickInto("promoReference"), onRemove: (url) => setPromoRefs((p) => p.filter((u) => u !== url)) }) : null,
|
|
416
434
|
mode === "promo" ? /* @__PURE__ */ jsx(PromoProductionFields, __spreadValues({ quality: promoQuality, onQuality: setPromoQuality, narrator: promoNarrator, onNarrator: setPromoNarrator, useCases: promoUseCases, onUseCases: setPromoUseCases }, onPromoDesigned && !lookupPromoPreset(promoPreset).produceOnly ? {
|
|
@@ -418,19 +436,24 @@ function CanvasGeneratePanel({
|
|
|
418
436
|
onDesignModel: setPromoDesignModel
|
|
419
437
|
} : {})) : null,
|
|
420
438
|
mode === "clips" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
421
|
-
/* @__PURE__ */ jsx(TextInput, { value: clipUrl, onChangeText: setClipUrl, placeholder: "Paste a video URL\u2026", placeholderTextColor:
|
|
422
|
-
/* @__PURE__ */ jsx(View, { style: styles.pills, children: CLIP_COUNT_CHOICES.map((n) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setClipCount(n), style:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
439
|
+
/* @__PURE__ */ jsx(TextInput, { value: clipUrl, onChangeText: setClipUrl, placeholder: "Paste a video URL\u2026", placeholderTextColor: theme.mutedForeground, autoCapitalize: "none", style: styles.field }),
|
|
440
|
+
/* @__PURE__ */ jsx(View, { style: styles.pills, children: CLIP_COUNT_CHOICES.map((n) => /* @__PURE__ */ jsx(Pressable, { onPress: () => setClipCount(n), style: ({
|
|
441
|
+
pressed
|
|
442
|
+
}) => [styles.pill, clipCount === n && styles.pillOn, pressedStyle(pressed)], children: /* @__PURE__ */ jsx(Text, { style: [styles.pillLabel, clipCount === n && styles.pillLabelOn], children: n }) }, n)) }),
|
|
443
|
+
/* @__PURE__ */ jsx(Segmented, { options: CLIP_ASPECT_RATIOS.map((value) => ({
|
|
444
|
+
id: value,
|
|
445
|
+
label: value
|
|
446
|
+
})), value: clipAspect, onChange: setClipAspect, style: styles.segmented }),
|
|
447
|
+
/* @__PURE__ */ jsx(Segmented, { options: CLIP_RESOLUTIONS.map((value) => ({
|
|
448
|
+
id: value,
|
|
449
|
+
label: `${value}p`
|
|
450
|
+
})), value: clipRes, onChange: setClipRes, style: styles.segmented })
|
|
451
|
+
] }) : mode === "slides" ? /* @__PURE__ */ jsx(Text, { style: styles.hint, children: "Opens the slides studio, the same as Generate, then Slides, on the web." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
452
|
+
/* @__PURE__ */ jsx(TextInput, { value: prompt, onChangeText: setPrompt, placeholder: mode === "image" || mode === "video" ? `${placeholder} Type / for effects` : placeholder, placeholderTextColor: theme.mutedForeground, multiline: true, style: styles.prompt }),
|
|
453
|
+
commandSuggestions.length > 0 ? /* @__PURE__ */ jsx(ScrollView, { horizontal: true, keyboardShouldPersistTaps: "handled", showsHorizontalScrollIndicator: false, style: styles.hScroll, contentContainerStyle: styles.pills, children: commandSuggestions.map((cmd) => /* @__PURE__ */ jsxs(Pressable, { onPress: () => applyCommand(cmd), style: ({
|
|
454
|
+
pressed
|
|
455
|
+
}) => [styles.pill, pressedStyle(pressed)], accessibilityRole: "button", accessibilityHint: cmd.blurb, children: [
|
|
456
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: cmd.icon, size: 14, color: theme.foreground }),
|
|
434
457
|
/* @__PURE__ */ jsxs(Text, { style: styles.pillLabel, children: [
|
|
435
458
|
"/",
|
|
436
459
|
cmd.id
|
|
@@ -445,7 +468,9 @@ function CanvasGeneratePanel({
|
|
|
445
468
|
}, children: /* @__PURE__ */ jsx(NativeDictationBar, { isDark: false, onInterim: () => void 0, onTranscriptionComplete: (text) => {
|
|
446
469
|
setDictating(false);
|
|
447
470
|
setPrompt((prev) => (prev ? `${prev.trim()} ${text}` : text).trim());
|
|
448
|
-
}, onCancel: () => setDictating(false), onFallback: () => setDictating(false) }) }) : /* @__PURE__ */ jsx(Pressable, { onPress: () => setDictating(true), style:
|
|
471
|
+
}, onCancel: () => setDictating(false), onFallback: () => setDictating(false) }) }) : /* @__PURE__ */ jsx(Pressable, { onPress: () => setDictating(true), style: ({
|
|
472
|
+
pressed
|
|
473
|
+
}) => [styles.mic, pressedStyle(pressed)], accessibilityRole: "button", accessibilityLabel: "Dictate", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "microphone-outline", size: 20, color: theme.foreground }) }),
|
|
449
474
|
mode === "promo" && onPromoDesigned && !lookupPromoPreset(promoPreset).produceOnly ? /* @__PURE__ */ jsx(Pressable, { onPress: () => {
|
|
450
475
|
if (!runAction || busy || !prompt.trim()) return;
|
|
451
476
|
setBusy(true);
|
|
@@ -467,15 +492,19 @@ function CanvasGeneratePanel({
|
|
|
467
492
|
} : {}), promoDesignModel ? {
|
|
468
493
|
model: promoDesignModel
|
|
469
494
|
} : {})).then((designed) => onPromoDesigned(designed)).catch((err) => setNotice(friendlyMediaError(err, "promo design"))).finally(() => setBusy(false));
|
|
470
|
-
}, disabled: busy || !prompt.trim(), style:
|
|
471
|
-
|
|
495
|
+
}, disabled: busy || !prompt.trim(), style: ({
|
|
496
|
+
pressed
|
|
497
|
+
}) => [styles.designCta, (busy || !prompt.trim()) && styles.ctaOff, pressedStyle(pressed && !busy)], accessibilityRole: "button", accessibilityLabel: "Design editable cut", children: /* @__PURE__ */ jsx(Text, { style: styles.designCtaLabel, children: "Design cut" }) }) : null,
|
|
498
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: generate, disabled: busy || !canGo && mode !== "slides", style: ({
|
|
499
|
+
pressed
|
|
500
|
+
}) => [styles.cta, (busy || !canGo && mode !== "slides") && styles.ctaOff, pressedStyle(pressed && !busy)], accessibilityRole: "button", children: busy ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.primaryForeground }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
472
501
|
/* @__PURE__ */ jsx(Text, { style: styles.ctaLabel, children: cta }),
|
|
473
|
-
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "arrow-right", size: 18, color:
|
|
502
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "arrow-right", size: 18, color: theme.primaryForeground })
|
|
474
503
|
] }) })
|
|
475
504
|
] })
|
|
476
505
|
] });
|
|
477
506
|
}
|
|
478
|
-
const
|
|
507
|
+
const makeStyles = themedStyles((theme) => StyleSheet.create({
|
|
479
508
|
root: {
|
|
480
509
|
flex: 1
|
|
481
510
|
},
|
|
@@ -483,170 +512,153 @@ const styles = StyleSheet.create({
|
|
|
483
512
|
flexGrow: 0
|
|
484
513
|
},
|
|
485
514
|
body: {
|
|
486
|
-
paddingHorizontal:
|
|
487
|
-
paddingBottom:
|
|
488
|
-
gap:
|
|
515
|
+
paddingHorizontal: SPACE.lg,
|
|
516
|
+
paddingBottom: SPACE.md,
|
|
517
|
+
gap: SPACE.lg
|
|
489
518
|
},
|
|
490
519
|
tabs: {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
},
|
|
495
|
-
tab: {
|
|
496
|
-
flexDirection: "row",
|
|
497
|
-
alignItems: "center",
|
|
498
|
-
gap: 6,
|
|
499
|
-
paddingHorizontal: 12,
|
|
500
|
-
paddingVertical: 6,
|
|
501
|
-
borderRadius: 999
|
|
502
|
-
},
|
|
503
|
-
tabOn: {
|
|
504
|
-
backgroundColor: "#fde8d8"
|
|
505
|
-
},
|
|
506
|
-
tabLabel: {
|
|
507
|
-
fontSize: 12,
|
|
508
|
-
fontWeight: "500",
|
|
509
|
-
color: "#64748b"
|
|
520
|
+
flexGrow: 0,
|
|
521
|
+
alignSelf: "flex-start",
|
|
522
|
+
maxWidth: "100%"
|
|
510
523
|
},
|
|
511
|
-
|
|
512
|
-
|
|
524
|
+
segmented: {
|
|
525
|
+
flexGrow: 0,
|
|
526
|
+
alignSelf: "flex-start"
|
|
513
527
|
},
|
|
514
528
|
pills: {
|
|
515
529
|
flexDirection: "row",
|
|
516
530
|
flexWrap: "wrap",
|
|
517
|
-
gap:
|
|
531
|
+
gap: SPACE.sm - 2
|
|
518
532
|
},
|
|
519
533
|
pill: {
|
|
520
534
|
flexDirection: "row",
|
|
521
535
|
alignItems: "center",
|
|
522
|
-
gap:
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
borderRadius:
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
backgroundColor: "#ffffff",
|
|
529
|
-
maxWidth: 180
|
|
536
|
+
gap: SPACE.sm - 2,
|
|
537
|
+
minHeight: 36,
|
|
538
|
+
paddingHorizontal: SPACE.md + 2,
|
|
539
|
+
borderRadius: RADIUS.pill,
|
|
540
|
+
backgroundColor: theme.card,
|
|
541
|
+
maxWidth: 200
|
|
530
542
|
},
|
|
531
543
|
pillOn: {
|
|
532
|
-
backgroundColor:
|
|
533
|
-
borderColor: "#fde8d8"
|
|
544
|
+
backgroundColor: theme.foreground
|
|
534
545
|
},
|
|
535
|
-
pillLabel: {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
546
|
+
pillLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
547
|
+
flexShrink: 1,
|
|
548
|
+
color: theme.foreground
|
|
549
|
+
}),
|
|
550
|
+
pillLabelOn: {
|
|
551
|
+
color: theme.background
|
|
539
552
|
},
|
|
540
553
|
frameBox: {
|
|
541
|
-
gap:
|
|
554
|
+
gap: SPACE.sm
|
|
542
555
|
},
|
|
543
556
|
refBlock: {
|
|
544
|
-
gap:
|
|
557
|
+
gap: SPACE.md
|
|
545
558
|
},
|
|
546
559
|
slotRow: {
|
|
547
560
|
flexDirection: "row",
|
|
548
|
-
gap:
|
|
549
|
-
},
|
|
550
|
-
rowLabel: {
|
|
551
|
-
fontSize: 12,
|
|
552
|
-
fontWeight: "600",
|
|
553
|
-
color: "#334155"
|
|
561
|
+
gap: SPACE.sm + 2
|
|
554
562
|
},
|
|
563
|
+
rowLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
564
|
+
color: theme.foreground
|
|
565
|
+
}),
|
|
555
566
|
menu: {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
backgroundColor: "#ffffff",
|
|
567
|
+
borderRadius: RADIUS.lg,
|
|
568
|
+
backgroundColor: theme.card,
|
|
569
|
+
padding: SPACE.xs,
|
|
560
570
|
overflow: "hidden"
|
|
561
571
|
},
|
|
562
572
|
menuRow: {
|
|
563
|
-
|
|
564
|
-
|
|
573
|
+
flexDirection: "row",
|
|
574
|
+
alignItems: "center",
|
|
575
|
+
gap: SPACE.sm,
|
|
576
|
+
minHeight: HIT,
|
|
577
|
+
paddingHorizontal: SPACE.md,
|
|
578
|
+
borderRadius: RADIUS.md
|
|
565
579
|
},
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
color: "#0f172a"
|
|
580
|
+
menuRowOn: {
|
|
581
|
+
backgroundColor: theme.isDark ? theme.secondary : theme.surface
|
|
569
582
|
},
|
|
583
|
+
menuLabel: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
584
|
+
flex: 1,
|
|
585
|
+
color: theme.foreground
|
|
586
|
+
}),
|
|
570
587
|
prompt: {
|
|
571
|
-
minHeight:
|
|
588
|
+
minHeight: 128,
|
|
572
589
|
flexGrow: 1,
|
|
573
|
-
borderRadius:
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
color: "#0f172a",
|
|
590
|
+
borderRadius: RADIUS.xl,
|
|
591
|
+
paddingHorizontal: SPACE.lg,
|
|
592
|
+
paddingTop: SPACE.md + 2,
|
|
593
|
+
paddingBottom: SPACE.md + 2,
|
|
594
|
+
backgroundColor: theme.card,
|
|
595
|
+
color: theme.foreground,
|
|
580
596
|
fontSize: 15,
|
|
597
|
+
lineHeight: 21,
|
|
581
598
|
textAlignVertical: "top"
|
|
582
599
|
},
|
|
583
600
|
field: {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
hint: {
|
|
592
|
-
fontSize: 13,
|
|
593
|
-
color: "#64748b",
|
|
594
|
-
paddingVertical: 8
|
|
595
|
-
},
|
|
596
|
-
notice: {
|
|
597
|
-
paddingHorizontal: 16,
|
|
598
|
-
paddingBottom: 8,
|
|
599
|
-
fontSize: 12,
|
|
600
|
-
color: "#b91c1c"
|
|
601
|
+
minHeight: HIT + 4,
|
|
602
|
+
borderRadius: RADIUS.xl,
|
|
603
|
+
paddingHorizontal: SPACE.lg,
|
|
604
|
+
paddingVertical: SPACE.md,
|
|
605
|
+
backgroundColor: theme.card,
|
|
606
|
+
color: theme.foreground,
|
|
607
|
+
fontSize: 15
|
|
601
608
|
},
|
|
609
|
+
hint: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
610
|
+
fontSize: 14,
|
|
611
|
+
color: theme.mutedForeground,
|
|
612
|
+
paddingVertical: SPACE.sm
|
|
613
|
+
}),
|
|
614
|
+
notice: __spreadProps(__spreadValues({}, TYPE.caption), {
|
|
615
|
+
fontWeight: "400",
|
|
616
|
+
paddingHorizontal: SPACE.lg,
|
|
617
|
+
paddingBottom: SPACE.sm,
|
|
618
|
+
color: theme.destructiveText
|
|
619
|
+
}),
|
|
602
620
|
designCta: {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
backgroundColor: "#fff7ed"
|
|
609
|
-
},
|
|
610
|
-
designCtaLabel: {
|
|
611
|
-
fontSize: 13,
|
|
612
|
-
fontWeight: "700",
|
|
613
|
-
color: "#9a3412"
|
|
621
|
+
minHeight: HIT + 4,
|
|
622
|
+
justifyContent: "center",
|
|
623
|
+
paddingHorizontal: SPACE.lg,
|
|
624
|
+
borderRadius: RADIUS.pill,
|
|
625
|
+
backgroundColor: theme.card
|
|
614
626
|
},
|
|
627
|
+
designCtaLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
628
|
+
fontSize: 15,
|
|
629
|
+
color: theme.foreground
|
|
630
|
+
}),
|
|
615
631
|
actions: {
|
|
616
632
|
flexDirection: "row",
|
|
617
633
|
alignItems: "center",
|
|
618
|
-
gap:
|
|
619
|
-
paddingHorizontal:
|
|
620
|
-
paddingTop:
|
|
621
|
-
paddingBottom:
|
|
622
|
-
borderTopWidth: StyleSheet.hairlineWidth,
|
|
623
|
-
borderTopColor: "#e2e8f0"
|
|
634
|
+
gap: SPACE.sm + 2,
|
|
635
|
+
paddingHorizontal: SPACE.lg,
|
|
636
|
+
paddingTop: SPACE.sm,
|
|
637
|
+
paddingBottom: SPACE.md
|
|
624
638
|
},
|
|
625
639
|
mic: {
|
|
626
|
-
width:
|
|
627
|
-
height:
|
|
628
|
-
borderRadius:
|
|
629
|
-
|
|
630
|
-
borderColor: "#e2e8f0",
|
|
640
|
+
width: HIT + 4,
|
|
641
|
+
height: HIT + 4,
|
|
642
|
+
borderRadius: (HIT + 4) / 2,
|
|
643
|
+
backgroundColor: theme.card,
|
|
631
644
|
alignItems: "center",
|
|
632
645
|
justifyContent: "center"
|
|
633
646
|
},
|
|
634
647
|
cta: {
|
|
635
648
|
flex: 1,
|
|
636
|
-
height:
|
|
637
|
-
borderRadius:
|
|
638
|
-
backgroundColor:
|
|
649
|
+
height: HIT + 4,
|
|
650
|
+
borderRadius: RADIUS.pill,
|
|
651
|
+
backgroundColor: theme.primary,
|
|
639
652
|
flexDirection: "row",
|
|
640
653
|
alignItems: "center",
|
|
641
654
|
justifyContent: "center",
|
|
642
|
-
gap:
|
|
655
|
+
gap: SPACE.sm
|
|
643
656
|
},
|
|
644
657
|
ctaOff: {
|
|
645
|
-
opacity: 0.
|
|
658
|
+
opacity: 0.4
|
|
646
659
|
},
|
|
647
|
-
ctaLabel: {
|
|
660
|
+
ctaLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
648
661
|
fontSize: 15,
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
});export{CanvasGeneratePanel};//# sourceMappingURL=CanvasGeneratePanel.js.map
|
|
662
|
+
color: theme.primaryForeground
|
|
663
|
+
})
|
|
664
|
+
}));export{CanvasGeneratePanel};//# sourceMappingURL=CanvasGeneratePanel.js.map
|