( project: ReturnType<typeof useEditorContext>["project"], editorState: ReturnType<typeof useEditorContext>["editorState"], )
| 89 | } |
| 90 | |
| 91 | function getPreviewProjectConfig( |
| 92 | project: ReturnType<typeof useEditorContext>["project"], |
| 93 | editorState: ReturnType<typeof useEditorContext>["editorState"], |
| 94 | ) { |
| 95 | const config = serializeProjectConfiguration(project); |
| 96 | |
| 97 | if (!editorState.timeline.tracks.caption && config.captions) { |
| 98 | config.captions = { |
| 99 | ...config.captions, |
| 100 | settings: { |
| 101 | ...config.captions.settings, |
| 102 | enabled: false, |
| 103 | }, |
| 104 | }; |
| 105 | } |
| 106 | |
| 107 | if (!editorState.timeline.tracks.keyboard && config.keyboard) { |
| 108 | config.keyboard = { |
| 109 | ...config.keyboard, |
| 110 | settings: { |
| 111 | ...config.keyboard.settings, |
| 112 | enabled: false, |
| 113 | }, |
| 114 | }; |
| 115 | } |
| 116 | |
| 117 | return config; |
| 118 | } |
| 119 | |
| 120 | export function Editor() { |
| 121 | const [projectPath] = createResource(() => commands.getEditorProjectPath()); |
no test coverage detected