( project: EditorProjectConfiguration, )
| 261 | } |
| 262 | |
| 263 | export function serializeProjectConfiguration( |
| 264 | project: EditorProjectConfiguration, |
| 265 | ): ProjectConfiguration { |
| 266 | const { background, camera, ...rest } = project; |
| 267 | const { roundingType: backgroundRoundingType, ...backgroundRest } = |
| 268 | background; |
| 269 | const { roundingType: cameraRoundingType, ...cameraRest } = camera; |
| 270 | |
| 271 | const timeline = project.timeline |
| 272 | ? { |
| 273 | ...project.timeline, |
| 274 | captionSegments: project.timeline.captionSegments ?? [], |
| 275 | keyboardSegments: project.timeline.keyboardSegments ?? [], |
| 276 | maskSegments: project.timeline.maskSegments ?? [], |
| 277 | textSegments: project.timeline.textSegments ?? [], |
| 278 | audioSegments: project.timeline.audioSegments ?? [], |
| 279 | } |
| 280 | : project.timeline; |
| 281 | |
| 282 | return { |
| 283 | ...rest, |
| 284 | timeline: timeline as unknown as ProjectConfiguration["timeline"], |
| 285 | background: { |
| 286 | ...backgroundRest, |
| 287 | roundingType: backgroundRoundingType, |
| 288 | }, |
| 289 | camera: { |
| 290 | ...cameraRest, |
| 291 | roundingType: cameraRoundingType, |
| 292 | }, |
| 293 | }; |
| 294 | } |
| 295 | |
| 296 | export const [EditorContextProvider, useEditorContext] = createContextProvider( |
| 297 | (props: { |
no outgoing calls
no test coverage detected