[feat] solution/frontend: 붙여넣기 아이템 셋 — 가요 다방·오늘의 한 장·반나절 산책
gunsan_365_story_db.xlsx 365행을 뜯어 보니 고유 주제는 52개이고 한 주제가 7회씩 돈다
(접미사 10개만 회전). 날짜 축으로 카드를 늘어놓으면 이레마다 같은 카드가 돌아온다 —
그래서 묶는 축을 주제로 잡고 날짜는 일력 한 장에만 썼다. 같은 파일 DB_Guide 가 가사·원문
전재를 금지해 가요 스키마에 lyrics 필드를 아예 두지 않았다. 없는 칸은 채울 수 없다.
- canvas/dataSpec.ts: 스키마·예시·프롬프트 단일 표. 레지스트리와 같은 결이라 한 줄을 더하면
캔버스·[콘텐츠] 탭·프롬프트가 동시에 는다. 파싱은 절대 throw 하지 않는다 — 편집 중인 JSON 은
늘 깨져 있고 그때 캔버스가 죽으면 고칠 방법이 없다
- shared/types/builder: SectionItem.data 는 파싱본이 아니라 원문 문자열이다. 파싱본만 들면
JSON 이 깨진 순간 사장님이 쓴 걸 잃는다
- variants/{songs,daily,course}: 턴테이블·일력·승차권. 카드 격자를 쓰지 않고 전부 가로로 넘긴다
- RightTabsPanel: JSON 칸 + 프롬프트 복사/보기·예시 넣기·줄맞춤. 프롬프트에 상호와 주소에서 뽑은
시·군·구를 박아 내보낸다 — 빈칸을 남기면 못 채우고 그대로 보내고 모델이 엉뚱한 곳을 지어낸다
- dataSpec.locate: JSON.parse 오류가 두 형식이다. position 형만 보면 조각 인용 형에서 위치를
통째로 잃는다 — 조각을 원문에서 되찾아 센다
- SECTION_DATA_MAX_CHARS: 테마 상한 64KB(site_service._THEME_MAX_BYTES)를 세 섹션이 함께
넘길 수 있고 거절은 발행 직전에야 드러난다. 화면에서 먼저 끊는다
- industryData: 네 업종에 꺼진 채로 넣는다. 내용 없이 켜져 있으면 발행본에 빈 섹션이 나간다
- index.html: Gugi·Gowun Batang·Nanum Pen Script. 없으면 고딕으로 떨어져 감성이 사라진다
발행 사이트(solution/site)는 아직 variantId 도 data 도 읽지 않는다 — 지금은 빌더 캔버스 전용이다.
tsc·eslint·vite build 통과(frontend·admin), 세 배리에이션 SSR 렌더 확인, 파서 경계 12건 확인
This commit is contained in:
1 parent
c250b656fd
commit
23162783f9
15 files changed
+1424
-2
No files matched your search
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
import type {IndustryType, SectionItem, TemplateItem} from '@o2o/shared';
|
||||
import {INDUSTRY_CONFIGS} from '@/data/industryData';
|
||||
import {dataSpecFor} from '@/features/builder/canvas/dataSpec';
|
||||
import type {SectionRenderProps} from '@/features/builder/canvas/types';
|
||||
import type {SectionVariant} from '@/features/builder/canvas/types';
|
||||
import {asTemplate, type TokenGroup} from './tokenGroups';
|
||||
@@ -23,8 +24,10 @@ export function baseTemplate(industry: IndustryType): TemplateItem {
|
||||
* 없으면 최소 형태로 지어낸다 — 그 업종 메뉴엔 없지만 배리에이션은 존재하는 경우다.
|
||||
*/
|
||||
function sectionFor(sectionType: string, industry: IndustryType, variantId: string): SectionItem {
|
||||
// 붙여넣기 아이템은 JSON 이 없으면 "붙여넣으세요" 안내만 뜬다 — 디자인을 보러 온 화면에선 예시를 얹는다.
|
||||
const sample = dataSpecFor(sectionType)?.sample;
|
||||
const found = INDUSTRY_CONFIGS[industry].sections.find((s) => s.type === sectionType);
|
||||
if (found) return {...found, isEnabled: true, variantId};
|
||||
if (found) return {...found, isEnabled: true, variantId, ...(sample ? {data: sample} : {})};
|
||||
return {
|
||||
id: sectionType,
|
||||
type: sectionType,
|
||||
@@ -32,6 +35,7 @@ function sectionFor(sectionType: string, industry: IndustryType, variantId: stri
|
||||
isLocked: false,
|
||||
isEnabled: true,
|
||||
variantId,
|
||||
...(sample ? {data: sample} : {}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user