de1311fe31
CI/CD Pipeline / Frontend Lint (push) Successful in 43s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 56s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 1m2s
CI/CD Pipeline / Validate - Code Quality (push) Failing after 2m32s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 2m12s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 53s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 4m27s
CI/CD Pipeline / Integration Tests (push) Successful in 2m28s
CI/CD Pipeline / Unit Tests (push) Failing after 4m53s
CI/CD Pipeline / Build Staging API Image (push) Successful in 11m59s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m40s
CI/CD Pipeline / ACR Image Cleanup (push) Failing after 14s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 1m25s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m34s
CI/CD Pipeline / Canary Release to Production (push) Failing after 1260h36m56s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1260h51m1s
CI/CD Pipeline / Deploy Production (push) Failing after 1260h51m5s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 1260h51m26s
CI/CD Pipeline / Build Production API Image (push) Failing after 1260h51m30s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 1260h54m15s
CI/CD Pipeline / PR Build Web Image (push) Failing after 1260h54m17s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1260h54m33s
CI/CD Pipeline / Build Production Web Image (push) Failing after 1261h24m5s
CI/CD Pipeline / PR Build API Image (push) Failing after 1261h26m56s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
247 lines
6.7 KiB
TypeScript
247 lines
6.7 KiB
TypeScript
import React from "react"
|
|
import BgmSelector from "./BgmSelector"
|
|
import SubtitleStylePanel from "./SubtitleStylePanel"
|
|
import TransitionSelector from "./TransitionSelector"
|
|
import SpeedPanel from "./SpeedPanel"
|
|
import TtsPanel from "./TtsPanel"
|
|
import WatermarkPanel from "./WatermarkPanel"
|
|
import IntroOutroPanel from "./IntroOutroPanel"
|
|
import PipConfigPanel from "./PipConfigPanel"
|
|
import FilterPanel from "./FilterPanel"
|
|
import GreenScreenPanel from "./GreenScreenPanel"
|
|
import StickerPanel from "./StickerPanel"
|
|
import type {
|
|
ClipData,
|
|
TransitionConfig,
|
|
SpeedConfig,
|
|
TtsConfig,
|
|
WatermarkConfig,
|
|
IntroOutroConfig,
|
|
PipConfig,
|
|
FilterConfig,
|
|
ChromaKeyConfig,
|
|
StickerConfig,
|
|
} from "../types"
|
|
import type { SubtitleStyleConfig } from "../types/subtitle"
|
|
import type { BgmMixConfig } from "@/api/bgm"
|
|
import { DEFAULT_TRANSITION, DEFAULT_SPEED, DEFAULT_TTS_CONFIG } from "../types"
|
|
|
|
interface EditorDrawersProps {
|
|
// BGM
|
|
bgmDrawerOpen: boolean
|
|
bgmSettings: BgmMixConfig
|
|
onBgmSettingsChange: (config: BgmMixConfig) => void
|
|
onCloseBgmDrawer: () => void
|
|
// 字幕
|
|
subtitleDrawerOpen: boolean
|
|
subtitleSettings: SubtitleStyleConfig
|
|
onSubtitleSettingsChange: (config: SubtitleStyleConfig) => void
|
|
onCloseSubtitleDrawer: () => void
|
|
// 转场
|
|
transitionDrawerOpen: boolean
|
|
transitionTargetClipId: string | null
|
|
clips: ClipData[]
|
|
onTransitionChange: (config: TransitionConfig) => void
|
|
onCloseTransitionDrawer: () => void
|
|
// 调速
|
|
speedDrawerOpen: boolean
|
|
speedTargetClipId: string | null
|
|
onSpeedChange: (config: SpeedConfig) => void
|
|
onApplySpeedAll: (config: SpeedConfig) => void
|
|
onCloseSpeedDrawer: () => void
|
|
// TTS
|
|
ttsDrawerOpen: boolean
|
|
ttsTargetClipId: string | null
|
|
onTtsChange: (config: TtsConfig) => void
|
|
onCloseTtsDrawer: () => void
|
|
// 水印
|
|
watermarkDrawerOpen: boolean
|
|
watermarkSettings: WatermarkConfig
|
|
onWatermarkChange: (config: WatermarkConfig) => void
|
|
onCloseWatermarkDrawer: () => void
|
|
// 片头片尾
|
|
introOutroDrawerOpen: boolean
|
|
introOutroSettings: IntroOutroConfig
|
|
onIntroOutroChange: (config: IntroOutroConfig) => void
|
|
onCloseIntroOutroDrawer: () => void
|
|
// 混剪
|
|
pipDrawerOpen: boolean
|
|
pipSettings: PipConfig
|
|
totalDuration: number
|
|
onPipChange: (config: PipConfig) => void
|
|
onClosePipDrawer: () => void
|
|
// 滤镜
|
|
filterDrawerOpen: boolean
|
|
filterSettings: FilterConfig
|
|
onFilterChange: (config: FilterConfig) => void
|
|
onCloseFilterDrawer: () => void
|
|
// 绿幕
|
|
chromaKeyDrawerOpen: boolean
|
|
chromaKeySettings: ChromaKeyConfig
|
|
onChromaKeyChange: (config: ChromaKeyConfig) => void
|
|
onCloseChromaKeyDrawer: () => void
|
|
// 贴纸
|
|
stickerDrawerOpen: boolean
|
|
stickerSettings: StickerConfig
|
|
onStickerChange: (config: StickerConfig) => void
|
|
onCloseStickerDrawer: () => void
|
|
}
|
|
|
|
const EditorDrawers: React.FC<EditorDrawersProps> = ({
|
|
bgmDrawerOpen,
|
|
bgmSettings,
|
|
onBgmSettingsChange,
|
|
onCloseBgmDrawer,
|
|
subtitleDrawerOpen,
|
|
subtitleSettings,
|
|
onSubtitleSettingsChange,
|
|
onCloseSubtitleDrawer,
|
|
transitionDrawerOpen,
|
|
transitionTargetClipId,
|
|
clips,
|
|
onTransitionChange,
|
|
onCloseTransitionDrawer,
|
|
speedDrawerOpen,
|
|
speedTargetClipId,
|
|
onSpeedChange,
|
|
onApplySpeedAll,
|
|
onCloseSpeedDrawer,
|
|
ttsDrawerOpen,
|
|
ttsTargetClipId,
|
|
onTtsChange,
|
|
onCloseTtsDrawer,
|
|
watermarkDrawerOpen,
|
|
watermarkSettings,
|
|
onWatermarkChange,
|
|
onCloseWatermarkDrawer,
|
|
introOutroDrawerOpen,
|
|
introOutroSettings,
|
|
onIntroOutroChange,
|
|
onCloseIntroOutroDrawer,
|
|
pipDrawerOpen,
|
|
pipSettings,
|
|
totalDuration,
|
|
onPipChange,
|
|
onClosePipDrawer,
|
|
filterDrawerOpen,
|
|
filterSettings,
|
|
onFilterChange,
|
|
onCloseFilterDrawer,
|
|
chromaKeyDrawerOpen,
|
|
chromaKeySettings,
|
|
onChromaKeyChange,
|
|
onCloseChromaKeyDrawer,
|
|
stickerDrawerOpen,
|
|
stickerSettings,
|
|
onStickerChange,
|
|
onCloseStickerDrawer,
|
|
}) => {
|
|
const transitionConfig = transitionTargetClipId
|
|
? (clips.find((c) => c.id === transitionTargetClipId)?.transition ?? DEFAULT_TRANSITION)
|
|
: DEFAULT_TRANSITION
|
|
|
|
const transitionTitle = transitionTargetClipId ? "片段转场设置" : "全局默认转场"
|
|
|
|
return (
|
|
<>
|
|
{/* BGM 选择器 Drawer */}
|
|
<BgmSelector
|
|
open={bgmDrawerOpen}
|
|
onClose={onCloseBgmDrawer}
|
|
config={bgmSettings}
|
|
onChange={onBgmSettingsChange}
|
|
/>
|
|
|
|
{/* 字幕样式配置 Drawer */}
|
|
<SubtitleStylePanel
|
|
open={subtitleDrawerOpen}
|
|
onClose={onCloseSubtitleDrawer}
|
|
config={subtitleSettings}
|
|
onChange={onSubtitleSettingsChange}
|
|
/>
|
|
|
|
{/* 转场特效选择器 Drawer */}
|
|
<TransitionSelector
|
|
open={transitionDrawerOpen}
|
|
onClose={onCloseTransitionDrawer}
|
|
config={transitionConfig}
|
|
onChange={onTransitionChange}
|
|
title={transitionTitle}
|
|
/>
|
|
|
|
{/* 片段调速面板 Drawer */}
|
|
{speedTargetClipId && (
|
|
<SpeedPanel
|
|
open={speedDrawerOpen}
|
|
onClose={onCloseSpeedDrawer}
|
|
config={clips.find((c) => c.id === speedTargetClipId)?.speed ?? DEFAULT_SPEED}
|
|
onChange={onSpeedChange}
|
|
onApplyAll={onApplySpeedAll}
|
|
/>
|
|
)}
|
|
|
|
{/* TTS 配音面板 Drawer */}
|
|
{ttsTargetClipId && (
|
|
<TtsPanel
|
|
open={ttsDrawerOpen}
|
|
onClose={onCloseTtsDrawer}
|
|
config={clips.find((c) => c.id === ttsTargetClipId)?.tts_config ?? DEFAULT_TTS_CONFIG}
|
|
onChange={onTtsChange}
|
|
/>
|
|
)}
|
|
|
|
{/* 水印配置面板 */}
|
|
<WatermarkPanel
|
|
open={watermarkDrawerOpen}
|
|
onClose={onCloseWatermarkDrawer}
|
|
config={watermarkSettings}
|
|
onChange={onWatermarkChange}
|
|
/>
|
|
|
|
{/* 片头片尾配置面板 */}
|
|
<IntroOutroPanel
|
|
open={introOutroDrawerOpen}
|
|
onClose={onCloseIntroOutroDrawer}
|
|
config={introOutroSettings}
|
|
onChange={onIntroOutroChange}
|
|
/>
|
|
|
|
{/* 混剪配置面板 */}
|
|
<PipConfigPanel
|
|
open={pipDrawerOpen}
|
|
onClose={onClosePipDrawer}
|
|
config={pipSettings}
|
|
onChange={onPipChange}
|
|
totalDuration={totalDuration}
|
|
/>
|
|
|
|
{/* 滤镜调色面板 */}
|
|
<FilterPanel
|
|
open={filterDrawerOpen}
|
|
onClose={onCloseFilterDrawer}
|
|
config={filterSettings}
|
|
onChange={onFilterChange}
|
|
/>
|
|
|
|
{/* 绿幕抠像面板 */}
|
|
<GreenScreenPanel
|
|
open={chromaKeyDrawerOpen}
|
|
onClose={onCloseChromaKeyDrawer}
|
|
config={chromaKeySettings}
|
|
onChange={onChromaKeyChange}
|
|
/>
|
|
|
|
{/* 贴纸面板 */}
|
|
<StickerPanel
|
|
open={stickerDrawerOpen}
|
|
onClose={onCloseStickerDrawer}
|
|
config={stickerSettings}
|
|
onChange={onStickerChange}
|
|
totalDuration={totalDuration}
|
|
/>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default EditorDrawers
|