webcake-storefront-mcp 1.28.0 → 1.29.0
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.
|
@@ -311,7 +311,9 @@ export function headerSection(opts = {}) {
|
|
|
311
311
|
{ label: "Sản phẩm", navTo: "collections" },
|
|
312
312
|
{ label: "Giỏ hàng", navTo: "cart" },
|
|
313
313
|
];
|
|
314
|
-
const logo =
|
|
314
|
+
const logo = opts.logo
|
|
315
|
+
? { type: "image", opts: { config: { src: opts.logo }, style: { height: 40, width: 140 } } }
|
|
316
|
+
: { type: "text", opts: { text: opts.brand || "Shop", specials: { tag: "h2" }, style: { fontSize: "24px", fontWeight: "800", color: p.text } } };
|
|
315
317
|
// Real designer templates use a `menu` of `menu-item`s, NOT text links — and a menu-item's
|
|
316
318
|
// navigation lives in its SPECIALS (linkType/linkPage/pageId), not events. We build the
|
|
317
319
|
// items directly (via buildElement, so buildFromSpec doesn't grid-stack the menu) and leave
|
|
@@ -327,16 +329,32 @@ export function headerSection(opts = {}) {
|
|
|
327
329
|
children: menuItems,
|
|
328
330
|
},
|
|
329
331
|
};
|
|
332
|
+
// Right-hand actions: optional search / account / language, then cart + CTA — like real headers.
|
|
333
|
+
const actionChildren = [];
|
|
334
|
+
const actionWidths = [];
|
|
335
|
+
if (opts.search !== false) {
|
|
336
|
+
actionChildren.push({ type: "input-search", opts: { specials: { field_name: "search", placeholder: "Tìm kiếm sản phẩm...", showIcon: true }, config: { inputBackground: p.surfaceAlt, inputBorderColor: p.border, inputBorderRadius: "8px", iconColor: p.muted, placeholderColor: p.muted, iconAlign: "left" }, style: { height: 40 } } });
|
|
337
|
+
actionWidths.push({ unit: "px", absValue: 200 });
|
|
338
|
+
}
|
|
339
|
+
if (opts.account) {
|
|
340
|
+
actionChildren.push({ type: "member-bar", opts: { specials: { showView: "not_logged", layoutShow: "text", textLogin: "Đăng nhập", textSignup: "Đăng ký" }, config: { colorIcon: p.text }, style: { color: p.text } } });
|
|
341
|
+
actionWidths.push({ unit: "max-c" });
|
|
342
|
+
}
|
|
343
|
+
if (opts.language) {
|
|
344
|
+
actionChildren.push({ type: "language-menu", opts: { specials: { show_flag: true, type: "dropdown" }, config: { color: p.text, display: "abbreviated" } } });
|
|
345
|
+
actionWidths.push({ unit: "max-c" });
|
|
346
|
+
}
|
|
347
|
+
actionChildren.push({ type: "cart-icon", opts: { style: { width: 26, height: 26, color: p.text } } });
|
|
348
|
+
actionWidths.push({ unit: "px", absValue: 32 });
|
|
349
|
+
actionChildren.push(cta(opts.cta || "Đặt mua ngay", p, { navTo: "collections", height: 44 }));
|
|
350
|
+
actionWidths.push({ unit: "max-c" });
|
|
330
351
|
const actions = {
|
|
331
352
|
type: "container",
|
|
332
353
|
layout: "row",
|
|
333
354
|
columnGap: 16,
|
|
334
|
-
colWidths:
|
|
335
|
-
collapse: { bp4: 2 },
|
|
336
|
-
children:
|
|
337
|
-
{ type: "cart-icon", opts: { style: { width: 26, height: 26, color: p.text } } },
|
|
338
|
-
cta(opts.cta || "Đặt mua ngay", p, { navTo: "collections", height: 44 }),
|
|
339
|
-
],
|
|
355
|
+
colWidths: actionWidths,
|
|
356
|
+
collapse: { bp4: Math.min(2, actionChildren.length) },
|
|
357
|
+
children: actionChildren,
|
|
340
358
|
};
|
|
341
359
|
return buildSection([
|
|
342
360
|
{
|
package/dist/changelog.json
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "1.29.0",
|
|
4
|
+
"d": "26/06/2026",
|
|
5
|
+
"type": "Added",
|
|
6
|
+
"en": "scaffold_global_sections now accepts a logo parameter (hosted image URL) that renders an image element in the header instead of the brand-name text…",
|
|
7
|
+
"vi": "scaffold_global_sections nay nhận thêm tham số logo (URL hình ảnh được host) để hiển thị phần tử image trong header thay vì node text tên thương hiệu."
|
|
8
|
+
},
|
|
2
9
|
{
|
|
3
10
|
"v": "1.28.0",
|
|
4
11
|
"d": "26/06/2026",
|
|
@@ -33,12 +40,5 @@
|
|
|
33
40
|
"type": "Changed",
|
|
34
41
|
"en": "list_elements now documents 16 previously-uncovered element types, completing curated attribute coverage across all 132 factory types: popup…",
|
|
35
42
|
"vi": "list_elements nay tài liệu hóa 16 kiểu phần tử trước đây chưa được ghi lại, hoàn thiện độ phủ thuộc tính curated cho toàn bộ 132 kiểu factory: popup…"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"v": "1.24.0",
|
|
39
|
-
"d": "26/06/2026",
|
|
40
|
-
"type": "Changed",
|
|
41
|
-
"en": "list_elements now documents tabIndex and text_animation_type as shared specials present on every element, covering tab-panel visibility binding and…",
|
|
42
|
-
"vi": "list_elements nay tài liệu hóa tabIndex và text_animation_type là các specials dùng chung có trên mọi phần tử, bao gồm gắn kết hiển thị/ẩn cho…"
|
|
43
43
|
}
|
|
44
44
|
]
|
|
@@ -135,11 +135,15 @@ force=true. Two-step safety: dry_run=true (default) previews; dry_run=false perf
|
|
|
135
135
|
links: z.array(z.object({ label: z.string(), navTo: z.string().optional(), url: z.string().optional() })).optional().describe("Header nav links. navTo = a page slug ('home','collections','cart') auto-wired to open_page; url = external link. Defaults to Home/Products/Cart."),
|
|
136
136
|
contact: z.object({ phone: z.string().optional(), email: z.string().optional(), address: z.string().optional() }).optional().describe("Real contact info for the footer (don't invent — omit what you don't have)."),
|
|
137
137
|
cta: z.string().optional().describe("Header call-to-action button label (default 'Đặt mua ngay')."),
|
|
138
|
+
logo: z.string().optional().describe("Logo image URL (hosted) — renders an image instead of the brand text."),
|
|
139
|
+
search: z.boolean().default(true).describe("Add a storefront search box to the header (most real templates have one)."),
|
|
140
|
+
account: z.boolean().default(false).describe("Add a login/account bar (member sites)."),
|
|
141
|
+
language: z.boolean().default(false).describe("Add a language switcher (multilingual sites)."),
|
|
138
142
|
palette: z.record(z.any()).optional().describe("Optional colour overrides { accent, onAccent, text, muted, surface, surfaceAlt, border }."),
|
|
139
143
|
include: z.enum(["both", "header", "footer"]).default("both").describe("Which chrome to generate."),
|
|
140
144
|
force: z.boolean().default(false).describe("Create even if a header/footer global already exists (otherwise that slot is skipped)."),
|
|
141
145
|
dry_run: z.boolean().default(true).describe("Preview (true) or perform the atomic save (false)."),
|
|
142
|
-
}, ({ brand, links, contact, cta, palette, include, force, dry_run }) => handle(async () => {
|
|
146
|
+
}, ({ brand, links, contact, cta, logo, search, account, language, palette, include, force, dry_run }) => handle(async () => {
|
|
143
147
|
// Which slots already have a global section? (dedupe by type unless force)
|
|
144
148
|
const existingRes = await api.listGlobalSections().catch(() => null);
|
|
145
149
|
const existing = (existingRes && (existingRes.data || existingRes.global_sections || existingRes)) || [];
|
|
@@ -174,7 +178,7 @@ force=true. Two-step safety: dry_run=true (default) previews; dry_run=false perf
|
|
|
174
178
|
if (!force && slotTaken("header"))
|
|
175
179
|
skipped.push("header");
|
|
176
180
|
else
|
|
177
|
-
toCreate.push({ type: "header", name: "Header", node: buildNode("header", headerSection({ brand, links: links, cta, palette })) });
|
|
181
|
+
toCreate.push({ type: "header", name: "Header", node: buildNode("header", headerSection({ brand, links: links, cta, logo, search, account, language, palette })) });
|
|
178
182
|
}
|
|
179
183
|
if (wantFooter) {
|
|
180
184
|
if (!force && slotTaken("footer"))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcake-storefront-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"description": "MCP server for the WebCake/StoreCake storefront builder — page CRUD, page authoring, products, orders, and more",
|
|
5
5
|
"mcpName": "io.github.vuluu2k/webcake-storefront-mcp",
|
|
6
6
|
"license": "MIT",
|