이름: solution/front → solution/frontend
`backend` 옆에 `front` 가 있을 이유가 없었다. negosium 의 negodata/front 를 그대로 베꼈고 그게 왜 front 인지는 따져보지 않았다 — 근거 없이 들여온 이름이라 바로잡는다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019uYhHQdssRubirPirrdJJC
This commit is contained in:
1 parent
06f6438d9b
commit
c85c577349
480 files changed
+22
-22
No files matched your search
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* 쇼케이스용 목업 props — 배리에이션 하나를 스토어 없이 그리기 위한 최소 입력.
|
||||
*
|
||||
* 캔버스(CanvasView)는 빌더 스토어에서 props 를 모으지만, 쇼케이스는 스토어를 건드리면 안 된다 —
|
||||
* 개발자가 색을 구경하다가 사장님이 편집 중이던 사이트 상태를 바꿔 버리면 곤란하다.
|
||||
* 그래서 여기서 업종 기본 데이터로 같은 모양의 props 를 직접 만든다.
|
||||
*/
|
||||
import type {IndustryType, SectionItem, TemplateItem} from '@o2o/shared';
|
||||
import {INDUSTRY_CONFIGS} from '@/data/industryData';
|
||||
import type {SectionRenderProps} from '@/features/builder/canvas/types';
|
||||
import type {SectionVariant} from '@/features/builder/canvas/types';
|
||||
import {asTemplate, type TokenGroup} from './tokenGroups';
|
||||
|
||||
/** 업종의 첫 템플릿 — 토큰 그룹이 색만 갈아끼울 바탕이 된다. */
|
||||
export function baseTemplate(industry: IndustryType): TemplateItem {
|
||||
return INDUSTRY_CONFIGS[industry].templates[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* 섹션 메타를 만든다.
|
||||
*
|
||||
* 업종 기본 섹션 목록에 같은 타입이 있으면 그걸 쓴다(이름·잠금 상태가 실제와 같아진다).
|
||||
* 없으면 최소 형태로 지어낸다 — 그 업종 메뉴엔 없지만 배리에이션은 존재하는 경우다.
|
||||
*/
|
||||
function sectionFor(sectionType: string, industry: IndustryType, variantId: string): SectionItem {
|
||||
const found = INDUSTRY_CONFIGS[industry].sections.find((s) => s.type === sectionType);
|
||||
if (found) return {...found, isEnabled: true, variantId};
|
||||
return {
|
||||
id: sectionType,
|
||||
type: sectionType,
|
||||
name: sectionType,
|
||||
isLocked: false,
|
||||
isEnabled: true,
|
||||
variantId,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 쇼케이스 전용 자리표시 값.
|
||||
*
|
||||
* ★ 실제 업소처럼 보이는 값을 쓰지 않는다. 예전에는 업종 시드('달빛스테이 제주',
|
||||
* '포레스트 힐 로스터스')를 그대로 썼는데, 그 값들이 캔버스 배리에이션에도
|
||||
* 폴백으로 새어 사장님 화면에 남의 가게가 떴다. 그래서 시드에서 콘텐츠를 걷어냈고,
|
||||
* 쇼케이스는 한눈에 가짜인 값을 **여기서만** 들고 간다 — 이 파일은 DEV 라우트
|
||||
* (`/dev/showcase`, app/router.tsx)에서만 로드된다.
|
||||
*/
|
||||
const SHOWCASE_VALUES = {
|
||||
storeName: '샘플 상호',
|
||||
location: '샘플 지역',
|
||||
infoFields: [],
|
||||
photos: [],
|
||||
};
|
||||
|
||||
/** 배리에이션 하나를 그릴 props 한 벌. */
|
||||
export function mockPropsFor(
|
||||
sectionType: string,
|
||||
variant: SectionVariant,
|
||||
industry: IndustryType,
|
||||
group: TokenGroup,
|
||||
): SectionRenderProps {
|
||||
return {
|
||||
section: sectionFor(sectionType, industry, variant.id),
|
||||
industryId: industry,
|
||||
...SHOWCASE_VALUES,
|
||||
template: asTemplate(group, baseTemplate(industry)),
|
||||
// 쇼케이스는 "고르는" 화면이 아니다 — 선택 링·배지가 뜨면 디자인을 가린다.
|
||||
isSelected: false,
|
||||
onSelect: () => {},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user