Compare commits

..
50 changed files with 3519 additions and 1925 deletions

No files matched your search

+56 -5
View File
@@ -4,15 +4,66 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>ADO2</title> <title>ADO2광장 - 역사 썰 숏폼으로 가게 홍보, AI 숏폼 자동 제작</title>
<!-- ① 페이지 설명 --> <!-- ① 페이지 설명 -->
<meta name="description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." /> <meta name="description" content="ADO2광장은 ㈜에이아이오투오의 AI 숏폼 제작 서비스입니다. 조선왕·삼국지·그리스로마신화 같은 역사 썰에 가게 셀링포인트를 녹인 홍보 숏폼을 업체명 하나로 약 5~6분 만에 만들고 YouTube까지 바로 올립니다." />
<link rel="canonical" href="https://dev-ssul.castad.net/" />
<!-- ② Open Graph 제목 --> <!-- ② Open Graph 제목 -->
<meta property="og:title" content="ADO2 - AI 마케팅 자동화 플랫폼" /> <meta property="og:title" content="ADO2광장 - 역사 썰 숏폼으로 가게 홍보, AI 숏폼 자동 제작" />
<!-- ③ Open Graph 설명 --> <!-- ③ Open Graph 설명 -->
<meta property="og:description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." /> <meta property="og:description" content="조선왕·삼국지·그리스로마신화 같은 역사 썰에 가게 셀링포인트를 녹인 홍보 숏폼을 업체명 하나로 약 5~6분 만에 만들고 YouTube까지 바로 올립니다." />
<meta property="og:url" content="https://ado2.o2osolution.ai" /> <meta property="og:url" content="https://dev-ssul.castad.net/" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:site_name" content="ADO2광장" />
<meta property="og:locale" content="ko_KR" />
<meta property="og:image" content="https://dev-ssul.castad.net/assets/images/ado2_image.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="ADO2광장 - 역사 썰 숏폼으로 가게 홍보, AI 숏폼 자동 제작" />
<meta name="twitter:description" content="조선왕·삼국지·그리스로마신화 같은 역사 썰에 가게 셀링포인트를 녹인 홍보 숏폼을 업체명 하나로 약 5~6분 만에 만들고 YouTube까지 바로 올립니다." />
<meta name="twitter:image" content="https://dev-ssul.castad.net/assets/images/ado2_image.png" />
<!-- ④ 구조화 데이터 (검색엔진·AI 답변 엔진용) -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://dev-ssul.castad.net/#organization",
"name": "㈜에이아이오투오",
"url": "https://dev-ssul.castad.net/",
"email": "o2oteam@o2o.kr",
"telephone": "+82-70-4260-8310",
"address": {
"@type": "PostalAddress",
"streetAddress": "옥산로 111, 5층 유니콘랩 대구 A05호",
"addressLocality": "북구",
"addressRegion": "대구광역시",
"addressCountry": "KR"
}
},
{
"@type": "WebSite",
"@id": "https://dev-ssul.castad.net/#website",
"name": "ADO2광장",
"url": "https://dev-ssul.castad.net/",
"inLanguage": "ko-KR",
"publisher": { "@id": "https://dev-ssul.castad.net/#organization" }
},
{
"@type": "SoftwareApplication",
"name": "ADO2광장",
"url": "https://dev-ssul.castad.net/",
"applicationCategory": "BusinessApplication",
"applicationSubCategory": "AI 숏폼 제작",
"operatingSystem": "Web",
"inLanguage": "ko-KR",
"description": "조선왕·삼국지·그리스로마신화·오디세이 같은 역사·신화 이야기에 업체 셀링포인트를 녹인 홍보 숏폼(썰박스)과, 매장 분석 기반 AI 음악 숏폼을 자동 제작하고 YouTube에 업로드하는 서비스",
"featureList": ["썰박스: 역사·신화 스토리형 홍보 숏폼 자동 제작", "AI 대본·이미지·내레이션 생성", "매장 분석 기반 AI 음악 숏폼", "YouTube 자동 업로드"],
"publisher": { "@id": "https://dev-ssul.castad.net/#organization" }
}
]
}
</script>
<link rel="icon" type="image/svg+xml" href="/favicon_32.svg" sizes="32x32"> <link rel="icon" type="image/svg+xml" href="/favicon_32.svg" sizes="32x32">
<link rel="icon" type="image/svg+xml" href="/favicon_48.svg" sizes="48x48"> <link rel="icon" type="image/svg+xml" href="/favicon_48.svg" sizes="48x48">
<!-- Meta Pixel Code --> <!-- Meta Pixel Code -->
+348
View File
@@ -0,0 +1,348 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>역사 썰 숏폼으로 가게 홍보하기 FAQ - AI 숏폼 자동 제작 | ADO2광장</title>
<meta name="description" content="조선왕·삼국지·그리스로마신화 같은 역사 썰 숏폼에 가게 홍보를 녹이는 방법, 광고 티 안 나는 매장 홍보 영상 만들기, AI로 유튜브 쇼츠를 자동 제작하는 방법을 정리했습니다." />
<link rel="canonical" href="https://dev-ssul.castad.net/faq.html" />
<meta property="og:title" content="역사 썰 숏폼으로 가게 홍보하기 FAQ - AI 숏폼 자동 제작 | ADO2광장" />
<meta property="og:description" content="조선왕·삼국지·그리스로마신화 같은 역사 썰 숏폼에 가게 홍보를 녹이는 방법, 광고 티 안 나는 매장 홍보 영상 만들기, AI로 유튜브 쇼츠를 자동 제작하는 방법을 정리했습니다." />
<meta property="og:url" content="https://dev-ssul.castad.net/faq.html" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="ADO2광장" />
<meta property="og:locale" content="ko_KR" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"url": "https://dev-ssul.castad.net/faq.html",
"inLanguage": "ko-KR",
"dateModified": "2026-10-13",
"publisher": {
"@type": "Organization",
"name": "㈜에이아이오투오",
"url": "https://dev-ssul.castad.net/"
},
"mainEntity": [
{
"@type": "Question",
"name": "가게 홍보 숏폼은 어떻게 만들어야 사람들이 끝까지 보나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "숏폼 시청자는 첫 몇 초 안에 광고라고 느끼면 바로 넘기는 경우가 많기 때문에, 가게 소개로 시작하기보다 흥미로운 이야기로 시작해 매장을 자연스럽게 연결하는 구성이 효과적입니다. 이야기에 빠져든 시청자는 끝까지 보는 동안 매장 이름과 특징을 함께 기억하게 됩니다. ADO2광장의 썰박스는 조선 왕, 삼국지, 그리스·로마신화 같은 유명한 이야기에 매장의 셀링 포인트를 녹여 이런 스토리형 홍보 숏폼을 자동으로 만들어 줍니다."
}
},
{
"@type": "Question",
"name": "스토리텔링 마케팅은 작은 가게에도 효과가 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "스토리텔링 마케팅은 광고비를 많이 쓰기 어려운 작은 가게에 특히 잘 맞는 방식입니다. 제품이나 가격을 나열하는 대신 이야기 속에 매장을 등장시키면 시청자가 거부감 없이 받아들이고, 재미있는 콘텐츠는 공유되면서 자연스럽게 퍼질 수 있습니다. ADO2광장의 썰박스를 사용하면 대본을 직접 쓰지 않아도 역사와 신화 이야기를 활용한 스토리텔링 홍보 영상을 만들 수 있습니다."
}
},
{
"@type": "Question",
"name": "광고 티가 나지 않는 가게 홍보 영상은 어떻게 만드나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "광고 티가 나지 않는 홍보 영상을 만들려면 시청자가 원래 즐겨 보는 콘텐츠 형식을 빌려 오는 것이 좋습니다. 역사 썰, 신화 이야기처럼 인기 있는 숏폼 장르의 흐름을 따라가면서 매장은 이야기 속 장소나 소재로 짧게 등장시키는 방식이 대표적입니다. ADO2광장의 썰박스는 이야기 흐름 안에 업체 정보와 사진을 배치해 콘텐츠로 즐길 수 있는 홍보 영상을 만듭니다."
}
},
{
"@type": "Question",
"name": "영상 편집을 할 줄 몰라도 매장 홍보 숏폼을 만들 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, 만들 수 있습니다. AI 숏폼 제작 도구를 사용하면 대본, 장면 구성, 이미지, 목소리, 자막을 자동으로 처리하기 때문에 편집 프로그램을 배우지 않아도 됩니다. ADO2광장에서는 시나리오를 고르고 업체를 검색하는 두 단계만으로 썰박스 영상이 완성되며, 별도 프로그램 설치 없이 웹에서 바로 이용할 수 있습니다."
}
},
{
"@type": "Question",
"name": "네이버 지도에 등록된 가게 정보로 홍보 영상을 만들 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, 네이버 지도나 네이버 플레이스에 등록된 매장 이름, 업종, 사진 같은 정보는 홍보 영상의 소재로 활용할 수 있습니다. ADO2광장에서 업체명을 검색하거나 네이버 지도 공유 링크를 붙여넣으면 해당 업체의 사진과 정보를 자동으로 수집해 영상 제작에 사용합니다."
}
},
{
"@type": "Question",
"name": "매장 홍보 영상의 제목과 태그는 어떻게 쓰나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "홍보 영상 제목과 태그에는 사람들이 실제로 검색하는 지역명, 업종, 특징을 함께 넣는 것이 좋습니다. 스토리형 영상이라면 '조선 왕도 반한 전주 한정식'처럼 이야기 소재와 매장 정보를 함께 담은 제목이 호기심과 검색 노출을 동시에 노릴 수 있습니다. ADO2광장은 YouTube에 업로드할 때 영상 제목, 설명, 태그를 AI가 자동으로 작성합니다."
}
},
{
"@type": "Question",
"name": "홍보 숏폼을 본 사람을 가게 홈페이지로 연결하려면 어떻게 하나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "홍보 숏폼이 방문이나 예약으로 이어지려면 영상을 본 직후 이동할 수 있는 링크가 있어야 합니다. 영상 설명란과 SNS 프로필에 홈페이지나 예약 페이지 링크를 넣어 두는 것이 기본입니다. ADO2광장에서 업체의 공식 홈페이지 주소를 등록하면 영상 페이지에서 영상이 끝나기 3초 전에 '자세히 보기' 링크가 표시됩니다."
}
},
{
"@type": "Question",
"name": "역사 썰 숏폼이란 무엇인가요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "역사 썰 숏폼은 역사 속 실화, 야사, 신화를 친구에게 이야기하듯 짧고 흥미롭게 풀어 주는 1분 안팎의 세로형 영상입니다. 누구나 아는 인물과 사건을 다루면서도 잘 알려지지 않은 뒷이야기를 꺼내기 때문에 끝까지 보게 만드는 힘이 있습니다. ADO2광장의 썰박스는 이런 역사 썰 형식에 매장 홍보를 결합한 숏폼을 AI로 만들어 줍니다."
}
},
{
"@type": "Question",
"name": "조선 왕 이야기로 숏폼 영상을 만들 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, ADO2광장의 썰박스에는 조선 27대 왕들의 실화 썰을 다루는 조선왕 시나리오가 있습니다. 조선 왕들의 일화를 이야기 소재로 삼아 업체의 특징을 녹여 낸 숏폼 영상을 만들 수 있어, 한식당이나 전통 숙소처럼 한국적인 분위기의 매장과 특히 잘 어울립니다."
}
},
{
"@type": "Question",
"name": "삼국지 이야기로 숏폼 영상을 만들 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, ADO2광장의 썰박스에는 위·촉·오 영웅 28인의 야사를 다루는 삼국지 시나리오가 있습니다. 유비, 관우, 조조처럼 잘 알려진 영웅들의 이야기에 업체의 셀링 포인트를 엮어 흥미로운 홍보 숏폼을 만들 수 있습니다."
}
},
{
"@type": "Question",
"name": "그리스·로마신화 이야기로 숏폼 영상을 만들 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, ADO2광장의 썰박스에는 올림포스 신과 영웅들의 전설을 다루는 그리스·로마신화 시나리오가 있습니다. 신화 속 장면과 인물을 활용해 카페, 레스토랑, 숙소 같은 매장을 이야기 속에 등장시키는 홍보 영상을 만들 수 있습니다."
}
},
{
"@type": "Question",
"name": "오디세이 이야기로 숏폼 영상을 만들 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, ADO2광장의 썰박스에는 오디세우스의 10년 귀향 대모험을 다루는 오디세이 시나리오가 있습니다. 긴 여정과 모험이라는 이야기 구조 덕분에 여행지, 숙박 업소, 체험형 매장을 소개하는 홍보 영상에 잘 어울립니다."
}
},
{
"@type": "Question",
"name": "역사 이야기와 가게 홍보는 어떻게 연결되나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "썰박스에서는 선택한 시나리오의 이야기 흐름 안에 업체의 셀링 포인트를 녹여 넣습니다. 시청자는 역사나 신화 이야기를 따라가다가 이야기 속에 자연스럽게 등장하는 매장을 만나게 되고, 영상에는 수집된 업체 사진이 함께 사용됩니다."
}
},
{
"@type": "Question",
"name": "AI가 만든 역사 썰 영상의 내용은 모두 역사적 사실인가요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "역사 썰 콘텐츠는 실화와 야사, 신화, 이야기를 위한 각색이 섞인 장르이므로 모든 내용을 학술적인 사실로 받아들이기보다는 재미를 위한 이야기로 보는 것이 좋습니다. ADO2광장의 썰박스도 AI가 대본을 쓰기 때문에, 중요한 사실 관계가 담긴 영상을 공개하기 전에는 내용을 한 번 확인하는 것을 권장합니다."
}
},
{
"@type": "Question",
"name": "AI로 유튜브 쇼츠를 자동으로 만들 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, AI 숏폼 제작 도구를 사용하면 대본 작성, 이미지 생성, 내레이션, 영상 합성까지 자동으로 처리해 유튜브 쇼츠를 만들 수 있습니다. ADO2광장의 썰박스는 대본 생성, 스토리보드 구성, 이미지와 목소리 생성, 영상 합성을 차례로 진행해 숏폼 영상을 완성하고, 연결된 YouTube 채널에 바로 업로드할 수 있습니다."
}
},
{
"@type": "Question",
"name": "AI 숏폼 영상을 만드는 데 시간이 얼마나 걸리나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "AI 숏폼 제작 시간은 도구와 영상 구성에 따라 다르지만, 사람이 직접 편집하는 것보다 훨씬 짧습니다. ADO2광장에서 썰박스 영상은 약 5~6분 만에 완성되며, 생성 중에는 대본, 스토리보드, 이미지·목소리, 영상 합성 중 어느 단계가 진행 중인지 확인할 수 있습니다."
}
},
{
"@type": "Question",
"name": "AI가 만든 숏폼에 목소리 내레이션도 들어가나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, ADO2광장의 썰박스는 AI가 쓴 대본을 바탕으로 이미지와 함께 목소리도 생성해 영상에 넣습니다. 따로 녹음하거나 성우를 구하지 않아도 이야기를 들려주는 내레이션이 들어간 숏폼이 만들어집니다."
}
},
{
"@type": "Question",
"name": "AI 숏폼 제작 도구를 고를 때 무엇을 확인해야 하나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "AI 숏폼 도구를 고를 때는 어떤 소재를 넣어야 하는지, 완성 후 추가 편집이 필요한지, 유튜브 같은 채널로 바로 업로드할 수 있는지, 비용이 어떤 방식으로 차감되는지를 확인하는 것이 좋습니다. ADO2광장은 업체명이나 네이버 지도 링크만으로 소재를 자동 수집하고, 완성된 영상을 다운로드하거나 YouTube에 바로 올릴 수 있으며, 크레딧 단위로 비용이 차감됩니다."
}
},
{
"@type": "Question",
"name": "AI로 만든 숏폼 영상을 다운로드할 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, ADO2광장에서 완성된 썰박스 영상은 결과 화면이나 내 콘텐츠 목록에서 다운로드할 수 있습니다. 내려받은 영상은 인스타그램 릴스나 블로그처럼 원하는 채널에 직접 올릴 수 있습니다."
}
},
{
"@type": "Question",
"name": "ADO2광장은 어떤 서비스인가요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "ADO2광장은 ㈜에이아이오투오가 운영하는 AI 숏폼 콘텐츠 제작 서비스입니다. 유명한 역사·신화 이야기에 매장의 셀링 포인트를 녹인 썰박스 영상과, 매장 분석을 바탕으로 가사와 음악을 만들어 넣은 ADO2 숏폼 영상을 만들 수 있습니다. 완성된 영상은 다운로드하거나 YouTube에 바로 업로드할 수 있습니다."
}
},
{
"@type": "Question",
"name": "썰박스와 ADO2 숏폼은 무엇이 다른가요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "썰박스는 조선왕, 삼국지, 그리스·로마신화, 오디세이 같은 유명 이야기에 업체 셀링 포인트를 녹여 흥미로운 스토리형 숏폼을 만듭니다. ADO2 숏폼은 업체 URL 하나로 브랜드를 분석해 매장을 위한 가사와 음악을 만들고 이를 넣은 홍보 영상을 제작합니다. 이야기로 관심을 끌고 싶다면 썰박스를, 매장 자체를 노래로 알리고 싶다면 ADO2 숏폼을 고르면 됩니다."
}
},
{
"@type": "Question",
"name": "썰박스 영상 한 편을 만드는 데 비용은 얼마인가요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "ADO2광장에서 썰박스 영상 한 편을 만들 때는 1크레딧이 차감됩니다. 생성에 실패하면 차감된 크레딧은 환불되며, 보유 크레딧은 내 정보 화면에서 확인하고 부족하면 서비스 안에서 충전을 요청할 수 있습니다."
}
},
{
"@type": "Question",
"name": "ADO2광장은 어떻게 시작하나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "ADO2광장은 카카오 계정으로 간편하게 가입하고 로그인할 수 있습니다. 로그인한 뒤 썰박스를 선택하고, 시나리오를 고른 다음 업체를 검색하면 영상 제작이 시작됩니다."
}
},
{
"@type": "Question",
"name": "다른 매장이 만든 썰박스 영상 예시를 볼 수 있나요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "네, ADO2광장의 ADO2 콘텐츠 메뉴에서 다른 매장들이 만든 썰박스와 ADO2 숏폼 영상을 볼 수 있습니다. 지역과 업체명으로 검색하고 최신순, 좋아요 많은순, 댓글 많은순으로 정렬해 업종별 예시를 참고할 수 있습니다."
}
},
{
"@type": "Question",
"name": "ADO2광장을 운영하는 회사는 어디인가요?",
"acceptedAnswer": {
"@type": "Answer",
"text": "ADO2광장은 ㈜에이아이오투오가 개발하고 운영합니다. 본사는 대구광역시 북구 옥산로 111에 있으며, 연구소는 경기도 성남시 수정구 금토로 32 KT 판교빌딩에 있습니다. 서비스 문의는 이메일 o2oteam@o2o.kr로 할 수 있습니다."
}
}
]
}
</script>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.8; color: #333; max-width: 800px; margin: 0 auto; padding: 40px 20px; }
h1 { font-size: 28px; border-bottom: 2px solid #eee; padding-bottom: 12px; margin-bottom: 30px; }
h2 { font-size: 22px; margin-top: 56px; color: #111; border-bottom: 1px solid #eee; padding-bottom: 8px; }
h3 { font-size: 17px; margin-top: 32px; color: #111; }
p, li { font-size: 15px; color: #555; margin-bottom: 10px; }
ul { padding-left: 20px; }
.updated { color: #888; font-size: 14px; margin-bottom: 30px; }
</style>
</head>
<body>
<h1>역사 썰 숏폼으로 가게 홍보하기 FAQ</h1>
<p class="updated"><strong>최종 수정일:</strong> <time datetime="2026-10-13">2026년 10월 13일</time></p>
<p>조선왕, 삼국지, 그리스·로마신화 같은 역사 썰 숏폼에 가게 홍보를 녹이는 방법과, 영상 편집 없이 AI로 매장 홍보 숏폼을 만드는 방법에 대해 자주 묻는 질문을 정리했습니다.</p>
<nav>
<ul>
<li><a href="#store">사장님을 위한 매장 홍보 숏폼</a></li>
<li><a href="#history">역사 썰·신화 숏폼</a></li>
<li><a href="#ai">AI 숏폼 제작 도구</a></li>
<li><a href="#guide">ADO2광장 이용 안내</a></li>
</ul>
</nav>
<section id="store">
<h2>사장님을 위한 매장 홍보 숏폼</h2>
<h3>가게 홍보 숏폼은 어떻게 만들어야 사람들이 끝까지 보나요?</h3>
<p>숏폼 시청자는 첫 몇 초 안에 광고라고 느끼면 바로 넘기는 경우가 많기 때문에, 가게 소개로 시작하기보다 흥미로운 이야기로 시작해 매장을 자연스럽게 연결하는 구성이 효과적입니다. 이야기에 빠져든 시청자는 끝까지 보는 동안 매장 이름과 특징을 함께 기억하게 됩니다. ADO2광장의 썰박스는 조선 왕, 삼국지, 그리스·로마신화 같은 유명한 이야기에 매장의 셀링 포인트를 녹여 이런 스토리형 홍보 숏폼을 자동으로 만들어 줍니다.</p>
<h3>스토리텔링 마케팅은 작은 가게에도 효과가 있나요?</h3>
<p>스토리텔링 마케팅은 광고비를 많이 쓰기 어려운 작은 가게에 특히 잘 맞는 방식입니다. 제품이나 가격을 나열하는 대신 이야기 속에 매장을 등장시키면 시청자가 거부감 없이 받아들이고, 재미있는 콘텐츠는 공유되면서 자연스럽게 퍼질 수 있습니다. ADO2광장의 썰박스를 사용하면 대본을 직접 쓰지 않아도 역사와 신화 이야기를 활용한 스토리텔링 홍보 영상을 만들 수 있습니다.</p>
<h3>광고 티가 나지 않는 가게 홍보 영상은 어떻게 만드나요?</h3>
<p>광고 티가 나지 않는 홍보 영상을 만들려면 시청자가 원래 즐겨 보는 콘텐츠 형식을 빌려 오는 것이 좋습니다. 역사 썰, 신화 이야기처럼 인기 있는 숏폼 장르의 흐름을 따라가면서 매장은 이야기 속 장소나 소재로 짧게 등장시키는 방식이 대표적입니다. ADO2광장의 썰박스는 이야기 흐름 안에 업체 정보와 사진을 배치해 콘텐츠로 즐길 수 있는 홍보 영상을 만듭니다.</p>
<h3>영상 편집을 할 줄 몰라도 매장 홍보 숏폼을 만들 수 있나요?</h3>
<p>네, 만들 수 있습니다. AI 숏폼 제작 도구를 사용하면 대본, 장면 구성, 이미지, 목소리, 자막을 자동으로 처리하기 때문에 편집 프로그램을 배우지 않아도 됩니다. ADO2광장에서는 시나리오를 고르고 업체를 검색하는 두 단계만으로 썰박스 영상이 완성되며, 별도 프로그램 설치 없이 웹에서 바로 이용할 수 있습니다.</p>
<h3>네이버 지도에 등록된 가게 정보로 홍보 영상을 만들 수 있나요?</h3>
<p>네, 네이버 지도나 네이버 플레이스에 등록된 매장 이름, 업종, 사진 같은 정보는 홍보 영상의 소재로 활용할 수 있습니다. ADO2광장에서 업체명을 검색하거나 네이버 지도 공유 링크를 붙여넣으면 해당 업체의 사진과 정보를 자동으로 수집해 영상 제작에 사용합니다.</p>
<h3>매장 홍보 영상의 제목과 태그는 어떻게 쓰나요?</h3>
<p>홍보 영상 제목과 태그에는 사람들이 실제로 검색하는 지역명, 업종, 특징을 함께 넣는 것이 좋습니다. 스토리형 영상이라면 '조선 왕도 반한 전주 한정식'처럼 이야기 소재와 매장 정보를 함께 담은 제목이 호기심과 검색 노출을 동시에 노릴 수 있습니다. ADO2광장은 YouTube에 업로드할 때 영상 제목, 설명, 태그를 AI가 자동으로 작성합니다.</p>
<h3>홍보 숏폼을 본 사람을 가게 홈페이지로 연결하려면 어떻게 하나요?</h3>
<p>홍보 숏폼이 방문이나 예약으로 이어지려면 영상을 본 직후 이동할 수 있는 링크가 있어야 합니다. 영상 설명란과 SNS 프로필에 홈페이지나 예약 페이지 링크를 넣어 두는 것이 기본입니다. ADO2광장에서 업체의 공식 홈페이지 주소를 등록하면 영상 페이지에서 영상이 끝나기 3초 전에 '자세히 보기' 링크가 표시됩니다.</p>
</section>
<section id="history">
<h2>역사 썰·신화 숏폼</h2>
<h3>역사 썰 숏폼이란 무엇인가요?</h3>
<p>역사 썰 숏폼은 역사 속 실화, 야사, 신화를 친구에게 이야기하듯 짧고 흥미롭게 풀어 주는 1분 안팎의 세로형 영상입니다. 누구나 아는 인물과 사건을 다루면서도 잘 알려지지 않은 뒷이야기를 꺼내기 때문에 끝까지 보게 만드는 힘이 있습니다. ADO2광장의 썰박스는 이런 역사 썰 형식에 매장 홍보를 결합한 숏폼을 AI로 만들어 줍니다.</p>
<h3>조선 왕 이야기로 숏폼 영상을 만들 수 있나요?</h3>
<p>네, ADO2광장의 썰박스에는 조선 27대 왕들의 실화 썰을 다루는 조선왕 시나리오가 있습니다. 조선 왕들의 일화를 이야기 소재로 삼아 업체의 특징을 녹여 낸 숏폼 영상을 만들 수 있어, 한식당이나 전통 숙소처럼 한국적인 분위기의 매장과 특히 잘 어울립니다.</p>
<h3>삼국지 이야기로 숏폼 영상을 만들 수 있나요?</h3>
<p>네, ADO2광장의 썰박스에는 위·촉·오 영웅 28인의 야사를 다루는 삼국지 시나리오가 있습니다. 유비, 관우, 조조처럼 잘 알려진 영웅들의 이야기에 업체의 셀링 포인트를 엮어 흥미로운 홍보 숏폼을 만들 수 있습니다.</p>
<h3>그리스·로마신화 이야기로 숏폼 영상을 만들 수 있나요?</h3>
<p>네, ADO2광장의 썰박스에는 올림포스 신과 영웅들의 전설을 다루는 그리스·로마신화 시나리오가 있습니다. 신화 속 장면과 인물을 활용해 카페, 레스토랑, 숙소 같은 매장을 이야기 속에 등장시키는 홍보 영상을 만들 수 있습니다.</p>
<h3>오디세이 이야기로 숏폼 영상을 만들 수 있나요?</h3>
<p>네, ADO2광장의 썰박스에는 오디세우스의 10년 귀향 대모험을 다루는 오디세이 시나리오가 있습니다. 긴 여정과 모험이라는 이야기 구조 덕분에 여행지, 숙박 업소, 체험형 매장을 소개하는 홍보 영상에 잘 어울립니다.</p>
<h3>역사 이야기와 가게 홍보는 어떻게 연결되나요?</h3>
<p>썰박스에서는 선택한 시나리오의 이야기 흐름 안에 업체의 셀링 포인트를 녹여 넣습니다. 시청자는 역사나 신화 이야기를 따라가다가 이야기 속에 자연스럽게 등장하는 매장을 만나게 되고, 영상에는 수집된 업체 사진이 함께 사용됩니다.</p>
<h3>AI가 만든 역사 썰 영상의 내용은 모두 역사적 사실인가요?</h3>
<p>역사 썰 콘텐츠는 실화와 야사, 신화, 이야기를 위한 각색이 섞인 장르이므로 모든 내용을 학술적인 사실로 받아들이기보다는 재미를 위한 이야기로 보는 것이 좋습니다. ADO2광장의 썰박스도 AI가 대본을 쓰기 때문에, 중요한 사실 관계가 담긴 영상을 공개하기 전에는 내용을 한 번 확인하는 것을 권장합니다.</p>
</section>
<section id="ai">
<h2>AI 숏폼 제작 도구</h2>
<h3>AI로 유튜브 쇼츠를 자동으로 만들 수 있나요?</h3>
<p>네, AI 숏폼 제작 도구를 사용하면 대본 작성, 이미지 생성, 내레이션, 영상 합성까지 자동으로 처리해 유튜브 쇼츠를 만들 수 있습니다. ADO2광장의 썰박스는 대본 생성, 스토리보드 구성, 이미지와 목소리 생성, 영상 합성을 차례로 진행해 숏폼 영상을 완성하고, 연결된 YouTube 채널에 바로 업로드할 수 있습니다.</p>
<h3>AI 숏폼 영상을 만드는 데 시간이 얼마나 걸리나요?</h3>
<p>AI 숏폼 제작 시간은 도구와 영상 구성에 따라 다르지만, 사람이 직접 편집하는 것보다 훨씬 짧습니다. ADO2광장에서 썰박스 영상은 약 5~6분 만에 완성되며, 생성 중에는 대본, 스토리보드, 이미지·목소리, 영상 합성 중 어느 단계가 진행 중인지 확인할 수 있습니다.</p>
<h3>AI가 만든 숏폼에 목소리 내레이션도 들어가나요?</h3>
<p>네, ADO2광장의 썰박스는 AI가 쓴 대본을 바탕으로 이미지와 함께 목소리도 생성해 영상에 넣습니다. 따로 녹음하거나 성우를 구하지 않아도 이야기를 들려주는 내레이션이 들어간 숏폼이 만들어집니다.</p>
<h3>AI 숏폼 제작 도구를 고를 때 무엇을 확인해야 하나요?</h3>
<p>AI 숏폼 도구를 고를 때는 어떤 소재를 넣어야 하는지, 완성 후 추가 편집이 필요한지, 유튜브 같은 채널로 바로 업로드할 수 있는지, 비용이 어떤 방식으로 차감되는지를 확인하는 것이 좋습니다. ADO2광장은 업체명이나 네이버 지도 링크만으로 소재를 자동 수집하고, 완성된 영상을 다운로드하거나 YouTube에 바로 올릴 수 있으며, 크레딧 단위로 비용이 차감됩니다.</p>
<h3>AI로 만든 숏폼 영상을 다운로드할 수 있나요?</h3>
<p>네, ADO2광장에서 완성된 썰박스 영상은 결과 화면이나 내 콘텐츠 목록에서 다운로드할 수 있습니다. 내려받은 영상은 인스타그램 릴스나 블로그처럼 원하는 채널에 직접 올릴 수 있습니다.</p>
</section>
<section id="guide">
<h2>ADO2광장 이용 안내</h2>
<h3>ADO2광장은 어떤 서비스인가요?</h3>
<p>ADO2광장은 ㈜에이아이오투오가 운영하는 AI 숏폼 콘텐츠 제작 서비스입니다. 유명한 역사·신화 이야기에 매장의 셀링 포인트를 녹인 썰박스 영상과, 매장 분석을 바탕으로 가사와 음악을 만들어 넣은 ADO2 숏폼 영상을 만들 수 있습니다. 완성된 영상은 다운로드하거나 YouTube에 바로 업로드할 수 있습니다.</p>
<h3>썰박스와 ADO2 숏폼은 무엇이 다른가요?</h3>
<p>썰박스는 조선왕, 삼국지, 그리스·로마신화, 오디세이 같은 유명 이야기에 업체 셀링 포인트를 녹여 흥미로운 스토리형 숏폼을 만듭니다. ADO2 숏폼은 업체 URL 하나로 브랜드를 분석해 매장을 위한 가사와 음악을 만들고 이를 넣은 홍보 영상을 제작합니다. 이야기로 관심을 끌고 싶다면 썰박스를, 매장 자체를 노래로 알리고 싶다면 ADO2 숏폼을 고르면 됩니다.</p>
<h3>썰박스 영상 한 편을 만드는 데 비용은 얼마인가요?</h3>
<p>ADO2광장에서 썰박스 영상 한 편을 만들 때는 1크레딧이 차감됩니다. 생성에 실패하면 차감된 크레딧은 환불되며, 보유 크레딧은 내 정보 화면에서 확인하고 부족하면 서비스 안에서 충전을 요청할 수 있습니다.</p>
<h3>ADO2광장은 어떻게 시작하나요?</h3>
<p>ADO2광장은 카카오 계정으로 간편하게 가입하고 로그인할 수 있습니다. 로그인한 뒤 썰박스를 선택하고, 시나리오를 고른 다음 업체를 검색하면 영상 제작이 시작됩니다.</p>
<h3>다른 매장이 만든 썰박스 영상 예시를 볼 수 있나요?</h3>
<p>네, ADO2광장의 ADO2 콘텐츠 메뉴에서 다른 매장들이 만든 썰박스와 ADO2 숏폼 영상을 볼 수 있습니다. 지역과 업체명으로 검색하고 최신순, 좋아요 많은순, 댓글 많은순으로 정렬해 업종별 예시를 참고할 수 있습니다.</p>
<h3>ADO2광장을 운영하는 회사는 어디인가요?</h3>
<p>ADO2광장은 ㈜에이아이오투오가 개발하고 운영합니다. 본사는 대구광역시 북구 옥산로 111에 있으며, 연구소는 경기도 성남시 수정구 금토로 32 KT 판교빌딩에 있습니다. 서비스 문의는 이메일 o2oteam@o2o.kr로 할 수 있습니다.</p>
</section>
<p style="margin-top:40px; font-size:14px; color:#999;"><a href="/">ADO2광장 홈</a> · <a href="/terms.html">서비스 약관</a> · <a href="/privacy.html">개인정보처리방침</a></p>
</body>
</html>
+15
View File
@@ -0,0 +1,15 @@
# ADO2광장
> ADO2광장은 ㈜에이아이오투오가 운영하는 AI 숏폼 콘텐츠 제작 서비스입니다. 조선왕·삼국지·그리스로마신화·오디세이 같은 역사·신화 이야기에 가게 셀링포인트를 녹인 홍보 숏폼(썰박스)을 업체명이나 네이버 지도 링크 하나로 약 5~6분 만에 만들고 YouTube에 바로 올릴 수 있습니다.
- 대상: 펜션, 음식점, 카페, 미용실 등 지역 기반 소상공인
- 썰박스: 시나리오 선택 → 업체 검색 → AI 대본·스토리보드·이미지·내레이션 생성 → 영상 합성 (1크레딧, 실패 시 환불)
- ADO2 숏폼: 매장 분석 기반 AI 가사·음악을 넣은 홍보 영상
- 로그인: 카카오 계정
- 문의: o2oteam@o2o.kr
## 문서
- [역사 썰 숏폼으로 가게 홍보하기 FAQ](https://dev-ssul.castad.net/faq.html): 스토리형 매장 홍보 숏폼, 역사 썰·신화 숏폼, AI 숏폼 제작 도구, ADO2광장 이용 안내
- [서비스 약관](https://dev-ssul.castad.net/terms.html)
- [개인정보처리방침](https://dev-ssul.castad.net/privacy.html)
+29
View File
@@ -0,0 +1,29 @@
User-agent: *
Allow: /
Disallow: /social/
User-agent: GPTBot
Allow: /
Disallow: /social/
User-agent: OAI-SearchBot
Allow: /
Disallow: /social/
User-agent: ClaudeBot
Allow: /
Disallow: /social/
User-agent: PerplexityBot
Allow: /
Disallow: /social/
User-agent: Google-Extended
Allow: /
Disallow: /social/
User-agent: Yeti
Allow: /
Disallow: /social/
Sitemap: https://dev-ssul.castad.net/sitemap.xml
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://dev-ssul.castad.net/</loc>
<lastmod>2026-10-13</lastmod>
</url>
<url>
<loc>https://dev-ssul.castad.net/faq.html</loc>
<lastmod>2026-10-13</lastmod>
</url>
<url>
<loc>https://dev-ssul.castad.net/terms.html</loc>
<lastmod>2026-05-21</lastmod>
</url>
<url>
<loc>https://dev-ssul.castad.net/privacy.html</loc>
<lastmod>2026-05-27</lastmod>
</url>
</urlset>
+9
View File
@@ -7,6 +7,7 @@ import SocialConnectError from './pages/Social/SocialConnectError';
import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback'; import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback';
import VideoDetailPage from './components/VideoDetailPage'; import VideoDetailPage from './components/VideoDetailPage';
import SsulDetailPage from './pages/Ssulbox/SsulDetailPage'; import SsulDetailPage from './pages/Ssulbox/SsulDetailPage';
import P2vDetailPage from './pages/P2v/P2vDetailPage';
import { kakaoCallback, saveTokens, storeUtmFromUrl, trackViewContent, trackCompleteRegistration } from './utils/api'; import { kakaoCallback, saveTokens, storeUtmFromUrl, trackViewContent, trackCompleteRegistration } from './utils/api';
import { clearSessionStorage } from './utils/storageKeys'; import { clearSessionStorage } from './utils/storageKeys';
import { NAV } from './components/navItems'; import { NAV } from './components/navItems';
@@ -154,6 +155,14 @@ const App: React.FC = () => {
return <SsulDetailPage contentId={ssulDetailMatch[1]} />; return <SsulDetailPage contentId={ssulDetailMatch[1]} />;
} }
const p2vDetailMatch = pathname.match(/^\/p2v\/(f1|playreel)\/(\d+)\/?$/);
if (p2vDetailMatch) {
return <P2vDetailPage
contentId={p2vDetailMatch[2]}
contentType={p2vDetailMatch[1] === 'f1' ? 'p2v_video' : 'p2v_playreel'}
/>;
}
// 카카오 콜백 처리 중 로딩 화면 표시 // 카카오 콜백 처리 중 로딩 화면 표시
if (isProcessingCallback) { if (isProcessingCallback) {
return ( return (
+3 -4
View File
@@ -2,6 +2,7 @@ import React, { useRef, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { API_URL, toggleVideoLike, isLoggedIn } from '../utils/api'; import { API_URL, toggleVideoLike, isLoggedIn } from '../utils/api';
import { buildContentShareUrl, tryNativeShare } from '../utils/nativeShare'; import { buildContentShareUrl, tryNativeShare } from '../utils/nativeShare';
import { ContentType } from '../types/api';
import LoginPromptModal from './LoginPromptModal'; import LoginPromptModal from './LoginPromptModal';
interface ContentCardSocialActionsProps { interface ContentCardSocialActionsProps {
@@ -9,10 +10,8 @@ interface ContentCardSocialActionsProps {
/** /**
* 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 좋아요 API 와 * 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 좋아요 API 와
* 공유 URL(/video/{id} vs /ssul/{id}) 분기에 반드시 필요하다. * 공유 URL(/video/{id} vs /ssul/{id}) 분기에 반드시 필요하다.
* ContentType 전체가 아니라 이 둘로 좁힌 이유: 좋아요·공유 축은 video·ssul
* 에만 있다 — P2V 항목은 이 컴포넌트를 렌더하지 않는다(MyContentsPage 분기).
*/ */
contentType?: 'video' | 'ssul'; contentType?: ContentType;
storeName: string; storeName: string;
region?: string; region?: string;
title?: string | null; title?: string | null;
@@ -32,7 +31,7 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
commentCount, commentCount,
initialLikeCount, initialLikeCount,
initialIsLiked = false, initialIsLiked = false,
}) => { }: ContentCardSocialActionsProps) => {
const { t } = useTranslation(); const { t } = useTranslation();
const [likeCount, setLikeCount] = useState(initialLikeCount); const [likeCount, setLikeCount] = useState(initialLikeCount);
+489
View File
@@ -0,0 +1,489 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
API_URL,
deleteComment,
getSsulContentById,
getUserMe,
getVideoComments,
isLoggedIn,
postVideoComment,
toggleVideoLike,
} from '../utils/api';
import type { SsulDetailItem } from '../utils/api';
import { CommentItem, P2vContentType, UserMeResponse } from '../types/api';
import { buildContentShareUrl, tryNativeShare } from '../utils/nativeShare';
import LoginPromptModal from './LoginPromptModal';
import { isSafeHttpUrl } from '../utils/url';
import { getP2vContentById } from '../utils/p2vApi';
interface ContentDetailContentProps {
contentId: string;
contentType: 'ssul' | P2vContentType;
isModal?: boolean;
onClose?: () => void;
}
type DetailContent = Pick<SsulDetailItem,
'video_url' | 'store_name' | 'official_site_url' | 'created_at' | 'like_count' | 'is_liked_by_me'
> & { poster_url?: string | null };
/** Shared public detail UI for Ssulbox and P2V content. */
const ContentDetailContent: React.FC<ContentDetailContentProps> = ({
contentId,
contentType,
isModal = false,
onClose,
}) => {
const { t } = useTranslation();
const authed = isLoggedIn();
const [content, setContent] = useState<DetailContent | null>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
const [likeCount, setLikeCount] = useState(0);
const [isLiked, setIsLiked] = useState(false);
const [likeSubmitting, setLikeSubmitting] = useState(false);
const [copied, setCopied] = useState(false);
const [isLandscape, setIsLandscape] = useState(false);
const [showSiteOverlay, setShowSiteOverlay] = useState(false);
const [showLoginModal, setShowLoginModal] = useState(false);
const [comments, setComments] = useState<CommentItem[]>([]);
const [commentsTotal, setCommentsTotal] = useState(0);
const [commentsPage, setCommentsPage] = useState(1);
const [commentsHasNext, setCommentsHasNext] = useState(false);
const [commentsLoading, setCommentsLoading] = useState(false);
const [commentInput, setCommentInput] = useState('');
const [commentSubmitting, setCommentSubmitting] = useState(false);
const commentTextareaRef = useRef<HTMLTextAreaElement>(null);
const [currentUser, setCurrentUser] = useState<UserMeResponse | null>(null);
const fetchComments = useCallback(
async (page: number, append = false) => {
setCommentsLoading(true);
try {
const res = await getVideoComments(contentId, page, 20, contentType);
const sorted = [...res.items].sort(
(a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()
);
setComments((prev) => (append ? [...prev, ...sorted] : sorted));
setCommentsTotal(res.total);
setCommentsHasNext(res.has_next);
setCommentsPage(page);
} catch (err) {
console.error('Failed to fetch content comments:', err);
} finally {
setCommentsLoading(false);
}
},
[contentId, contentType]
);
useEffect(() => {
const fetchContent = async () => {
setLoading(true);
setError(null);
setShowSiteOverlay(false);
try {
const data = contentType === 'ssul'
? await getSsulContentById(contentId)
: await getP2vContentById(contentType, contentId).then((item) => ({
...item, store_name: item.title,
}));
setContent(data);
setLikeCount(data.like_count);
setIsLiked(data.is_liked_by_me);
} catch (err) {
console.error('Failed to fetch content:', err);
setError(t('ado2Contents.loadFailed'));
} finally {
setLoading(false);
}
};
setIsLandscape(false);
fetchContent();
fetchComments(1);
}, [contentId, contentType, fetchComments, t]);
useEffect(() => {
if (!authed) return;
getUserMe().then(setCurrentUser).catch((err) => {
console.error('Failed to fetch current user:', err);
});
}, [authed]);
const formatDate = (dateString: string) => {
const date = new Date(dateString);
return t('videoDetail.dateFormat', {
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate(),
});
};
const formatCommentDate = (dateString: string) => {
const date = new Date(dateString);
return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(
date.getDate()
).padStart(2, '0')}`;
};
// ID 가 같아도 콘텐츠 종류에 맞는 공유 경로로 연다.
const shareUrl = buildContentShareUrl(API_URL, contentId, contentType);
const handleCopyLink = async () => {
try {
await navigator.clipboard.writeText(shareUrl);
} catch {
// clipboard API 미지원 환경에서는 무시
}
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
const handleShareButtonClick = async () => {
const handled = await tryNativeShare({
title: content?.store_name ?? t('videoDetail.kakaoDefaultTitle'),
url: shareUrl,
});
if (handled) {
return;
}
await handleCopyLink();
};
const handleLike = async () => {
if (!authed) {
setShowLoginModal(true);
return;
}
if (likeSubmitting) return;
const prevLiked = isLiked;
const prevCount = likeCount;
setLikeSubmitting(true);
setIsLiked(!prevLiked);
setLikeCount(prevLiked ? prevCount - 1 : prevCount + 1);
try {
const result = await toggleVideoLike(contentId, contentType);
setIsLiked(result.is_liked);
setLikeCount(result.like_count);
} catch (err) {
console.error('Failed to toggle content like:', err);
setIsLiked(prevLiked);
setLikeCount(prevCount);
} finally {
setLikeSubmitting(false);
}
};
const handleHeaderAction = () => {
onClose?.();
};
const handleCommentFocus = () => {
if (!authed) setShowLoginModal(true);
};
const handleCommentSubmit = async () => {
if (!authed) {
setShowLoginModal(true);
return;
}
if (!commentInput.trim() || commentSubmitting) return;
setCommentSubmitting(true);
try {
await postVideoComment(contentId, commentInput.trim(), undefined, contentType);
setCommentInput('');
if (commentTextareaRef.current) {
commentTextareaRef.current.style.height = 'auto';
}
await fetchComments(1);
} catch (err) {
console.error('Failed to post content comment:', err);
} finally {
setCommentSubmitting(false);
}
};
const handleDeleteComment = async (commentId: number) => {
try {
await deleteComment(commentId);
await fetchComments(commentsPage);
} catch (err) {
console.error('Failed to delete content comment:', err);
}
};
const renderCommentContent = (content_: string | null, isDeleted: boolean) => {
if (isDeleted) {
return (
<span style={{ color: '#6B9EA0', fontStyle: 'italic' }}>
{t('videoDetail.deletedComment')}
</span>
);
}
return content_;
};
return (
<div className={isModal ? 'video-detail-modal-content' : 'video-detail-page-content'}>
{/* 헤더 */}
<div className="video-detail-header">
{isModal ? (
<>
{/* 제목이 없으면 space-between 인 헤더에서 닫기 버튼이 왼쪽으로 붙는다.
문구는 ADO2 상세와 같은 키를 쓴다 — 통합 목록에서 열리는 같은
모달이므로 콘텐츠 종류에 따라 제목이 바뀌면 오히려 어색하다. */}
<h2 className="video-detail-modal-title">{t('sidebar.ado2Contents')}</h2>
<button className="video-detail-close-btn" onClick={handleHeaderAction} aria-label={t('videoDetail.closeAriaLabel')}>
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
</svg>
</button>
</>
) : (
<button className="video-detail-back-btn" onClick={handleHeaderAction}>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
<path d="M13 4l-6 6 6 6" />
</svg>
{t('sidebar.ado2Contents')}
</button>
)}
</div>
<div className="video-detail-body">
{loading ? (
<div className="ado2-contents-loading">
<div className="loading-spinner"></div>
<p>{t('ado2Contents.loading')}</p>
</div>
) : error ? (
<div className="ado2-contents-error"><p>{error}</p></div>
) : content ? (
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
<div className="video-detail-player-wrap">
<video
src={content.video_url}
poster={content.poster_url ?? undefined}
controls
autoPlay
playsInline
controlsList="nodownload"
onContextMenu={(e) => e.preventDefault()}
className="video-detail-player"
onLoadedMetadata={(e) => {
const v = e.currentTarget;
setIsLandscape(v.videoWidth > v.videoHeight);
}}
onTimeUpdate={(e) => {
if (!content.official_site_url) return;
const v = e.currentTarget;
// 영상 종료 3초 전부터 공식 홈페이지 오버레이 노출
setShowSiteOverlay(
Number.isFinite(v.duration) && v.duration - v.currentTime <= 3
);
}}
/>
{showSiteOverlay && isSafeHttpUrl(content.official_site_url) && (
<a
href={content.official_site_url as string}
target="_blank"
rel="noopener noreferrer"
className="video-site-overlay"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="12" cy="12" r="10"/>
<line x1="2" y1="12" x2="22" y2="12"/>
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
</svg>
<span className="video-site-overlay-text">
<strong>{content.store_name}</strong>
{t('videoDetail.siteOverlayLabel')}
</span>
</a>
)}
</div>
<div className="video-detail-info">
<h2 className="video-detail-store">
{content.store_name || t('ssulbox.viewer.untitled')}
</h2>
<p className="video-detail-date">{formatDate(content.created_at)}</p>
{/* 좋아요 + 공유 */}
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<button
className={`video-detail-like-btn ${isLiked ? 'liked' : ''}`}
onClick={handleLike}
disabled={likeSubmitting}
>
<svg width="16" height="16" viewBox="0 0 24 24" fill={isLiked ? 'currentColor' : 'none'} stroke="currentColor" strokeWidth="2">
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />
</svg>
{likeCount}
</button>
<button
className="video-detail-copy-btn"
onClick={handleShareButtonClick}
title={t('videoDetail.share')}
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="18" cy="5" r="3" /><circle cx="6" cy="12" r="3" /><circle cx="18" cy="19" r="3" />
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" /><line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
</svg>
{copied ? t('videoDetail.copied') : t('videoDetail.share')}
</button>
</div>
{/* 댓글 섹션 */}
<div className="video-detail-comments">
<div className="video-detail-comments-header">
<h3 className="video-detail-comments-title">{t('videoDetail.commentsTitle')}</h3>
<span className="video-detail-comments-count">{commentsTotal}</span>
</div>
{authed && currentUser && (
<div className="video-detail-comment-profile">
{currentUser.profile_image_url && (
<img
src={currentUser.profile_image_url}
alt={currentUser.nickname}
className="video-detail-comment-avatar"
/>
)}
<span className="video-detail-comment-nickname">{currentUser.nickname}</span>
</div>
)}
<div className="video-detail-comment-input-wrap">
<textarea
ref={commentTextareaRef}
className="video-detail-comment-input"
placeholder={authed ? t('videoDetail.commentPlaceholder') : t('videoDetail.commentLoginRequired')}
maxLength={500}
rows={1}
value={commentInput}
onChange={(e) => {
setCommentInput(e.target.value);
e.target.style.height = 'auto';
e.target.style.height = `${e.target.scrollHeight}px`;
}}
onFocus={handleCommentFocus}
onKeyDown={(e) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
handleCommentSubmit();
}
}}
disabled={!authed}
/>
<button
className="video-detail-comment-submit"
onClick={handleCommentSubmit}
disabled={!authed || !commentInput.trim() || commentSubmitting}
>
{commentSubmitting ? t('videoDetail.commentSubmitting') : t('videoDetail.commentSubmit')}
</button>
</div>
{comments.length === 0 && !commentsLoading ? (
<p className="video-detail-comments-empty">{t('videoDetail.noComments')}</p>
) : (
<ul className="video-detail-comment-list">
{comments.map((c) => (
<li key={c.id} className="video-detail-comment-item">
{c.profile_image_url && (
<img
src={c.profile_image_url}
alt={c.nickname || t('videoDetail.anonymous')}
className="video-detail-comment-avatar"
/>
)}
<div className="video-detail-comment-body">
<span className="video-detail-comment-nickname">
{c.nickname || t('videoDetail.anonymous')}
</span>
<p className="video-detail-comment-text">
{renderCommentContent(c.content, c.is_deleted)}
</p>
<div className="video-detail-comment-bottom">
<span className="video-detail-comment-date">{formatCommentDate(c.created_at)}</span>
{c.is_mine && !c.is_deleted && (
<button
className="video-detail-comment-delete"
onClick={() => handleDeleteComment(c.id)}
>
{t('videoDetail.deleteComment')}
</button>
)}
</div>
{c.replies && c.replies.length > 0 && (
<ul className="video-detail-reply-list">
{c.replies.map((r) => (
<li key={r.id} className="video-detail-reply-item">
{r.profile_image_url && (
<img
src={r.profile_image_url}
alt={r.nickname || t('videoDetail.anonymous')}
className="video-detail-comment-avatar small"
/>
)}
<div className="video-detail-comment-body">
<span className="video-detail-comment-nickname">
{r.nickname || t('videoDetail.anonymous')}
</span>
<p className="video-detail-comment-text">
{renderCommentContent(r.content, r.is_deleted)}
</p>
<div className="video-detail-comment-bottom">
<span className="video-detail-comment-date">{formatCommentDate(r.created_at)}</span>
{r.is_mine && !r.is_deleted && (
<button
className="video-detail-comment-delete"
onClick={() => handleDeleteComment(r.id)}
>
{t('videoDetail.deleteComment')}
</button>
)}
</div>
</div>
</li>
))}
</ul>
)}
</div>
</li>
))}
</ul>
)}
{commentsHasNext && (
<button
className="video-detail-comments-more"
onClick={() => fetchComments(commentsPage + 1, true)}
disabled={commentsLoading}
>
{commentsLoading ? t('videoDetail.loadingComments') : t('videoDetail.loadMoreComments')}
</button>
)}
</div>
</div>
</div>
) : null}
</div>
{showLoginModal && (
<LoginPromptModal onClose={() => setShowLoginModal(false)} />
)}
</div>
);
};
export default ContentDetailContent;
-46
View File
@@ -1,46 +0,0 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { P2vLicense } from '../utils/p2vApi';
/**
* 스타일 템플릿의 배포 등급 표시.
*
* 왜 카드마다 붙이나 — 퍼블릭 도메인 명화와 영화 포스터가 한 그리드에 섞여 있어
* 페이지 배너로는 **어느 결과물이 공개 가능한지** 구분되지 않는다. 경고 문구는
* 실제로 고른 순간에만 띄운다(항상 떠 있으면 아무도 안 읽는다).
*/
const CLASS: Record<P2vLicense, string> = {
'public-domain': 'ok',
'internal-only': 'warn',
// 내부 전용과 색을 나눈다 — 해제 조건도, 책임 주체도 다르다
'user-uploaded': 'unknown',
};
export const LicenseBadge: React.FC<{ license: P2vLicense }> = ({ license }) => {
const { t } = useTranslation();
const variant = CLASS[license] ?? CLASS['internal-only'];
return (
<span className={`p2v-license p2v-license--${variant}`}>
{t(`poster.styling.license.${license}`)}
</span>
);
};
/** 내부 전용 템플릿을 고른 순간의 경고 */
export const InternalOnlyWarning: React.FC<{ note?: string }> = ({ note }) => {
const { t } = useTranslation();
return (
<div className="p2v-notice p2v-notice--warn">
<b>{t('poster.styling.internalOnlyTitle')}</b>
{' — '}
{note || t('poster.styling.internalOnlyBody')}
</div>
);
};
/** 사용자가 올린 레퍼런스 고지 — 남의 저작물일 수 있다 */
export const UserReferenceNotice: React.FC = () => {
const { t } = useTranslation();
return <div className="p2v-notice p2v-notice--unknown">{t('poster.styling.userRefNotice')}</div>;
};
-49
View File
@@ -1,49 +0,0 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { getP2vKey, setP2vKey } from '../utils/p2vApi';
interface P2vKeyGateProps {
/** 키를 저장한 뒤 호출 — 호출부가 실패했던 요청을 다시 태운다 */
onSaved: () => void;
}
/**
* P2V 접근 키 입력.
*
* P2V 웹은 401 에서 `window.prompt` 를 띄우지만(내부 도구라 그걸로 충분했다),
* castad 안에서는 제품 화면 한가운데라 시스템 다이얼로그가 튀어나오면 어색하다.
* 디자인 시스템 문법(민트 테두리 알림 + pill 입력)으로 인라인 처리한다.
*/
const P2vKeyGate: React.FC<P2vKeyGateProps> = ({ onSaved }) => {
const { t } = useTranslation();
const [value, setValue] = useState(getP2vKey());
const save = () => {
if (!value.trim()) return;
setP2vKey(value);
onSaved();
};
return (
<div className="p2v-keygate">
<p className="p2v-keygate__title">{t('poster.key.title')}</p>
<p className="p2v-keygate__desc">{t('poster.key.desc')}</p>
<div className="p2v-keygate__row">
<input
type="password"
className="p2v-input"
placeholder={t('poster.key.placeholder')}
value={value}
onChange={(e) => setValue(e.target.value)}
onKeyDown={(e) => e.key === 'Enter' && save()}
autoComplete="off"
/>
<button type="button" className="p2v-btn-mint" disabled={!value.trim()} onClick={save}>
{t('poster.key.save')}
</button>
</div>
</div>
);
};
export default P2vKeyGate;
+16 -104
View File
@@ -1,38 +1,32 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { VideoListItem } from '../types/api'; import { VideoListItem } from '../types/api';
import { useOverlayClose } from '../hooks/useOverlayClose'; import { useOverlayClose } from '../hooks/useOverlayClose';
import { downloadP2vFile } from '../utils/p2vApi'; import ContentDetailContent from './ContentDetailContent';
import { isP2vContent } from '../utils/p2vApi';
interface P2vViewerModalProps { interface P2vViewerModalProps {
/** null 이면 닫힘. type 이 p2v_video 면 영상, p2v_poster 면 이미지로 그린다 */ /** null 이면 닫힘 */
item: VideoListItem | null; item: VideoListItem | null;
onClose: () => void; onClose: () => void;
} }
/** /**
* P2V 콘텐츠 상세 뷰어 — ADO2/썰박스 상세(video-detail-*)와 같은 화면 구성. * P2V(무빙 포스터·롱컷) 콘텐츠 재생 모달 — `SsulViewerModal` 과 같은 백드롭 래퍼.
* *
* 다른 점 둘: * 공개 상세 API 를 사용하며 공유 상세 화면과 같은 소셜 기능을 제공한다.
* - 상세 조회 API 를 부르지 않는다. P2V 항목은 목록 응답(result_movie_url =
* Blob 공개 URL)만으로 그릴 수 있고, 부를 상세 엔드포인트도 없다.
* - 좋아요·댓글·공유가 없다. comment/video_reaction 축이 video·ssul 전용이라
* P2V 지원은 별도 확장(DDL) 없이는 불가 — 화면 구성만 맞춘다(2026-08-26 결정).
* 대신 그 자리에 다운로드 버튼을 둔다.
*/ */
const P2vViewerModal: React.FC<P2vViewerModalProps> = ({ item, onClose }) => { const P2vViewerModal: React.FC<P2vViewerModalProps> = ({ item, onClose }) => {
const { t, i18n } = useTranslation();
const [isLandscape, setIsLandscape] = useState(false);
useEffect(() => { useEffect(() => {
if (!item) return; if (!item) return;
setIsLandscape(false);
const prev = document.body.style.overflow; const prev = document.body.style.overflow;
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
const handleKeyDown = (e: KeyboardEvent) => { const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Escape') onClose(); if (e.key === 'Escape') onClose();
}; };
document.addEventListener('keydown', handleKeyDown); document.addEventListener('keydown', handleKeyDown);
return () => { return () => {
document.body.style.overflow = prev; document.body.style.overflow = prev;
document.removeEventListener('keydown', handleKeyDown); document.removeEventListener('keydown', handleKeyDown);
@@ -41,100 +35,18 @@ const P2vViewerModal: React.FC<P2vViewerModalProps> = ({ item, onClose }) => {
const overlayCloseHandlers = useOverlayClose(onClose); const overlayCloseHandlers = useOverlayClose(onClose);
if (!item) return null; if (!item || !isP2vContent(item.type)) return null;
const isVideo = item.type === 'p2v_video';
const fileName = `${item.store_name || 'p2v'}.${isVideo ? 'mp4' : 'png'}`;
const formatDate = (iso: string) =>
new Date(iso).toLocaleDateString(i18n.language === 'ko' ? 'ko-KR' : 'en-US', {
year: 'numeric', month: 'long', day: 'numeric',
});
return ( return (
<div className="video-detail-overlay" {...overlayCloseHandlers}> <div className="video-detail-overlay" {...overlayCloseHandlers}>
<div className="video-detail-modal-box" onClick={(e) => e.stopPropagation()}> <div className="video-detail-modal-box" onClick={(e) => e.stopPropagation()}>
<div className="video-detail-modal-content"> <ContentDetailContent
{/* 헤더 — 문구는 ADO2/썰박스 상세와 같은 키를 쓴다 (같은 목록에서 열리는 모달) */} key={`${item.type}-${item.video_id}`}
<div className="video-detail-header"> contentId={String(item.video_id)}
<h2 className="video-detail-modal-title">{t('sidebar.ado2Contents')}</h2> contentType={item.type}
<button isModal
className="video-detail-close-btn" onClose={onClose}
onClick={onClose} />
aria-label={t('videoDetail.closeAriaLabel')}
>
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
</svg>
</button>
</div>
<div className="video-detail-body">
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
<div className="video-detail-player-wrap">
{isVideo ? (
<video
src={item.result_movie_url}
controls
autoPlay
playsInline
className="video-detail-player"
onLoadedMetadata={(e) => {
const v = e.currentTarget;
setIsLandscape(v.videoWidth > v.videoHeight);
}}
/>
) : (
<img
src={item.result_movie_url}
alt={item.store_name}
className="video-detail-player"
style={{ objectFit: 'contain' }}
onLoad={(e) => {
const im = e.currentTarget;
setIsLandscape(im.naturalWidth > im.naturalHeight);
}}
/>
)}
</div>
<div className="video-detail-info">
<h2 className="video-detail-store">{item.store_name}</h2>
<p className="video-detail-date">{formatDate(item.created_at)}</p>
{/* 좋아요·공유 자리 — P2V 는 그 축이 없어 다운로드를 둔다.
교차 출처(Blob) URL 은 <a download> 가 무시되므로 fetch 경유 */}
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<button
className="video-detail-copy-btn"
onClick={() => downloadP2vFile(item.result_movie_url, fileName)}
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M12 3v12M12 15l-4-4M12 15l4-4" />
<path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" />
</svg>
{t('p2vViewer.download')}
</button>
</div>
{/* F1 키워드 해시태그 (있을 때만) — 검수 화면과 같은 칩 스타일 재사용 */}
{item.hashtags && item.hashtags.length > 0 && (
<div className="p2v-scope">
<div className="p2v-tags">
{item.hashtags.map((kw) => (
<span key={kw} className="p2v-tag">#{kw}</span>
))}
</div>
</div>
)}
{/* 스타일링은 사용한 템플릿 이름을 부가 정보로 (title 자리에 실려온다) */}
{item.type === 'p2v_poster' && item.title && (
<p className="video-detail-date">{item.title}</p>
)}
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
); );
+8 -12
View File
@@ -1,21 +1,16 @@
import React from 'react'; import React from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import { BookIcon, PosterVideoIcon, StorefrontIcon } from './pipelineIcons';
BookIcon,
PaletteIcon,
PosterVideoIcon,
StorefrontIcon,
} from './pipelineIcons';
/** /**
* 생성할 콘텐츠 종류. 진입 화면에서 고르면 이후 플로우 전체가 갈린다. * 생성할 콘텐츠 종류. 진입 화면에서 고르면 이후 플로우 전체가 갈린다.
* *
* poster·styling 은 castad 백엔드가 아니라 **P2V 서버(:8010)** 를 쓴다(utils/p2vApi.ts). * poster·playreel 은 castad 백엔드의 `/p2v/*` 를 쓴다(utils/p2vApi.ts, utils/playreelApi.ts).
*/ */
export type Pipeline = 'ado2' | 'ssul' | 'poster' | 'styling'; export type Pipeline = 'ado2' | 'ssul' | 'poster' | 'playreel';
/** 유효한 파이프라인 값인가 — localStorage 복원 때 쓴다 */ /** 유효한 파이프라인 값인가 — localStorage 복원 때 쓴다 */
export const PIPELINES: readonly Pipeline[] = ['ado2', 'ssul', 'poster', 'styling']; export const PIPELINES: readonly Pipeline[] = ['ado2', 'ssul', 'poster', 'playreel'];
export const isPipeline = (value: unknown): value is Pipeline => export const isPipeline = (value: unknown): value is Pipeline =>
typeof value === 'string' && (PIPELINES as readonly string[]).includes(value); typeof value === 'string' && (PIPELINES as readonly string[]).includes(value);
@@ -29,7 +24,6 @@ const TABS: { id: Pipeline; labelKey: string; Icon: React.FC<{ size?: number }>
{ id: 'ado2', labelKey: 'pipelineTabs.ado2', Icon: StorefrontIcon }, { id: 'ado2', labelKey: 'pipelineTabs.ado2', Icon: StorefrontIcon },
{ id: 'ssul', labelKey: 'pipelineTabs.ssul', Icon: BookIcon }, { id: 'ssul', labelKey: 'pipelineTabs.ssul', Icon: BookIcon },
{ id: 'poster', labelKey: 'pipelineTabs.poster', Icon: PosterVideoIcon }, { id: 'poster', labelKey: 'pipelineTabs.poster', Icon: PosterVideoIcon },
{ id: 'styling', labelKey: 'pipelineTabs.styling', Icon: PaletteIcon },
]; ];
/** /**
@@ -50,11 +44,13 @@ const TABS: { id: Pipeline; labelKey: string; Icon: React.FC<{ size?: number }>
*/ */
const PipelineTabs: React.FC<PipelineTabsProps> = ({ value, onChange }) => { const PipelineTabs: React.FC<PipelineTabsProps> = ({ value, onChange }) => {
const { t } = useTranslation(); const { t } = useTranslation();
// 롱컷은 무빙 포스터 안의 두 번째 갈래라 별도 탭이 없다. 그 안에 있을 때도 무빙 포스터 탭을 켠다
const active: Pipeline = value === 'playreel' ? 'poster' : value;
return ( return (
<div <div
className="pipeline-tabs" className="pipeline-tabs"
data-active={value} data-active={active}
role="tablist" role="tablist"
aria-label={t('pipelineTabs.ariaLabel')} aria-label={t('pipelineTabs.ariaLabel')}
> >
@@ -63,7 +59,7 @@ const PipelineTabs: React.FC<PipelineTabsProps> = ({ value, onChange }) => {
key={id} key={id}
type="button" type="button"
role="tab" role="tab"
aria-selected={value === id} aria-selected={active === id}
className="pipeline-tab" className="pipeline-tab"
onClick={() => onChange(id)} onClick={() => onChange(id)}
> >
+10 -10
View File
@@ -2,14 +2,14 @@
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { getSocialAccounts, uploadToSocial, waitForUploadComplete, TokenExpiredError, handleSocialReconnect, getAutoSeoYoutube } from '../utils/api'; import { getSocialAccounts, uploadToSocial, waitForUploadComplete, TokenExpiredError, handleSocialReconnect, getAutoSeoYoutube } from '../utils/api';
import { SocialAccount, VideoListItem, SocialUploadStatusResponse } from '../types/api'; import { SocialAccount, SocialUploadableItem, SocialUploadStatusResponse } from '../types/api';
import UploadProgressModal, { UploadStatus } from './UploadProgressModal'; import UploadProgressModal, { UploadStatus } from './UploadProgressModal';
import { useOverlayClose } from '../hooks/useOverlayClose'; import { useOverlayClose } from '../hooks/useOverlayClose';
interface SocialPostingModalProps { interface SocialPostingModalProps {
isOpen: boolean; isOpen: boolean;
onClose: () => void; onClose: () => void;
video: VideoListItem | null; video: SocialUploadableItem | null;
onGoToCalendar?: () => void; onGoToCalendar?: () => void;
} }
@@ -199,8 +199,8 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
const now = Date.now(); const now = Date.now();
const seoKey = const seoKey =
video?.type === 'ssul' video && video.type !== 'video'
? `ssul:${video.video_id}` ? `${video.type}:${video.video_id}`
: video?.task_id || null; : video?.task_id || null;
const expired = now - loadedAtRef.current > SEO_CACHE_TTL; const expired = now - loadedAtRef.current > SEO_CACHE_TTL;
@@ -244,20 +244,20 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
/** /**
* 제목·설명·태그 자동 채움. * 제목·설명·태그 자동 채움.
* *
* `seoKey` 는 호출부가 만든 캐시 키다(ADO2=task_id, 썰박스=`ssul:{id}`). * `seoKey` 는 호출부가 만든 캐시 키다(ADO2=task_id, 썰박스=`ssul:{id}`, 무빙 포스터=`p2v_video:{id}`).
* 백엔드에 보낼 식별자는 종류마다 다르다 — ADO2 는 task_id(UUID), 썰박스는 * 백엔드에 보낼 식별자는 종류마다 다르다 — ADO2 는 task_id(UUID), 썰박스·무빙 포스터는
* ssul_content.id 문자열이며, 서버가 content_type 으로 어느 테이블을 볼지 가른다. * 콘텐츠 id 문자열이며, 서버가 content_type 으로 어느 테이블을 볼지 가른다.
*/ */
const loadAutocomplete = async (seoKey: string) => { const loadAutocomplete = async (seoKey: string) => {
if (!video) return; if (!video) return;
const isSsul = video.type === 'ssul'; const byContentId = video.type !== 'video';
if (!isSsul && !video.task_id) return; if (!byContentId && !video.task_id) return;
setIsLoadingAutoDescription(true); setIsLoadingAutoDescription(true);
try { try {
const requestPayload = { const requestPayload = {
content_type: video.type, content_type: video.type,
task_id: isSsul ? String(video.video_id) : video.task_id, task_id: byContentId ? String(video.video_id) : video.task_id,
}; };
const autoSeoResponse = await getAutoSeoYoutube(requestPayload); const autoSeoResponse = await getAutoSeoYoutube(requestPayload);
-10
View File
@@ -57,13 +57,3 @@ export const PosterVideoIcon: React.FC<IconProps> = ({ size = 24 }) => (
<path d="M10.5 9v6l4.2-3z" fill="currentColor" /> <path d="M10.5 9v6l4.2-3z" fill="currentColor" />
</svg> </svg>
); );
/** 포스터 스타일 — 화풍 재해석 → 팔레트 */
export const PaletteIcon: React.FC<IconProps> = ({ size = 24 }) => (
<svg {...base(size)} aria-hidden="true">
<path d="M12 3a9 9 0 1 0 0 18 1.8 1.8 0 0 0 1.35-3 1.8 1.8 0 0 1 1.35-3H17a4 4 0 0 0 4-4c0-4.42-4.03-8-9-8z" />
<circle cx="7.6" cy="12.4" r="1.1" fill="currentColor" stroke="none" />
<circle cx="9.8" cy="8.2" r="1.1" fill="currentColor" stroke="none" />
<circle cx="14.6" cy="7.6" r="1.1" fill="currentColor" stroke="none" />
</svg>
);
+5 -95
View File
@@ -1,97 +1,7 @@
import { useCallback, useEffect, useRef, useState } from 'react'; import { P2vJob, getPosterJob, isP2vActive } from '../utils/p2vApi';
import { import { UsePolledJobResult, usePolledJob } from './usePolledJob';
P2vAuthError,
P2vJob,
P2vNotFoundError,
getPosterJob,
getStylingJob,
isP2vActive,
} from '../utils/p2vApi';
interface UseP2vJobResult { /** 무빙 포스터 잡 폴링. 검수 대기·완료·실패에서는 멈춘다 */
job: P2vJob | null; export function useP2vJob(id: string | null): UsePolledJobResult<P2vJob> {
error: string | null; return usePolledJob(id, getPosterJob, isP2vActive);
/** 401 — 화면이 접근 키 입력을 띄워야 한다 */
authNeeded: boolean;
/** 404 — 서버에 없는 잡이다. 호출부가 화면을 처음으로 되돌려야 한다 */
notFound: boolean;
/** 즉시 1회 조회하고, 멈춰 있던 폴링을 다시 켠다 (승인·재시도 직후에 쓴다) */
refresh: () => void;
}
const POLL_INTERVAL = 2500;
/**
* P2V 잡 폴링 훅.
*
* castad 에는 웹소켓이 없고 썰박스도 폴링(`waitForSsulComplete`)이라 같은 방식을 쓴다.
* 다만 썰박스는 "끝날 때까지 기다리는" 재귀 함수인 반면 이쪽은 **중간 상태를 계속
* 그려야** 한다 — 검수 게이트에서 멈춰 사용자 입력을 기다리기 때문이다.
*
* 폴링은 queued/running 에서만 돈다. awaiting_review·done·failed 는 사용자가 뭔가
* 하기 전까지 절대 안 바뀌므로 계속 두드리면 서버만 때린다. 승인·재시도 후에는
* 호출부가 refresh() 로 다시 켠다.
*/
export function useP2vJob(kind: 'f1' | 'f2', id: string | null): UseP2vJobResult {
const [job, setJob] = useState<P2vJob | null>(null);
const [error, setError] = useState<string | null>(null);
const [authNeeded, setAuthNeeded] = useState(false);
const [notFound, setNotFound] = useState(false);
const timerRef = useRef<ReturnType<typeof setInterval> | null>(null);
const stop = useCallback(() => {
if (timerRef.current) {
clearInterval(timerRef.current);
timerRef.current = null;
}
}, []);
const fetchOnce = useCallback(async (jobId: string) => {
try {
const next = kind === 'f1' ? await getPosterJob(jobId) : await getStylingJob(jobId);
setJob(next);
setError(null);
setAuthNeeded(false);
setNotFound(false);
if (!isP2vActive(next)) stop();
} catch (e) {
if (e instanceof P2vAuthError) {
setAuthNeeded(true);
stop(); // 키가 없으면 계속 두드려봐야 401만 쌓인다
return;
}
if (e instanceof P2vNotFoundError) {
setNotFound(true);
stop(); // 없는 잡은 다시 생기지 않는다
return;
}
setError((e as Error).message);
}
}, [kind, stop]);
useEffect(() => {
if (!id) {
setJob(null);
setError(null);
setNotFound(false);
stop();
return;
}
// 잡이 바뀌면 이전 잡의 상태가 한 틱 남아 보이므로 먼저 비운다
setJob(null);
setNotFound(false);
fetchOnce(id);
timerRef.current = setInterval(() => fetchOnce(id), POLL_INTERVAL);
return stop;
}, [id, fetchOnce, stop]);
const refresh = useCallback(() => {
if (!id) return;
fetchOnce(id);
if (!timerRef.current) {
timerRef.current = setInterval(() => fetchOnce(id), POLL_INTERVAL);
}
}, [id, fetchOnce]);
return { job, error, authNeeded, notFound, refresh };
} }
+9
View File
@@ -0,0 +1,9 @@
import { PlayreelJob, getPlayreelJob } from '../utils/playreelApi';
import { UsePolledJobResult, usePolledJob } from './usePolledJob';
const isActive = (job: PlayreelJob): boolean => job.status === 'queued' || job.status === 'running';
/** 롱컷 잡 폴링. 검수 게이트(awaiting_review)에서는 멈춘다 */
export function usePlayreelJob(id: string | null): UsePolledJobResult<PlayreelJob> {
return usePolledJob(id, getPlayreelJob, isActive);
}
+87
View File
@@ -0,0 +1,87 @@
import { useCallback, useEffect, useRef, useState } from 'react';
import { P2vNotFoundError } from '../utils/p2vApi';
export interface UsePolledJobResult<T> {
job: T | null;
error: string | null;
/** 404 — 서버에 없는 잡이다. 호출부가 화면을 처음으로 되돌려야 한다 */
notFound: boolean;
/** 즉시 1회 조회하고, 멈춰 있던 폴링을 다시 켠다 (승인·재시도 직후에 쓴다) */
refresh: () => void;
}
const POLL_INTERVAL = 2500;
/**
* P2V 잡 폴링 훅(무빙 포스터·롱컷 공용).
*
* castad 에는 웹소켓이 없고 썰박스도 폴링(`waitForSsulComplete`)이라 같은 방식을 쓴다.
* 다만 썰박스는 "끝날 때까지 기다리는" 재귀 함수인 반면 이쪽은 **중간 상태를 계속
* 그려야** 한다 — 검수 게이트에서 멈춰 사용자 입력을 기다리기 때문이다.
*
* 폴링은 활성(`isActive`) 상태에서만 돈다. 검수 대기·완료·실패는 사용자가 뭔가
* 하기 전까지 절대 안 바뀌므로 계속 두드리면 서버만 때린다. 승인·재시도 후에는
* 호출부가 refresh() 로 다시 켠다.
*
* `fetchJob`·`isActive` 는 모듈 상수여야 한다 — 바뀌면 폴링이 다시 시작된다.
*/
export function usePolledJob<T>(
id: string | null,
fetchJob: (id: string) => Promise<T>,
isActive: (job: T) => boolean,
): UsePolledJobResult<T> {
const [job, setJob] = useState<T | null>(null);
const [error, setError] = useState<string | null>(null);
const [notFound, setNotFound] = useState(false);
const timerRef = useRef<ReturnType<typeof setInterval> | null>(null);
const stop = useCallback(() => {
if (timerRef.current) {
clearInterval(timerRef.current);
timerRef.current = null;
}
}, []);
const fetchOnce = useCallback(async (jobId: string) => {
try {
const next = await fetchJob(jobId);
setJob(next);
setError(null);
setNotFound(false);
if (!isActive(next)) stop();
} catch (e) {
if (e instanceof P2vNotFoundError) {
setNotFound(true);
stop(); // 없는 잡은 다시 생기지 않는다
return;
}
setError((e as Error).message);
}
}, [fetchJob, isActive, stop]);
useEffect(() => {
if (!id) {
setJob(null);
setError(null);
setNotFound(false);
stop();
return;
}
// 잡이 바뀌면 이전 잡의 상태가 한 틱 남아 보이므로 먼저 비운다
setJob(null);
setNotFound(false);
fetchOnce(id);
timerRef.current = setInterval(() => fetchOnce(id), POLL_INTERVAL);
return stop;
}, [id, fetchOnce, stop]);
const refresh = useCallback(() => {
if (!id) return;
fetchOnce(id);
if (!timerRef.current) {
timerRef.current = setInterval(() => fetchOnce(id), POLL_INTERVAL);
}
}, [id, fetchOnce]);
return { job, error, notFound, refresh };
}
+230 -26
View File
@@ -600,21 +600,16 @@
"autocompleteGeneralError": "An error occurred while retrieving business information. Please try again.", "autocompleteGeneralError": "An error occurred while retrieving business information. Please try again.",
"pageComingSoon": "{{page}} page is coming soon." "pageComingSoon": "{{page}} page is coming soon."
}, },
"p2vViewer": {
"download": "Download",
"close": "Close"
},
"pipelineTabs": { "pipelineTabs": {
"ariaLabel": "Content type", "ariaLabel": "Content type",
"ado2": "ADO2", "ado2": "ADO2",
"ssul": "Ssulbox", "ssul": "Ssulbox",
"poster": "Moving Poster", "poster": "Moving Poster",
"styling": "Poster Styling",
"desc": { "desc": {
"ado2": "One business URL becomes a brand analysis, lyrics, music and a short-form video.", "ado2": "One business URL becomes a brand analysis, lyrics, music and a short-form video.",
"ssul": "Weaves a business into a historical story people watch to the end.", "ssul": "Weaves a business into a historical story people watch to the end.",
"poster": "One event poster becomes a short-form video with narration, music and camera moves.", "poster": "One event poster becomes a short-form video with narration, music and camera moves.",
"styling": "Reinterprets a poster in the visual language of paintings and film posters." "playreel": "One show ticket page link becomes a 30-second vertical trailer, with checks at key moments."
} }
}, },
"ssulbox": { "ssulbox": {
@@ -636,6 +631,61 @@
} }
}, },
"poster": { "poster": {
"start": {
"title": "How do you want to start?",
"subtitle": "Choose by what you have. Both end as 9:16 vertical videos.",
"badge": "With the detail page",
"back": "‹ Choose again",
"comingSoon": "Coming soon",
"image": {
"title": "Start with an image",
"desc": "A single poster comes alive from its original first frame as an 8–15 sec moving poster",
"flow": {
"first": "Start with the original poster",
"move": "Add motion to flames, water and lights",
"narration": "Add title and date narration with music"
},
"facts": {
"need": {
"label": "You need",
"value": "1 image"
},
"review": {
"label": "Check",
"value": "1 time"
},
"time": {
"label": "Time",
"value": "About 3 min"
}
},
"cta": "Upload poster"
},
"url": {
"title": "Start with a show page",
"desc": "One ticket page link becomes a 30-sec trailer with casting, schedule and story",
"flow": {
"first": "Start with a moving poster · 8 sec",
"move": "Introduce the story, cast and schedule",
"narration": "Finish with booking details and a QR code"
},
"facts": {
"need": {
"label": "You need",
"value": "Ticket page URL"
},
"review": {
"label": "Check",
"value": "5 times"
},
"time": {
"label": "Time",
"value": "About 15 min"
}
},
"cta": "Enter link"
}
},
"steps": { "steps": {
"upload": "Upload", "upload": "Upload",
"analyze": "Analyze", "analyze": "Analyze",
@@ -643,12 +693,6 @@
"render": "Generate", "render": "Generate",
"done": "Done" "done": "Done"
}, },
"key": {
"title": "P2V access key required",
"desc": "The poster pipeline runs on a separate server. The key you enter is stored in this browser.",
"placeholder": "P2V_ACCESS_KEY",
"save": "Save"
},
"dropzone": { "dropzone": {
"cta": "Drop a poster here\nor click to choose", "cta": "Drop a poster here\nor click to choose",
"formats": "JPG · PNG · WEBP · GIF\nNo resolution limit", "formats": "JPG · PNG · WEBP · GIF\nNo resolution limit",
@@ -659,6 +703,8 @@
"create": { "create": {
"step": "STEP 1 · Upload poster", "step": "STEP 1 · Upload poster",
"namePlaceholder": "Event name (leave blank to auto-detect)", "namePlaceholder": "Event name (leave blank to auto-detect)",
"cost": "Cost",
"costValue": "3 credits",
"submit": "Create short-form", "submit": "Create short-form",
"submitting": "Uploading…" "submitting": "Uploading…"
}, },
@@ -670,8 +716,7 @@
"phaseAnalyze": "Analyzing", "phaseAnalyze": "Analyzing",
"phaseRender": "Generating", "phaseRender": "Generating",
"failTitle": "Generation failed", "failTitle": "Generation failed",
"retry": "Retry", "refunded": "Generation failed and the credits used were refunded. Please start a new one.",
"force": "Ignore and proceed",
"discard": "Start over", "discard": "Start over",
"discardConfirm": "This deletes the job and every generated video, audio and analysis file. This cannot be undone." "discardConfirm": "This deletes the job and every generated video, audio and analysis file. This cannot be undone."
}, },
@@ -694,20 +739,179 @@
"downloadThumb": "Still JPG", "downloadThumb": "Still JPG",
"downloadVideo": "Download MP4", "downloadVideo": "Download MP4",
"new": "Start a new poster" "new": "Start a new poster"
}
},
"playreel": {
"auto": {
"title": "Auto-approval settings",
"done": "Step {{step}} {{name}} was auto-approved.",
"gate": "Step {{step}} · {{name}}",
"fetch_confirm": "Use the details and default sections read from the page as they are",
"narration_confirm": "Continue with the generated lines and the default voice",
"switchLabel": "Auto-approve {{name}}",
"lockedTitle": "Steps 2 · 4 · 5",
"lockedDesc": "These steps cannot be undone, so they always need your check",
"working": "Auto-approving step {{step}} {{name}}",
"hint": "You can turn this off on the start screen.",
"failed": "Auto-approval failed — please review it yourself. {{message}}"
}, },
"styling": { "steps": {
"internalScope": "Internal demo only. Because of reference licensing, results must not be published externally or used commercially (public-domain artworks excepted).", "input": "Link",
"templates": "Style templates", "prepare": "Collect",
"myPoster": "My poster", "review": "Review",
"result": "Result", "render": "Generate",
"converting": "Converting (about 30s)", "done": "Done"
"formats": "Output format", },
"submit": "Convert style", "create": {
"license": { "step": "STEP 1 · Show page link",
"public-domain": "Publishable", "placeholder": "Paste the show's ticket page link",
"internal-only": "Internal only", "recognized": "Product {{id}} recognized",
"user-uploaded": "Rights unverified" "unsupported": "This link is not supported yet. Enter a show ticket page link.",
"submit": "Create trailer",
"submitting": "Reading the page…"
},
"stages": {
"fetch": "Fetch",
"split": "Sections",
"upscale": "Upscale",
"analyze": "Analyze",
"motion": "Motion",
"narration": "Narration",
"tts": "Voice",
"bgm": "Music",
"i2v": "Generate",
"hybrid": "Overlay",
"compose": "Compose",
"review": "Review"
},
"running": {
"fetch": "Fetching the poster and details from the page",
"split": "Splitting the detail page into sections",
"upscale": "Enhancing the poster (about 1 min)",
"analyze": "Finding elements that can move",
"motion": "Writing the motion prompt",
"narration": "Writing the narration",
"tts": "Reading the narration aloud",
"bgm": "Composing background music (may take a few minutes)",
"i2v": "Animating the poster (5–8 min)",
"hybrid": "Re-applying the original lettering",
"compose": "Composing with the page scroll",
"review": "Running automatic checks"
},
"making": {
"title": "Creating your trailer",
"preparing": "Preparing",
"queued": "Queued",
"wait": "The next review request will appear here. The job keeps running if you close the window.",
"failTitle": "Generation failed",
"refunded": "Generation failed and the credits used were refunded. Please start a new one.",
"discard": "Start over",
"discardConfirm": "This deletes the job and all generated video, audio and analysis files. This cannot be undone."
},
"gate": {
"progress": "Review {{step}} / {{total}} · {{name}}",
"next": "Next · {{next}} · {{eta}}",
"approve": "Approve and continue",
"approveFinal": "Approve and save",
"approveClip": "Continue with this clip",
"working": "Working…",
"back": "‹ Previous step",
"redo": "Regenerate"
},
"gates": {
"fetch_confirm": {
"name": "Collection check",
"title": "Check this is the right show and choose what to include",
"why": "The video is built from details taken from the page. The casting schedule is always included.",
"next": "Poster enhancement · element analysis",
"eta": "about 2 min"
},
"analysis_confirm": {
"name": "Motion check",
"title": "Choose what moves in the poster",
"why": "Approving starts video generation and cannot be undone. Title, logo and figures stay exactly as in the original.",
"next": "Kling 3.0 video generation",
"eta": "about 5–8 min"
},
"narration_confirm": {
"name": "Narration check",
"title": "Check the narration and the voice",
"why": "These sentences are read exactly as written. The casting schedule notice and the date/CTA lines are required.",
"next": "Voice synthesis · music generation",
"eta": "about 3 min"
},
"clip_confirm": {
"name": "Clip review",
"title": "Check the generated scene",
"why": "This is the result of an automatic check that the title is intact. Regenerating starts over from the beginning.",
"next": "Original lettering overlay · page scroll composition",
"eta": "about 5 min"
},
"final_confirm": {
"name": "Final review",
"title": "Check the finished trailer",
"why": "Approving locks this version and saves it to My Contents. Later changes become a new version.",
"next": "Save · download",
"eta": "instant"
} }
},
"fetch": {
"info": "Show details",
"field": {
"title": "Title",
"date_text": "Dates",
"place": "Venue"
},
"cast": "Cast · {{cast}}",
"sections": "Where to start scrolling the detail page",
"sectionsHelp": "The detail page is scrolled continuously from the chosen point. Pieces are not cut and pasted.",
"sectionsCount": "{{chosen}} of {{total}} selected · the casting schedule is always included.",
"lowRes": "The poster is only {{width}}px wide. It is enhanced 2x in the next step. If you have the original file, uploading it in Moving Poster looks sharper.",
"poster": "Poster"
},
"analysis": {
"movable": "Elements that move",
"movableHelp": "The camera does not move. Only elements like light, smoke and fabric come alive.",
"fixed": "Keep as original",
"fixedHelp": "Original pixels are laid back over the generated frames. The title never changes by a single pixel.",
"model": "Generation model",
"modelValue": "Kling 3.0 pro · 8 sec",
"ipRisk": "This is a known IP (e.g. Disney). Other models have been rejected by copyright filters, so only Kling is used. If it fails, an artwork push-in is used instead.",
"noQr": "The poster has no QR code, so the ending band QR is generated from the product page link.",
"grid": "Element analysis (5% grid)"
},
"narration": {
"lines": "Narration · {{count}} lines",
"voice": "Voice",
"sampleMissing": "Sample coming soon",
"estimate": "Estimated length",
"seconds": "{{value}}s",
"target": "Target {{min}}–{{max}}s",
"adjust": "shorten or lengthen the lines"
},
"clip": {
"missing": "Generated 8-sec clip",
"titleCheck": "Title integrity check",
"passed": "Passed · title deviation {{mae}}",
"failed": "Failed · title deviation {{mae}}",
"criteria": "Threshold 4.0 or less, compared pixel by pixel with the original title.",
"frames": "Frames at 5 points",
"redoNote": "Regenerating repeats video generation from the start. The original-lettering overlay on this clip is not redone."
},
"final": {
"missing": "Finished video {{seconds}}s",
"checks": "Automatic checks",
"proof": "Proof sheet",
"version": "Approving locks this as v{{version}}."
},
"result": {
"title": "Trailer ready",
"videoMissing": "The video file could not be found.",
"fileName": "File name",
"source": "Source ·",
"sourceLink": "Open the show page →",
"download": "Download MP4",
"new": "Create a new trailer"
} }
} }
} }
+230 -42
View File
@@ -600,21 +600,16 @@
"autocompleteGeneralError": "업체 정보 조회 중 오류가 발생했습니다. 다시 시도해주세요.", "autocompleteGeneralError": "업체 정보 조회 중 오류가 발생했습니다. 다시 시도해주세요.",
"pageComingSoon": "{{page}} 페이지 준비 중입니다." "pageComingSoon": "{{page}} 페이지 준비 중입니다."
}, },
"p2vViewer": {
"download": "다운로드",
"close": "닫기"
},
"pipelineTabs": { "pipelineTabs": {
"ariaLabel": "생성할 콘텐츠 종류", "ariaLabel": "생성할 콘텐츠 종류",
"ado2": "ADO2", "ado2": "ADO2",
"ssul": "썰박스", "ssul": "썰박스",
"poster": "무빙 포스터", "poster": "무빙 포스터",
"styling": "포스터 스타일링",
"desc": { "desc": {
"ado2": "업체 URL 하나로 브랜드를 분석해 가사·음악·숏폼 영상까지 자동 제작합니다.", "ado2": "업체 URL 하나로 브랜드를 분석해 가사·음악·숏폼 영상까지 자동 제작합니다.",
"ssul": "유명 역사 스토리에 업체 셀링포인트를 녹여 흥미로운 숏폼 콘텐츠를 만듭니다.", "ssul": "유명 역사 스토리에 업체 셀링포인트를 녹여 흥미로운 숏폼 콘텐츠를 만듭니다.",
"poster": "포스터가 나레이션, 음악, 애니메이션을 추가한 숏폼 콘텐츠로 나옵니다.", "poster": "포스터가 나레이션, 음악, 애니메이션을 추가한 숏폼 콘텐츠로 나옵니다.",
"styling": "포스터를 유명 영화의 한 장면 · 고전화 · 영화 포스터 스타일로 재해석합니다." "playreel": "공연 상품페이지 주소 하나로 30초 세로 예고편을 만듭니다. 중요한 순간마다 확인을 요청합니다."
} }
}, },
"ssulbox": { "ssulbox": {
@@ -685,6 +680,61 @@
} }
}, },
"poster": { "poster": {
"start": {
"title": "어떻게 시작할까요?",
"subtitle": "가진 것에 따라 고르세요. 둘 다 9:16 세로 영상으로 완성됩니다.",
"badge": "상세페이지까지",
"back": "‹ 다시 선택",
"comingSoon": "준비 중",
"image": {
"title": "이미지로 시작하기",
"desc": "포스터 한 장이 첫 프레임 그대로 살아나는 8~15초 무빙포스터",
"flow": {
"first": "포스터 원본으로 시작",
"move": "불꽃·물결·조명에 움직임 추가",
"narration": "제목·일시 나레이션과 음악 추가"
},
"facts": {
"need": {
"label": "필요한 것",
"value": "이미지 1장"
},
"review": {
"label": "확인",
"value": "1회"
},
"time": {
"label": "시간",
"value": "약 3분"
}
},
"cta": "포스터 올리기"
},
"url": {
"title": "공연상품페이지로 시작하기",
"desc": "상품페이지 주소 하나로 캐스팅·일정·줄거리까지 담긴 30초 예고편",
"flow": {
"first": "포스터 무빙으로 시작 · 8초",
"move": "줄거리·캐스팅·일정 소개",
"narration": "예매 안내와 QR로 마무리"
},
"facts": {
"need": {
"label": "필요한 것",
"value": "상품페이지 URL"
},
"review": {
"label": "확인",
"value": "5회"
},
"time": {
"label": "시간",
"value": "약 15분"
}
},
"cta": "주소 넣기"
}
},
"steps": { "steps": {
"upload": "업로드", "upload": "업로드",
"analyze": "분석", "analyze": "분석",
@@ -692,12 +742,6 @@
"render": "생성", "render": "생성",
"done": "완성" "done": "완성"
}, },
"key": {
"title": "P2V 접근 키가 필요합니다",
"desc": "포스터 파이프라인은 별도 서버에서 돕니다. 서버에 설정된 접근 키를 입력하면 이 브라우저에 저장됩니다.",
"placeholder": "P2V_ACCESS_KEY",
"save": "저장"
},
"dropzone": { "dropzone": {
"cta": "포스터를 끌어다 놓거나\n클릭해서 선택", "cta": "포스터를 끌어다 놓거나\n클릭해서 선택",
"formats": "JPG · PNG · WEBP · GIF\n해상도 제한 없음", "formats": "JPG · PNG · WEBP · GIF\n해상도 제한 없음",
@@ -708,6 +752,8 @@
"create": { "create": {
"step": "STEP 1 · 포스터 업로드", "step": "STEP 1 · 포스터 업로드",
"namePlaceholder": "행사 이름을 입력하세요 (비우면 자동 추출)", "namePlaceholder": "행사 이름을 입력하세요 (비우면 자동 추출)",
"cost": "생성 비용",
"costValue": "3 크레딧",
"submit": "숏폼 만들기", "submit": "숏폼 만들기",
"submitting": "업로드 중…" "submitting": "업로드 중…"
}, },
@@ -719,8 +765,7 @@
"phaseAnalyze": "분석 중", "phaseAnalyze": "분석 중",
"phaseRender": "생성 중", "phaseRender": "생성 중",
"failTitle": "생성에 실패했어요", "failTitle": "생성에 실패했어요",
"retry": "다시 시도", "refunded": "생성에 실패해 사용한 크레딧은 환불되었습니다. 새로 만들어 주세요.",
"force": "무시하고 진행",
"discard": "처음부터", "discard": "처음부터",
"discardConfirm": "이 작업과 만들어진 영상·음성·분석 파일을 모두 지웁니다. 되돌릴 수 없습니다." "discardConfirm": "이 작업과 만들어진 영상·음성·분석 파일을 모두 지웁니다. 되돌릴 수 없습니다."
}, },
@@ -776,36 +821,179 @@
"downloadThumb": "정지 컷 JPG", "downloadThumb": "정지 컷 JPG",
"downloadVideo": "MP4 다운로드", "downloadVideo": "MP4 다운로드",
"new": "새 포스터로 만들기" "new": "새 포스터로 만들기"
}
},
"playreel": {
"auto": {
"title": "자동화 승인 단계 설정",
"done": "{{step}}단계 {{name}}을 자동 승인했습니다.",
"gate": "{{step}}단계 · {{name}}",
"fetch_confirm": "상세페이지에서 읽은 정보와 기본 섹션을 그대로 사용",
"narration_confirm": "자동 생성 문장과 기본 목소리로 바로 진행",
"switchLabel": "{{name}} 자동 승인",
"lockedTitle": "2 · 4 · 5단계",
"lockedDesc": "되돌릴 수 없는 단계라 항상 확인합니다",
"working": "{{step}}단계 {{name}}을 자동 승인하는 중",
"hint": "시작 화면에서 끌 수 있습니다.",
"failed": "자동 승인 실패 — 직접 확인해 주세요. {{message}}"
}, },
"styling": { "steps": {
"internalScope": "내부 시연 전용입니다. 레퍼런스 저작권 때문에 결과물의 외부 공개·상업 사용은 금합니다(퍼블릭 도메인 명화 제외).", "input": "주소 입력",
"templates": "스타일 템플릿", "prepare": "수집·분석",
"pickTemplate": "템플릿을 선택하세요", "review": "확인",
"count": "{{count}}종", "render": "생성",
"myRefs": "내 레퍼런스", "done": "완성"
"myRefsHint": "직접 올린 이미지의 화법으로 변환합니다", },
"addRef": "레퍼런스 추가", "create": {
"minEdge": "긴 변 {{px}}px 이상 권장", "step": "STEP 1 · 공연 상품페이지 주소",
"analyzing": "화풍 분석 중…", "placeholder": "공연 상품페이지 주소를 붙여넣으세요",
"deleteRef": "레퍼런스 삭제", "recognized": "상품 {{id}} 인식됨",
"confirmDelete": "이 레퍼런스를 삭제할까요? 되돌릴 수 없습니다.", "unsupported": "아직 지원하지 않는 주소입니다. 공연 상품페이지 주소를 넣어주세요.",
"attribution": "레퍼런스 출처 · {{source}}", "submit": "예고편 만들기",
"myPoster": "내 포스터", "submitting": "상세페이지 읽는 중…"
"result": "결과", },
"resultAlt": "변환 결과", "stages": {
"resultHint": "변환 결과가 여기에 표시됩니다", "fetch": "수집",
"converting": "변환 중 (30초 안팎)", "split": "섹션",
"downloadPng": "PNG 다운로드", "upscale": "화질",
"formats": "출력 포맷", "analyze": "요소",
"submit": "스타일 변환", "motion": "연출",
"license": { "narration": "나레이션",
"public-domain": "공개 가능", "tts": "음성",
"internal-only": "내부 전용", "bgm": "음악",
"user-uploaded": "권리 미확인" "i2v": "생성",
"hybrid": "합성",
"compose": "조립",
"review": "검수"
},
"running": {
"fetch": "상세페이지에서 포스터와 정보를 가져오는 중",
"split": "상세페이지를 섹션으로 나누는 중",
"upscale": "포스터 화질을 보정하는 중 (약 1분)",
"analyze": "포스터에서 움직일 요소를 찾는 중",
"motion": "연출 프롬프트를 쓰는 중",
"narration": "나레이션 문장을 쓰는 중",
"tts": "나레이션을 읽는 중",
"bgm": "배경음악을 만드는 중 (몇 분 걸릴 수 있습니다)",
"i2v": "포스터를 움직이는 중 (5~8분)",
"hybrid": "원본 글자를 다시 덮는 중",
"compose": "상세페이지 스크롤과 함께 조립하는 중",
"review": "자동 검사 중"
},
"making": {
"title": "예고편을 만들고 있어요",
"preparing": "준비 중",
"queued": "대기 중",
"wait": "다음 확인 요청이 오면 이 화면에 나타납니다. 창을 닫아도 작업은 계속됩니다.",
"failTitle": "생성에 실패했어요",
"refunded": "생성에 실패해 사용한 크레딧은 환불되었습니다. 새로 만들어 주세요.",
"discard": "처음부터",
"discardConfirm": "이 작업과 만들어진 영상·음성·분석 파일을 모두 지웁니다. 되돌릴 수 없습니다."
},
"gate": {
"progress": "확인 {{step}} / {{total}} · {{name}}",
"next": "다음 단계 · {{next}} · {{eta}}",
"approve": "승인하고 계속",
"approveFinal": "승인하고 저장",
"approveClip": "이 클립으로 계속",
"working": "처리 중…",
"back": "‹ 이전 단계로",
"redo": "다시 만들기"
},
"gates": {
"fetch_confirm": {
"name": "수집 확인",
"title": "이 공연이 맞는지, 어떤 부분을 넣을지 확인해 주세요",
"why": "상세페이지에서 가져온 정보로 영상의 뼈대를 만듭니다. 캐스팅 스케줄은 항상 들어갑니다.",
"next": "포스터 화질 보정 · 요소 분석",
"eta": "약 2분"
}, },
"internalOnlyTitle": "내부 전용 템플릿", "analysis_confirm": {
"internalOnlyBody": "이 레퍼런스로 만든 결과물은 외부 공개·상업 사용을 금합니다.", "name": "연출 확인",
"userRefNotice": "직접 올린 레퍼런스는 권리를 가진 이미지만 사용하세요. 타인의 저작물을 올려 생긴 문제의 책임은 업로드한 사람에게 있습니다. 결과물은 권리 미확인으로 분류됩니다." "title": "포스터에서 무엇을 움직일지 정해주세요",
"why": "승인하면 영상 생성이 시작되고 되돌릴 수 없습니다. 제목·로고·인물은 원본 그대로 고정됩니다.",
"next": "Kling 3.0 영상 생성",
"eta": "약 5~8분"
},
"narration_confirm": {
"name": "나레이션 확인",
"title": "나레이션 문장과 목소리를 확인해 주세요",
"why": "이 문장이 그대로 읽힙니다. 캐스팅 스케줄 안내와 일시·CTA 문장은 꼭 필요합니다.",
"next": "음성 합성 · 배경음악 생성",
"eta": "약 3분"
},
"clip_confirm": {
"name": "클립 검수",
"title": "생성된 장면을 확인해 주세요",
"why": "제목이 깨지지 않았는지 자동 검사한 결과입니다. 다시 만들면 처음부터 다시 만듭니다.",
"next": "원본 글자 합성 · 상세페이지 스크롤 조립",
"eta": "약 5분"
},
"final_confirm": {
"name": "최종 검수",
"title": "완성된 예고편을 확인해 주세요",
"why": "승인하면 이 버전이 고정되어 내 콘텐츠에 저장됩니다. 이후 수정은 새 버전으로 만들어집니다.",
"next": "저장 · 다운로드",
"eta": "즉시"
}
},
"fetch": {
"info": "공연 정보",
"field": {
"title": "공연명",
"date_text": "일시",
"place": "장소"
},
"cast": "캐스트 · {{cast}}",
"sections": "상세페이지에서 훑기 시작할 지점",
"sectionsHelp": "고른 지점부터 상세페이지를 이어서 훑습니다. 조각을 잘라 붙이는 것이 아닙니다.",
"sectionsCount": "{{total}}개 중 {{chosen}}개 선택 · 캐스팅 스케줄은 항상 포함됩니다.",
"lowRes": "포스터가 {{width}}px로 작습니다. 다음 단계에서 화질을 2배 보정합니다. 원본 파일이 있으면 무빙 포스터에서 직접 올리는 편이 더 선명합니다.",
"poster": "포스터"
},
"analysis": {
"movable": "움직일 요소",
"movableHelp": "카메라는 움직이지 않습니다. 빛·안개·천 같은 요소만 살아납니다.",
"fixed": "원본 그대로 고정",
"fixedHelp": "생성된 화면 위에 원본 픽셀을 다시 덮습니다. 제목은 한 픽셀도 바뀌지 않습니다.",
"model": "생성 모델",
"modelValue": "Kling 3.0 pro · 8초",
"ipRisk": "알려진 IP(디즈니 등) 작품입니다. 다른 모델은 저작권 필터로 거부된 이력이 있어 Kling으로만 진행합니다. 실패하면 아트워크 푸시인으로 대체됩니다.",
"noQr": "포스터에 QR이 없어 엔딩 밴드 QR은 상품 페이지 링크로 자동 생성합니다.",
"grid": "요소 분석 (5% 격자)"
},
"narration": {
"lines": "나레이션 {{count}}문장",
"voice": "목소리",
"sampleMissing": "샘플 준비 중",
"estimate": "예상 길이",
"seconds": "{{value}}초",
"target": "목표 {{min}}~{{max}}초",
"adjust": "문장을 줄이거나 늘려주세요"
},
"clip": {
"missing": "생성 클립 8초",
"titleCheck": "제목 훼손 검사",
"passed": "통과 · 제목대 편차 {{mae}}",
"failed": "실패 · 제목대 편차 {{mae}}",
"criteria": "기준 4.0 이하. 원본 제목과 픽셀 단위로 비교한 값입니다.",
"frames": "5시점 프레임",
"redoNote": "다시 만들기는 영상 생성을 처음부터 반복합니다. 이 클립 위에 원본 글자를 덮는 합성은 다시 만들지 않습니다."
},
"final": {
"missing": "완성본 {{seconds}}초",
"checks": "자동 확인 항목",
"proof": "proof 시트",
"version": "승인하면 v{{version}}으로 고정됩니다."
},
"result": {
"title": "예고편 완성",
"videoMissing": "영상 파일을 찾지 못했습니다.",
"fileName": "파일명",
"source": "출처 ·",
"sourceLink": "공연 상품페이지 열기 →",
"download": "MP4 다운로드",
"new": "새 예고편 만들기"
} }
} }
} }
+18 -19
View File
@@ -1,12 +1,13 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { getAllVideos } from '../../utils/api'; import { getAllVideos } from '../../utils/api';
import { isP2vContent } from '../../utils/p2vApi';
import { VideoListItem } from '../../types/api'; import { VideoListItem } from '../../types/api';
import VideoDetailModal from '../../components/VideoDetailModal'; import VideoDetailModal from '../../components/VideoDetailModal';
import CitySelectModal from '../../components/CitySelectModal'; import CitySelectModal from '../../components/CitySelectModal';
import ContentCardSocialActions from '../../components/ContentCardSocialActions'; import ContentCardSocialActions from '../../components/ContentCardSocialActions';
import P2vViewerModal from '../../components/P2vViewerModal';
import SsulViewerModal from '../Ssulbox/SsulViewerModal'; import SsulViewerModal from '../Ssulbox/SsulViewerModal';
import P2vViewerModal from '../../components/P2vViewerModal';
interface ADO2ContentsPageProps { interface ADO2ContentsPageProps {
onBack?: () => void; onBack?: () => void;
@@ -18,7 +19,6 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
// 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로 // 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로
// 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다. // 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다.
const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null); const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null);
// P2V(무빙 포스터·스타일링)도 별도 뷰어 — 상세 API 없이 목록 데이터로 그린다
const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null); const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null);
const [videos, setVideos] = useState<VideoListItem[]>([]); const [videos, setVideos] = useState<VideoListItem[]>([]);
const [total, setTotal] = useState(0); const [total, setTotal] = useState(0);
@@ -151,19 +151,23 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
key={`${video.type}-${video.video_id}`} key={`${video.type}-${video.video_id}`}
className="ado2-content-card" className="ado2-content-card"
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
onClick={() => { onClick={() =>
if (video.type === 'ssul') setSelectedSsul(video); isP2vContent(video.type)
else if (video.type === 'p2v_video' || video.type === 'p2v_poster') setSelectedP2v(video); ? setSelectedP2v(video)
else handleCardClick(video.video_id); : video.type === 'ssul'
}} ? setSelectedSsul(video)
: handleCardClick(video.video_id)
}
role="button" role="button"
tabIndex={0} tabIndex={0}
onKeyDown={(e) => { onKeyDown={(e) =>
if (e.key !== 'Enter') return; e.key === 'Enter' &&
if (video.type === 'ssul') setSelectedSsul(video); (isP2vContent(video.type)
else if (video.type === 'p2v_video' || video.type === 'p2v_poster') setSelectedP2v(video); ? setSelectedP2v(video)
else handleCardClick(video.video_id); : video.type === 'ssul'
}} ? setSelectedSsul(video)
: handleCardClick(video.video_id))
}
> >
<div className="content-card-thumbnail ado2-gallery-thumbnail-wrap"> <div className="content-card-thumbnail ado2-gallery-thumbnail-wrap">
{video.poster_url ? ( {video.poster_url ? (
@@ -205,10 +209,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
<h3 className="content-card-title">{video.store_name}</h3> <h3 className="content-card-title">{video.store_name}</h3>
<div className="content-card-meta"> <div className="content-card-meta">
<p className="content-card-date">{formatDate(video.created_at)}</p> <p className="content-card-date">{formatDate(video.created_at)}</p>
{/* 좋아요·댓글 API 가 type 을 받으므로 썰박스에도 노출한다. {/* 모든 콘텐츠는 ID 와 종류를 함께 보내 소셜 반응을 구분한다. */}
contentType 이 없으면 id 가 겹치는 다른 영상에 반영된다.
갤러리(/video/all)에는 video·ssul 만 내려온다 — P2V 는 내 콘텐츠 전용. */}
{(video.type === 'video' || video.type === 'ssul') && (
<ContentCardSocialActions <ContentCardSocialActions
videoId={video.video_id} videoId={video.video_id}
contentType={video.type} contentType={video.type}
@@ -220,7 +221,6 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
initialLikeCount={video.like_count ?? 0} initialLikeCount={video.like_count ?? 0}
initialIsLiked={video.is_liked_by_me} initialIsLiked={video.is_liked_by_me}
/> />
)}
</div> </div>
</div> </div>
</div> </div>
@@ -249,7 +249,6 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
)} )}
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} /> <SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} /> <P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
{selectedVideoId !== null && ( {selectedVideoId !== null && (
@@ -146,7 +146,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
const handleDrop = (e: React.DragEvent) => { const handleDrop = (e: React.DragEvent) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
const files = Array.from(e.dataTransfer.files).filter(isImageInputFile); const files = Array.from<File>(e.dataTransfer.files).filter(isImageInputFile);
if (files.length > 0) void runAddImages(files); if (files.length > 0) void runAddImages(files);
}; };
+142 -46
View File
@@ -37,8 +37,13 @@ import SsulResultContent from '../Ssulbox/SsulResultContent';
import PosterMakingContent from '../Poster/PosterMakingContent'; import PosterMakingContent from '../Poster/PosterMakingContent';
import PosterReviewContent from '../Poster/PosterReviewContent'; import PosterReviewContent from '../Poster/PosterReviewContent';
import PosterResultContent from '../Poster/PosterResultContent'; import PosterResultContent from '../Poster/PosterResultContent';
import PlayreelMakingContent from '../P2v/PlayreelMakingContent';
import PlayreelGateContent from '../P2v/PlayreelGateContent';
import PlayreelResultContent from '../P2v/PlayreelResultContent';
import { usePlayreelJob } from '../../hooks/usePlayreelJob';
import { GateKey, deletePlayreelJob } from '../../utils/playreelApi';
import { useP2vJob } from '../../hooks/useP2vJob'; import { useP2vJob } from '../../hooks/useP2vJob';
import { deletePosterJob, forcePosterJob, isPastReview, retryPosterJob } from '../../utils/p2vApi'; import { deletePosterJob, isPastReview } from '../../utils/p2vApi';
import { import {
K, K,
clearProjectStorage, clearProjectStorage,
@@ -83,6 +88,21 @@ const SSUL_STEP_INDEX: Record<SsulStep, number> = {
*/ */
type PosterStep = 'entry' | 'making' | 'review' | 'result'; type PosterStep = 'entry' | 'making' | 'review' | 'result';
/** 롱컷(Playreel) 진행 단계. 포스터와 같은 이유로 잡 status 에서 파생한다 */
type PlayreelStep = 'entry' | 'making' | 'review' | 'result';
/**
* 롱컷 스텝퍼 라벨. 검수 게이트가 5번이라 게이트마다 칸을 두면 너무 길어진다 —
* 승인 전 준비(수집·분석) / 확인 / 승인 후 생성으로 묶는다.
*/
const PLAYREEL_STEP_LABELS = [
'playreel.steps.input',
'playreel.steps.prepare',
'playreel.steps.review',
'playreel.steps.render',
'playreel.steps.done',
] as const;
/** /**
* 스텝퍼 라벨. 5단계인 이유는 검수 게이트 **앞뒤가 서로 다른 작업**이기 때문이다 — * 스텝퍼 라벨. 5단계인 이유는 검수 게이트 **앞뒤가 서로 다른 작업**이기 때문이다 —
* 분석(검출·나레이션·모션)과 생성(음성·음악·애니메이션·렌더)을 한 칸에 묶으면 * 분석(검출·나레이션·모션)과 생성(음성·음악·애니메이션·렌더)을 한 칸에 묶으면
@@ -215,8 +235,18 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
() => localStorage.getItem(K.POSTER_JOB_ID), () => localStorage.getItem(K.POSTER_JOB_ID),
); );
const [posterBusy, setPosterBusy] = useState(false); const [posterBusy, setPosterBusy] = useState(false);
/** 롱컷(Playreel) 잡. 포스터 영상과 같은 규칙으로 서버 status 에서 단계를 파생한다 */
const [playreelJobId, setPlayreelJobId] = useState<string | null>(
() => localStorage.getItem(K.PLAYREEL_JOB_ID),
);
const [playreelBusy, setPlayreelBusy] = useState(false);
/** 방금 자동 승인한 게이트. 진행 화면이 안내를 보여주고, 새 잡·검수 화면에서 지운다 */
const [playreelAutoGate, setPlayreelAutoGate] = useState<GateKey | null>(null);
const { job: playreelJob, notFound: playreelNotFound, refresh: refreshPlayreelJob } =
usePlayreelJob(pipeline === 'playreel' ? playreelJobId : null);
const { job: posterJob, notFound: posterNotFound, refresh: refreshPosterJob } = const { job: posterJob, notFound: posterNotFound, refresh: refreshPosterJob } =
useP2vJob('f1', pipeline === 'poster' ? posterJobId : null); useP2vJob(pipeline === 'poster' ? posterJobId : null);
const changePipeline = (next: Pipeline) => { const changePipeline = (next: Pipeline) => {
setPipeline(next); setPipeline(next);
@@ -241,12 +271,40 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
? 4 ? 4
: isPastReview(posterJob) ? 3 : 1; : isPastReview(posterJob) ? 3 : 1;
const playreelStep: PlayreelStep = !playreelJobId
? 'entry'
: playreelJob?.status === 'awaiting_review' && playreelJob.gate && playreelJob.review
? 'review'
: playreelJob?.status === 'done'
? 'result'
: 'making'; // queued · running · failed · 조회 전(null)
// 자동 승인 안내는 다음 확인 요청(또는 완성)이 오면 낡은 정보라 지운다
useEffect(() => {
// 승인 직후에도 한동안 같은 게이트가 검수 대기로 보이므로, 다른 게이트일 때만 지운다
if (playreelStep === 'result' || (playreelStep === 'review' && playreelJob?.gate !== playreelAutoGate)) {
setPlayreelAutoGate(null);
}
}, [playreelStep, playreelJob?.gate, playreelAutoGate]);
/** 첫 게이트(연출 확인)를 승인했으면 이후 대기는 '생성' 구간이다 */
const playreelPastApproval = playreelJob?.stages.motion?.status !== undefined
&& playreelJob.stages.motion.status !== 'idle';
const playreelStepIndex = playreelStep === 'entry'
? 0
: playreelStep === 'review'
? 2
: playreelStep === 'result'
? 4
: playreelPastApproval ? 3 : 1;
/** 진입 화면(탭이 보이는 단계) 여부. 파이프라인마다 진입 조건이 다르다 */ /** 진입 화면(탭이 보이는 단계) 여부. 파이프라인마다 진입 조건이 다르다 */
const isEntry = const isEntry =
pipeline === 'ado2' ? wizardStep === -2 pipeline === 'ado2' ? wizardStep === -2
: pipeline === 'ssul' ? ssulStep === 'entry' : pipeline === 'ssul' ? ssulStep === 'entry'
: pipeline === 'poster' ? posterStep === 'entry' : pipeline === 'poster' ? posterStep === 'entry'
// 스타일링은 전 과정이 진입 화면 안에서 끝난다 (위저드 없음) : pipeline === 'playreel' ? playreelStep === 'entry'
: true; : true;
const [songTaskId, setSongTaskId] = useState<string | null>(savedSongTaskId); const [songTaskId, setSongTaskId] = useState<string | null>(savedSongTaskId);
const [imageTaskId, setImageTaskId] = useState<string | null>(savedImageTaskId); const [imageTaskId, setImageTaskId] = useState<string | null>(savedImageTaskId);
@@ -623,43 +681,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
setPosterJobId(null); setPosterJobId(null);
}; };
/** /** 실패한 잡과 산출물을 지우고 처음부터. 크레딧은 실패 시점에 이미 환불됐다. 되돌릴 수 없다 */
* 실패한 스테이지부터 다시. 업로드부터 다시 하지 않는다 —
* i2v 실패(모델 큐·크레딧)는 같은 입력으로 재시도하면 자주 통과한다.
*/
const handlePosterRetry = async () => {
if (!posterJobId || posterBusy) return;
setPosterBusy(true);
try {
await retryPosterJob(posterJobId);
refreshPosterJob();
} catch {
// 재시도 요청 자체가 실패해도 잡 상태는 그대로다 — 폴링 결과가 계속 화면을 그린다
} finally {
setPosterBusy(false);
}
};
/**
* 실패를 무시하고 진행 — i2v 게이트 실패에서 이미 생성된 클립으로 렌더를 잇는다.
* 재시도와 달리 Higgsfield 재생성 비용이 없다. 무시 불가한 실패는 서버가 409 를 준다.
*/
const handlePosterForce = async () => {
if (!posterJobId || posterBusy) return;
setPosterBusy(true);
try {
await forcePosterJob(posterJobId);
refreshPosterJob();
} catch (e) {
// 409 = 무시할 수 없는 실패(클립 미생성 — 저해상·모션 없음 등).
// 조용히 삼키면 버튼이 아무 반응 없어 보여 재클릭만 유발한다 — 사유를 보여준다.
alert((e as Error).message);
} finally {
setPosterBusy(false);
}
};
/** 실패한 잡과 산출물을 지우고 처음부터. 되돌릴 수 없다 */
const handlePosterDiscard = async () => { const handlePosterDiscard = async () => {
if (!posterJobId || posterBusy) return; if (!posterJobId || posterBusy) return;
if (!window.confirm(t('poster.making.discardConfirm'))) return; if (!window.confirm(t('poster.making.discardConfirm'))) return;
@@ -674,13 +696,47 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
} }
}; };
// ── 롱컷 (Playreel) ──────────────────────────────────────────────────
const handlePlayreelJobStarted = (jobId: string) => {
localStorage.setItem(K.PLAYREEL_JOB_ID, jobId);
setPlayreelJobId(jobId);
};
/** 잡을 버리고 주소 입력 화면으로. 서버 잡은 남겨둔다(내 콘텐츠에 쓰인다) */
const handlePlayreelNew = () => {
localStorage.removeItem(K.PLAYREEL_JOB_ID);
setPlayreelJobId(null);
setPlayreelAutoGate(null);
};
/** 실패한 잡과 산출물을 지우고 처음부터. 크레딧은 실패 시점에 이미 환불됐다. 되돌릴 수 없다 */
const handlePlayreelDiscard = async () => {
if (!playreelJobId || playreelBusy) return;
if (!window.confirm(t('playreel.making.discardConfirm'))) return;
setPlayreelBusy(true);
try {
await deletePlayreelJob(playreelJobId);
} catch {
// 서버에서 이미 사라졌어도 화면은 처음으로 돌려보내는 게 맞다
} finally {
setPlayreelBusy(false);
handlePlayreelNew();
}
};
/** 사라졌거나 내 것이 아닌 롱컷 잡(404)이면 주소 입력 화면으로 되돌린다 */
useEffect(() => {
if (playreelNotFound) handlePlayreelNew();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [playreelNotFound]);
/** /**
* 사라진 잡 정리. * 사라진 잡 정리.
* *
* P2V 에는 "내 활성 잡" 엔드포인트가 없어(단일 팀 키라 사용자 개념이 없다) * 복구의 근거는 localStorage 의 id 다. 그런데 그 잡이 지워졌거나 로그인한 사용자의
* localStorage 의 id 가 복구의 유일한 근거다. 그런데 서버를 재시작하거나 다른 * 것이 아니면(백엔드는 남의 잡을 404 로 답한다) id 만 남아 **빈 진행 화면에서
* 사람이 그 잡을 지우면 id 만 남아 **빈 진행 화면에서 영원히 멈춘다** — 실제로 겪었다. * 영원히 멈춘다**. 404 를 만나면 업로드 화면으로 되돌린다.
* 404 를 만나면 업로드 화면으로 되돌린다.
*/ */
useEffect(() => { useEffect(() => {
if (posterNotFound) handlePosterNew(); if (posterNotFound) handlePosterNew();
@@ -737,6 +793,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
setSsulStep('entry'); setSsulStep('entry');
// clearProjectStorage() 가 POSTER_JOB_ID 를 지우므로 state 도 함께 비운다 // clearProjectStorage() 가 POSTER_JOB_ID 를 지우므로 state 도 함께 비운다
setPosterJobId(null); setPosterJobId(null);
setPlayreelJobId(null);
setSongTaskId(null); setSongTaskId(null);
setImageTaskId(null); setImageTaskId(null);
setAnalysisData(null); setAnalysisData(null);
@@ -764,6 +821,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
error={analysisError} error={analysisError}
onSsulJobStarted={handleSsulJobStarted} onSsulJobStarted={handleSsulJobStarted}
onPosterJobStarted={handlePosterJobStarted} onPosterJobStarted={handlePosterJobStarted}
onPlayreelJobStarted={handlePlayreelJobStarted}
onGoToPayment={handleGoToPayment} onGoToPayment={handleGoToPayment}
/> />
); );
@@ -785,6 +843,34 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
} }
} }
// 롱컷도 자체 축으로 진행한다 (단계는 잡 status 파생)
if (pipeline === 'playreel') {
switch (playreelStep) {
case 'review':
return playreelJob ? (
<PlayreelGateContent
key={playreelJob.gate}
job={playreelJob}
onChanged={refreshPlayreelJob}
onAutoApproved={setPlayreelAutoGate}
/>
) : null;
case 'result':
return playreelJob ? (
<PlayreelResultContent job={playreelJob} onNew={handlePlayreelNew} />
) : null;
default:
return (
<PlayreelMakingContent
job={playreelJob}
onDiscard={handlePlayreelDiscard}
busy={playreelBusy}
autoApprovedGate={playreelAutoGate}
/>
);
}
}
// 포스터 영상도 자체 축으로 진행한다 (단계는 잡 status 파생) // 포스터 영상도 자체 축으로 진행한다 (단계는 잡 status 파생)
if (pipeline === 'poster') { if (pipeline === 'poster') {
switch (posterStep) { switch (posterStep) {
@@ -800,8 +886,6 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
return ( return (
<PosterMakingContent <PosterMakingContent
job={posterJob} job={posterJob}
onRetry={handlePosterRetry}
onForce={handlePosterForce}
onDiscard={handlePosterDiscard} onDiscard={handlePosterDiscard}
busy={posterBusy} busy={posterBusy}
/> />
@@ -933,6 +1017,18 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
</div> </div>
); );
} }
// 롱컷은 검수 게이트 5번을 준비·확인·생성 3구간으로 묶은 5단계
if (pipeline === 'playreel') {
return (
<div className="wizard-page-container">
<WizardStepper
steps={PLAYREEL_STEP_LABELS.map((key) => t(key))}
currentStep={playreelStepIndex}
/>
{renderWizardContent()}
</div>
);
}
// 브랜드 분석(0)은 전체 화면 스크롤이지만 스텝퍼는 표시 // 브랜드 분석(0)은 전체 화면 스크롤이지만 스텝퍼는 표시
if (wizardStep === 0) { if (wizardStep === 0) {
return ( return (
+32 -38
View File
@@ -2,13 +2,13 @@
import React, { useState, useEffect, useRef, useCallback } from 'react'; import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { getVideosList, deleteVideo, deleteSsulContent } from '../../utils/api'; import { getVideosList, deleteVideo, deleteSsulContent } from '../../utils/api';
import { deletePosterJob, deleteStylingJob } from '../../utils/p2vApi'; import { deleteP2vContent, isP2vContent } from '../../utils/p2vApi';
import { VideoListItem } from '../../types/api'; import { SocialUploadableItem, VideoListItem } from '../../types/api';
import SocialPostingModal from '../../components/SocialPostingModal'; import SocialPostingModal from '../../components/SocialPostingModal';
import VideoDetailModal from '../../components/VideoDetailModal'; import VideoDetailModal from '../../components/VideoDetailModal';
import ContentCardSocialActions from '../../components/ContentCardSocialActions'; import ContentCardSocialActions from '../../components/ContentCardSocialActions';
import P2vViewerModal from '../../components/P2vViewerModal';
import SsulViewerModal from '../Ssulbox/SsulViewerModal'; import SsulViewerModal from '../Ssulbox/SsulViewerModal';
import P2vViewerModal from '../../components/P2vViewerModal';
import { useOverlayClose } from '../../hooks/useOverlayClose'; import { useOverlayClose } from '../../hooks/useOverlayClose';
const VideoPreviewCard: React.FC<{ src: string; className?: string }> = ({ src, className }) => { const VideoPreviewCard: React.FC<{ src: string; className?: string }> = ({ src, className }) => {
@@ -109,12 +109,11 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
const [deleteTarget, setDeleteTarget] = useState<VideoListItem | null>(null); const [deleteTarget, setDeleteTarget] = useState<VideoListItem | null>(null);
const [isDeleting, setIsDeleting] = useState(false); const [isDeleting, setIsDeleting] = useState(false);
const [uploadModalOpen, setUploadModalOpen] = useState(false); const [uploadModalOpen, setUploadModalOpen] = useState(false);
const [uploadTargetVideo, setUploadTargetVideo] = useState<VideoListItem | null>(null); const [uploadTargetVideo, setUploadTargetVideo] = useState<SocialUploadableItem | null>(null);
const [selectedVideoId, setSelectedVideoId] = useState<number | null>(null); const [selectedVideoId, setSelectedVideoId] = useState<number | null>(null);
// 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로 // 썰박스는 별도 뷰어를 쓴다 — VideoDetailModal 은 video_id 로 조회하므로
// 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다. // 썰박스 id 를 넘기면 id 가 겹치는 다른 영상이 열린다.
const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null); const [selectedSsul, setSelectedSsul] = useState<VideoListItem | null>(null);
// P2V(무빙 포스터·스타일링)도 별도 뷰어 — 상세 API 없이 목록 데이터로 그린다
const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null); const [selectedP2v, setSelectedP2v] = useState<VideoListItem | null>(null);
const pageSize = 12; const pageSize = 12;
@@ -185,7 +184,9 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
}; };
const handleUploadClick = (video: VideoListItem) => { const handleUploadClick = (video: VideoListItem) => {
setUploadTargetVideo(video); // 롱컷(p2v_playreel)은 소셜 업로드를 지원하지 않는다(버튼도 막는다). 무빙 포스터는 지원한다.
if (video.type === 'p2v_playreel') return;
setUploadTargetVideo({ ...video, type: video.type });
setUploadModalOpen(true); setUploadModalOpen(true);
}; };
@@ -205,13 +206,11 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
setIsDeleting(true); setIsDeleting(true);
try { try {
// 종류별 삭제 API 가 다르다. deleteVideo 는 Video.id 로 지우므로 // 종류별 삭제 API 가 다르다. deleteVideo 는 Video.id 로 지우므로
// 썰박스·P2V id 를 넘기면 id 가 겹치는 엉뚱한 ADO2 영상이 삭제된다. // 썰박스 id 를 넘기면 id 가 겹치는 엉뚱한 ADO2 영상이 삭제된다.
if (deleteTarget.type === 'ssul') { if (isP2vContent(deleteTarget.type)) {
await deleteP2vContent(deleteTarget.type, deleteTarget.video_id);
} else if (deleteTarget.type === 'ssul') {
await deleteSsulContent(deleteTarget.video_id); await deleteSsulContent(deleteTarget.video_id);
} else if (deleteTarget.type === 'p2v_video') {
await deletePosterJob(deleteTarget.video_id);
} else if (deleteTarget.type === 'p2v_poster') {
await deleteStylingJob(deleteTarget.video_id);
} else { } else {
await deleteVideo(deleteTarget.video_id); await deleteVideo(deleteTarget.video_id);
} }
@@ -266,11 +265,13 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
<div <div
className="content-card-thumbnail" className="content-card-thumbnail"
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
onClick={() => { onClick={() =>
if (video.type === 'ssul') setSelectedSsul(video); isP2vContent(video.type)
else if (video.type === 'p2v_video' || video.type === 'p2v_poster') setSelectedP2v(video); ? setSelectedP2v(video)
else setSelectedVideoId(video.video_id); : video.type === 'ssul'
}} ? setSelectedSsul(video)
: setSelectedVideoId(video.video_id)
}
> >
{video.poster_url ? ( {video.poster_url ? (
<img <img
@@ -311,35 +312,29 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
<p className="content-card-date"> <p className="content-card-date">
{formatDate(video.created_at)} {formatDate(video.created_at)}
</p> </p>
{/* 좋아요·댓글 API 가 type 을 받으므로 썰박스에도 노출한다. {/* 모든 콘텐츠는 ID 와 종류를 함께 보내 소셜 반응을 구분한다. */}
contentType 이 없으면 id 가 겹치는 다른 영상에 반영된다. <ContentCardSocialActions
P2V 는 좋아요·댓글 축이 없어(내 콘텐츠 전용) 숨긴다. */} videoId={video.video_id}
{(video.type === 'video' || video.type === 'ssul') && ( contentType={video.type}
<ContentCardSocialActions storeName={video.store_name}
videoId={video.video_id} region={video.region}
contentType={video.type} title={video.title}
storeName={video.store_name} description={video.description}
region={video.region} commentCount={video.comment_count ?? 0}
title={video.title} initialLikeCount={video.like_count ?? 0}
description={video.description} initialIsLiked={video.is_liked_by_me}
commentCount={video.comment_count ?? 0} />
initialLikeCount={video.like_count ?? 0}
initialIsLiked={video.is_liked_by_me}
/>
)}
</div> </div>
</div> </div>
{/* Action Buttons */} {/* Action Buttons */}
<div className="content-card-actions"> <div className="content-card-actions">
{/* SocialPostingModal 이 content_type 을 함께 보내므로 {/* SocialPostingModal 이 content_type 을 함께 보내므로
썰박스 항목도 같은 모달로 업로드한다 (social_upload 병합). 썰박스 항목도 같은 모달로 업로드한다 (social_upload 병합). */}
P2V 는 업로드 파이프라인이 video·ssul 전용이라 SNS 버튼을 숨긴다. */}
<button <button
className="content-download-btn" className="content-download-btn"
onClick={() => handleUploadClick(video)} onClick={() => handleUploadClick(video)}
disabled={!video.result_movie_url} disabled={!video.result_movie_url || video.type === 'p2v_playreel'}
style={video.type === 'p2v_video' || video.type === 'p2v_poster' ? { display: 'none' } : undefined}
> >
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5"> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
<path d="M10 13V3M10 3l-4 4M10 3l4 4"/> <path d="M10 13V3M10 3l-4 4M10 3l4 4"/>
@@ -431,7 +426,6 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate, embedded })
)} )}
<SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} /> <SsulViewerModal item={selectedSsul} onClose={() => setSelectedSsul(null)} />
<P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} /> <P2vViewerModal item={selectedP2v} onClose={() => setSelectedP2v(null)} />
{/* 소셜 미디어 업로드 모달 */} {/* 소셜 미디어 업로드 모달 */}
+46 -11
View File
@@ -1,4 +1,4 @@
import React from 'react'; import React, { useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { AutocompleteRequest } from '../../utils/api'; import { AutocompleteRequest } from '../../utils/api';
import SearchInputForm, { SearchType } from '../../components/SearchInputForm'; import SearchInputForm, { SearchType } from '../../components/SearchInputForm';
@@ -6,7 +6,8 @@ import PipelineTabs, { Pipeline } from '../../components/PipelineTabs';
import SsulCreateForm from '../Ssulbox/SsulCreateForm'; import SsulCreateForm from '../Ssulbox/SsulCreateForm';
import { Scen } from '../Ssulbox/ssulData'; import { Scen } from '../Ssulbox/ssulData';
import PosterCreateForm from '../Poster/PosterCreateForm'; import PosterCreateForm from '../Poster/PosterCreateForm';
import StylingContent from '../Poster/StylingContent'; import PosterStartChoice from '../Poster/PosterStartChoice';
import PlayreelCreateForm from '../P2v/PlayreelCreateForm';
interface UrlInputContentProps { interface UrlInputContentProps {
/** 현재 선택된 파이프라인. 소유자는 GenerationFlow (분기·리셋 때문) */ /** 현재 선택된 파이프라인. 소유자는 GenerationFlow (분기·리셋 때문) */
@@ -20,6 +21,8 @@ interface UrlInputContentProps {
onSsulJobStarted: (taskId: number, scenario: Scen) => void; onSsulJobStarted: (taskId: number, scenario: Scen) => void;
/** 포스터 영상(F1) 생성 요청 접수 시. 폴링 소유는 GenerationFlow */ /** 포스터 영상(F1) 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
onPosterJobStarted: (jobId: string) => void; onPosterJobStarted: (jobId: string) => void;
/** 롱컷 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
onPlayreelJobStarted: (jobId: string) => void;
/** 크레딧 부족 시 충전 화면으로 */ /** 크레딧 부족 시 충전 화면으로 */
onGoToPayment: () => void; onGoToPayment: () => void;
} }
@@ -38,12 +41,28 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
error, error,
onSsulJobStarted, onSsulJobStarted,
onPosterJobStarted, onPosterJobStarted,
onPlayreelJobStarted,
onGoToPayment, onGoToPayment,
}) => { }) => {
const { t } = useTranslation(); const { t } = useTranslation();
// 스타일링은 한 화면짜리 도구라 진입 폼보다 넓은 판이 필요하다 (generation-flow.css 참조) /**
const wide = pipeline === 'styling'; * 무빙 포스터 탭의 시작 화면. 롱컷은 별도 탭이 아니라 이 화면의 두 번째 갈래다 —
* 'choose' 에서 가진 것(이미지 / 상품페이지 주소)을 고르면 폼으로 들어간다.
*/
const [posterStart, setPosterStart] = useState<'choose' | 'image'>('choose');
const showChoice = pipeline === 'poster' && posterStart === 'choose';
const handleTabChange = (next: Pipeline) => {
// 무빙 포스터 탭을 다시 누르면 어느 폼에 있었든 선택 화면으로 돌아간다
if (next === 'poster') setPosterStart('choose');
onPipelineChange(next);
};
const backToChoice = () => {
setPosterStart('choose');
onPipelineChange('poster');
};
const renderForm = () => { const renderForm = () => {
switch (pipeline) { switch (pipeline) {
@@ -59,10 +78,26 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
case 'ssul': case 'ssul':
return <SsulCreateForm onSubmitted={onSsulJobStarted} onNeedCredit={onGoToPayment} />; return <SsulCreateForm onSubmitted={onSsulJobStarted} onNeedCredit={onGoToPayment} />;
case 'poster': case 'poster':
return <PosterCreateForm onSubmitted={onPosterJobStarted} />; return posterStart === 'choose' ? (
case 'styling': <PosterStartChoice
// 스타일링은 위저드가 아니라 도구다 — 진입 화면 안에서 처음부터 끝까지 끝난다 onPickImage={() => setPosterStart('image')}
return <StylingContent />; onPickUrl={() => onPipelineChange('playreel')}
/>
) : (
<PosterCreateForm
onSubmitted={onPosterJobStarted}
onNeedCredit={onGoToPayment}
onBack={backToChoice}
/>
);
case 'playreel':
return (
<PlayreelCreateForm
onSubmitted={onPlayreelJobStarted}
onNeedCredit={onGoToPayment}
onBack={backToChoice}
/>
);
default: default:
return null; return null;
} }
@@ -70,16 +105,16 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
return ( return (
<div className="url-input-container"> <div className="url-input-container">
<div className={`url-input-content${wide ? ' url-input-content--wide' : ''}`}> <div className="url-input-content">
<div className="url-input-logo"> <div className="url-input-logo">
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" /> <img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
</div> </div>
<PipelineTabs value={pipeline} onChange={onPipelineChange} /> <PipelineTabs value={pipeline} onChange={handleTabChange} />
{/* 고른 기능이 무엇을 해주는지 한 줄. 탭 라벨(2~6자)만으로는 네 기능의 차이가 {/* 고른 기능이 무엇을 해주는지 한 줄. 탭 라벨(2~6자)만으로는 네 기능의 차이가
전달되지 않아 처음 온 사람이 아무거나 눌러본다. STEP 1 위에 둔다. */} 전달되지 않아 처음 온 사람이 아무거나 눌러본다. STEP 1 위에 둔다. */}
<p className="pipeline-desc">{t(`pipelineTabs.desc.${pipeline}`)}</p> {!showChoice && <p className="pipeline-desc">{t(`pipelineTabs.desc.${pipeline}`)}</p>}
{renderForm()} {renderForm()}
</div> </div>
+25
View File
@@ -0,0 +1,25 @@
import React from 'react';
import ContentDetailContent from '../../components/ContentDetailContent';
import { P2vContentType } from '../../types/api';
import { NAV } from '../../components/navItems';
interface P2vDetailPageProps {
contentId: string;
contentType: P2vContentType;
}
const P2vDetailPage: React.FC<P2vDetailPageProps> = ({ contentId, contentType }) => (
<div className="video-detail-page">
<ContentDetailContent
key={`${contentType}-${contentId}`}
contentId={contentId}
contentType={contentType}
onClose={() => {
localStorage.setItem('castad_active_item', NAV.HOME);
window.location.href = '/';
}}
/>
</div>
);
export default P2vDetailPage;
@@ -0,0 +1,52 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { GATE_ORDER } from '../../utils/playreelApi';
import { AUTO_APPROVABLE, setAutoApprove, useAutoApprove } from '../../utils/playreelPrefs';
/**
* 게이트 자동 승인 설정 — 롱컷 시작 화면에 놓는다(playreel 원본과 같은 자리).
* 스위치는 되돌릴 수 있는 ①·③ 만 있고, 나머지는 잠금으로 이유를 알려준다.
*/
const PlayreelAutoApprovePanel: React.FC = () => {
const { t } = useTranslation();
const prefs = useAutoApprove();
return (
<div className="pr-auto">
<p className="p2v-label">{t('playreel.auto.title')}</p>
<div className="p2v-panel">
{AUTO_APPROVABLE.map((gate) => {
const name = t(`playreel.gates.${gate}.name`);
return (
<div key={gate} className="pr-auto__row">
<div className="pr-auto__text">
<p className="pr-strong">
{t('playreel.auto.gate', { step: GATE_ORDER.indexOf(gate) + 1, name })}
</p>
<p className="p2v-note">{t(`playreel.auto.${gate}`)}</p>
</div>
<button
type="button"
role="switch"
aria-checked={!!prefs[gate]}
aria-label={t('playreel.auto.switchLabel', { name })}
className={`pr-switch${prefs[gate] ? ' on' : ''}`}
onClick={() => setAutoApprove(gate, !prefs[gate])}
>
<span className="pr-switch__knob" />
</button>
</div>
);
})}
<div className="pr-auto__row pr-auto__row--locked">
<div className="pr-auto__text">
<p className="pr-strong">{t('playreel.auto.lockedTitle')}</p>
<p className="p2v-note">{t('playreel.auto.lockedDesc')}</p>
</div>
</div>
</div>
</div>
);
};
export default PlayreelAutoApprovePanel;
+78
View File
@@ -0,0 +1,78 @@
import React, { useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { InsufficientCreditError } from '../../utils/api';
import { createPlayreelJob, parseGoodsId } from '../../utils/playreelApi';
import PlayreelAutoApprovePanel from './PlayreelAutoApprovePanel';
interface PlayreelCreateFormProps {
/** 생성 요청이 접수되면 호출. 폴링 소유는 GenerationFlow (썰박스·포스터와 같은 규칙) */
onSubmitted: (jobId: string) => void;
/** 크레딧 부족(402) 시 충전 화면으로 유도 */
onNeedCredit: () => void;
/** 시작 선택 화면으로 돌아간다 */
onBack: () => void;
}
/**
* 롱컷(공연 상품페이지 → 30초 예고편) 생성 폼. 진입 화면의 '롱컷' 탭에 들어간다.
*
* 입력 도중의 안내(상품 번호 인식)는 `parseGoodsId` 가 하고, 판정은 서버가 같은 규칙으로 한다.
*/
const PlayreelCreateForm: React.FC<PlayreelCreateFormProps> = ({ onSubmitted, onNeedCredit, onBack }) => {
const { t } = useTranslation();
const [url, setUrl] = useState('');
const [submitting, setSubmitting] = useState(false);
const [error, setError] = useState<string | null>(null);
const goodsId = useMemo(() => parseGoodsId(url), [url]);
const submit = async () => {
if (!goodsId || submitting) return;
setSubmitting(true);
setError(null);
try {
const { id } = await createPlayreelJob(url);
onSubmitted(id);
} catch (e) {
if (e instanceof InsufficientCreditError) {
onNeedCredit();
} else {
setError((e as Error).message);
}
setSubmitting(false);
}
};
return (
<div className="p2v-scope p2v-create">
<button type="button" className="p2v-back" onClick={onBack}>{t('poster.start.back')}</button>
<span className="p2v-step">{t('playreel.create.step')}</span>
<input
className="p2v-input p2v-input--center"
placeholder={t('playreel.create.placeholder')}
value={url}
onChange={(e) => setUrl(e.target.value)}
onKeyDown={(e) => { if (e.key === 'Enter') submit(); }}
/>
{goodsId && (
<p className="p2v-note">
<span className="p2v-tag">{t('playreel.create.recognized', { id: goodsId })}</span>
</p>
)}
{url.trim() && !goodsId && <div className="p2v-note warn">{t('playreel.create.unsupported')}</div>}
{error && <div className="p2v-note warn">{error}</div>}
<button type="button" className="p2v-btn-cta" disabled={!goodsId || submitting} onClick={submit}>
{submitting ? t('playreel.create.submitting') : t('playreel.create.submit')}
</button>
{/* 게이트 ①·③ 자동 승인 — 시작 전에 정하고, 되돌리는 자리도 여기다 */}
<PlayreelAutoApprovePanel />
</div>
);
};
export default PlayreelCreateForm;
+467
View File
@@ -0,0 +1,467 @@
import React, { useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
AnalysisReview, ClipReview, FetchReview, FinalReview, GATE_CAN_BACK, GATE_ORDER,
GateEdits, GateKey, NarrationReview, PlayreelJob,
approvePlayreelGate, backPlayreelGate, retryPlayreelClip,
} from '../../utils/playreelApi';
import { isAutoApprovable, useAutoApprove } from '../../utils/playreelPrefs';
interface PlayreelGateContentProps {
/** `gate` 와 `review` 가 채워진 검수 대기 잡 */
job: PlayreelJob;
/** 승인·되돌리기·재생성 요청이 끝나면 호출 — GenerationFlow 가 폴링을 다시 켠다 */
onChanged: () => void;
/** 자동 승인이 성공했을 때 호출 — 진행 화면이 "자동 승인했습니다" 안내를 이어서 보여준다 */
onAutoApproved: (gate: GateKey) => void;
}
const Icon: React.FC<{ d: string; size?: number }> = ({ d, size = 12 }) => (
<svg
width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"
>
<path d={d} />
</svg>
);
const CHECK = 'M20 6 9 17l-5-5';
const CROSS = 'M18 6 6 18M6 6l12 12';
const PLUS = 'M12 5v14M5 12h14';
const Lock: React.FC<{ size?: number }> = ({ size = 12 }) => (
<svg
width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"
>
<rect x="4" y="11" width="16" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" />
</svg>
);
/** 켜고 끄는 칩. `locked` 는 항상 켜져 있어 누를 수 없다 */
const Chip: React.FC<{
on: boolean; locked?: boolean; onClick?: () => void; children: React.ReactNode;
}> = ({ on, locked, onClick, children }) => (
<button
type="button"
className={`p2v-chip pr-chip${on ? ' active' : ''}${locked ? ' locked' : ''}`}
onClick={locked ? undefined : onClick}
>
{locked ? <Lock /> : <Icon d={on ? CHECK : PLUS} />}
{children}
</button>
);
// ── ① 수집 확인 ─────────────────────────────────────────────────────────
type FetchEdits = Extract<GateEdits, { sections: string[] }>;
/**
* 상세페이지 조각은 라벨이 겹친다 — "유의사항"만 일곱 개인 페이지가 흔하다.
* 칩으로 그리면 같은 글자가 줄줄이 서서 무엇을 고르는지 알 수 없어 썸네일을 그린다.
*/
const FetchGate: React.FC<{ data: FetchReview; onChange: (edits: FetchEdits) => void }> = ({
data, onChange,
}) => {
const { t } = useTranslation();
const [sections, setSections] = useState(data.sections);
const [meta, setMeta] = useState(data.meta);
const emit = (nextSections = sections, nextMeta = meta) =>
onChange({ sections: nextSections.filter((s) => s.selected).map((s) => s.id), meta: nextMeta });
const chosen = sections.filter((s) => s.selected).length;
return (
<div className="pr-two">
<div>
<p className="p2v-label">{t('playreel.fetch.info')}</p>
{(['title', 'date_text', 'place'] as const).map((key) => (
<div key={key} className="pr-row">
<span className="pr-row__label">{t(`playreel.fetch.field.${key}`)}</span>
<input
className="p2v-input"
value={meta[key]}
onChange={(e) => {
const next = { ...meta, [key]: e.target.value };
setMeta(next);
emit(sections, next);
}}
/>
</div>
))}
<p className="p2v-note">{t('playreel.fetch.cast', { cast: meta.cast.join(', ') })}</p>
<p className="p2v-label pr-gap">{t('playreel.fetch.sections')}</p>
<p className="p2v-help">{t('playreel.fetch.sectionsHelp')}</p>
<div className="pr-sections">
{sections.map((s, i) => (
<button
key={s.id}
type="button"
title={`${s.label} · ${s.height.toLocaleString()}px`}
className={`pr-section${s.selected ? ' selected' : ''}${s.required ? ' locked' : ''}`}
onClick={s.required ? undefined : () => {
const next = sections.map((x) => (x.id === s.id ? { ...x, selected: !x.selected } : x));
setSections(next);
emit(next);
}}
>
<img src={s.thumb_url} alt={s.label} />
<span className="pr-section__no">{i + 1}</span>
<span className="pr-section__cap">
{s.required ? <Lock size={10} /> : <Icon d={s.selected ? CHECK : PLUS} size={10} />}
<span>{s.label}</span>
</span>
</button>
))}
</div>
<p className="p2v-note">
{t('playreel.fetch.sectionsCount', { total: sections.length, chosen })}
</p>
{data.poster_width <= 800 && (
<p className="pr-callout">{t('playreel.fetch.lowRes', { width: data.poster_width })}</p>
)}
</div>
<div>
<p className="p2v-label">{t('playreel.fetch.poster')}</p>
<img className="p2v-review__image pr-image" src={data.poster_url} alt={t('playreel.fetch.poster')} />
</div>
</div>
);
};
// ── ② 연출 확인 ─────────────────────────────────────────────────────────
type AnalysisEdits = Extract<GateEdits, { movable: string[] }>;
const AnalysisGate: React.FC<{ data: AnalysisReview; onChange: (edits: AnalysisEdits) => void }> = ({
data, onChange,
}) => {
const { t } = useTranslation();
const [movable, setMovable] = useState(data.movable);
const [fixed, setFixed] = useState(data.fixed);
const emit = (nextMovable = movable, nextFixed = fixed) =>
onChange({
movable: nextMovable.filter((x) => x.on).map((x) => x.key),
fixed: nextFixed.filter((x) => x.on).map((x) => x.key),
model: data.model,
});
return (
<div className="pr-two">
<div>
<p className="p2v-label">{t('playreel.analysis.movable')}</p>
<p className="p2v-help">{t('playreel.analysis.movableHelp')}</p>
<div className="p2v-chips">
{movable.map((m) => (
<Chip
key={m.key}
on={m.on}
onClick={() => {
const next = movable.map((x) => (x.key === m.key ? { ...x, on: !x.on } : x));
setMovable(next);
emit(next);
}}
>
{m.label}
</Chip>
))}
</div>
<p className="p2v-label pr-gap">{t('playreel.analysis.fixed')}</p>
<p className="p2v-help">{t('playreel.analysis.fixedHelp')}</p>
<div className="p2v-chips">
{fixed.map((f) => (
<Chip
key={f.key}
on={f.on}
locked={f.key === 'title'}
onClick={() => {
const next = fixed.map((x) => (x.key === f.key ? { ...x, on: !x.on } : x));
setFixed(next);
emit(movable, next);
}}
>
{f.label}
</Chip>
))}
</div>
<p className="p2v-label pr-gap">{t('playreel.analysis.model')}</p>
<p className="p2v-help">{t('playreel.analysis.modelValue')}</p>
{data.ip_risk && <p className="pr-callout">{t('playreel.analysis.ipRisk')}</p>}
{!data.has_qr && <p className="p2v-note">{t('playreel.analysis.noQr')}</p>}
</div>
<div>
<p className="p2v-label">{t('playreel.analysis.grid')}</p>
<img className="p2v-review__image pr-image" src={data.grid_url} alt={t('playreel.analysis.grid')} />
</div>
</div>
);
};
// ── ③ 나레이션·보이스 확인 ──────────────────────────────────────────────
type NarrationEdits = Extract<GateEdits, { lines: string[] }>;
const NARRATION_MIN_SECONDS = 28;
const NARRATION_MAX_SECONDS = 31;
const NarrationGate: React.FC<{ data: NarrationReview; onChange: (edits: NarrationEdits) => void }> = ({
data, onChange,
}) => {
const { t } = useTranslation();
const [lines, setLines] = useState(data.lines);
const lengthOk = data.est_seconds >= NARRATION_MIN_SECONDS && data.est_seconds <= NARRATION_MAX_SECONDS;
return (
<div className="pr-two">
<div>
<p className="p2v-label">{t('playreel.narration.lines', { count: lines.length })}</p>
{lines.map((line, i) => (
<div key={i} className="pr-row">
<span className="pr-row__label pr-row__label--slot">{line.slot}</span>
<input
className="p2v-input"
value={line.text}
onChange={(e) => {
const next = lines.map((x, j) => (j === i ? { ...x, text: e.target.value } : x));
setLines(next);
onChange({ lines: next.map((x) => x.text), voice_id: data.voice.id });
}}
/>
</div>
))}
</div>
<div>
<p className="p2v-label">{t('playreel.narration.voice')}</p>
<div className="p2v-panel">
<p className="pr-strong">{data.voice.name}</p>
{data.voice.sample_url ? (
<audio controls src={data.voice.sample_url} className="pr-audio" />
) : (
<p className="p2v-note">{t('playreel.narration.sampleMissing')}</p>
)}
</div>
<p className="p2v-label pr-gap">{t('playreel.narration.estimate')}</p>
<p className={`pr-stat${lengthOk ? '' : ' warn'}`}>
{t('playreel.narration.seconds', { value: data.est_seconds.toFixed(1) })}
</p>
<p className="p2v-note">
{t('playreel.narration.target', { min: NARRATION_MIN_SECONDS, max: NARRATION_MAX_SECONDS })}
{!lengthOk && ` — ${t('playreel.narration.adjust')}`}
</p>
</div>
</div>
);
};
// ── ④ 클립 검수 ─────────────────────────────────────────────────────────
const ClipGate: React.FC<{ data: ClipReview }> = ({ data }) => {
const { t } = useTranslation();
return (
<div className="pr-two">
<div className="p2v-panel pr-player">
{data.clip_url ? (
<video src={data.clip_url} controls playsInline />
) : (
<p className="p2v-note">{t('playreel.clip.missing')}</p>
)}
</div>
<div>
<p className="p2v-label">{t('playreel.clip.titleCheck')}</p>
<div className={`p2v-panel pr-verdict${data.gate_passed ? ' ok' : ' fail'}`}>
<p className="pr-strong">
{t(data.gate_passed ? 'playreel.clip.passed' : 'playreel.clip.failed', {
mae: data.title_mae.toFixed(2),
})}
</p>
<p className="p2v-note">{t('playreel.clip.criteria')}</p>
{data.gate_reason && <p className="p2v-note warn">{data.gate_reason}</p>}
</div>
<p className="p2v-label pr-gap">{t('playreel.clip.frames')}</p>
<img className="p2v-review__image pr-image" src={data.frames_url} alt={t('playreel.clip.frames')} />
<p className="pr-callout">{t('playreel.clip.redoNote')}</p>
</div>
</div>
);
};
// ── ⑤ 최종 검수 ─────────────────────────────────────────────────────────
const FinalGate: React.FC<{ data: FinalReview }> = ({ data }) => {
const { t } = useTranslation();
return (
<div className="pr-two">
<div className="p2v-panel pr-player">
{data.video_url ? (
<video src={data.video_url} controls playsInline />
) : (
<p className="p2v-note">{t('playreel.final.missing', { seconds: data.duration.toFixed(1) })}</p>
)}
</div>
<div>
<p className="p2v-label">{t('playreel.final.checks')}</p>
{data.checks.map((c) => (
<p key={c.key} className={`pr-check${c.ok ? '' : ' fail'}`}>
<Icon d={c.ok ? CHECK : CROSS} size={14} />
{c.label}
</p>
))}
<p className="p2v-label pr-gap">{t('playreel.final.proof')}</p>
<img className="p2v-review__image pr-image" src={data.proof_url} alt={t('playreel.final.proof')} />
<p className="p2v-note">{t('playreel.final.version', { version: data.version })}</p>
</div>
</div>
);
};
// ── 게이트 셸 ───────────────────────────────────────────────────────────
/**
* 롱컷 검수 게이트. 파이프라인이 사람의 확인을 기다리며 멈추는 5개 지점 중 하나를 그린다.
*
* 승인하면 다음 단계가 이어지고, 크레딧을 이미 쓴 지점(연출 확인 이후)부터는 되돌릴 수 없다.
* 고친 값은 `edits` ref 에 모았다가 승인할 때 함께 보낸다 — 입력마다 요청하지 않는다.
*/
const PlayreelGateContent: React.FC<PlayreelGateContentProps> = ({ job, onChanged, onAutoApproved }) => {
const { t } = useTranslation();
const edits = useRef<GateEdits | null>(null);
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
const prefs = useAutoApprove();
const autoFired = useRef(false); // 같은 게이트에 두 번 보내지 않는다
const { gate, review } = job;
// 자동 승인이 켜진 게이트(①·③)는 폴링이 검수 대기를 보는 순간 한 번만 승인한다.
// 실패하면 카드가 그대로 남아 사람이 직접 누를 수 있다.
const autoGate = isAutoApprovable(gate) && prefs[gate] ? gate : null;
const autoActive = autoGate !== null && !error;
useEffect(() => {
if (!autoGate || autoFired.current) return;
autoFired.current = true;
approvePlayreelGate(job.id, autoGate, null)
.then(() => {
onAutoApproved(autoGate);
onChanged();
})
.catch((e) => setError(t('playreel.auto.failed', { message: (e as Error).message })));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [autoGate]);
if (!gate || !review) return null;
if (autoActive) {
return (
<div className="p2v-scope p2v-making">
<div className="p2v-spinner" aria-hidden="true" />
<p className="p2v-making__desc">
{t('playreel.auto.working', { step: GATE_ORDER.indexOf(gate) + 1, name: t(`playreel.gates.${gate}.name`) })}
</p>
<p className="p2v-note">{t('playreel.auto.hint')}</p>
</div>
);
}
const step = GATE_ORDER.indexOf(gate) + 1;
const run = async (request: () => Promise<unknown>) => {
setBusy(true);
setError(null);
try {
await request();
edits.current = null;
onChanged();
} catch (e) {
setError((e as Error).message);
} finally {
setBusy(false);
}
};
const approveLabel =
gate === 'final_confirm' ? t('playreel.gate.approveFinal')
: gate === 'clip_confirm' ? t('playreel.gate.approveClip')
: t('playreel.gate.approve');
const renderBody = () => {
switch (review.gate) {
case 'fetch_confirm':
return <FetchGate data={review.data} onChange={(e) => { edits.current = e; }} />;
case 'analysis_confirm':
return <AnalysisGate data={review.data} onChange={(e) => { edits.current = e; }} />;
case 'narration_confirm':
return <NarrationGate data={review.data} onChange={(e) => { edits.current = e; }} />;
case 'clip_confirm':
return <ClipGate data={review.data} />;
case 'final_confirm':
return <FinalGate data={review.data} />;
}
};
return (
<div className="p2v-scope p2v-review pr-gate">
<p className="pr-gate__eyebrow">
{t('playreel.gate.progress', { step, total: GATE_ORDER.length, name: t(`playreel.gates.${gate}.name`) })}
</p>
<h2 className="pr-gate__title">{t(`playreel.gates.${gate}.title`)}</h2>
<p className="p2v-help">{t(`playreel.gates.${gate}.why`)}</p>
{renderBody()}
{error && <div className="p2v-note warn">{error}</div>}
<button
type="button"
className="p2v-btn-cta"
disabled={busy}
onClick={() => run(() => approvePlayreelGate(job.id, gate, edits.current))}
>
{busy ? t('playreel.gate.working') : approveLabel}
</button>
<div className="pr-gate__actions">
{gate === 'clip_confirm' && (
<button
type="button"
className="p2v-btn-outline"
disabled={busy}
onClick={() => run(() => retryPlayreelClip(job.id))}
>
{t('playreel.gate.redo')}
</button>
)}
{GATE_CAN_BACK[gate] && (
<button
type="button"
className="p2v-btn-outline"
disabled={busy}
onClick={() => run(() => backPlayreelGate(job.id))}
>
{t('playreel.gate.back')}
</button>
)}
</div>
<p className="p2v-note">
{t('playreel.gate.next', {
next: t(`playreel.gates.${gate}.next`),
eta: t(`playreel.gates.${gate}.eta`),
})}
</p>
</div>
);
};
export default PlayreelGateContent;
+88
View File
@@ -0,0 +1,88 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { p2vProgress } from '../../utils/p2vApi';
import { GATE_ORDER, GateKey, PlayreelJob } from '../../utils/playreelApi';
interface PlayreelMakingContentProps {
job: PlayreelJob | null;
/** 실패한 잡을 버리고 처음부터. 실패하면 크레딧이 환불되므로 같은 잡을 다시 돌리지 않는다 */
onDiscard: () => void;
busy: boolean;
/** 방금 자동 승인한 게이트가 있으면 그 안내. 다음 확인 요청이 올 때까지 보여준다 */
autoApprovedGate?: GateKey | null;
}
/**
* 롱컷 진행·실패 화면. 검수 게이트 사이사이의 대기 구간에 쓰인다.
*
* 진행바는 스테이지 완료 수 기반이라 구간 사이에서 멈춰 보인다 —
* 스피너가 "살아 있다"를 따로 알린다(PosterMakingContent 와 같은 판단).
*/
const PlayreelMakingContent: React.FC<PlayreelMakingContentProps> = ({
job, onDiscard, busy, autoApprovedGate,
}) => {
const { t } = useTranslation();
if (!job) return null;
const percent = p2vProgress(job);
if (job.status === 'failed') {
return (
<div className="p2v-scope p2v-making">
<span className="p2v-making__name">{job.name}</span>
<h2 className="p2v-making__title warn">{t('playreel.making.failTitle')}</h2>
<p className="p2v-making__desc">
{t(`playreel.stages.${job.error?.stage}`, { defaultValue: job.error?.stage ?? '' })}
</p>
{job.error?.detail && <pre className="p2v-errorbox">{job.error.detail}</pre>}
<p className="p2v-making__desc">{t('playreel.making.refunded')}</p>
<div className="p2v-making__actions">
<button type="button" className="p2v-btn-mint" disabled={busy} onClick={onDiscard}>
{t('playreel.making.discard')}
</button>
</div>
</div>
);
}
const stageKey = job.stage ?? '';
const copy = t(`playreel.running.${stageKey}`, { defaultValue: t('playreel.making.preparing') });
return (
<div className="p2v-scope p2v-making">
<span className="p2v-making__name">{job.name}</span>
<h2 className="p2v-making__title">{t('playreel.making.title')}</h2>
<div className="p2v-spinner" aria-hidden="true" />
<div
className="p2v-bar"
role="progressbar"
aria-valuenow={percent}
aria-valuemin={0}
aria-valuemax={100}
>
<div className="p2v-bar__fill" style={{ width: `${percent}%` }} />
</div>
<div className="p2v-making__meta">
<span>{job.status === 'queued' ? t('playreel.making.queued') : copy}</span>
<span className="p2v-making__pct">{percent}%</span>
</div>
<p className="p2v-making__desc">{t('playreel.making.wait')}</p>
{autoApprovedGate && (
<p className="pr-auto-note">
{t('playreel.auto.done', {
step: GATE_ORDER.indexOf(autoApprovedGate) + 1,
name: t(`playreel.gates.${autoApprovedGate}.name`),
})}
</p>
)}
</div>
);
};
export default PlayreelMakingContent;
+61
View File
@@ -0,0 +1,61 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { PlayreelJob } from '../../utils/playreelApi';
interface PlayreelResultContentProps {
job: PlayreelJob;
/** 새 롱컷으로 처음부터 */
onNew: () => void;
}
/**
* 롱컷 완성 화면.
*
* 완성 영상은 blob 에 내려받기 헤더가 붙어 있어, 주소를 그대로 열면 파일로 저장된다.
* `<a download>` 는 다른 출처에 듣지 않으므로 이 속성에 기대지 않는다.
*/
const PlayreelResultContent: React.FC<PlayreelResultContentProps> = ({ job, onNew }) => {
const { t } = useTranslation();
const video = job.artifacts.video ?? '';
return (
<div className="p2v-scope p2v-result">
<h2 className="p2v-result__title">{t('playreel.result.title')}</h2>
<div className="p2v-result__grid">
<div className="p2v-panel p2v-result__player">
{video ? (
<video src={video} controls playsInline />
) : (
<p className="p2v-note">{t('playreel.result.videoMissing')}</p>
)}
</div>
<div className="p2v-result__side">
<p className="p2v-label">{t('playreel.result.fileName')}</p>
<p className="p2v-result__filename">{job.source.slug}_30_v{job.version}.mp4</p>
<p className="p2v-note">
{t('playreel.result.source')}{' '}
<a href={job.source.url} target="_blank" rel="noreferrer">{t('playreel.result.sourceLink')}</a>
</p>
<div className="p2v-result__actions">
{video && (
<a href={video} className="p2v-btn-cta p2v-btn-cta--compact">
{t('playreel.result.download')}
</a>
)}
</div>
</div>
</div>
<button type="button" className="p2v-btn-outline p2v-result__new" onClick={onNew}>
{t('playreel.result.new')}
</button>
</div>
);
};
export default PlayreelResultContent;
+19 -14
View File
@@ -1,12 +1,16 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import PosterDropzone from '../../components/PosterDropzone'; import PosterDropzone from '../../components/PosterDropzone';
import P2vKeyGate from '../../components/P2vKeyGate'; import { InsufficientCreditError } from '../../utils/api';
import { P2vAuthError, createPosterJob } from '../../utils/p2vApi'; import { createPosterJob } from '../../utils/p2vApi';
interface PosterCreateFormProps { interface PosterCreateFormProps {
/** 생성 요청이 접수되면 호출. 폴링 소유는 GenerationFlow (썰박스와 같은 규칙) */ /** 생성 요청이 접수되면 호출. 폴링 소유는 GenerationFlow (썰박스와 같은 규칙) */
onSubmitted: (jobId: string) => void; onSubmitted: (jobId: string) => void;
/** 크레딧 부족(402) 시 충전 화면으로 유도 */
onNeedCredit: () => void;
/** 시작 선택 화면으로 돌아간다 */
onBack: () => void;
} }
/** /**
@@ -15,14 +19,13 @@ interface PosterCreateFormProps {
* 행사명은 비워도 된다 — 서버가 포스터에서 뽑는다. 다만 뽑은 값이 틀릴 수 있어 * 행사명은 비워도 된다 — 서버가 포스터에서 뽑는다. 다만 뽑은 값이 틀릴 수 있어
* 검수 단계에서 다시 고칠 기회를 준다(메타태그는 아카이브에 영구 저장된다). * 검수 단계에서 다시 고칠 기회를 준다(메타태그는 아카이브에 영구 저장된다).
*/ */
const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted }) => { const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted, onNeedCredit, onBack }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const [file, setFile] = useState<File | null>(null); const [file, setFile] = useState<File | null>(null);
const [name, setName] = useState(''); const [name, setName] = useState('');
const [submitting, setSubmitting] = useState(false); const [submitting, setSubmitting] = useState(false);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
const [authNeeded, setAuthNeeded] = useState(false);
const submit = async () => { const submit = async () => {
if (!file || submitting) return; if (!file || submitting) return;
@@ -32,8 +35,8 @@ const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted }) => {
const { id } = await createPosterJob(file, name.trim()); const { id } = await createPosterJob(file, name.trim());
onSubmitted(id); onSubmitted(id);
} catch (e) { } catch (e) {
if (e instanceof P2vAuthError) { if (e instanceof InsufficientCreditError) {
setAuthNeeded(true); onNeedCredit();
} else { } else {
setError((e as Error).message); setError((e as Error).message);
} }
@@ -41,16 +44,10 @@ const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted }) => {
} }
}; };
if (authNeeded) {
return (
<div className="p2v-scope p2v-create">
<P2vKeyGate onSaved={() => { setAuthNeeded(false); submit(); }} />
</div>
);
}
return ( return (
<div className="p2v-scope p2v-create"> <div className="p2v-scope p2v-create">
<button type="button" className="p2v-back" onClick={onBack}>{t('poster.start.back')}</button>
<span className="p2v-step">{t('poster.create.step')}</span> <span className="p2v-step">{t('poster.create.step')}</span>
<PosterDropzone file={file} onFile={setFile} /> <PosterDropzone file={file} onFile={setFile} />
@@ -64,6 +61,14 @@ const PosterCreateForm: React.FC<PosterCreateFormProps> = ({ onSubmitted }) => {
{error && <div className="p2v-note warn">{error}</div>} {error && <div className="p2v-note warn">{error}</div>}
<div className="p2v-create__cost">
<span>{t('poster.create.cost')}</span>
<span className="p2v-create__cost-badge">
<span className="p2v-create__coin" aria-hidden="true">🪙</span>
{t('poster.create.costValue')}
</span>
</div>
<button <button
type="button" type="button"
className="p2v-btn-cta" className="p2v-btn-cta"
+4 -20
View File
@@ -4,11 +4,7 @@ import { P2vJob, isPastReview, p2vProgress } from '../../utils/p2vApi';
interface PosterMakingContentProps { interface PosterMakingContentProps {
job: P2vJob | null; job: P2vJob | null;
/** 실패 시 같은 잡을 다시 태운다 (업로드부터 다시 하지 않는다) */ /** 실패한 잡을 버리고 처음부터. 실패하면 크레딧이 환불되므로 같은 잡을 다시 돌리지 않는다 */
onRetry: () => void;
/** 실패를 무시하고 이미 생성된 클립으로 렌더를 잇는다 (i2v 게이트 실패 전용) */
onForce: () => void;
/** 실패한 잡을 버리고 처음부터 */
onDiscard: () => void; onDiscard: () => void;
busy: boolean; busy: boolean;
} }
@@ -23,18 +19,13 @@ interface PosterMakingContentProps {
* 스피너가 "살아 있다"를 따로 알린다(썰박스 SsulMakingContent 와 같은 판단). * 스피너가 "살아 있다"를 따로 알린다(썰박스 SsulMakingContent 와 같은 판단).
*/ */
const PosterMakingContent: React.FC<PosterMakingContentProps> = ({ const PosterMakingContent: React.FC<PosterMakingContentProps> = ({
job, onRetry, onForce, onDiscard, busy, job, onDiscard, busy,
}) => { }) => {
const { t } = useTranslation(); const { t } = useTranslation();
if (!job) return null; if (!job) return null;
const failed = job.status === 'failed'; const failed = job.status === 'failed';
// "무시하고 진행"은 i2v 게이트 실패(클립은 이미 생성됨)에서만 의미가 있다.
// 다른 스테이지 실패는 이어갈 산출물이 없어 서버도 409 로 거절한다.
// 개발자 모드(vite dev) 전용 — 품질 게이트를 일반 사용자가 우회하면 훼손된
// 제목의 영상이 그대로 나가므로, 프로덕션 빌드에서는 버튼 자체를 뺀다.
const canForce = import.meta.env.DEV && failed && job.error?.stage === 'i2v';
const percent = p2vProgress(job); const percent = p2vProgress(job);
const past = isPastReview(job); const past = isPastReview(job);
@@ -57,18 +48,11 @@ const PosterMakingContent: React.FC<PosterMakingContentProps> = ({
{job.error?.detail && ( {job.error?.detail && (
<pre className="p2v-errorbox">{job.error.detail}</pre> <pre className="p2v-errorbox">{job.error.detail}</pre>
)} )}
<p className="p2v-making__desc">{t('poster.making.refunded')}</p>
<div className="p2v-making__actions"> <div className="p2v-making__actions">
<button type="button" className="p2v-btn-outline" disabled={busy} onClick={onDiscard}> <button type="button" className="p2v-btn-mint" disabled={busy} onClick={onDiscard}>
{t('poster.making.discard')} {t('poster.making.discard')}
</button> </button>
<button type="button" className="p2v-btn-mint" disabled={busy} onClick={onRetry}>
{t('poster.making.retry')}
</button>
{canForce && (
<button type="button" className="p2v-btn-tonal" disabled={busy} onClick={onForce}>
{t('poster.making.force')}
</button>
)}
</div> </div>
</> </>
) : ( ) : (
+45 -18
View File
@@ -1,6 +1,8 @@
import React from 'react'; import React, { useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { P2vJob, downloadP2vFile, p2vFile } from '../../utils/p2vApi'; import { P2vJob } from '../../utils/p2vApi';
import { SocialUploadableItem } from '../../types/api';
import SocialPostingModal from '../../components/SocialPostingModal';
interface PosterResultContentProps { interface PosterResultContentProps {
job: P2vJob; job: P2vJob;
@@ -11,14 +13,33 @@ interface PosterResultContentProps {
/** /**
* 포스터 영상 완성 화면. * 포스터 영상 완성 화면.
* *
* 다운로드는 `<a download>` 다 — 헤더를 못 붙이므로 p2vFile() 이 접근 키를 * 산출물은 Azure Blob 의 절대 URL 이다. 완성 영상은 blob 에 내려받기 헤더가 붙어 있어
* 쿼리로 태워준다(P2V 서버가 ?key= 경로를 지원하는 이유가 이것이다). * `<a download>` 가 다른 출처에서도 파일로 저장된다.
*/ */
const PosterResultContent: React.FC<PosterResultContentProps> = ({ job, onNew }) => { const PosterResultContent: React.FC<PosterResultContentProps> = ({ job, onNew }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const [showSocialModal, setShowSocialModal] = useState(false);
const video = p2vFile(job.artifacts.video); const video = job.artifacts.video ?? '';
const thumbnail = job.artifacts.thumbnail ? p2vFile(job.artifacts.thumbnail) : null; const thumbnail = job.artifacts.thumbnail ?? null;
// 소셜 업로드 모달은 VideoListItem 형태를 받는다. type='p2v_video' 가 핵심이다 —
// 모달이 content_type 으로 보내므로 id 가 겹치는 ADO2 영상이 업로드되는 사고가 없다.
const uploadItem = video
? ({
type: 'p2v_video',
video_id: job.id,
store_name: job.name,
region: '',
task_id: '',
result_movie_url: video,
thumbnail_url: thumbnail ?? undefined,
created_at: new Date(job.created_at * 1000).toISOString(),
like_count: 0,
comment_count: 0,
is_liked_by_me: false,
} as SocialUploadableItem)
: null;
return ( return (
<div className="p2v-scope p2v-result"> <div className="p2v-scope p2v-result">
@@ -71,29 +92,35 @@ const PosterResultContent: React.FC<PosterResultContentProps> = ({ job, onNew })
)} )}
<div className="p2v-result__actions"> <div className="p2v-result__actions">
{/* 교차 출처(Blob) URL 은 <a download> 가 무시된다 — fetch 경유 다운로드 */}
{thumbnail && ( {thumbnail && (
<a href={thumbnail} download className="p2v-btn-tonal">
{t('poster.result.downloadThumb')}
</a>
)}
{video && (
<a href={video} download className="p2v-btn-cta p2v-btn-cta--compact">
{t('poster.result.downloadVideo')}
</a>
)}
{uploadItem && job.status === 'done' && (
<button <button
type="button" type="button"
className="p2v-btn-tonal" className="p2v-btn-tonal"
onClick={() => downloadP2vFile(thumbnail, `${job.name || 'poster'}_thumb.jpg`)} onClick={() => setShowSocialModal(true)}
> >
{t('poster.result.downloadThumb')} {t('ado2Contents.uploadToSocial')}
</button>
)}
{video && (
<button
type="button"
className="p2v-btn-cta p2v-btn-cta--compact"
onClick={() => downloadP2vFile(video, `${job.name || 'poster'}.mp4`)}
>
{t('poster.result.downloadVideo')}
</button> </button>
)} )}
</div> </div>
</div> </div>
</div> </div>
<SocialPostingModal
isOpen={showSocialModal}
onClose={() => setShowSocialModal(false)}
video={uploadItem}
/>
<button type="button" className="p2v-btn-outline p2v-result__new" onClick={onNew}> <button type="button" className="p2v-btn-outline p2v-result__new" onClick={onNew}>
{t('poster.result.new')} {t('poster.result.new')}
</button> </button>
+2 -20
View File
@@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next';
import { import {
P2vJob, P2vJob,
approvePosterJob, approvePosterJob,
fetchP2vImage,
updatePosterMetadata, updatePosterMetadata,
updatePosterNarration, updatePosterNarration,
} from '../../utils/p2vApi'; } from '../../utils/p2vApi';
@@ -40,23 +39,6 @@ const PosterReviewContent: React.FC<PosterReviewContentProps> = ({ job, onApprov
const [meta, setMeta] = useState<MetaDraft>(emptyMeta); const [meta, setMeta] = useState<MetaDraft>(emptyMeta);
const [busy, setBusy] = useState(false); const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
const [checkImageUrl, setCheckImageUrl] = useState<string | null>(null);
// 검수 이미지는 인증이 필요한 프록시 경로(regions/)라 <img src> 로 직접 못 넣는다.
// authenticatedFetch → blob URL 로 받아오고, 잡이 바뀌면 이전 URL 을 회수한다.
useEffect(() => {
const path = job.artifacts.check_jpg;
if (!path) {
setCheckImageUrl(null);
return undefined;
}
let revoked: string | null = null;
fetchP2vImage(path)
.then((url) => { revoked = url; setCheckImageUrl(url); })
.catch(() => setCheckImageUrl(null));
return () => { if (revoked) URL.revokeObjectURL(revoked); };
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [job.artifacts.check_jpg]);
// 서버 값으로 초안을 채우되, 사용자가 고치기 시작한 뒤에는 폴링 응답이 덮지 않아야 한다. // 서버 값으로 초안을 채우되, 사용자가 고치기 시작한 뒤에는 폴링 응답이 덮지 않아야 한다.
// 잡 id 가 바뀔 때만 다시 채운다(같은 잡의 재조회는 무시). // 잡 id 가 바뀔 때만 다시 채운다(같은 잡의 재조회는 무시).
@@ -169,10 +151,10 @@ const PosterReviewContent: React.FC<PosterReviewContentProps> = ({ job, onApprov
{/* ── 대조용 분석 이미지 ────────────────────── */} {/* ── 대조용 분석 이미지 ────────────────────── */}
<div className="p2v-review__preview"> <div className="p2v-review__preview">
<p className="p2v-label">{t('poster.review.analysis')}</p> <p className="p2v-label">{t('poster.review.analysis')}</p>
{checkImageUrl ? ( {job.artifacts.check_jpg ? (
<img <img
className="p2v-review__image" className="p2v-review__image"
src={checkImageUrl} src={job.artifacts.check_jpg}
alt={t('poster.review.analysisAlt')} alt={t('poster.review.analysisAlt')}
/> />
) : ( ) : (
+72
View File
@@ -0,0 +1,72 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
/** `ready` 가 false 인 갈래는 버튼이 "준비 중" 으로 잠긴다. 열 때는 이 값만 true 로 바꾼다 */
const CARDS = [
{ key: 'image', icon: 'IMG', hot: false, ready: true },
{ key: 'url', icon: 'URL', hot: true, ready: false },
] as const;
const FLOW_KEYS = ['first', 'move', 'narration'] as const;
const FACT_KEYS = ['need', 'review', 'time'] as const;
interface PosterStartChoiceProps {
/** 이미지로 시작하기 — 포스터 업로드 폼(무빙 포스터)으로 */
onPickImage: () => void;
/** 공연상품페이지로 시작하기 — 주소 입력 폼(롱컷)으로 */
onPickUrl: () => void;
}
/**
* 무빙 포스터 시작 선택 화면 — playreel 의 "어떻게 시작할까요?" 와 같은 구성이다.
* 가진 것(이미지 한 장 / 상품페이지 주소)에 따라 두 갈래 중 하나를 고른다.
*/
const PosterStartChoice: React.FC<PosterStartChoiceProps> = ({ onPickImage, onPickUrl }) => {
const { t } = useTranslation();
const handlers = { image: onPickImage, url: onPickUrl };
return (
<div className="p2v-scope p2v-start">
<h2 className="p2v-start__title">{t('poster.start.title')}</h2>
<p className="p2v-start__subtitle">{t('poster.start.subtitle')}</p>
{CARDS.map(({ key, icon, hot, ready }) => (
<div key={key} className={`p2v-panel p2v-intro${hot ? ' p2v-intro--hot' : ''}`}>
{hot && <span className="p2v-intro__badge">{t('poster.start.badge')}</span>}
<div className="p2v-intro__head">
<div className="p2v-intro__icon">{icon}</div>
<div>
<h3 className="p2v-intro__title">{t(`poster.start.${key}.title`)}</h3>
<p className="p2v-intro__desc">{t(`poster.start.${key}.desc`)}</p>
</div>
</div>
<ol className="p2v-intro__flow">
{FLOW_KEYS.map((flow, i) => (
<li key={flow}>
<span className="p2v-intro__flow-number" aria-hidden="true">
{String(i + 1).padStart(2, '0')}
</span>
<span>{t(`poster.start.${key}.flow.${flow}`)}</span>
</li>
))}
</ol>
<div className="p2v-intro__facts">
{FACT_KEYS.map((fact) => (
<div key={fact}>
<b>{t(`poster.start.${key}.facts.${fact}.label`)}</b>
<span>{t(`poster.start.${key}.facts.${fact}.value`)}</span>
</div>
))}
</div>
<button type="button" className="p2v-btn-cta" disabled={!ready} onClick={handlers[key]}>
{ready ? t(`poster.start.${key}.cta`) : t('poster.start.comingSoon')}
</button>
</div>
))}
</div>
);
};
export default PosterStartChoice;
-341
View File
@@ -1,341 +0,0 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import PosterDropzone from '../../components/PosterDropzone';
import P2vKeyGate from '../../components/P2vKeyGate';
import {
InternalOnlyWarning,
LicenseBadge,
UserReferenceNotice,
} from '../../components/LicenseBadge';
import { useP2vJob } from '../../hooks/useP2vJob';
import {
F2Category,
F2Format,
F2Template,
F2UploadHint,
P2vAuthError,
createF2Template,
createStylingJob,
deleteF2Template,
downloadP2vFile,
getF2UploadHint,
isP2vActive,
listF2Categories,
listF2Formats,
listF2Templates,
p2vFile,
} from '../../utils/p2vApi';
/** 사용자가 올린 레퍼런스 카테고리. 서버 카테고리 목록에서 따로 떼어 아래에 둔다 */
const USER_CATEGORY = 'user';
/**
* 포스터 스타일링(F2).
*
* **내부 시연 전용이다.** 영화 포스터 레퍼런스는 저작권 자산이라 결과물을 외부에
* 공개하면 안 된다(퍼블릭 도메인 명화만 예외). 그래서 화면 상단에 범위를 못박고,
* 템플릿마다 배포 등급 배지를 붙인다.
*
* 다른 파이프라인과 달리 위저드가 아니라 **한 화면짜리 도구**다 — 업로드·템플릿·
* 포맷·결과가 한눈에 있어야 여러 스타일을 빠르게 갈아 끼우며 비교할 수 있고,
* 30초짜리 작업에 단계를 나누면 왕복만 늘어난다. 그래서 폴링도 GenerationFlow 가
* 아니라 이 컴포넌트가 직접 소유한다(F1·썰박스와 다른 유일한 지점).
*/
const StylingContent: React.FC = () => {
const { t } = useTranslation();
const [templates, setTemplates] = useState<F2Template[]>([]);
const [categories, setCategories] = useState<F2Category[]>([]);
const [formats, setFormats] = useState<F2Format[]>([]);
const [hint, setHint] = useState<F2UploadHint | null>(null);
const [file, setFile] = useState<File | null>(null);
const [selected, setSelected] = useState<string | null>(null);
const [format, setFormat] = useState('poster');
const [jobId, setJobId] = useState<string | null>(null);
const [tplOpen, setTplOpen] = useState(true);
const [busy, setBusy] = useState(false);
const [refBusy, setRefBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
const [authNeeded, setAuthNeeded] = useState(false);
const refInput = useRef<HTMLInputElement>(null);
const { job, authNeeded: jobAuthNeeded } = useP2vJob('f2', jobId);
const selectedTpl = templates.find((tpl) => tpl.id === selected) ?? null;
const running = isP2vActive(job);
const loadAll = useCallback(async () => {
try {
const [tpls, cats, fmts, uploadHint] = await Promise.all([
listF2Templates(),
listF2Categories(),
listF2Formats(),
getF2UploadHint(),
]);
setTemplates(tpls);
setCategories(cats);
setFormats(fmts);
setHint(uploadHint);
setAuthNeeded(false);
setError(null);
} catch (e) {
if (e instanceof P2vAuthError) setAuthNeeded(true);
else setError((e as Error).message);
}
}, []);
useEffect(() => {
loadAll();
}, [loadAll]);
const uploadReference = async (f: File) => {
setRefBusy(true);
setError(null);
try {
const tpl = await createF2Template(f, f.name.replace(/\.[^.]+$/, '').slice(0, 40));
setTemplates(await listF2Templates());
setSelected(tpl.id); // 방금 올린 것을 바로 고른 상태로
} catch (e) {
if (e instanceof P2vAuthError) setAuthNeeded(true);
else setError((e as Error).message);
} finally {
setRefBusy(false);
if (refInput.current) refInput.current.value = '';
}
};
const removeReference = async (id: string) => {
if (!window.confirm(t('poster.styling.confirmDelete'))) return;
try {
await deleteF2Template(id);
if (selected === id) setSelected(null);
setTemplates(await listF2Templates());
} catch (e) {
setError((e as Error).message);
}
};
const submit = async () => {
if (!file || !selected || busy) return;
setBusy(true);
setError(null);
try {
const { id } = await createStylingJob(file, selected, format);
setJobId(id);
} catch (e) {
if (e instanceof P2vAuthError) setAuthNeeded(true);
else setError((e as Error).message);
} finally {
setBusy(false);
}
};
if (authNeeded || jobAuthNeeded) {
return (
<div className="p2v-scope p2v-styling">
<P2vKeyGate onSaved={() => { setAuthNeeded(false); loadAll(); }} />
</div>
);
}
const renderCard = (tpl: F2Template) => (
<div key={tpl.id} className="p2v-tplcard">
<button
type="button"
aria-pressed={selected === tpl.id}
className={`p2v-tpl${selected === tpl.id ? ' active' : ''}`}
onClick={() => setSelected(tpl.id)}
>
{/* 명화는 가로 그림도 있다 — cover 로 자르면 무엇인지 알 수 없어 contain 을 쓴다 */}
<img src={p2vFile(tpl.thumb_url)} alt={tpl.name_ko} />
<span className="p2v-tpl__name">{tpl.name_ko}</span>
{/* 제목이 1줄인 카드와 2줄인 카드가 섞인다. 아래로 밀어붙여야 한 행의 배지가 같은 선에 선다 */}
<span className="p2v-tpl__badge">
<LicenseBadge license={tpl.license} />
</span>
</button>
{tpl.removable && (
<button
type="button"
className="p2v-tpl__remove"
title={t('poster.styling.deleteRef')}
onClick={() => removeReference(tpl.id)}
>
×
</button>
)}
</div>
);
return (
<div className="p2v-scope p2v-styling">
<div className="p2v-notice p2v-notice--warn p2v-styling__scope">
{t('poster.styling.internalScope')}
</div>
{/* ── 스타일 템플릿 (접이식) ─────────────────────── */}
<button
type="button"
className="p2v-collapse"
aria-expanded={tplOpen}
onClick={() => setTplOpen(!tplOpen)}
>
<span className="p2v-label">{t('poster.styling.templates')}</span>
{!tplOpen && selectedTpl && (
<span className="p2v-collapse__picked">
<img src={p2vFile(selectedTpl.thumb_url)} alt="" />
<b>{selectedTpl.name_ko}</b>
<LicenseBadge license={selectedTpl.license} />
</span>
)}
{!tplOpen && !selectedTpl && (
<span className="p2v-collapse__empty">{t('poster.styling.pickTemplate')}</span>
)}
<svg
className={`p2v-collapse__caret${tplOpen ? ' open' : ''}`}
width="18" height="18" viewBox="0 0 24 24" fill="none"
stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"
>
<path d="m6 9 6 6 6-6" />
</svg>
</button>
{tplOpen && categories.filter((c) => c.id !== USER_CATEGORY).map((cat) => {
const items = templates.filter((tpl) => tpl.category === cat.id);
if (items.length === 0) return null;
return (
<div key={cat.id} className="p2v-tplgroup">
<p className="p2v-tplgroup__title">
{cat.label}
<span>{t('poster.styling.count', { count: items.length })}</span>
</p>
<div className="p2v-tplgrid">{items.map(renderCard)}</div>
</div>
);
})}
{/* 내 레퍼런스 — 목록이 비어도 업로드 타일은 보여야 하므로 categories 가 아니라
upload-hint 의 enabled 로 렌더한다 */}
{tplOpen && hint?.enabled && (
<div className="p2v-tplgroup">
<p className="p2v-tplgroup__title">
{t('poster.styling.myRefs')}
<span>{t('poster.styling.myRefsHint')}</span>
</p>
<div className="p2v-tplgrid">
{templates.filter((tpl) => tpl.category === USER_CATEGORY).map(renderCard)}
<button
type="button"
className="p2v-tpl p2v-tpl--add"
disabled={refBusy}
onClick={() => refInput.current?.click()}
>
{refBusy ? (
<>
<span className="p2v-spinner p2v-spinner--sm" aria-hidden="true" />
<span className="p2v-tpl__name">{t('poster.styling.analyzing')}</span>
</>
) : (
<>
<span className="p2v-tpl__plus" aria-hidden="true">+</span>
<span className="p2v-tpl__name">{t('poster.styling.addRef')}</span>
<span className="p2v-tpl__sub">
{t('poster.styling.minEdge', { px: hint.min_long_edge })}
</span>
</>
)}
</button>
<input
ref={refInput}
type="file"
accept="image/jpeg,image/png,image/webp,image/gif"
hidden
onChange={(e) => { const f = e.target.files?.[0]; if (f) uploadReference(f); }}
/>
</div>
<UserReferenceNotice />
</div>
)}
{/* 경고는 실제로 고른 순간에만 */}
{selectedTpl?.license === 'internal-only' && (
<InternalOnlyWarning note={selectedTpl.license_note} />
)}
{selectedTpl?.attribution && (
<p className="p2v-note">{t('poster.styling.attribution', { source: selectedTpl.attribution })}</p>
)}
{/* ── 입력 / 결과 ─────────────────────────────── */}
<div className="p2v-styling__io">
<div>
<p className="p2v-label">{t('poster.styling.myPoster')}</p>
<PosterDropzone file={file} onFile={setFile} />
</div>
<div>
<p className="p2v-label">{t('poster.styling.result')}</p>
{job?.status === 'done' && job.artifacts.image ? (
<div className="p2v-panel p2v-styling__out">
<img src={p2vFile(job.artifacts.image)} alt={t('poster.styling.resultAlt')} />
</div>
) : (
<div className="p2v-panel p2v-styling__out p2v-styling__out--empty">
{running && <span className="p2v-spinner p2v-spinner--md" aria-hidden="true" />}
<span>{t(running ? 'poster.styling.converting' : 'poster.styling.resultHint')}</span>
</div>
)}
{job?.status === 'done' && job.artifacts.image && (
<div className="p2v-styling__download">
{/* 교차 출처(Blob) URL 은 <a download> 가 무시된다 — fetch 경유 다운로드 */}
<button
type="button"
className="p2v-btn-tonal"
onClick={() => downloadP2vFile(
p2vFile(job.artifacts.image),
`p2v_poster_${job.id}.png`,
)}
>
{t('poster.styling.downloadPng')}
</button>
</div>
)}
</div>
</div>
{/* ── 출력 포맷 ───────────────────────────────── */}
<p className="p2v-label">{t('poster.styling.formats')}</p>
<div className="p2v-formats">
{formats.map((f) => (
<button
key={f.id}
type="button"
aria-pressed={format === f.id}
className={`p2v-select${format === f.id ? ' active' : ''}`}
onClick={() => setFormat(f.id)}
>
{f.label}
</button>
))}
</div>
<button
type="button"
className="p2v-btn-cta"
disabled={!file || !selected || busy || running}
onClick={submit}
>
{running
? t('poster.styling.converting')
: busy ? t('poster.create.submitting') : t('poster.styling.submit')}
</button>
{error && <div className="p2v-note warn">{error}</div>}
{job?.status === 'failed' && job.error && (
<pre className="p2v-errorbox">{job.error.detail}</pre>
)}
</div>
);
};
export default StylingContent;
+5 -479
View File
@@ -1,20 +1,5 @@
import React, { useCallback, useEffect, useRef, useState } from 'react'; import React from 'react';
import { useTranslation } from 'react-i18next'; import ContentDetailContent from '../../components/ContentDetailContent';
import {
API_URL,
deleteComment,
getSsulContentById,
getUserMe,
getVideoComments,
isLoggedIn,
postVideoComment,
toggleVideoLike,
} from '../../utils/api';
import type { SsulDetailItem } from '../../utils/api';
import { CommentItem, UserMeResponse } from '../../types/api';
import { buildContentShareUrl, tryNativeShare } from '../../utils/nativeShare';
import LoginPromptModal from '../../components/LoginPromptModal';
import { isSafeHttpUrl } from '../../utils/url';
interface SsulDetailContentProps { interface SsulDetailContentProps {
contentId: string; contentId: string;
@@ -22,467 +7,8 @@ interface SsulDetailContentProps {
onClose?: () => void; onClose?: () => void;
} }
/** const SsulDetailContent: React.FC<SsulDetailContentProps> = (props) => (
* 썰박스 콘텐츠 상세 — castad `VideoDetailContent` 와 같은 3층 구조의 내용부. <ContentDetailContent {...props} contentType="ssul" />
* (SsulViewerModal 이 모달로, SsulDetailPage 가 공유 링크 페이지로 감싼다) );
*
* UI·동작(좋아요 낙관 갱신·댓글·대댓글·공유·비로그인 게이트)은
* `VideoDetailContent` 와 동일하고, 다른 점은 셋뿐이다:
* 1. 상세 조회가 `GET /ssul/{id}` (video 조회를 쓰면 id 가 겹치는 남의 영상이 열린다)
* 2. 좋아요·댓글 API 에 `contentType='ssul'` 을 얹는다
* 3. 공유 URL 이 `/ssul/share/{id}` 다
*/
const SsulDetailContent: React.FC<SsulDetailContentProps> = ({
contentId,
isModal = false,
onClose,
}) => {
const { t } = useTranslation();
const authed = isLoggedIn();
const [content, setContent] = useState<SsulDetailItem | null>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
const [likeCount, setLikeCount] = useState(0);
const [isLiked, setIsLiked] = useState(false);
const [copied, setCopied] = useState(false);
const [isLandscape, setIsLandscape] = useState(false);
const [showSiteOverlay, setShowSiteOverlay] = useState(false);
const [showLoginModal, setShowLoginModal] = useState(false);
const [comments, setComments] = useState<CommentItem[]>([]);
const [commentsTotal, setCommentsTotal] = useState(0);
const [commentsPage, setCommentsPage] = useState(1);
const [commentsHasNext, setCommentsHasNext] = useState(false);
const [commentsLoading, setCommentsLoading] = useState(false);
const [commentInput, setCommentInput] = useState('');
const [commentSubmitting, setCommentSubmitting] = useState(false);
const commentTextareaRef = useRef<HTMLTextAreaElement>(null);
const [currentUser, setCurrentUser] = useState<UserMeResponse | null>(null);
const fetchComments = useCallback(
async (page: number, append = false) => {
setCommentsLoading(true);
try {
const res = await getVideoComments(contentId, page, 20, 'ssul');
const sorted = [...res.items].sort(
(a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()
);
setComments((prev) => (append ? [...prev, ...sorted] : sorted));
setCommentsTotal(res.total);
setCommentsHasNext(res.has_next);
setCommentsPage(page);
} catch (err) {
console.error('Failed to fetch ssul comments:', err);
} finally {
setCommentsLoading(false);
}
},
[contentId]
);
useEffect(() => {
const fetchContent = async () => {
setLoading(true);
setError(null);
setShowSiteOverlay(false);
try {
const data = await getSsulContentById(contentId);
setContent(data);
setLikeCount(data.like_count);
setIsLiked(data.is_liked_by_me);
} catch (err) {
console.error('Failed to fetch ssul content:', err);
setError(t('ado2Contents.loadFailed'));
} finally {
setLoading(false);
}
};
setIsLandscape(false);
fetchContent();
fetchComments(1);
}, [contentId, fetchComments, t]);
useEffect(() => {
if (!authed) return;
getUserMe().then(setCurrentUser).catch((err) => {
console.error('Failed to fetch current user:', err);
});
}, [authed]);
const formatDate = (dateString: string) => {
const date = new Date(dateString);
return t('videoDetail.dateFormat', {
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate(),
});
};
const formatCommentDate = (dateString: string) => {
const date = new Date(dateString);
return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(
date.getDate()
).padStart(2, '0')}`;
};
// 썰박스 공개 페이지 경로. /video/{id} 를 쓰면 id 가 겹치는 남의 영상이 열린다.
const shareUrl = buildContentShareUrl(API_URL, contentId, 'ssul');
const handleCopyLink = async () => {
try {
await navigator.clipboard.writeText(shareUrl);
} catch {
// clipboard API 미지원 환경에서는 무시
}
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
const handleShareButtonClick = async () => {
const handled = await tryNativeShare({
title: content?.store_name ?? t('videoDetail.kakaoDefaultTitle'),
url: shareUrl,
});
if (handled) {
return;
}
await handleCopyLink();
};
const likeDebounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const handleLike = () => {
if (!authed) {
setShowLoginModal(true);
return;
}
setIsLiked((prev) => !prev);
setLikeCount((prev) => (isLiked ? prev - 1 : prev + 1));
if (likeDebounceRef.current) clearTimeout(likeDebounceRef.current);
likeDebounceRef.current = setTimeout(async () => {
const prevLiked = isLiked;
const prevCount = likeCount;
try {
await toggleVideoLike(contentId, 'ssul');
} catch (err) {
console.error('Failed to toggle ssul like:', err);
setIsLiked(prevLiked);
setLikeCount(prevCount);
}
}, 500);
};
const handleHeaderAction = () => {
if (!isModal && !authed) {
setShowLoginModal(true);
return;
}
onClose?.();
};
const handleCommentFocus = () => {
if (!authed) setShowLoginModal(true);
};
const handleCommentSubmit = async () => {
if (!authed) {
setShowLoginModal(true);
return;
}
if (!commentInput.trim() || commentSubmitting) return;
setCommentSubmitting(true);
try {
await postVideoComment(contentId, commentInput.trim(), undefined, 'ssul');
setCommentInput('');
if (commentTextareaRef.current) {
commentTextareaRef.current.style.height = 'auto';
}
await fetchComments(1);
} catch (err) {
console.error('Failed to post ssul comment:', err);
} finally {
setCommentSubmitting(false);
}
};
const handleDeleteComment = async (commentId: number) => {
try {
await deleteComment(commentId);
await fetchComments(commentsPage);
} catch (err) {
console.error('Failed to delete ssul comment:', err);
}
};
const renderCommentContent = (content_: string | null, isDeleted: boolean) => {
if (isDeleted) {
return (
<span style={{ color: '#6B9EA0', fontStyle: 'italic' }}>
{t('videoDetail.deletedComment')}
</span>
);
}
return content_;
};
return (
<div className={isModal ? 'video-detail-modal-content' : 'video-detail-page-content'}>
{/* 헤더 */}
<div className="video-detail-header">
{isModal ? (
<>
{/* 제목이 없으면 space-between 인 헤더에서 닫기 버튼이 왼쪽으로 붙는다.
문구는 ADO2 상세와 같은 키를 쓴다 — 통합 목록에서 열리는 같은
모달이므로 콘텐츠 종류에 따라 제목이 바뀌면 오히려 어색하다. */}
<h2 className="video-detail-modal-title">{t('sidebar.ado2Contents')}</h2>
<button className="video-detail-close-btn" onClick={handleHeaderAction} aria-label={t('videoDetail.closeAriaLabel')}>
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
</svg>
</button>
</>
) : (
<button className="video-detail-back-btn" onClick={handleHeaderAction}>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
<path d="M13 4l-6 6 6 6" />
</svg>
{t('sidebar.ado2Contents')}
</button>
)}
</div>
<div className="video-detail-body">
{loading ? (
<div className="ado2-contents-loading">
<div className="loading-spinner"></div>
<p>{t('ado2Contents.loading')}</p>
</div>
) : error ? (
<div className="ado2-contents-error"><p>{error}</p></div>
) : content ? (
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
<div className="video-detail-player-wrap">
<video
src={content.video_url}
controls
autoPlay
playsInline
controlsList="nodownload"
onContextMenu={(e) => e.preventDefault()}
className="video-detail-player"
onLoadedMetadata={(e) => {
const v = e.currentTarget;
setIsLandscape(v.videoWidth > v.videoHeight);
}}
onTimeUpdate={(e) => {
if (!content.official_site_url) return;
const v = e.currentTarget;
// 영상 종료 3초 전부터 공식 홈페이지 오버레이 노출
setShowSiteOverlay(
Number.isFinite(v.duration) && v.duration - v.currentTime <= 3
);
}}
/>
{showSiteOverlay && isSafeHttpUrl(content.official_site_url) && (
<a
href={content.official_site_url as string}
target="_blank"
rel="noopener noreferrer"
className="video-site-overlay"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="12" cy="12" r="10"/>
<line x1="2" y1="12" x2="22" y2="12"/>
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
</svg>
<span className="video-site-overlay-text">
<strong>{content.store_name}</strong>
{t('videoDetail.siteOverlayLabel')}
</span>
</a>
)}
</div>
<div className="video-detail-info">
<h2 className="video-detail-store">
{content.store_name || t('ssulbox.viewer.untitled')}
</h2>
<p className="video-detail-date">{formatDate(content.created_at)}</p>
{/* 좋아요 + 공유 */}
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<button
className={`video-detail-like-btn ${isLiked ? 'liked' : ''}`}
onClick={handleLike}
>
<svg width="16" height="16" viewBox="0 0 24 24" fill={isLiked ? 'currentColor' : 'none'} stroke="currentColor" strokeWidth="2">
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />
</svg>
{likeCount}
</button>
<button
className="video-detail-copy-btn"
onClick={handleShareButtonClick}
title={t('videoDetail.share')}
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="18" cy="5" r="3" /><circle cx="6" cy="12" r="3" /><circle cx="18" cy="19" r="3" />
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" /><line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
</svg>
{copied ? t('videoDetail.copied') : t('videoDetail.share')}
</button>
</div>
{/* 댓글 섹션 */}
<div className="video-detail-comments">
<div className="video-detail-comments-header">
<h3 className="video-detail-comments-title">{t('videoDetail.commentsTitle')}</h3>
<span className="video-detail-comments-count">{commentsTotal}</span>
</div>
{authed && currentUser && (
<div className="video-detail-comment-profile">
{currentUser.profile_image_url && (
<img
src={currentUser.profile_image_url}
alt={currentUser.nickname}
className="video-detail-comment-avatar"
/>
)}
<span className="video-detail-comment-nickname">{currentUser.nickname}</span>
</div>
)}
<div className="video-detail-comment-input-wrap">
<textarea
ref={commentTextareaRef}
className="video-detail-comment-input"
placeholder={authed ? t('videoDetail.commentPlaceholder') : t('videoDetail.commentLoginRequired')}
maxLength={500}
rows={1}
value={commentInput}
onChange={(e) => {
setCommentInput(e.target.value);
e.target.style.height = 'auto';
e.target.style.height = `${e.target.scrollHeight}px`;
}}
onFocus={handleCommentFocus}
onKeyDown={(e) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
handleCommentSubmit();
}
}}
disabled={!authed}
/>
<button
className="video-detail-comment-submit"
onClick={handleCommentSubmit}
disabled={!authed || !commentInput.trim() || commentSubmitting}
>
{commentSubmitting ? t('videoDetail.commentSubmitting') : t('videoDetail.commentSubmit')}
</button>
</div>
{comments.length === 0 && !commentsLoading ? (
<p className="video-detail-comments-empty">{t('videoDetail.noComments')}</p>
) : (
<ul className="video-detail-comment-list">
{comments.map((c) => (
<li key={c.id} className="video-detail-comment-item">
{c.profile_image_url && (
<img
src={c.profile_image_url}
alt={c.nickname || t('videoDetail.anonymous')}
className="video-detail-comment-avatar"
/>
)}
<div className="video-detail-comment-body">
<span className="video-detail-comment-nickname">
{c.nickname || t('videoDetail.anonymous')}
</span>
<p className="video-detail-comment-text">
{renderCommentContent(c.content, c.is_deleted)}
</p>
<div className="video-detail-comment-bottom">
<span className="video-detail-comment-date">{formatCommentDate(c.created_at)}</span>
{c.is_mine && !c.is_deleted && (
<button
className="video-detail-comment-delete"
onClick={() => handleDeleteComment(c.id)}
>
{t('videoDetail.deleteComment')}
</button>
)}
</div>
{c.replies && c.replies.length > 0 && (
<ul className="video-detail-reply-list">
{c.replies.map((r) => (
<li key={r.id} className="video-detail-reply-item">
{r.profile_image_url && (
<img
src={r.profile_image_url}
alt={r.nickname || t('videoDetail.anonymous')}
className="video-detail-comment-avatar small"
/>
)}
<div className="video-detail-comment-body">
<span className="video-detail-comment-nickname">
{r.nickname || t('videoDetail.anonymous')}
</span>
<p className="video-detail-comment-text">
{renderCommentContent(r.content, r.is_deleted)}
</p>
<div className="video-detail-comment-bottom">
<span className="video-detail-comment-date">{formatCommentDate(r.created_at)}</span>
{r.is_mine && !r.is_deleted && (
<button
className="video-detail-comment-delete"
onClick={() => handleDeleteComment(r.id)}
>
{t('videoDetail.deleteComment')}
</button>
)}
</div>
</div>
</li>
))}
</ul>
)}
</div>
</li>
))}
</ul>
)}
{commentsHasNext && (
<button
className="video-detail-comments-more"
onClick={() => fetchComments(commentsPage + 1, true)}
disabled={commentsLoading}
>
{commentsLoading ? t('videoDetail.loadingComments') : t('videoDetail.loadMoreComments')}
</button>
)}
</div>
</div>
</div>
) : null}
</div>
{showLoginModal && (
<LoginPromptModal onClose={() => setShowLoginModal(false)} />
)}
</div>
);
};
export default SsulDetailContent; export default SsulDetailContent;
+2 -2
View File
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { SsulTaskStatus, getSsulTask } from '../../utils/api'; import { SsulTaskStatus, getSsulTask } from '../../utils/api';
import { VideoListItem } from '../../types/api'; import { SocialUploadableItem } from '../../types/api';
import SocialPostingModal from '../../components/SocialPostingModal'; import SocialPostingModal from '../../components/SocialPostingModal';
import CompletionView from '../../components/CompletionView'; import CompletionView from '../../components/CompletionView';
import { Scen, scenDesc, scenName } from './ssulData'; import { Scen, scenDesc, scenName } from './ssulData';
@@ -136,7 +136,7 @@ const SsulResultContent: React.FC<SsulResultContentProps> = ({ taskId, scenario
created_at: task.created_at, created_at: task.created_at,
like_count: 0, like_count: 0,
comment_count: 0, comment_count: 0,
} as VideoListItem) } as SocialUploadableItem)
: null : null
} }
/> />
+2 -10
View File
@@ -2416,14 +2416,6 @@
max-width: 375px; max-width: 375px;
} }
/* 진입 화면에 들어가는 폼은 대부분 한 줄 입력이라 375px 로 충분하지만,
포스터 스타일링(F2)은 템플릿 그리드·입출력 2단이 한 화면에 있는 **도구**라
그 폭에서는 못 쓴다.
(세로 넘침 처리는 이제 컨테이너 기본 규칙이 담당한다 — 예외를 두지 않는다) */
.url-input-content--wide {
max-width: 900px;
}
/* 375px 화면에서는 타일 4개 + 라벨이 폭을 넘긴다. 타일과 글자를 함께 줄여 /* 375px 화면에서는 타일 4개 + 라벨이 폭을 넘긴다. 타일과 글자를 함께 줄여
한 줄을 지킨다 — 라벨이 줄바꿈되면 타일 정렬이 어긋난다 */ 한 줄을 지킨다 — 라벨이 줄바꿈되면 타일 정렬이 어긋난다 */
@@ -2529,7 +2521,7 @@
설명은 탭에 딸린 것이지 폼의 일부가 아니다 */ 설명은 탭에 딸린 것이지 폼의 일부가 아니다 */
.pipeline-desc { .pipeline-desc {
width: 100%; width: 100%;
margin: 0 0 32px; margin: 0 0 13px;
font-size: 14px; font-size: 14px;
line-height: 1.6; line-height: 1.6;
letter-spacing: -0.006em; letter-spacing: -0.006em;
@@ -2560,7 +2552,7 @@
} }
.pipeline-desc { .pipeline-desc {
margin-bottom: 28px; margin-bottom: 13px;
font-size: 13px; font-size: 13px;
} }
} }
+1
View File
@@ -19,3 +19,4 @@
/* Poster to Video (F1 영상 · F2 스타일링) — 모든 규칙이 `.p2v-scope` 안에 갇혀 있다 */ /* Poster to Video (F1 영상 · F2 스타일링) — 모든 규칙이 `.p2v-scope` 안에 갇혀 있다 */
@import './poster-p2v.css'; @import './poster-p2v.css';
@import './playreel-p2v.css';
+1 -1
View File
@@ -129,7 +129,7 @@
/* Hero Form */ /* Hero Form */
.hero-form { .hero-form {
padding-top: 20px; padding-top: 13px;
width: 100%; width: 100%;
max-width: 375px; max-width: 375px;
display: flex; display: flex;
+266
View File
@@ -0,0 +1,266 @@
/* =====================================================
Playreel(롱컷) — 검수 게이트 화면 스타일
poster-p2v.css 의 `.p2v-*` 규칙(패널·라벨·버튼·칩·진행바)을 그대로 쓰고,
게이트에만 있는 요소(섹션 썸네일 선택, 판정 카드, 경고 박스)만 `.pr-*` 로 더한다.
규칙은 poster-p2v.css 와 같다: 모든 선택자를 `.p2v-scope` 안에 가둔다.
===================================================== */
.p2v-scope .pr-gate__eyebrow {
margin: 0;
font-size: var(--text-sm);
font-weight: 700;
color: var(--color-mint);
}
.p2v-scope .pr-gate__title {
margin: 6px 0 8px;
font-size: var(--text-2xl);
font-weight: 700;
letter-spacing: -0.02em;
}
.p2v-scope .pr-gate__actions {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 12px;
}
/* 좌우 2단. 좁은 화면에서는 자동으로 한 줄씩 쌓인다 */
.p2v-scope .pr-two {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: var(--spacing-page-md);
align-items: start;
}
.p2v-scope .pr-gap { margin-top: 24px; }
.p2v-scope .pr-row {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 8px;
}
.p2v-scope .pr-row__label {
flex-shrink: 0;
width: 52px;
font-size: var(--text-sm);
color: var(--color-text-gray-400);
}
.p2v-scope .pr-row__label--slot {
width: 92px;
font-size: var(--text-xs);
}
.p2v-scope .pr-row .p2v-input { height: 44px; }
.p2v-scope .pr-strong {
margin: 0;
font-weight: 700;
}
.p2v-scope .pr-audio {
width: 100%;
margin-top: 10px;
}
.p2v-scope .pr-image {
max-width: 320px;
}
.p2v-scope .pr-player {
display: flex;
align-items: center;
justify-content: center;
min-height: 320px;
}
.p2v-scope .pr-player video {
display: block;
width: 100%;
max-height: 520px;
border-radius: var(--radius-md);
}
/* 연출 칩 — 잠긴 칩은 눌리지 않는다 */
.p2v-scope .pr-chip {
display: inline-flex;
align-items: center;
gap: 6px;
}
.p2v-scope .pr-chip.locked { cursor: default; }
/* 상세페이지 섹션 썸네일 선택 */
.p2v-scope .pr-sections {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
gap: 8px;
max-height: 340px;
padding-right: 4px;
overflow-y: auto;
}
.p2v-scope .pr-section {
position: relative;
padding: 0;
overflow: hidden;
border: 2px solid var(--color-border-white-10);
border-radius: var(--radius-md);
background: transparent;
text-align: left;
cursor: pointer;
opacity: 0.5;
}
.p2v-scope .pr-section.selected {
border-color: var(--color-mint);
opacity: 1;
}
.p2v-scope .pr-section.locked { cursor: default; }
.p2v-scope .pr-section img {
display: block;
width: 100%;
aspect-ratio: 3 / 4;
object-fit: cover;
object-position: top;
background: #000;
}
.p2v-scope .pr-section__no {
position: absolute;
top: 4px;
left: 4px;
min-width: 16px;
padding: 1px 4px;
border-radius: 4px;
background: rgba(0, 0, 0, 0.65);
color: #fff;
font-size: 10px;
text-align: center;
}
.p2v-scope .pr-section__cap {
display: flex;
align-items: center;
gap: 4px;
padding: 3px 5px;
background: rgba(0, 0, 0, 0.65);
color: var(--color-text-gray-400);
font-size: 10px;
line-height: 1.3;
}
.p2v-scope .pr-section.selected .pr-section__cap { color: var(--color-mint); }
.p2v-scope .pr-section__cap span:last-child {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 경고 박스 — 실패가 아니라 "확인하세요" 라서 호박색으로 구분한다 */
.p2v-scope .pr-callout {
margin: 12px 0 0;
padding: 10px 14px;
border: 1px solid rgba(255, 210, 122, 0.35);
border-radius: var(--radius-md);
background: rgba(255, 210, 122, 0.1);
color: #ffd27a;
font-size: var(--text-sm);
line-height: 1.5;
}
/* 예상 길이 */
.p2v-scope .pr-stat {
margin: 0;
font-size: var(--text-2xl);
font-weight: 700;
color: var(--color-mint);
}
.p2v-scope .pr-stat.warn { color: #ffd27a; }
/* 제목 훼손 검사 판정 */
.p2v-scope .pr-verdict.ok { border-color: var(--color-mint-30); }
.p2v-scope .pr-verdict.fail { border-color: rgba(255, 122, 122, 0.4); }
.p2v-scope .pr-verdict.ok .pr-strong { color: var(--color-mint); }
.p2v-scope .pr-verdict.fail .pr-strong { color: #ff8c8c; }
/* 자동 확인 항목 */
.p2v-scope .pr-check {
display: flex;
align-items: center;
gap: 8px;
margin: 5px 0;
font-size: var(--text-base);
color: var(--color-text-gray-300);
}
.p2v-scope .pr-check svg { color: var(--color-mint); }
.p2v-scope .pr-check.fail { color: #ff8c8c; }
.p2v-scope .pr-check.fail svg { color: #ff8c8c; }
/* 자동 승인 설정 패널 */
.p2v-scope .pr-auto { margin-top: 28px; }
.p2v-scope .pr-auto__row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 10px 0;
}
.p2v-scope .pr-auto__row + .pr-auto__row { border-top: 1px solid var(--color-border-white-5); }
.p2v-scope .pr-auto__row--locked { opacity: 0.55; }
.p2v-scope .pr-auto__text { min-width: 0; }
.p2v-scope .pr-auto__text .p2v-note { margin: 2px 0 0; }
.p2v-scope .pr-switch {
position: relative;
flex-shrink: 0;
width: 44px;
height: 24px;
padding: 0;
border: 1px solid var(--color-border-white-10);
border-radius: var(--radius-full);
background: transparent;
cursor: pointer;
transition: background-color var(--transition-normal), border-color var(--transition-normal);
}
.p2v-scope .pr-switch.on {
border-color: var(--color-mint);
background: var(--color-mint-20);
}
.p2v-scope .pr-switch__knob {
position: absolute;
top: 2px;
left: 2px;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--color-text-gray-400);
transition: transform var(--transition-normal), background-color var(--transition-normal);
}
.p2v-scope .pr-switch.on .pr-switch__knob {
transform: translateX(20px);
background: var(--color-mint);
}
/* 자동 승인 안내 — 진행 화면 아래에 이어서 보인다 */
.p2v-scope .pr-auto-note {
margin: 14px 0 0;
font-size: var(--text-sm);
text-align: center;
color: var(--color-mint);
}
+184 -283
View File
@@ -311,6 +311,188 @@
.p2v-scope.p2v-create .p2v-btn-cta { margin-top: 28px; } .p2v-scope.p2v-create .p2v-btn-cta { margin-top: 28px; }
.p2v-scope .p2v-create__cost {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding: 0 4px;
margin-top: 28px;
font-size: 12px;
color: var(--color-text-gray-400);
}
.p2v-scope .p2v-create__cost-badge {
display: inline-flex;
align-items: center;
gap: 5px;
font-weight: 700;
color: var(--color-mint);
}
.p2v-scope .p2v-create__coin {
font-size: 14px;
line-height: 1;
}
.p2v-scope.p2v-create .p2v-create__cost + .p2v-btn-cta {
margin-top: 12px;
}
/* ── 시작 선택 화면 + 소개 카드 (playreel 의 "어떻게 시작할까요?") ── */
.p2v-scope.p2v-start {
display: flex;
flex-direction: column;
gap: 12px;
max-width: 560px;
margin: 0 auto;
}
.p2v-scope .p2v-start__title {
margin: 0;
font-size: var(--text-2xl);
font-weight: 800;
text-align: center;
letter-spacing: -0.02em;
}
.p2v-scope .p2v-start__subtitle {
margin: 0 0 8px;
font-size: var(--text-sm);
text-align: center;
color: var(--color-text-gray-400);
}
.p2v-scope .p2v-back {
align-self: flex-start;
margin: 0 0 16px;
padding: 0;
border: none;
background: none;
color: var(--color-text-gray-400);
font-family: inherit;
font-size: var(--text-sm);
cursor: pointer;
}
.p2v-scope .p2v-back:hover { color: var(--color-text-white); }
.p2v-scope .p2v-intro--hot { border-color: var(--color-mint-30); }
.p2v-scope .p2v-intro__badge {
align-self: flex-start;
margin-bottom: -4px;
padding: 3px 10px;
border-radius: var(--radius-full);
background: var(--color-mint);
color: var(--color-bg-dark);
font-size: 11px;
font-weight: 800;
letter-spacing: 0.04em;
}
.p2v-scope .p2v-intro .p2v-btn-cta { margin-top: 4px; }
.p2v-scope .p2v-intro {
display: flex;
flex-direction: column;
gap: 14px;
padding: 20px;
}
.p2v-scope .p2v-intro__head {
display: flex;
align-items: center;
gap: 12px;
}
.p2v-scope .p2v-intro__icon {
display: grid;
flex: none;
place-items: center;
width: 44px;
height: 44px;
border-radius: var(--radius-md);
background: var(--color-mint-10);
color: var(--color-mint);
font-size: 12px;
font-weight: 800;
letter-spacing: 0.04em;
}
.p2v-scope .p2v-intro__title {
margin: 0;
font-size: var(--text-lg);
font-weight: 800;
letter-spacing: -0.02em;
}
.p2v-scope .p2v-intro__desc {
margin: 2px 0 0;
font-size: var(--text-sm);
color: var(--color-text-gray-400);
}
.p2v-scope .p2v-intro__flow {
display: grid;
gap: 10px;
margin: 0;
padding: 14px;
list-style: none;
border: 1px solid var(--color-border-white-5);
border-radius: var(--radius-md);
background: var(--color-bg-card);
font-size: var(--text-xs);
line-height: 1.6;
color: var(--color-text-gray-300);
}
.p2v-scope .p2v-intro__flow li {
display: grid;
grid-template-columns: 22px minmax(0, 1fr);
align-items: baseline;
gap: 10px;
text-align: left;
}
.p2v-scope .p2v-intro__flow-number {
color: var(--color-mint);
font-weight: 800;
font-variant-numeric: tabular-nums;
}
.p2v-scope .p2v-intro__facts {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
.p2v-scope .p2v-intro__facts div {
padding: 8px 10px;
border: 1px solid var(--color-bg-card);
border-radius: var(--radius-md);
background: var(--color-bg-card);
}
.p2v-scope .p2v-intro__facts b {
display: block;
font-size: var(--text-xs);
font-weight: 600;
color: var(--color-text-gray-500);
}
.p2v-scope .p2v-intro__facts span {
font-size: var(--text-sm);
font-weight: 700;
font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) {
.p2v-scope .p2v-intro__facts { grid-template-columns: repeat(2, 1fr); }
}
/* ── F1 진행 화면 ────────────────────────────────── */ /* ── F1 진행 화면 ────────────────────────────────── */
.p2v-scope.p2v-making { .p2v-scope.p2v-making {
@@ -602,294 +784,14 @@
/* ── F2 스타일링 ─────────────────────────────────── */ /* ── F2 스타일링 ─────────────────────────────────── */
.p2v-scope.p2v-styling {
max-width: 900px;
margin: 0 auto;
padding: 8px 0 40px;
}
.p2v-scope .p2v-styling__scope { margin-bottom: 22px; }
.p2v-scope .p2v-notice {
padding: 12px 18px;
border-radius: var(--radius-xl);
font-size: var(--text-sm);
line-height: 1.6;
color: var(--color-text-gray-300);
}
/* 내부 전용 — 주황 계열. 민트/퍼플과 겹치지 않아야 "제한"으로 읽힌다 */ /* 내부 전용 — 주황 계열. 민트/퍼플과 겹치지 않아야 "제한"으로 읽힌다 */
.p2v-scope .p2v-notice--warn {
border: 1px solid rgba(255, 154, 90, 0.35);
background: rgba(255, 154, 90, 0.12);
}
.p2v-scope .p2v-notice--warn b { color: #ffc9a3; }
.p2v-scope .p2v-notice--unknown {
margin-top: 12px;
border: 1px solid rgba(166, 130, 255, 0.38);
background: rgba(166, 130, 255, 0.14);
}
.p2v-scope .p2v-license {
display: inline-block;
padding: 2px 8px;
border-radius: var(--radius-full);
font-size: var(--text-xs);
font-weight: 700;
line-height: 1.5;
white-space: nowrap;
}
.p2v-scope .p2v-license--ok {
border: 1px solid var(--color-mint-30);
background: var(--color-mint-10);
color: var(--color-mint);
}
.p2v-scope .p2v-license--warn {
border: 1px solid rgba(255, 154, 90, 0.35);
background: rgba(255, 154, 90, 0.12);
color: #ffc9a3;
}
.p2v-scope .p2v-license--unknown {
border: 1px solid rgba(166, 130, 255, 0.38);
background: rgba(166, 130, 255, 0.14);
color: #c9b6ff;
}
.p2v-scope .p2v-collapse {
display: flex;
align-items: center;
gap: 12px;
width: 100%;
padding: 0;
border: none;
background: none;
color: var(--color-text-white);
font-family: inherit;
text-align: left;
cursor: pointer;
}
.p2v-scope .p2v-collapse .p2v-label { margin: 0; }
.p2v-collapse__picked {
display: inline-flex;
align-items: center;
gap: 8px;
font-size: var(--text-base);
}
.p2v-collapse__picked img {
width: 22px;
height: 30px;
object-fit: cover;
border-radius: var(--radius-sm);
}
.p2v-collapse__picked b { color: var(--color-mint); font-weight: 700; }
.p2v-collapse__empty {
font-size: var(--text-base);
color: var(--color-text-gray-500);
}
.p2v-collapse__caret {
margin-left: auto;
color: var(--color-text-gray-400);
transition: transform var(--transition-normal);
}
.p2v-collapse__caret.open { transform: rotate(180deg); }
.p2v-tplgroup { margin-top: 20px; }
.p2v-tplgroup__title {
margin: 0 0 10px;
font-size: var(--text-sm);
font-weight: 700;
color: var(--color-text-gray-400);
}
.p2v-tplgroup__title span {
margin-left: 8px;
font-weight: 500;
color: var(--color-text-gray-500);
}
.p2v-tplgrid {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 12px;
}
.p2v-tplcard { position: relative; }
.p2v-scope .p2v-tpl {
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
height: 100%;
padding: 8px;
border: 1px solid var(--color-border-gray-700);
border-radius: var(--radius-xl);
background: var(--color-bg-card-inner);
color: var(--color-text-gray-400);
font-family: inherit;
cursor: pointer;
transition: border-color var(--transition-normal), background-color var(--transition-normal),
color var(--transition-normal);
}
.p2v-scope .p2v-tpl:hover { color: var(--color-text-white); }
.p2v-scope .p2v-tpl.active {
border: 1px solid var(--color-mint);
background: var(--color-mint-10);
color: var(--color-text-white);
/* 링을 테두리와 같은 색으로 둔다 — 다르면 두 줄로 갈라져 보인다.
테두리 두께를 바꾸지 않아 카드 안 글자도 흔들리지 않는다 */
box-shadow: 0 0 0 1px var(--color-mint);
}
/* 명화는 가로 그림도 있다 — cover 로 자르면 무엇인지 알 수 없다 */ /* 명화는 가로 그림도 있다 — cover 로 자르면 무엇인지 알 수 없다 */
.p2v-scope .p2v-tpl img {
display: block;
width: 100%;
aspect-ratio: 2 / 3;
object-fit: contain;
border-radius: var(--radius-md);
background: var(--color-bg-darker);
}
.p2v-tpl__name {
font-size: var(--text-sm);
font-weight: 700;
line-height: 1.3;
white-space: normal;
}
/* 제목이 1줄인 카드와 2줄인 카드가 섞인다 — 아래로 밀어야 배지가 같은 선에 선다 */ /* 제목이 1줄인 카드와 2줄인 카드가 섞인다 — 아래로 밀어야 배지가 같은 선에 선다 */
.p2v-tpl__badge {
display: flex;
margin-top: auto;
}
.p2v-tpl__sub {
font-size: var(--text-xs);
line-height: 1.4;
color: var(--color-text-gray-500);
white-space: normal;
}
.p2v-scope .p2v-tpl--add {
align-items: center;
justify-content: center;
gap: 10px;
min-height: 200px;
border-style: dashed;
text-align: center;
}
.p2v-tpl__plus { font-size: 26px; font-weight: 300; line-height: 1; }
.p2v-scope .p2v-tpl__remove {
position: absolute;
top: 10px;
right: 10px;
width: 26px;
height: 26px;
border: 1px solid var(--color-border-white-10);
border-radius: var(--radius-full);
background: rgba(0, 0, 0, 0.62);
color: var(--color-text-gray-300);
font-family: inherit;
font-size: 15px;
line-height: 1;
cursor: pointer;
}
.p2v-styling__io {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--spacing-page-md);
margin-top: 28px;
}
.p2v-scope .p2v-styling__out {
display: flex;
align-items: center;
justify-content: center;
aspect-ratio: 4 / 5;
max-width: 400px;
margin: 0 auto;
padding: 0;
overflow: hidden;
}
.p2v-scope .p2v-styling__out--empty {
flex-direction: column;
gap: 16px;
padding: var(--spacing-page);
font-size: var(--text-base);
color: var(--color-text-gray-500);
text-align: center;
}
.p2v-scope .p2v-styling__out img {
width: 100%;
height: 100%;
object-fit: contain;
}
.p2v-styling__download {
display: flex;
justify-content: center;
margin-top: 12px;
}
.p2v-scope.p2v-styling .p2v-label { margin-top: 26px; }
.p2v-scope.p2v-styling .p2v-styling__io .p2v-label { margin-top: 0; }
.p2v-formats {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
}
.p2v-scope .p2v-select {
padding: 12px;
border: 1px solid var(--color-border-gray-700);
border-radius: var(--radius-xl);
background: var(--color-bg-card-inner);
color: var(--color-text-gray-400);
font-family: inherit;
font-size: var(--text-sm);
font-weight: 700;
cursor: pointer;
transition: border-color var(--transition-normal), background-color var(--transition-normal),
color var(--transition-normal);
}
.p2v-scope .p2v-select:hover { color: var(--color-text-white); }
.p2v-scope .p2v-select.active {
border-color: var(--color-mint);
background: var(--color-mint-10);
color: var(--color-text-white);
box-shadow: 0 0 0 1px var(--color-mint);
}
/* ── 모바일 ──────────────────────────────────────── */ /* ── 모바일 ──────────────────────────────────────── */
@media (max-width: 900px) {
.p2v-tplgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) { @media (max-width: 768px) {
.p2v-review__grid, .p2v-review__grid,
.p2v-result__grid, .p2v-result__grid,
@@ -905,8 +807,8 @@
border-top: 2px solid var(--color-mint-20); border-top: 2px solid var(--color-mint-20);
} }
.p2v-tplgrid { grid-template-columns: repeat(2, 1fr); }
.p2v-formats { grid-template-columns: repeat(2, 1fr); }
/* 검수 화면(모바일) — 2단이 1단으로 접히면서 순서 문제가 생긴다. /* 검수 화면(모바일) — 2단이 1단으로 접히면서 순서 문제가 생긴다.
데스크톱은 좌(편집)·우(포스터)라 나란히 보이지만, 세로로 쌓으면 편집이 먼저 오고 데스크톱은 좌(편집)·우(포스터)라 나란히 보이지만, 세로로 쌓으면 편집이 먼저 오고
@@ -936,4 +838,3 @@
.p2v-scope .p2v-spinner::after { animation: none; } .p2v-scope .p2v-spinner::after { animation: none; }
.p2v-scope .p2v-bar__fill { transition: none; } .p2v-scope .p2v-bar__fill { transition: none; }
} }
+11 -7
View File
@@ -270,12 +270,13 @@ export interface UserCreditsResponse {
} }
// 비디오 목록 아이템 (갤러리용) // 비디오 목록 아이템 (갤러리용)
/** 좋아요·댓글·공유에서 사용하는 통합 콘텐츠 종류 */
export type ContentType = 'video' | 'ssul' | P2vContentType;
/** /**
* 콘텐츠 종류. ADO2 영상·썰박스·P2V 가 한 목록에 섞인다. * P2V(무빙 포스터·롱컷) 콘텐츠 종류.
* p2v_poster 는 영상이 아니라 **이미지**다 — result_movie_url 에 이미지 URL 이 실리므로
* <video> 가 아니라 <img> 로 그려야 한다. p2v_* 는 내 콘텐츠 목록에만 나온다.
*/ */
export type ContentType = 'video' | 'ssul' | 'p2v_video' | 'p2v_poster'; export type P2vContentType = 'p2v_video' | 'p2v_playreel';
export interface VideoListItem { export interface VideoListItem {
/** /**
@@ -285,7 +286,7 @@ export interface VideoListItem {
* 특히 `DELETE /archive/videos/{id}` 는 `Video.id` 로 지우므로, * 특히 `DELETE /archive/videos/{id}` 는 `Video.id` 로 지우므로,
* 썰박스 항목의 id 를 넘기면 **엉뚱한 ADO2 영상이 삭제된다.** * 썰박스 항목의 id 를 넘기면 **엉뚱한 ADO2 영상이 삭제된다.**
*/ */
type: ContentType; type: ContentType | P2vContentType;
video_id: number; video_id: number;
store_name: string; store_name: string;
region: string; region: string;
@@ -329,6 +330,9 @@ export interface VideosListResponse {
has_prev: boolean; has_prev: boolean;
} }
/** 소셜 업로드 모달이 받는 항목 — 무빙 포스터(p2v_video)까지 업로드를 지원하고 롱컷(p2v_playreel)은 제외한다 */
export type SocialUploadableItem = VideoListItem & { type: Exclude<ContentType, 'p2v_playreel'> };
// 댓글 대댓글 // 댓글 대댓글
export interface CommentReply { export interface CommentReply {
id: number; id: number;
@@ -417,7 +421,7 @@ export interface SocialDisconnectResponse {
// 유튜브 SEO Description 자동완성 요청 // 유튜브 SEO Description 자동완성 요청
export interface YTAutoSeoRequest { export interface YTAutoSeoRequest {
/** 썰박스면 'ssul' + task_id 자리에 ssul_content.id 문자열. 생략 시 video */ /** 썰박스면 'ssul' + task_id 자리에 ssul_content.id 문자열. 생략 시 video */
content_type?: ContentType; content_type?: SocialUploadableItem['type'];
task_id: string; // ADO2 는 task_id, 썰박스는 콘텐츠 id 문자열 task_id: string; // ADO2 는 task_id, 썰박스는 콘텐츠 id 문자열
} }
@@ -434,7 +438,7 @@ export interface SocialUploadRequest {
* 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 생략(=video)한 채 * 콘텐츠 종류. video.id 와 ssul_content.id 가 겹치므로 생략(=video)한 채
* 썰박스 id 를 보내면 **엉뚱한 ADO2 영상이 업로드된다.** * 썰박스 id 를 보내면 **엉뚱한 ADO2 영상이 업로드된다.**
*/ */
content_type?: ContentType; content_type?: SocialUploadableItem['type'];
video_id: number; // 콘텐츠 ID (content_type 안에서만 유일) video_id: number; // 콘텐츠 ID (content_type 안에서만 유일)
social_account_id: number; // 선택된 채널 ID social_account_id: number; // 선택된 채널 ID
title: string; // 최대 100자 title: string; // 최대 100자
+7 -1
View File
@@ -1,3 +1,5 @@
import type { ContentType } from '../types/api';
/** /**
* 기기의 네이티브 공유 시트를 열고 요청을 처리했는지 반환합니다. * 기기의 네이티브 공유 시트를 열고 요청을 처리했는지 반환합니다.
* *
@@ -32,9 +34,13 @@ export function buildVideoShareUrl(apiBaseUrl: string, videoId: number | string)
export function buildContentShareUrl( export function buildContentShareUrl(
apiBaseUrl: string, apiBaseUrl: string,
contentId: number | string, contentId: number | string,
contentType: 'video' | 'ssul' = 'video', contentType: ContentType = 'video',
): string { ): string {
const base = apiBaseUrl.replace(/\/$/, ''); const base = apiBaseUrl.replace(/\/$/, '');
if (contentType === 'p2v_video' || contentType === 'p2v_playreel') {
const kind = contentType === 'p2v_video' ? 'f1' : 'playreel';
return `${base}/p2v/${kind}/share/${encodeURIComponent(String(contentId))}`;
}
if (contentType === 'ssul') { if (contentType === 'ssul') {
return `${base}/ssul/share/${encodeURIComponent(String(contentId))}`; return `${base}/ssul/share/${encodeURIComponent(String(contentId))}`;
} }
+77 -204
View File
@@ -1,45 +1,18 @@
/** /**
* Poster to Video (P2V) 클라이언트. * Poster to Video (P2V) 클라이언트.
* *
* **castad 백엔드의 `/p2v/*` 프록시**를 호출한다 (2026-08-25 전환). 이전에는 * castad 백엔드의 `/p2v/*` 를 다른 파이프라인(ADO2·썰박스)과 같은 방식으로 부른다 —
* P2V 서버(:8010)를 팀 키로 직접 호출했지만, 이제 castad 가 카카오 인증(JWT)· * `authenticatedFetch` 가 Bearer 토큰을 싣는다. 잡 소유권·크레딧은 백엔드가 맡는다.
* 크레딧 선차감·Blob 아카이빙을 얹는다. 다른 파이프라인(ADO2·썰박스)과 같은
* 인증 축이 됐으므로 `authenticatedFetch` 를 그대로 쓴다 (토큰 갱신·재시도 포함).
* *
* 산출물 URL 두 종류: * 크레딧은 생성 요청 시점에 선차감되고, 실패하면 환불된다(썰박스와 같다).
* - 완성 결과물(영상·결과 이미지) → **Azure Blob 공개 URL** (절대 URL 그대로 사용) * 잔액이 모자라면 402 가 오며, 호출부가 충전 화면으로 유도할 수 있게
* - 템플릿 썸네일·검수 이미지 → castad 프록시 경로(`/p2v/files/...`). * `InsufficientCreditError` 로 던진다.
* 썸네일은 공개라 <img src> 로 바로 되고, 검수 이미지(regions/)는 인증이
* 필요해 fetchP2vImage() 로 blob URL 을 만들어 넣는다.
*/ */
import { ContentType, P2vContentType } from '../types/api';
import { API_URL, InsufficientCreditError, authenticatedFetch } from './api'; import { API_URL, InsufficientCreditError, authenticatedFetch } from './api';
/** /**
* (구) P2V 접근 키 저장소 — 프록시 전환으로 더 이상 쓰지 않는다. * 404 — 서버에 그 잡이 없다(지워졌거나 내 것이 아니다). 화면은 처음으로 되돌려야 한다.
* P2vKeyGate 가 아직 import 하고 있어 심볼만 유지한다. 게이트가 뜰 일은 없다
* (401 은 authenticatedFetch 가 토큰 갱신/로그인 이동으로 처리한다).
*/
const KEY_STORAGE = 'castad_p2v_key';
export const getP2vKey = (): string => localStorage.getItem(KEY_STORAGE) ?? '';
export const setP2vKey = (key: string): void => localStorage.setItem(KEY_STORAGE, key.trim());
export const clearP2vKey = (): void => localStorage.removeItem(KEY_STORAGE);
/**
* (구) 401 — P2V 키 입력이 필요하던 상황. 프록시 전환 후에는 castad 로그인 문제라
* authenticatedFetch 가 갱신/리다이렉트로 처리하므로 이 예외는 던져지지 않는다.
* 컴포넌트들의 instanceof 분기가 남아 있어 타입만 유지한다.
*/
export class P2vAuthError extends Error {
constructor() {
super('P2V_AUTH_REQUIRED');
this.name = 'P2vAuthError';
}
}
/**
* 404 — 서버에 그 잡이 없다. 화면은 처음으로 되돌려야 한다.
* *
* 상태 코드로 판정하는 이유: 서버 detail 문구("잡 없음")를 문자열로 맞추려다 * 상태 코드로 판정하는 이유: 서버 detail 문구("잡 없음")를 문자열로 맞추려다
* 실제로 한 번 놓쳤다. 문구는 서버 사정으로 바뀌고 번역도 되지만 코드는 안 바뀐다. * 실제로 한 번 놓쳤다. 문구는 서버 사정으로 바뀌고 번역도 되지만 코드는 안 바뀐다.
@@ -52,7 +25,7 @@ export class P2vNotFoundError extends Error {
} }
export async function p2vFetch<T>(path: string, init?: RequestInit): Promise<T> { export async function p2vFetch<T>(path: string, init?: RequestInit): Promise<T> {
const res = await authenticatedFetch(`${API_URL}/p2v${path}`, init); const res = await authenticatedFetch(`${API_URL}${path}`, init);
if (res.status === 402) throw new InsufficientCreditError(); if (res.status === 402) throw new InsufficientCreditError();
@@ -71,65 +44,7 @@ export async function p2vFetch<T>(path: string, init?: RequestInit): Promise<T>
return res.json() as Promise<T>; return res.json() as Promise<T>;
} }
/** // ── 타입 (백엔드 app/p2v/api/routers/v1/view.py 와 1:1) ───────────────
* 산출물 URL 해석.
*
* - Azure Blob 공개 URL(절대 URL) → 그대로 (완성 영상·썸네일·결과 이미지)
* - `/p2v/files/...` 프록시 경로 → castad 오리진을 붙인다 (템플릿 썸네일 등 공개 파일)
*/
export const p2vFile = (path: string | null | undefined): string => {
if (!path) return '';
if (/^https?:\/\//.test(path)) return path;
return `${API_URL}${path}`;
};
/**
* 인증이 필요한 프록시 이미지(검수용 regions/)를 <img> 에 넣을 blob URL 로 받는다.
* <img src> 는 Authorization 헤더를 못 실으므로 fetch 를 경유한다.
* 반환된 URL 은 쓰는 쪽이 URL.revokeObjectURL 로 정리한다.
*/
export async function fetchP2vImage(path: string): Promise<string> {
const res = await authenticatedFetch(`${API_URL}${path}`);
if (!res.ok) throw new Error(`이미지 로드 실패 (${res.status})`);
return URL.createObjectURL(await res.blob());
}
/**
* 결과물 다운로드.
*
* **Blob URL 을 `<a download>` 에 그대로 걸면 다운로드가 아니라 열람 화면으로
* 이동한다** — `download` 속성은 교차 출처 URL 에서 무시되고, 결과물은 Azure Blob
* 도메인에 있어 앱과 출처가 다르기 때문이다. 썰박스(SsulResultContent)와 동일하게
* fetch → Blob → 동일 출처 objectURL 로 바꿔 내려받는다.
*
* fetch 가 실패하면(CORS 등) 새 탭으로라도 열어준다 — 사용자가 거기서
* 직접 저장할 수 있으므로 아무 일도 안 일어나는 것보다 낫다.
*/
export async function downloadP2vFile(url: string, fileName: string): Promise<void> {
try {
const response = await fetch(url);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const blobUrl = URL.createObjectURL(await response.blob());
const link = document.createElement('a');
link.href = blobUrl;
link.download = fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(blobUrl);
} catch {
const link = document.createElement('a');
link.href = url;
link.download = fileName;
link.target = '_blank';
link.rel = 'noopener';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
}
// ── 타입 (서버 jobs.py / routers 와 1:1) ──────────────────────────────
export type P2vStageStatus = 'idle' | 'running' | 'done' | 'failed'; export type P2vStageStatus = 'idle' | 'running' | 'done' | 'failed';
@@ -149,152 +64,114 @@ export interface PosterMeta {
} }
export interface P2vJob { export interface P2vJob {
/** castad 잡 id (정수). 이전 P2V 직접 호출 시절엔 문자열 슬러그였다 */ id: number;
id: number | string; kind: 'f1';
kind?: 'f1' | 'f2'; name: string;
name?: string | null; status: 'queued' | 'running' | 'awaiting_review' | 'failed' | 'done';
/** 'archiving' = 완성본을 Blob 으로 옮기는 중 — 진행 중으로 취급한다 */ stage: string | null;
status: 'queued' | 'running' | 'awaiting_review' | 'archiving' | 'failed' | 'done'; stages: Record<string, P2vStageState>;
stage?: string | null; narration: string[] | null;
/** 진행 중에만 내려온다 (아카이브 후 조회는 DB 미러라 없음) */
stages?: Record<string, P2vStageState> | null;
narration?: string[] | null;
motion_elements?: string[] | null; motion_elements?: string[] | null;
metadata?: PosterMeta | null; metadata: PosterMeta | null;
error?: { stage: string; detail: string } | null; error: { stage: string; detail: string } | null;
/** 산출물은 Azure Blob 의 절대 URL 이다 */
artifacts: Record<string, string>; artifacts: Record<string, string>;
created_at?: number; created_at: number;
queue_size?: number;
template_id?: string | null;
} }
/** 배포 등급. public-domain 만 외부 공개 가능 — 나머지는 내부 시연 한정 */ /** 잡 id. 서버는 숫자로 주고, 화면은 localStorage 때문에 문자열로도 든다 */
export type P2vLicense = 'public-domain' | 'internal-only' | 'user-uploaded'; export type P2vJobId = string | number;
export interface F2Template {
id: string;
name_ko: string;
thumb_url: string;
category: string;
license: P2vLicense;
attribution: string;
license_note: string;
/** 사용자가 올린 레퍼런스인가 (삭제 가능) */
removable: boolean;
small_ref: boolean;
}
export interface F2Category { id: string; label: string }
export interface F2Format { id: string; label: string }
export interface F2UploadHint { enabled: boolean; min_long_edge: number }
// ── F1 (포스터 → 영상) ──────────────────────────────────────────────── // ── F1 (포스터 → 영상) ────────────────────────────────────────────────
/** 포스터 업로드 → 잡 생성. 반환된 id 로 폴링한다 */ /** 포스터 업로드 → 잡 생성. 반환된 id 로 폴링한다. 크레딧이 먼저 차감된다 */
export async function createPosterJob(poster: File, name: string): Promise<{ id: string }> { export async function createPosterJob(poster: File, name: string): Promise<{ id: string }> {
const fd = new FormData(); const fd = new FormData();
fd.append('poster', poster); fd.append('poster', poster);
fd.append('name', name); fd.append('name', name);
return p2vFetch<{ id: string }>('/f1/jobs', { method: 'POST', body: fd }); const { id } = await p2vFetch<{ id: number }>('/p2v/f1/jobs', { method: 'POST', body: fd });
// 화면은 잡 id 를 localStorage 문자열로 들고 있어 경계에서 맞춘다
return { id: String(id) };
} }
export const getPosterJob = (id: string | number): Promise<P2vJob> => export const getPosterJob = (id: P2vJobId): Promise<P2vJob> =>
p2vFetch<P2vJob>(`/f1/jobs/${id}`); p2vFetch<P2vJob>(`/p2v/f1/jobs/${id}`);
export const updatePosterNarration = (id: string | number, narration: string[]): Promise<unknown> => export const updatePosterNarration = (id: P2vJobId, narration: string[]): Promise<unknown> =>
p2vFetch(`/f1/jobs/${id}/narration`, { p2vFetch(`/p2v/f1/jobs/${id}/narration`, {
method: 'PUT', method: 'PUT',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ narration }), body: JSON.stringify({ narration }),
}); });
export const updatePosterMetadata = ( export const updatePosterMetadata = (
id: string | number, id: P2vJobId,
meta: { event_name: string; date_text: string; place: string }, meta: { event_name: string; date_text: string; place: string },
): Promise<unknown> => ): Promise<unknown> =>
p2vFetch(`/f1/jobs/${id}/metadata`, { p2vFetch(`/p2v/f1/jobs/${id}/metadata`, {
method: 'PUT', method: 'PUT',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(meta), body: JSON.stringify(meta),
}); });
/** 검수 승인 → TTS·BGM·애니메이션·렌더가 이어진다. motions 를 넘기면 모션 선정을 덮어쓴다 */ /** 검수 승인 → TTS·BGM·애니메이션·렌더가 이어진다. motions 를 넘기면 모션 선정을 덮어쓴다 */
export const approvePosterJob = (id: string | number, motions?: string[] | null): Promise<unknown> => export const approvePosterJob = (id: P2vJobId, motions?: string[] | null): Promise<unknown> =>
p2vFetch(`/f1/jobs/${id}/approve`, { p2vFetch(`/p2v/f1/jobs/${id}/approve`, {
method: 'POST', method: 'POST',
...(motions ...(motions
? { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ motions }) } ? { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ motions }) }
: {}), : {}),
}); });
export const deletePosterJob = (id: P2vJobId): Promise<unknown> =>
p2vFetch(`/p2v/f1/jobs/${id}`, { method: 'DELETE' });
// ── 통합 콘텐츠 목록 ──────────────────────────────────────────────────
export const isP2vContent = (type: ContentType | P2vContentType): type is P2vContentType =>
type === 'p2v_video' || type === 'p2v_playreel';
export interface P2vDetailItem {
type: P2vContentType;
content_id: number;
video_url: string;
poster_url: string | null;
title: string | null;
created_at: string;
like_count: number;
is_liked_by_me: boolean;
}
/** 비로그인도 보는 공개 상세. 소유자 전용 /jobs/{id} API 와 구분한다. */
export async function getP2vContentById(type: P2vContentType, id: string): Promise<P2vDetailItem> {
const kind = type === 'p2v_video' ? 'f1' : 'playreel';
const response = await authenticatedFetch(
`${API_URL}/p2v/${kind}/${encodeURIComponent(id)}`,
{ method: 'GET' },
{ redirectOnAuthFail: false },
);
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return response.json();
}
/** /**
* 실패 무시하고 진행 — i2v 게이트(제목 훼손 등) 실패 전용. * 내 콘텐츠에서 P2V 항목 삭제. 종류마다 테이블이 달라 경로가 갈린다.
* 이미 생성된 클립으로 렌더만 이으므로 재시도와 달리 Higgsfield 재생성 비용이 없다. * ⚠️ `deleteVideo`(`/archive/videos/{id}`, Video.id 기준)와 혼용하면 id 가 겹치는
* 클립 없는 실패는 서버가 409 로 거절한다. * 엉뚱한 ADO2 영상이 지워진다.
*/ */
export const forcePosterJob = (id: string | number): Promise<unknown> => export const deleteP2vContent = (type: P2vContentType, id: number): Promise<unknown> =>
p2vFetch(`/f1/jobs/${id}/force`, { method: 'POST' }); p2vFetch(`/p2v/${type === 'p2v_video' ? 'f1' : 'playreel'}/jobs/${id}`, { method: 'DELETE' });
export const retryPosterJob = (id: string | number, motions?: string[] | null): Promise<unknown> =>
p2vFetch(`/f1/jobs/${id}/retry`, {
method: 'POST',
...(motions
? { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ motions }) }
: {}),
});
export const deletePosterJob = (id: string | number): Promise<unknown> =>
p2vFetch(`/f1/jobs/${id}`, { method: 'DELETE' });
// ── F2 (포스터 스타일링) ──────────────────────────────────────────────
export const listF2Templates = (): Promise<F2Template[]> => p2vFetch<F2Template[]>('/f2/templates');
export const listF2Categories = (): Promise<F2Category[]> => p2vFetch<F2Category[]>('/f2/categories');
export const listF2Formats = (): Promise<F2Format[]> => p2vFetch<F2Format[]>('/f2/formats');
export const getF2UploadHint = (): Promise<F2UploadHint> => p2vFetch<F2UploadHint>('/f2/upload-hint');
/** 레퍼런스 업로드 — 저장 + 화풍 분석까지 서버가 동기로 끝낸다(10초 안팎) */
export async function createF2Template(reference: File, name: string): Promise<F2Template> {
const fd = new FormData();
fd.append('reference', reference);
fd.append('name', name);
return p2vFetch<F2Template>('/f2/templates', { method: 'POST', body: fd });
}
export const deleteF2Template = (id: string): Promise<unknown> =>
p2vFetch(`/f2/templates/${id}`, { method: 'DELETE' });
export async function createStylingJob(
poster: File,
templateId: string,
format: string,
): Promise<{ id: string }> {
const fd = new FormData();
fd.append('poster', poster);
fd.append('template_id', templateId);
fd.append('format', format);
return p2vFetch<{ id: string }>('/f2/jobs', { method: 'POST', body: fd });
}
export const getStylingJob = (id: string | number): Promise<P2vJob> =>
p2vFetch<P2vJob>(`/f2/jobs/${id}`);
/** 스타일링 잡 삭제 — 내 콘텐츠 목록에서 제거. 미완성 잡은 서버가 크레딧을 환불한다 */
export const deleteStylingJob = (id: string | number): Promise<unknown> =>
p2vFetch(`/f2/jobs/${id}`, { method: 'DELETE' });
// ── 진행 계산 ──────────────────────────────────────────────────────── // ── 진행 계산 ────────────────────────────────────────────────────────
/** 아직 도는 중인가. 이 상태들에서만 폴링을 계속한다 (archiving = Blob 업로드 중) */ /** 아직 도는 중인가. 이 두 상태에서만 폴링을 계속한다 */
export const isP2vActive = (job: P2vJob | null): boolean => export const isP2vActive = (job: P2vJob | null): boolean =>
job !== null job !== null && (job.status === 'queued' || job.status === 'running');
&& (job.status === 'queued' || job.status === 'running' || job.status === 'archiving');
/** 스테이지 진행률(%) — 선형 진행바용. 도는 중인 스테이지는 절반으로 친다 */ /** 스테이지 진행률(%) — 선형 진행바용. 도는 중인 스테이지는 절반으로 친다 */
export function p2vProgress(job: P2vJob | null): number { export function p2vProgress(job: Pick<P2vJob, 'stages'> | null): number {
if (!job) return 0; if (!job) return 0;
if (job.status === 'archiving') return 99; // 렌더 끝, 업로드만 남음 const states = Object.values(job.stages);
const states = Object.values(job.stages ?? {});
if (states.length === 0) return 0; if (states.length === 0) return 0;
const done = states.filter((s) => s.status === 'done').length; const done = states.filter((s) => s.status === 'done').length;
const running = states.some((s) => s.status === 'running') ? 0.5 : 0; const running = states.some((s) => s.status === 'running') ? 0.5 : 0;
@@ -311,10 +188,6 @@ export function p2vProgress(job: P2vJob | null): number {
*/ */
const POST_REVIEW_STAGE = 'tts'; const POST_REVIEW_STAGE = 'tts';
export const isPastReview = (job: P2vJob | null): boolean => { export const isPastReview = (job: P2vJob | null): boolean =>
if (!job) return false; !!job && job.stages[POST_REVIEW_STAGE]?.status !== undefined
// 아카이브 이후 조회는 stages 가 없다 — done/archiving 이면 당연히 검수 뒤다 && job.stages[POST_REVIEW_STAGE].status !== 'idle';
if (job.status === 'done' || job.status === 'archiving') return true;
const st = job.stages?.[POST_REVIEW_STAGE]?.status;
return st !== undefined && st !== 'idle';
};
+170
View File
@@ -0,0 +1,170 @@
/**
* Playreel(롱컷) 클라이언트 — 공연 상품페이지 URL → 30초 세로 예고편.
*
* castad 백엔드의 `/p2v/playreel/*` 를 부른다(p2vApi.ts 의 `p2vFetch` 를 공유).
* 이 파이프라인은 사람이 확인하는 **게이트 5개**에서 멈춘다. 게이트마다 검수 페이로드
* (`review`)가 오고, 승인할 때 고친 값(`edits`)을 함께 보낸다.
*
* 크레딧은 생성 요청 시점에 선차감되고, 실패하면 환불된다. 실패한 잡은 다시 돌릴 수
* 없다(새로 만든다). 다시 돌릴 수 있는 것은 클립 검수 게이트의 "다시 만들기" 뿐이다.
*/
import { P2vJobId, P2vStageState, p2vFetch } from './p2vApi';
export type GateKey =
| 'fetch_confirm'
| 'analysis_confirm'
| 'narration_confirm'
| 'clip_confirm'
| 'final_confirm';
export const GATE_ORDER: readonly GateKey[] = [
'fetch_confirm', 'analysis_confirm', 'narration_confirm', 'clip_confirm', 'final_confirm',
];
/**
* 게이트 진행 상태. 문구는 locales 의 `playreel.gates.<key>` 에 있다.
* 되돌리기는 크레딧을 이미 쓴 지점 뒤로는 서버가 거절한다(`REVERSIBLE_GATES`).
*/
export const GATE_CAN_BACK: Record<GateKey, boolean> = {
fetch_confirm: false,
analysis_confirm: true,
narration_confirm: true,
clip_confirm: false,
final_confirm: false,
};
// ── 게이트별 검수 페이로드 (백엔드 app/p2v/worker/gate.py 와 1:1) ──────────
export interface DetailSection {
id: string;
tag: string;
label: string;
thumb_url: string;
height: number;
/** 캐스팅 스케줄은 항상 포함 */
required?: boolean;
selected: boolean;
}
export interface FetchReview {
poster_url: string;
/** 800px 이하면 저해상 경고 */
poster_width: number;
meta: { title: string; date_text: string; place: string; cast: string[]; genre: string };
sections: DetailSection[];
}
export interface AnalysisReview {
grid_url: string;
movable: { key: string; label: string; on: boolean }[];
fixed: { key: string; label: string; on: boolean }[];
model: string;
ip_risk: boolean;
has_qr: boolean;
}
export interface NarrationReview {
lines: { slot: string; text: string }[];
voice: { id: string; name: string; sample_url: string };
est_seconds: number;
}
export interface ClipReview {
clip_url: string;
frames_url: string;
title_mae: number;
gate_passed: boolean;
gate_reason: string | null;
}
export interface FinalReview {
video_url: string;
proof_url: string;
duration: number;
checks: { key: string; label: string; ok: boolean }[];
version: number;
}
export type GateReview =
| { gate: 'fetch_confirm'; data: FetchReview }
| { gate: 'analysis_confirm'; data: AnalysisReview }
| { gate: 'narration_confirm'; data: NarrationReview }
| { gate: 'clip_confirm'; data: ClipReview }
| { gate: 'final_confirm'; data: FinalReview };
/** 승인할 때 함께 보내는 고친 값. 게이트마다 모양이 다르다 */
export type GateEdits =
| { sections: string[]; meta: FetchReview['meta'] }
| { movable: string[]; fixed: string[]; model: string }
| { lines: string[]; voice_id: string };
export interface PlayreelJob {
id: number;
kind: 'playreel';
name: string;
status: 'queued' | 'running' | 'awaiting_review' | 'failed' | 'done';
stage: string | null;
stages: Record<string, P2vStageState>;
error: { stage: string; detail: string } | null;
/** 산출물은 Azure Blob 의 절대 URL 이다 */
artifacts: Record<string, string>;
created_at: number;
source: { url: string; goods_id: string; slug: string };
gate: GateKey | null;
review: GateReview | null;
version: number;
}
// ── URL 인식 ────────────────────────────────────────────────────────────
/**
* NOL티켓/인터파크 상품 URL 에서 goodsId 를 뽑는다. 못 뽑으면 null.
* 입력 도중의 안내용이고, 판정은 서버가 같은 규칙으로 다시 한다.
*/
export function parseGoodsId(url: string): string | null {
const s = url.trim();
if (!s) return null;
const m =
// 인터파크 주소는 야놀자로 리다이렉트된다. 상품 번호는 양쪽이 같다
s.match(/nol\.yanolja\.com\/ticket\/products\/(\d{5,})/i) ??
s.match(/tickets\.interpark\.com\/goods\/(\d{5,})/i) ??
s.match(/nol\.interpark\.com\/[^?]*?(\d{8,})/i) ??
s.match(/[?&]goodsCode=(\d{5,})/i) ??
s.match(/^(\d{8,})$/);
return m ? m[1] : null;
}
// ── API ─────────────────────────────────────────────────────────────────
const jsonBody = (body: unknown): RequestInit => ({
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
});
/** 상품페이지 주소 → 잡 생성. 크레딧이 먼저 차감된다 */
export async function createPlayreelJob(url: string): Promise<{ id: string }> {
const { id } = await p2vFetch<{ id: number }>('/p2v/playreel/jobs', jsonBody({ url: url.trim() }));
// 화면은 잡 id 를 localStorage 문자열로 들고 있어 경계에서 맞춘다
return { id: String(id) };
}
export const getPlayreelJob = (id: P2vJobId): Promise<PlayreelJob> =>
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}`);
/** 게이트 승인. gate 를 함께 보내 화면과 서버의 게이트가 어긋나면 서버가 409 로 막는다 */
export const approvePlayreelGate = (
id: P2vJobId, gate: GateKey, edits: GateEdits | null,
): Promise<PlayreelJob> =>
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}/approve`, jsonBody({ gate, edits }));
/** 직전 게이트로 되돌린다 */
export const backPlayreelGate = (id: P2vJobId): Promise<PlayreelJob> =>
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}/back`, { method: 'POST' });
/** 클립 검수 게이트에서 영상을 다시 만든다. 추가 크레딧은 차감되지 않는다 */
export const retryPlayreelClip = (id: P2vJobId): Promise<PlayreelJob> =>
p2vFetch<PlayreelJob>(`/p2v/playreel/jobs/${id}/retry`, { method: 'POST' });
export const deletePlayreelJob = (id: P2vJobId): Promise<unknown> =>
p2vFetch(`/p2v/playreel/jobs/${id}`, { method: 'DELETE' });
+72
View File
@@ -0,0 +1,72 @@
import { useSyncExternalStore } from 'react';
import { GateKey } from './playreelApi';
/**
* 롱컷 게이트 자동 승인 설정 — playreel 원본(`lib/prefs.ts`)과 같은 방식이다.
*
* 대상은 되돌릴 수 있는 게이트(① 수집 확인, ③ 나레이션 확인)뿐이다.
* ②·④·⑤ 는 크레딧을 쓰거나 결과를 고정하는 비가역 단계라 항상 사람이 확인한다.
*
* 브라우저 localStorage 에만 저장하고 서버에는 보내지 않는다. `storageKeys.K` 에 넣지 않은 것도
* 의도적이다 — 그쪽 키는 새 프로젝트·로그아웃 때 지워지는데, 이건 사용자의 취향이라
* 생성할 때마다 다시 켜게 만들면 안 된다.
*/
export const AUTO_APPROVABLE = ['fetch_confirm', 'narration_confirm'] as const satisfies readonly GateKey[];
export type AutoApprovable = (typeof AUTO_APPROVABLE)[number];
export type AutoApprovePrefs = Partial<Record<AutoApprovable, boolean>>;
export const isAutoApprovable = (gate: GateKey | null | undefined): gate is AutoApprovable =>
!!gate && (AUTO_APPROVABLE as readonly string[]).includes(gate);
const STORAGE_KEY = 'castad_playreel_auto_approve';
const CHANGE_EVENT = 'castad:playreel-prefs';
const EMPTY: AutoApprovePrefs = {};
// useSyncExternalStore 는 같은 값이면 같은 참조를 돌려줘야 한다
let cache: { raw: string | null; value: AutoApprovePrefs } = { raw: null, value: EMPTY };
export function readAutoApprove(): AutoApprovePrefs {
let raw: string | null = null;
try {
raw = localStorage.getItem(STORAGE_KEY);
} catch {
return EMPTY; // 저장소를 못 쓰면 항상 사람이 확인한다
}
if (raw === cache.raw) return cache.value;
let value: AutoApprovePrefs = EMPTY;
try {
const parsed = raw ? JSON.parse(raw) : {};
value = Object.fromEntries(
AUTO_APPROVABLE.filter((gate) => parsed?.[gate] === true).map((gate) => [gate, true]),
);
} catch {
/* 깨진 값은 꺼진 것으로 본다 */
}
cache = { raw, value };
return value;
}
export function setAutoApprove(gate: AutoApprovable, on: boolean): void {
const next = { ...readAutoApprove() };
if (on) next[gate] = true;
else delete next[gate];
try {
localStorage.setItem(STORAGE_KEY, JSON.stringify(next));
} catch {
/* 프라이빗 모드 등 — 이 세션에서만 유지되지 않는다 */
}
window.dispatchEvent(new Event(CHANGE_EVENT));
}
function subscribe(onChange: () => void): () => void {
window.addEventListener(CHANGE_EVENT, onChange);
window.addEventListener('storage', onChange); // 다른 탭에서 바꾼 경우
return () => {
window.removeEventListener(CHANGE_EVENT, onChange);
window.removeEventListener('storage', onChange);
};
}
export function useAutoApprove(): AutoApprovePrefs {
return useSyncExternalStore(subscribe, readAutoApprove, () => EMPTY);
}
+6
View File
@@ -50,6 +50,11 @@ export const K = {
* 로그아웃으로 지워지면 시연 중 매번 다시 물어야 한다 (utils/p2vApi.ts 참조). * 로그아웃으로 지워지면 시연 중 매번 다시 물어야 한다 (utils/p2vApi.ts 참조).
*/ */
POSTER_JOB_ID: 'castad_poster_job_id', POSTER_JOB_ID: 'castad_poster_job_id',
/**
* 롱컷(Playreel) 진행 중 잡 id. 포스터 영상과 같은 이유로 새로고침 복구의 근거다.
* 잡이 사라졌으면 조회가 404 로 떨어지고 GenerationFlow 가 이 키를 정리한다.
*/
PLAYREEL_JOB_ID: 'castad_playreel_job_id',
} as const; } as const;
/** /**
@@ -67,6 +72,7 @@ export const PROJECT_KEYS: readonly string[] = [
K.PIPELINE, K.PIPELINE,
K.SSUL_TASK_ID, K.SSUL_TASK_ID,
K.POSTER_JOB_ID, K.POSTER_JOB_ID,
K.PLAYREEL_JOB_ID,
]; ];
/** /**
-7
View File
@@ -10,13 +10,6 @@ export default defineConfig({
server: { server: {
port: 3000, port: 3000,
host: '0.0.0.0', host: '0.0.0.0',
// 도커 컨테이너가 Windows 바인드 마운트를 감시할 때 inotify 이벤트가 오지 않아
// HMR 이 전혀 동작하지 않는다(호스트에서 파일을 고쳐도 옛 모듈을 계속 서빙).
// 2026-08-26 실측: 1시간 편집에 HMR 이벤트 0건 → 폴링으로 전환.
watch: {
usePolling: true,
interval: 500,
},
}, },
plugins: [react()], plugins: [react()],
resolve: { resolve: {