/* ============================================================================= * B05_Profile_UI_Profile_Panel.ts * 종단 보기의 하단 종단도 — 한 페이지의 **종단도 한 벌**(`design_shared` · 오른쪽 판 배수유역도)에 * 종단 보기 알림을 건다(계획서 24-2c · 24-3b). * * 종단도는 두 보기가 같은 노드를 쓴다. 여기는 종단 보기가 부르던 이름 · 모양을 지킨다 — * 페이지는 `drainage` 로 배수유역도를 바로 부른다. * ========================================================================== */ import type { DesignSideBoard } from "../A00_Common/design/design_profile"; import { bindDesignView, sharedProfile, type DesignPageShared, } from "../A00_Common/design/design_shared"; import type { RouteProfilePanelCallbacks } from "./B05_Profile_UI_Profile_Panel_Types"; /** 콜백 타입은 `_Panel_Types` 에 있다 — 옛 임포트 경로가 그대로 동작하도록 다시 내보낸다. */ export type { RouteProfilePanelCallbacks } from "./B05_Profile_UI_Profile_Panel_Types"; export function createRouteProfilePanel( shared: DesignPageShared, /** 측점 선택 변경 — 같은 측점 재선택·빈 곳 클릭이면 null(해제)로 알린다. */ onSelectStation: (stationId: string | null) => void, /** [초기선 복원] 클릭 시 함께 실행(비정규 측점 등 다른 조작값도 초기화하려고 Page가 넘긴다). */ onResetAll?: () => void, callbacks?: RouteProfilePanelCallbacks, ) { bindDesignView(shared, "profile", { profile: { onSelectStation, onResetAll, callbacks } }); const profile = sharedProfile(shared); /** 배수유역도 패널 — 경로 확정 흐름에서 유역선 편집 저장 여부를 묻는 데 쓴다. */ const drainage = profile.side as DesignSideBoard; return Object.assign(profile, { drainage }); }