@leviosa-ai/detail-page-editor 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -421,6 +421,14 @@ export interface DetailPageHostSlots {
|
|
|
421
421
|
store: never;
|
|
422
422
|
className?: string;
|
|
423
423
|
}>;
|
|
424
|
+
/**
|
|
425
|
+
* '내 이미지' 서랍의 두 번째 탭 — 저작이 구운 사진.
|
|
426
|
+
*
|
|
427
|
+
* 브랜드 자산과 한 그리드에 안 섞는 이유는 고르는 방식이 달라서다. 자산은 이름으로
|
|
428
|
+
* 찾고, 저작 사진은 "그때 그 상세페이지"로 찾는다. 뒤쪽은 상세페이지 저작이라는 앱
|
|
429
|
+
* 도메인을 알아야 묶이므로 앱이 꽂는다. 안 꽂으면 탭 없이 브랜드 자산만 뜬다.
|
|
430
|
+
*/
|
|
431
|
+
AuthoredImagesPanel?: ComponentType<{ store: unknown }>;
|
|
424
432
|
}
|
|
425
433
|
|
|
426
434
|
export interface DetailPageHost {
|
|
@@ -28,7 +28,80 @@ function uploadKind(file: File): BrandAssetKind {
|
|
|
28
28
|
return "image";
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* 브랜드 이미지 서랍. 앱이 저작 갤러리를 꽂아 주면 두 갈래를 한 자리에서 고른다.
|
|
33
|
+
*
|
|
34
|
+
* - **브랜드 자산** — 셀러가 올려 둔 사진. 오래 사는 물건이다.
|
|
35
|
+
* - **저작 생성 이미지** — 저작이 구운 사진. 한 건이 최대 30장인데 고른 한 벌에
|
|
36
|
+
* 들어가는 것은 열 몇 장이라, 나머지를 여기서 못 찾으면 다음 상품에서 같은 사진을
|
|
37
|
+
* 다시 굽는다.
|
|
38
|
+
*
|
|
39
|
+
* 한 그리드에 섞지 않는 이유는 고르는 방식이 달라서다. 브랜드 자산은 이름으로 찾고,
|
|
40
|
+
* 저작 사진은 "그때 그 상세페이지"로 찾는다 — 뒤쪽은 페이지 단위 묶음이 필요하다.
|
|
41
|
+
*
|
|
42
|
+
* 슬롯이 없으면 탭도 없다. 저작이라는 앱 도메인이 없는 소비자에게 빈 탭을 보이느니
|
|
43
|
+
* 브랜드 자산 하나로 두는 편이 맞다.
|
|
44
|
+
*/
|
|
31
45
|
export function DetailPageMyImagesPanel({ store }: { store: unknown }) {
|
|
46
|
+
const { slots } = useDetailPageHost();
|
|
47
|
+
const { t } = useTranslation("branding");
|
|
48
|
+
const [source, setSource] = useState<"brand" | "authored">("brand");
|
|
49
|
+
const AuthoredPanel = slots?.AuthoredImagesPanel;
|
|
50
|
+
|
|
51
|
+
if (!AuthoredPanel) return <BrandAssetGallery store={store} />;
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className="flex h-full flex-col">
|
|
55
|
+
<div className="flex gap-1 border-b border-neutral-200 px-4 pt-3">
|
|
56
|
+
<SourceTab
|
|
57
|
+
label={t("detailPage.brandAssets.sourceBrand")}
|
|
58
|
+
active={source === "brand"}
|
|
59
|
+
onClick={() => setSource("brand")}
|
|
60
|
+
/>
|
|
61
|
+
<SourceTab
|
|
62
|
+
label={t("detailPage.brandAssets.sourceAuthored")}
|
|
63
|
+
active={source === "authored"}
|
|
64
|
+
onClick={() => setSource("authored")}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
<div className="min-h-0 flex-1">
|
|
68
|
+
{source === "brand" ? (
|
|
69
|
+
<BrandAssetGallery store={store} />
|
|
70
|
+
) : (
|
|
71
|
+
<AuthoredPanel store={store} />
|
|
72
|
+
)}
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function SourceTab({
|
|
79
|
+
label,
|
|
80
|
+
active,
|
|
81
|
+
onClick,
|
|
82
|
+
}: {
|
|
83
|
+
label: string;
|
|
84
|
+
active: boolean;
|
|
85
|
+
onClick: () => void;
|
|
86
|
+
}) {
|
|
87
|
+
return (
|
|
88
|
+
<button
|
|
89
|
+
type="button"
|
|
90
|
+
onClick={onClick}
|
|
91
|
+
aria-pressed={active}
|
|
92
|
+
className={
|
|
93
|
+
"-mb-px border-b-2 px-2.5 pb-2 text-[11px] font-medium " +
|
|
94
|
+
(active
|
|
95
|
+
? "border-neutral-800 text-neutral-800"
|
|
96
|
+
: "border-transparent text-neutral-400 hover:text-neutral-600")
|
|
97
|
+
}
|
|
98
|
+
>
|
|
99
|
+
{label}
|
|
100
|
+
</button>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function BrandAssetGallery({ store }: { store: unknown }) {
|
|
32
105
|
const { brand, queryKeys, toast } = useDetailPageHost();
|
|
33
106
|
const { t } = useTranslation("branding");
|
|
34
107
|
const queryClient = useQueryClient();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leviosa-ai/detail-page-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Leviosa detail-page editor shell. Source-only: consumers compile it through Next transpilePackages. Every app coupling (sourcing server, brand store, cache keys, toast) arrives through the DetailPageHost interface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|