diff --git a/src/components/PropSidebar.tsx b/src/components/PropSidebar.tsx index 7516a39..cb3aaec 100644 --- a/src/components/PropSidebar.tsx +++ b/src/components/PropSidebar.tsx @@ -48,6 +48,8 @@ import { HelpCircle, Lock, Unlock, + Eye, + EyeOff, ArrowUp, ArrowDown, ArrowLeft, @@ -570,6 +572,14 @@ export const PropSidebar: React.FC = ({ } }; + const toggleLayerVisibility = (idx: number) => { + const list = template.elements.map((el, i) => { + if (i !== idx) return el; + return { ...el, hidden: el.hidden ? undefined : true }; + }); + onChangeTemplate({ ...template, elements: list }); + }; + const deleteLayer = async (id: string) => { const el = template.elements.find((x) => x.id === id); if (el?.locked) return; @@ -1535,6 +1545,60 @@ export const PropSidebar: React.FC = ({ /> 自动换行 + +
+
+ + { + const raw = String(val).trim(); + if (!raw) { + handleElemChange({ + ...selectedElem, + textMaxLines: undefined, + textEllipsis: undefined, + }); + return; + } + const n = Math.max(0, Math.min(99, Math.floor(Number(val) || 0))); + handleElemChange({ + ...selectedElem, + textMaxLines: n > 0 ? n : undefined, + textEllipsis: n > 0 ? selectedElem.textEllipsis : undefined, + }); + }} + className="ps-field font-mono" + placeholder="不限" + /> +

留空表示不限制

+
+
+ +
+
)} @@ -2116,6 +2180,7 @@ export const PropSidebar: React.FC = ({ const actualIdx = template.elements.length - 1 - revIdx; const isSelected = selectedElementIds.includes(elem.id); const isLocked = !!elem.locked; + const isHidden = elem.hidden === true; return (
= ({ } } className={`ps-layer-item group ${isSelected && !isLocked ? 'selected' : ''} ${isLocked ? 'ps-layer-item-locked' : '' - }`} + }${isHidden ? ' ps-layer-item-hidden' : ''}`} >
@@ -2186,6 +2251,14 @@ export const PropSidebar: React.FC = ({ )} +