From 5c33769930d8c88def718d4bb5aca78fac3c32c2 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Mon, 14 Sep 2026 20:43:36 +0800 Subject: [PATCH] refactor: delete LayerConfig.tsx (#1899 #1900) --- .../PipConfigPanel/components/LayerConfig.tsx | 268 ------------------ 1 file changed, 268 deletions(-) delete mode 100644 apps/web/src/pages/editing-planner/components/PipConfigPanel/components/LayerConfig.tsx diff --git a/apps/web/src/pages/editing-planner/components/PipConfigPanel/components/LayerConfig.tsx b/apps/web/src/pages/editing-planner/components/PipConfigPanel/components/LayerConfig.tsx deleted file mode 100644 index 1af03d1e4..000000000 --- a/apps/web/src/pages/editing-planner/components/PipConfigPanel/components/LayerConfig.tsx +++ /dev/null @@ -1,268 +0,0 @@ -import React from "react" -import type { PipLayer, PipGridPosition, PipAnimType, PipSlideDirection } from "../../../types" -import { GRID_POSITIONS, ANIM_OPTIONS, SLIDE_DIR_OPTIONS } from "../constants" - -export interface LayerConfigProps { - layer: PipLayer - totalDuration: number - onUpdate: (id: string, partial: Partial) => void - onGridClick: (pos: PipGridPosition) => void - onWidthChange: (val: number) => void - onHeightChange: (val: number) => void -} - -export const LayerConfig: React.FC = ({ - layer, - totalDuration, - onUpdate, - onGridClick, - onWidthChange, - onHeightChange, -}) => { - return ( -
- {/* ── 素材类型 ── */} -
- -
- - -
-
- - {/* ── 素材 URL ── */} -
- - onUpdate(layer.id, { material_url: e.target.value })} - /> -
- - {/* ── 位置:九宫格 + 坐标 ── */} -
- -
-
- {GRID_POSITIONS.map((pos) => ( - - ))} -
-
-
- - { - const val = Number(e.target.value) - if (!isNaN(val) && val >= 0 && val <= 100) onUpdate(layer.id, { x: val }) - }} - /> -
-
- - { - const val = Number(e.target.value) - if (!isNaN(val) && val >= 0 && val <= 100) onUpdate(layer.id, { y: val }) - }} - /> -
-
-
-
- - {/* ── 尺寸 ── */} -
- -
- 宽 - { - const val = Number(e.target.value) - if (!isNaN(val)) onWidthChange(val) - }} - /> - {layer.width}% -
-
- 高 - { - const val = Number(e.target.value) - if (!isNaN(val)) onHeightChange(val) - }} - /> - {layer.height}% -
-
onUpdate(layer.id, { aspect_lock: !layer.aspect_lock })} - > - {layer.aspect_lock ? "🔒" : "🔓"} - {layer.aspect_lock ? "已锁定比例" : "锁定宽高比"} -
-
- - {/* ── 圆角 ── */} -
- -
- { - const val = Number(e.target.value) - if (!isNaN(val)) onUpdate(layer.id, { border_radius: val }) - }} - /> - {layer.border_radius}% -
-
- - {/* ── 透明度 ── */} -
- -
- { - const val = Number(e.target.value) - if (!isNaN(val)) onUpdate(layer.id, { opacity: val }) - }} - /> - {layer.opacity}% -
-
- - {/* ── 时间 ── */} -
- -
-
- - { - const val = Number(e.target.value) - if (!isNaN(val) && val >= 0 && val <= totalDuration) - onUpdate(layer.id, { start_time: val }) - }} - /> -
-
- - { - const val = Number(e.target.value) - if (!isNaN(val) && val > 0 && val <= totalDuration) - onUpdate(layer.id, { duration: val }) - }} - /> -
-
-
- - {/* ── 入场动画 ── */} -
- - -
- - {/* 滑入方向(仅 slide_in 时显示) */} - {layer.animation === "slide_in" && ( -
- - -
- )} -
- ) -}