Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
ecec80b
1
Parent(s):
cc43ec0
fixes + work on first wizard
Browse files- package-lock.json +4 -4
- package.json +1 -1
- src/components/wizards/project/index.tsx +92 -0
- src/lib/utils/formatSegmentForExport.ts +1 -2
- src/services/io/useIO.ts +1 -1
- src/services/ui/useUI.ts +4 -0
package-lock.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
"dependencies": {
|
11 |
"@aitube/broadway": "0.0.22",
|
12 |
"@aitube/clap": "0.0.30",
|
13 |
-
"@aitube/clapper-services": "0.0.
|
14 |
"@aitube/engine": "0.0.26",
|
15 |
"@aitube/timeline": "0.0.42",
|
16 |
"@fal-ai/serverless-client": "^0.11.0",
|
@@ -149,9 +149,9 @@
|
|
149 |
}
|
150 |
},
|
151 |
"node_modules/@aitube/clapper-services": {
|
152 |
-
"version": "0.0.
|
153 |
-
"resolved": "https://registry.npmjs.org/@aitube/clapper-services/-/clapper-services-0.0.
|
154 |
-
"integrity": "sha512
|
155 |
"peerDependencies": {
|
156 |
"@aitube/clap": "0.0.30",
|
157 |
"@aitube/timeline": "0.0.42",
|
|
|
10 |
"dependencies": {
|
11 |
"@aitube/broadway": "0.0.22",
|
12 |
"@aitube/clap": "0.0.30",
|
13 |
+
"@aitube/clapper-services": "0.0.28",
|
14 |
"@aitube/engine": "0.0.26",
|
15 |
"@aitube/timeline": "0.0.42",
|
16 |
"@fal-ai/serverless-client": "^0.11.0",
|
|
|
149 |
}
|
150 |
},
|
151 |
"node_modules/@aitube/clapper-services": {
|
152 |
+
"version": "0.0.28",
|
153 |
+
"resolved": "https://registry.npmjs.org/@aitube/clapper-services/-/clapper-services-0.0.28.tgz",
|
154 |
+
"integrity": "sha512-YmiPGAGtZcgqqnXmgtWvFyd9TL5eCpF343+ndvDa+aorQ43PkIKo7f3df550njOICM5KZhSBRFEIh1c5Dsi7Yg==",
|
155 |
"peerDependencies": {
|
156 |
"@aitube/clap": "0.0.30",
|
157 |
"@aitube/timeline": "0.0.42",
|
package.json
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
"dependencies": {
|
22 |
"@aitube/broadway": "0.0.22",
|
23 |
"@aitube/clap": "0.0.30",
|
24 |
-
"@aitube/clapper-services": "0.0.
|
25 |
"@aitube/engine": "0.0.26",
|
26 |
"@aitube/timeline": "0.0.42",
|
27 |
"@fal-ai/serverless-client": "^0.11.0",
|
|
|
21 |
"dependencies": {
|
22 |
"@aitube/broadway": "0.0.22",
|
23 |
"@aitube/clap": "0.0.30",
|
24 |
+
"@aitube/clapper-services": "0.0.28",
|
25 |
"@aitube/engine": "0.0.26",
|
26 |
"@aitube/timeline": "0.0.42",
|
27 |
"@fal-ai/serverless-client": "^0.11.0",
|
src/components/wizards/project/index.tsx
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Button } from '@/components/ui/button'
|
2 |
+
import { Dialog, DialogContent, DialogFooter } from '@/components/ui/dialog'
|
3 |
+
import { ScrollArea } from '@/components/ui/scroll-area'
|
4 |
+
import { cn } from '@/lib/utils'
|
5 |
+
import { useUI } from '@/services'
|
6 |
+
import { ProjectCreationWizardStep } from '@aitube/clapper-services'
|
7 |
+
|
8 |
+
export function StepChooseCategory() {
|
9 |
+
return (
|
10 |
+
<>
|
11 |
+
<p>Choose a category:</p>
|
12 |
+
</>
|
13 |
+
)
|
14 |
+
}
|
15 |
+
|
16 |
+
|
17 |
+
export function StepCreateFromPrompt() {
|
18 |
+
return (
|
19 |
+
<>
|
20 |
+
<p>Type a prompt:</p>
|
21 |
+
</>
|
22 |
+
)
|
23 |
+
}
|
24 |
+
|
25 |
+
const stepPanels: Record<ProjectCreationWizardStep, JSX.Element> = {
|
26 |
+
[ProjectCreationWizardStep.NONE]: <></>,
|
27 |
+
[ProjectCreationWizardStep.CHOOSE_CATEGORY]: <StepChooseCategory />,
|
28 |
+
[ProjectCreationWizardStep.CREATE_FROM_PROMPT]: <StepCreateFromPrompt />,
|
29 |
+
}
|
30 |
+
|
31 |
+
const stepLabels = {
|
32 |
+
[ProjectCreationWizardStep.NONE]: '',
|
33 |
+
[ProjectCreationWizardStep.CHOOSE_CATEGORY]: 'Choose category',
|
34 |
+
[ProjectCreationWizardStep.CREATE_FROM_PROMPT]: 'Create from prompt'
|
35 |
+
} as any
|
36 |
+
|
37 |
+
export function ProjectCreationWizard() {
|
38 |
+
const projectCreationWizardStep = useUI((s) => s.projectCreationWizardStep)
|
39 |
+
const setProjectCreationWizardStep = useUI((s) => s.setProjectCreationWizardStep)
|
40 |
+
|
41 |
+
return (
|
42 |
+
<Dialog
|
43 |
+
open={projectCreationWizardStep !== ProjectCreationWizardStep.NONE}
|
44 |
+
onOpenChange={(open) =>
|
45 |
+
setProjectCreationWizardStep(
|
46 |
+
open ? ProjectCreationWizardStep.CHOOSE_CATEGORY : ProjectCreationWizardStep.NONE
|
47 |
+
)
|
48 |
+
}
|
49 |
+
>
|
50 |
+
<DialogContent
|
51 |
+
className={cn(
|
52 |
+
`select-none`,
|
53 |
+
// DialogContent comes with some hardcoded values so we need to override them
|
54 |
+
`h-[70%] w-[95w] max-w-6xl md:w-[60vw]`,
|
55 |
+
`flex flex-row`
|
56 |
+
)}
|
57 |
+
>
|
58 |
+
<ScrollArea className="flex h-full w-44 flex-col">
|
59 |
+
<div className="flex flex-col items-end">
|
60 |
+
{Object.keys(stepPanels).map((key) => (
|
61 |
+
<Button
|
62 |
+
key={key}
|
63 |
+
variant="ghost"
|
64 |
+
className="flex w-full flex-col items-end text-right text-lg font-thin capitalize text-stone-300"
|
65 |
+
onClick={() => setProjectCreationWizardStep(key as ProjectCreationWizardStep)}
|
66 |
+
>
|
67 |
+
{stepLabels[key]}
|
68 |
+
</Button>
|
69 |
+
))}
|
70 |
+
</div>
|
71 |
+
</ScrollArea>
|
72 |
+
|
73 |
+
<div className="flex h-full max-w-[calc(100%-150px)] flex-grow select-none flex-col justify-between border-l border-stone-800 pl-8">
|
74 |
+
<ScrollArea className="flex h-full flex-row">
|
75 |
+
{stepPanels[projectCreationWizardStep]}
|
76 |
+
</ScrollArea>
|
77 |
+
<DialogFooter>
|
78 |
+
<Button
|
79 |
+
variant="outline"
|
80 |
+
className="text-sm font-light dark:border-stone-700 dark:bg-stone-800 dark:text-stone-400"
|
81 |
+
onClick={() => {
|
82 |
+
setProjectCreationWizardStep(ProjectCreationWizardStep.NONE)
|
83 |
+
}}
|
84 |
+
>
|
85 |
+
Close
|
86 |
+
</Button>
|
87 |
+
</DialogFooter>
|
88 |
+
</div>
|
89 |
+
</DialogContent>
|
90 |
+
</Dialog>
|
91 |
+
)
|
92 |
+
}
|
src/lib/utils/formatSegmentForExport.ts
CHANGED
@@ -44,7 +44,6 @@ export function formatSegmentForExport(
|
|
44 |
const directory = `${segment.category}`.toLowerCase()
|
45 |
const prefix = `shot_${String(index).padStart(4, '0')}_`
|
46 |
|
47 |
-
|
48 |
const notFoundFileFormat = 'unknown/unknown'
|
49 |
let fallbackFileFormat = notFoundFileFormat
|
50 |
|
@@ -75,7 +74,7 @@ export function formatSegmentForExport(
|
|
75 |
segment.assetUrl.startsWith('data:')
|
76 |
|
77 |
const category = segment.category.toLocaleLowerCase()
|
78 |
-
|
79 |
return {
|
80 |
id: segment.id,
|
81 |
segment,
|
|
|
44 |
const directory = `${segment.category}`.toLowerCase()
|
45 |
const prefix = `shot_${String(index).padStart(4, '0')}_`
|
46 |
|
|
|
47 |
const notFoundFileFormat = 'unknown/unknown'
|
48 |
let fallbackFileFormat = notFoundFileFormat
|
49 |
|
|
|
74 |
segment.assetUrl.startsWith('data:')
|
75 |
|
76 |
const category = segment.category.toLocaleLowerCase()
|
77 |
+
|
78 |
return {
|
79 |
id: segment.id,
|
80 |
segment,
|
src/services/io/useIO.ts
CHANGED
@@ -403,7 +403,7 @@ export const useIO = create<IOStore>((set, get) => ({
|
|
403 |
isExportableToFile && id !== ignoreThisVideoSegmentId
|
404 |
)
|
405 |
|
406 |
-
console.log(
|
407 |
|
408 |
const videos: FFMPegVideoInput[] = []
|
409 |
const audios: FFMPegAudioInput[] = []
|
|
|
403 |
isExportableToFile && id !== ignoreThisVideoSegmentId
|
404 |
)
|
405 |
|
406 |
+
console.log('segments:', segments)
|
407 |
|
408 |
const videos: FFMPegVideoInput[] = []
|
409 |
const audios: FFMPegAudioInput[] = []
|
src/services/ui/useUI.ts
CHANGED
@@ -4,6 +4,7 @@ import { create } from 'zustand'
|
|
4 |
import { persist } from 'zustand/middleware'
|
5 |
|
6 |
import {
|
|
|
7 |
ScriptEditorService,
|
8 |
ScriptEditorStore,
|
9 |
SettingsCategory,
|
@@ -76,6 +77,9 @@ export const useUI = create<UIStore>()(
|
|
76 |
setEditorFontSize: (editorFontSize: number) => {
|
77 |
set({ editorFontSize })
|
78 |
},
|
|
|
|
|
|
|
79 |
}),
|
80 |
{
|
81 |
name: 'CLAPPER_REVISION_0_CONTROLLERS_UI',
|
|
|
4 |
import { persist } from 'zustand/middleware'
|
5 |
|
6 |
import {
|
7 |
+
ProjectCreationWizardStep,
|
8 |
ScriptEditorService,
|
9 |
ScriptEditorStore,
|
10 |
SettingsCategory,
|
|
|
77 |
setEditorFontSize: (editorFontSize: number) => {
|
78 |
set({ editorFontSize })
|
79 |
},
|
80 |
+
setProjectCreationWizardStep: (projectCreationWizardStep: ProjectCreationWizardStep) => {
|
81 |
+
set({ projectCreationWizardStep })
|
82 |
+
}
|
83 |
}),
|
84 |
{
|
85 |
name: 'CLAPPER_REVISION_0_CONTROLLERS_UI',
|