에디터 인라인/속성 패널 리팩터링 및 폼 전송 기본 기능 추가
CI / pr_and_merge (push) Blocked by required conditions
CI / test (push) Has been cancelled

This commit is contained in:
2025-11-20 00:53:39 +09:00
parent 211b0f8230
commit a6ef5f01cd
29 changed files with 3371 additions and 1052 deletions
@@ -0,0 +1,65 @@
"use client";
import type { ListBlockProps } from "@/features/editor/state/editorStore";
export type ListPropertiesPanelProps = {
listProps: ListBlockProps;
selectedBlockId: string;
updateBlock: (id: string, partial: Partial<ListBlockProps>) => void;
};
export function ListPropertiesPanel({ listProps, selectedBlockId, updateBlock }: ListPropertiesPanelProps) {
const firstItem = listProps.items && listProps.items.length > 0 ? listProps.items[0] : "";
return (
<>
<div className="space-y-1">
<label className="flex flex-col gap-1 text-xs text-slate-400">
<span> </span>
<input
className="w-full rounded border border-slate-700 bg-slate-900 px-2 py-1 text-xs outline-none focus:border-sky-500"
aria-label="리스트 첫 번째 아이템"
value={firstItem}
onChange={(e) => {
const nextItems = [...(listProps.items ?? [])];
if (nextItems.length === 0) {
nextItems.push(e.target.value);
} else {
nextItems[0] = e.target.value;
}
updateBlock(selectedBlockId, { items: nextItems } as any);
}}
/>
</label>
</div>
<div className="flex items-center justify-between text-xs text-slate-400">
<label className="flex items-center gap-2">
<input
type="checkbox"
checked={listProps.ordered}
onChange={(e) => {
updateBlock(selectedBlockId, { ordered: e.target.checked } as any);
}}
/>
<span> </span>
</label>
<label className="flex items-center gap-2">
<span></span>
<select
className="rounded border border-slate-700 bg-slate-900 px-2 py-1 text-xs outline-none focus:border-sky-500"
aria-label="리스트 정렬"
value={listProps.align}
onChange={(e) => {
const value = e.target.value as ListBlockProps["align"];
updateBlock(selectedBlockId, { align: value } as any);
}}
>
<option value="left"></option>
<option value="center"></option>
<option value="right"></option>
</select>
</label>
</div>
</>
);
}