/* ============================================================================= * B03_FileInput_UI_Guide.ts * 파일 입력 좌측 안내 패널 (2026-09-03 사용자 지시). * * 종전에는 고르는 방법·필요한 파일 목록이 **선택 영역과 카드 안에** 길게 들어가 있어 * 카드 한 장이 220px씩 차지했다. 안내는 한 번 읽으면 되는 것이라 다른 단계(B04·B05)와 * 같은 자리 — 공용 오버레이의 좌측 패널(`createWorkflowOverlays.optionsContent`) — 로 * 옮기고, 본문은 고르는 자리만 남긴다. * * 패널 양식은 **B04~B07과 같은 공용 양식**을 그대로 쓴다(2026-09-03 사용자 지시): * 패널 루트 `{page}__form`, 문단은 `ui-collapsible ui-sidebar-section` + 제목에 * `ui-collapsible__title`. 제목 행을 누르면 접히는 동작·캐럿·외곽선이 전부 공용 것이다. * ========================================================================== */ import { attachCollapsible } from "@ui/ui_template_collapsible"; import { ui_locales, currentLanguageIndex } from "@ui/ui_template_locale"; function L(key: keyof typeof ui_locales): string { return ui_locales[key][currentLanguageIndex]; } /** 안내 문단 하나 — 공용 접기 컨테이너(B06 `buildGroup`과 같은 조립). */ function section( titleKey: keyof typeof ui_locales, itemKeys: (keyof typeof ui_locales)[], ): HTMLElement { const group = document.createElement("section"); group.className = "b03-file__guide-group ui-collapsible ui-sidebar-section"; const title = document.createElement("h3"); title.className = "b03-file__guide-legend ui-collapsible__title"; title.textContent = L(titleKey); const list = document.createElement("ul"); list.className = "b03-file__guide-list"; for (const key of itemKeys) { const item = document.createElement("li"); item.textContent = L(key); list.append(item); } group.append(title, list); return group; } /** * 좌측 패널 본문 — 필요한 파일 · 고르는 방법 · 알아 둘 것. * * `statusNote`(재접속 현황 배너)는 「고르는 방법」 끝에 붙는다 — 프로젝트가 이미 완료라 * 다시 올리면 교체된다는 안내라서, 고르기 전에 읽을 것들과 같은 자리에 둔다 * (2026-09-03 사용자 지시). */ export function createInputGuide(statusNote?: HTMLElement): HTMLElement { const guide = document.createElement("div"); guide.className = "b03-file__form"; const howTo = section("B03_Guide_How_Title", [ "B03_Guide_How_Drop", "B03_Guide_How_Card", "B03_Guide_How_Temp", ]); if (statusNote) howTo.append(statusNote); guide.append( section("B03_Guide_Files_Title", [ "B03_Guide_Files_Route", "B03_Guide_Files_Terrain", "B03_Guide_Files_Optional", ]), howTo, section("B03_Guide_Notes_Title", [ "B03_Guide_Notes_Replace", "B03_Guide_Notes_Crs", "B03_Guide_Notes_LasFree", ]), ); attachCollapsible(guide); return guide; }