sbuilder-mcp 0.110.0 → 0.110.2

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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,28 @@ All notable changes to this project are documented in this file.
6
6
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
7
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [0.110.2] - 2026-11-19
10
+
11
+ ### Added
12
+ - The `text-dataset` element gains a result-count mode (`datasetSource` `list`, `kind` `count`) that prints a `countFormat` such as "24 sản phẩm" from the page's product list.
13
+
14
+ ### Changed
15
+ - The element catalog is regenerated against web_builder v1.0.285, and the `hoverSwapImage` guidance now spells out the gallery requirement.
16
+
17
+ ## [0.110.1] - 2026-11-19
18
+
19
+ ### Added
20
+ - `sb_add` takes `menu_item_id` to turn a menu row into a mega panel, and `sb_outline` tags the panel with its row id and label.
21
+ - The `sale-badge` element gains a `tag` mode that binds product tags, and `product-variants` gains a `showAttributes` option.
22
+ - The API catalog grows to 1009 operations, adding `POST /api/v1/code-components/preview` and `GET /api/v1/pages/{id}/preview`.
23
+
24
+ ### Changed
25
+ - `sb_remove` of a mega panel clears its menu row's `panelId` in the same save.
26
+
27
+ ### Fixed
28
+ - `sb_move` of a menu's mega panel and a same-page `sb_duplicate` of one are refused with a pointer to `sb_remove` or `menu_item_id`, instead of leaving a row that points at nothing.
29
+ - A mega panel added under its menu with `menu_item_id` no longer warns that it never renders.
30
+
9
31
  ## [0.110.0] - 2026-11-19
10
32
 
11
33
  ### Added
package/CHANGELOG.vi.md CHANGED
@@ -6,6 +6,28 @@ Mọi thay đổi đáng chú ý của dự án được ghi lại trong file n
6
6
  Định dạng dựa trên [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
7
  và dự án tuân theo [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [0.110.2] - 2026-11-19
10
+
11
+ ### Added
12
+ - Phần tử `text-dataset` có thêm chế độ đếm kết quả (`datasetSource` `list`, `kind` `count`) in ra `countFormat` như "24 sản phẩm" từ danh sách sản phẩm của trang.
13
+
14
+ ### Changed
15
+ - Danh mục phần tử được tạo lại theo web_builder v1.0.285, và hướng dẫn `hoverSwapImage` nay nêu rõ yêu cầu về thư viện ảnh.
16
+
17
+ ## [0.110.1] - 2026-11-19
18
+
19
+ ### Added
20
+ - `sb_add` nhận `menu_item_id` để biến một hàng menu thành mega panel, và `sb_outline` gắn nhãn panel bằng id và nhãn của hàng đó.
21
+ - Phần tử `sale-badge` có thêm chế độ `tag` gắn thẻ sản phẩm, và `product-variants` có thêm tùy chọn `showAttributes`.
22
+ - Danh mục API tăng lên 1009 thao tác, thêm `POST /api/v1/code-components/preview` và `GET /api/v1/pages/{id}/preview`.
23
+
24
+ ### Changed
25
+ - `sb_remove` một mega panel xoá `panelId` của hàng menu tương ứng trong cùng một lần lưu.
26
+
27
+ ### Fixed
28
+ - `sb_move` mega panel của menu và `sb_duplicate` nó trong cùng trang bị từ chối kèm gợi ý dùng `sb_remove` hoặc `menu_item_id`, thay vì để lại một hàng trỏ vào chỗ không có gì.
29
+ - Mega panel thêm vào menu bằng `menu_item_id` không còn bị cảnh báo là không bao giờ hiển thị.
30
+
9
31
  ## [0.110.0] - 2026-11-19
10
32
 
11
33
  ### Added
package/README.md CHANGED
@@ -110,7 +110,7 @@ in this client: one would put the very key the platform exists to hold back into
110
110
  | `sb_node_read` | One node in full, with a warning if it is a shared global |
111
111
  | `sb_catalog_search` | Find an element by what it should do, using the platform's own AI hints |
112
112
  | `sb_traits_for` | An element's inspector — tabs, groups, controls and what each declared one writes — plus its AI hints, defaults and containment rules |
113
- | `sb_add` | Add an element — or a whole nested subtree — in one call; a filter arrives with its option rows read from the catalogue |
113
+ | `sb_add` | Add an element — or a whole nested subtree — in one call; a filter arrives with its option rows read from the catalogue; `menu_item_id` turns a menu row into a mega panel |
114
114
  | `sb_set` | Write style/config/specials. Per breakpoint by default |
115
115
  | `sb_move` | Move a node to another parent |
116
116
  | `sb_remove` | Remove a node and its subtree |
@@ -142,7 +142,7 @@ in this client: one would put the very key the platform exists to hold back into
142
142
  | `sb_store` | Run a store flow that must happen in a fixed order — `checkout` (the four writes that make a working one), `checkout_sync` (the store's current payment and delivery methods into every existing order form, checkout page republished), `form` (any of the platform's 17 templates with its own field document), `chrome` (one shared header or footer on a real site menu — site name linked home, desktop menu, mobile drawer, search, cart and account icons), `menu` (a menu node bound to the site's menu, its links resolved), `overlay_attach` (a pop-up or quick view on the open page), `cart` (the site's cart drawer, when it has none; `relocalize` puts an existing one in the site's language) and `app` (a built-in app plus the pages it needs), `global_attach` / `global_detach` (put an EXISTING shared section on the open page, or take it off), `global_promote` (make a section on the page a NEW shared section) and `template_save` (save a section as a reusable template) |
143
143
  | `sb_undo` | Undo / redo this session's writes — page and form edits and `sb_api_call` PUTs, each named by tool and target, the open page's by default (`all: true` for every page); a page is refused if someone else saved it since. The platform's versions and history (`sb_page_version`) outlive this process |
144
144
 
145
- Forty tools, **1007 API operations** (373 of the 464 writes carrying a body shape read
145
+ Forty tools, **1011 API operations** (375 of the 466 writes carrying a body shape read
146
146
  off the handler), 125 elements, 96 binding sources. `sb_api_find`
147
147
  is an index rather than a tool per endpoint, so the tool list stays short while everything
148
148
  the platform can do stays reachable — and operations added to the platform arrive with the
package/README.vi.md CHANGED
@@ -106,7 +106,7 @@ nhét ngược lại vào mọi bản cài.
106
106
  | `sb_node_read` | Một node đầy đủ, kèm cảnh báo nếu nó là global dùng chung |
107
107
  | `sb_catalog_search` | Tìm element theo việc nó cần làm, dùng chính AI hints của nền tảng |
108
108
  | `sb_traits_for` | Inspector của element — tab, nhóm, control và mỗi control khai báo sẵn ghi vào đâu — kèm AI hints, default và luật chứa con |
109
- | `sb_add` | Thêm một element — hoặc cả cây con lồng nhau — trong một lần gọi; filter được tạo kèm sẵn các dòng lấy từ catalogue |
109
+ | `sb_add` | Thêm một element — hoặc cả cây con lồng nhau — trong một lần gọi; filter được tạo kèm sẵn các dòng lấy từ catalogue; `menu_item_id` biến một dòng menu thành mega panel |
110
110
  | `sb_set` | Ghi style/config/specials. Mặc định theo breakpoint |
111
111
  | `sb_move` | Chuyển node sang cha khác |
112
112
  | `sb_remove` | Xoá node và cả cây con |
@@ -138,7 +138,7 @@ nhét ngược lại vào mọi bản cài.
138
138
  | `sb_store` | Chạy một luồng cửa hàng bắt buộc đúng thứ tự — `checkout` (bốn lệnh ghi tạo nên trang thanh toán), `checkout_sync` (đưa phương thức thanh toán và giao hàng hiện tại vào mọi form đặt hàng đã có, publish lại trang thanh toán), `form` (một trong 17 template của nền tảng kèm field document của nó), `chrome` (một header hoặc footer dùng chung trên menu thật của site — tên site dẫn về trang chủ, menu desktop, drawer mobile, ô tìm kiếm, icon giỏ hàng và tài khoản), `menu` (một node menu bind vào menu của site, link đã phân giải), `overlay_attach` (một pop-up hay quick view trên trang đang mở), `cart` (ngăn giỏ hàng của site, khi chưa có; `relocalize` đưa ngăn giỏ đã có về ngôn ngữ của site), `app` (một app dựng sẵn kèm những trang nó cần), và `global_attach` / `global_detach` (đặt một section dùng chung ĐÃ CÓ lên trang đang mở, hoặc gỡ ra), `global_promote` (biến một section trên trang thành section dùng chung MỚI) và `template_save` (lưu một section làm mẫu dùng lại) |
139
139
  | `sb_undo` | Hoàn tác / làm lại các thao tác ghi trong phiên — chỉnh sửa trang, form và PUT qua `sb_api_call`, mỗi mục ghi tên tool và đối tượng, mặc định của trang đang mở (`all: true` cho mọi trang); trang bị từ chối nếu người khác đã lưu sau đó. Version và history của nền tảng (`sb_page_version`) sống lâu hơn process này |
140
140
 
141
- Bốn mươi tool, **1007 operation API** (373 trong 464 lệnh ghi có hình dạng body đọc thẳng
141
+ Bốn mươi tool, **1011 operation API** (375 trong 466 lệnh ghi có hình dạng body đọc thẳng
142
142
  từ handler), 125 element, 96 nguồn binding. `sb_api_find` là
143
143
  một chỉ mục chứ không phải mỗi endpoint một tool, nên danh sách tool vẫn ngắn trong khi mọi
144
144
  thứ nền tảng làm được vẫn với tới — và operation mới thêm bên nền tảng sẽ tự có sau lần
@@ -1,7 +1,7 @@
1
1
  export const SWAGGER_SOURCE = {
2
- "operations": 1007,
3
- "definitions": 437,
4
- "bodyCarrying": 484,
2
+ "operations": 1011,
3
+ "definitions": 444,
4
+ "bodyCarrying": 487,
5
5
  "bodyUndescribed": 122,
6
6
  "generatedFrom": "server/docs/swagger.json"
7
7
  };
@@ -28999,6 +28999,27 @@ export const API_OPERATIONS = [
28999
28999
  "bodyRef": "internal_publicapi.CodeComponentInput",
29000
29000
  "credential": "apiKey"
29001
29001
  },
29002
+ {
29003
+ "id": "post:/api/v1/code-components/preview",
29004
+ "method": "POST",
29005
+ "path": "/api/v1/code-components/preview",
29006
+ "tags": [
29007
+ "v1"
29008
+ ],
29009
+ "summary": "Render an unstored SSR bundle once, before uploading it",
29010
+ "params": [
29011
+ {
29012
+ "name": "preview",
29013
+ "in": "body",
29014
+ "required": true,
29015
+ "type": "object",
29016
+ "description": "Bundle, props schema and props"
29017
+ }
29018
+ ],
29019
+ "bodyDescribed": true,
29020
+ "bodyRef": "internal_publicapi.CodeComponentPreviewInput",
29021
+ "credential": "apiKey"
29022
+ },
29002
29023
  {
29003
29024
  "id": "get:/api/v1/code-components/{name}",
29004
29025
  "method": "GET",
@@ -31135,6 +31156,27 @@ export const API_OPERATIONS = [
31135
31156
  "bodyRef": "internal_publicapi.PageDocumentInput",
31136
31157
  "credential": "apiKey"
31137
31158
  },
31159
+ {
31160
+ "id": "get:/api/v1/pages/{id}/preview",
31161
+ "method": "GET",
31162
+ "path": "/api/v1/pages/{id}/preview",
31163
+ "tags": [
31164
+ "v1"
31165
+ ],
31166
+ "summary": "Mint a draft-preview link for one page",
31167
+ "params": [
31168
+ {
31169
+ "name": "id",
31170
+ "in": "path",
31171
+ "required": true,
31172
+ "type": "string",
31173
+ "description": "Page ID"
31174
+ }
31175
+ ],
31176
+ "bodyDescribed": false,
31177
+ "bodyRef": null,
31178
+ "credential": "apiKey"
31179
+ },
31138
31180
  {
31139
31181
  "id": "post:/api/v1/pages/{id}/publish",
31140
31182
  "method": "POST",
@@ -31394,6 +31436,48 @@ export const API_OPERATIONS = [
31394
31436
  "bodyRef": "internal_publicapi.ProductInput",
31395
31437
  "credential": "apiKey"
31396
31438
  },
31439
+ {
31440
+ "id": "get:/api/v1/site-settings",
31441
+ "method": "GET",
31442
+ "path": "/api/v1/site-settings",
31443
+ "tags": [
31444
+ "v1"
31445
+ ],
31446
+ "summary": "Read or save the site's settings",
31447
+ "params": [
31448
+ {
31449
+ "name": "siteSettings",
31450
+ "in": "body",
31451
+ "required": false,
31452
+ "type": "object",
31453
+ "description": "The settings to save (PUT only)"
31454
+ }
31455
+ ],
31456
+ "bodyDescribed": true,
31457
+ "bodyRef": "internal_publicapi.SiteSettingsInput",
31458
+ "credential": "apiKey"
31459
+ },
31460
+ {
31461
+ "id": "put:/api/v1/site-settings",
31462
+ "method": "PUT",
31463
+ "path": "/api/v1/site-settings",
31464
+ "tags": [
31465
+ "v1"
31466
+ ],
31467
+ "summary": "Read or save the site's settings",
31468
+ "params": [
31469
+ {
31470
+ "name": "siteSettings",
31471
+ "in": "body",
31472
+ "required": false,
31473
+ "type": "object",
31474
+ "description": "The settings to save (PUT only)"
31475
+ }
31476
+ ],
31477
+ "bodyDescribed": true,
31478
+ "bodyRef": "internal_publicapi.SiteSettingsInput",
31479
+ "credential": "apiKey"
31480
+ },
31397
31481
  {
31398
31482
  "id": "get:/api/v1/theme",
31399
31483
  "method": "GET",
@@ -40619,6 +40703,29 @@ export const API_DEFINITIONS = {
40619
40703
  }
40620
40704
  }
40621
40705
  },
40706
+ "internal_publicapi.CodeComponentPreviewInput": {
40707
+ "type": "object",
40708
+ "properties": {
40709
+ "props": {
40710
+ "type": "object",
40711
+ "additionalProperties": {}
40712
+ },
40713
+ "propsSchema": {
40714
+ "type": "object"
40715
+ },
40716
+ "ssrBundle": {
40717
+ "type": "string"
40718
+ }
40719
+ }
40720
+ },
40721
+ "internal_publicapi.CodeComponentPreviewResponse": {
40722
+ "type": "object",
40723
+ "properties": {
40724
+ "html": {
40725
+ "type": "string"
40726
+ }
40727
+ }
40728
+ },
40622
40729
  "internal_publicapi.CodeComponentResponse": {
40623
40730
  "type": "object",
40624
40731
  "properties": {
@@ -42057,6 +42164,23 @@ export const API_DEFINITIONS = {
42057
42164
  }
42058
42165
  }
42059
42166
  },
42167
+ "internal_publicapi.PagePreview": {
42168
+ "type": "object",
42169
+ "properties": {
42170
+ "url": {
42171
+ "description": "URL opens the page's saved draft as a visitor would see it. Signed, valid\nfor one hour, needs no credential: whoever holds it can view the draft.",
42172
+ "type": "string"
42173
+ }
42174
+ }
42175
+ },
42176
+ "internal_publicapi.PagePreviewResponse": {
42177
+ "type": "object",
42178
+ "properties": {
42179
+ "preview": {
42180
+ "$ref": "#/definitions/internal_publicapi.PagePreview"
42181
+ }
42182
+ }
42183
+ },
42060
42184
  "internal_publicapi.PageResponse": {
42061
42185
  "type": "object",
42062
42186
  "properties": {
@@ -42281,16 +42405,49 @@ export const API_DEFINITIONS = {
42281
42405
  }
42282
42406
  }
42283
42407
  },
42284
- "internal_publicapi.Theme": {
42408
+ "internal_publicapi.SiteSettings": {
42409
+ "type": "object",
42410
+ "properties": {
42411
+ "document": {
42412
+ "description": "Document is null until settings have been saved.",
42413
+ "type": "object"
42414
+ },
42415
+ "updatedAt": {
42416
+ "description": "UpdatedAt is \"\" until settings have been saved. Send it back as\nexpectedUpdatedAt.",
42417
+ "type": "string"
42418
+ }
42419
+ }
42420
+ },
42421
+ "internal_publicapi.SiteSettingsInput": {
42285
42422
  "type": "object",
42286
42423
  "properties": {
42287
42424
  "document": {
42288
- "description": "Document is null until a theme has been saved.",
42289
42425
  "type": "array",
42290
42426
  "items": {
42291
42427
  "type": "integer"
42292
42428
  }
42293
42429
  },
42430
+ "expectedUpdatedAt": {
42431
+ "description": "ExpectedUpdatedAt is the `updatedAt` you read (\"\" when none was saved\nyet). REQUIRED to be present: a settings save replaces the whole document\nand is live at once, so a blind write is refused rather than defaulted.",
42432
+ "type": "string"
42433
+ }
42434
+ }
42435
+ },
42436
+ "internal_publicapi.SiteSettingsResponse": {
42437
+ "type": "object",
42438
+ "properties": {
42439
+ "siteSettings": {
42440
+ "$ref": "#/definitions/internal_publicapi.SiteSettings"
42441
+ }
42442
+ }
42443
+ },
42444
+ "internal_publicapi.Theme": {
42445
+ "type": "object",
42446
+ "properties": {
42447
+ "document": {
42448
+ "description": "Document is null until a theme has been saved.",
42449
+ "type": "object"
42450
+ },
42294
42451
  "updatedAt": {
42295
42452
  "description": "UpdatedAt is \"\" until a theme has been saved. Send it back as\nexpectedUpdatedAt.",
42296
42453
  "type": "string"
@@ -66,6 +66,7 @@ export const APP_SCAFFOLDS = {
66
66
  "specials": {
67
67
  "htmlTag": "p",
68
68
  "moreButtonEnabled": false,
69
+ "countFormat": "",
69
70
  "stylePreset": "text-dataset-default"
70
71
  },
71
72
  "responsive": {},
@@ -112,6 +113,7 @@ export const APP_SCAFFOLDS = {
112
113
  "specials": {
113
114
  "htmlTag": "p",
114
115
  "moreButtonEnabled": false,
116
+ "countFormat": "",
115
117
  "stylePreset": "text-dataset-default"
116
118
  },
117
119
  "responsive": {},
@@ -158,6 +160,7 @@ export const APP_SCAFFOLDS = {
158
160
  "specials": {
159
161
  "htmlTag": "p",
160
162
  "moreButtonEnabled": false,
163
+ "countFormat": "",
161
164
  "stylePreset": "text-dataset-default"
162
165
  },
163
166
  "responsive": {},
@@ -254,6 +257,7 @@ export const APP_SCAFFOLDS = {
254
257
  "specials": {
255
258
  "htmlTag": "p",
256
259
  "moreButtonEnabled": false,
260
+ "countFormat": "",
257
261
  "stylePreset": "text-dataset-default"
258
262
  },
259
263
  "responsive": {},
@@ -589,6 +593,7 @@ export const APP_SCAFFOLDS = {
589
593
  "specials": {
590
594
  "htmlTag": "p",
591
595
  "moreButtonEnabled": false,
596
+ "countFormat": "",
592
597
  "stylePreset": "text-dataset-default"
593
598
  },
594
599
  "responsive": {},
@@ -635,6 +640,7 @@ export const APP_SCAFFOLDS = {
635
640
  "specials": {
636
641
  "htmlTag": "p",
637
642
  "moreButtonEnabled": false,
643
+ "countFormat": "",
638
644
  "stylePreset": "text-dataset-default"
639
645
  },
640
646
  "responsive": {},
@@ -1,7 +1,7 @@
1
1
  export const DEAD_KEY_SOURCE = {
2
- "files": 6453,
3
- "identifiers": 118047,
4
- "seededKeys": 465,
2
+ "files": 6495,
3
+ "identifiers": 118729,
4
+ "seededKeys": 470,
5
5
  "dead": 0
6
6
  };
7
7
  /**
@@ -16026,7 +16026,7 @@ export const ELEMENTS = {
16026
16026
  "Use a consistent image ratio (config.featureImageRatio) so the layout does not jump between images — default is a uniform 1:1 square; \"auto\" uses each image's natural size.",
16027
16027
  "Hover-zoom is on by default at 150% (config.hoverZoomValue); set it to 100 to disable, or raise it up to 300 for a closer zoom.",
16028
16028
  "Nav arrows sit \"inside\" (overlaid) or \"outside\" the image via config.listNavPosition.",
16029
- "config.hoverSwapImage shows the NEXT gallery photo while the pointer is on the tile — the product-grid effect. It needs a gallery of 2+, is off by default, and does nothing on a touch screen (no pointer), so a phone keeps the first photo."
16029
+ "config.hoverSwapImage fades in the NEXT gallery photo while the pointer is on the tile OR anywhere on the linked product card around it — the product-grid effect, nothing else to set. It needs a gallery of 2+ (a product with one photo just holds still), is off by default, and does nothing on a touch screen (no pointer), so a phone keeps the first photo. A product-bound tile shown with NO product in context renders its grey placeholders, and the swap then fades to the next placeholder."
16030
16030
  ],
16031
16031
  "semantics": [
16032
16032
  "product-image",
@@ -17123,7 +17123,9 @@ export const ELEMENTS = {
17123
17123
  "direction": "vertical",
17124
17124
  "gap": 8
17125
17125
  },
17126
- "optionGap": ""
17126
+ "optionGap": "",
17127
+ "showAttributes": [],
17128
+ "pickAction": "select"
17127
17129
  },
17128
17130
  "specials": {
17129
17131
  "displayType": "select",
@@ -17356,7 +17358,9 @@ export const ELEMENTS = {
17356
17358
  "key": "variant_display",
17357
17359
  "label": "Variant display",
17358
17360
  "controls": [
17359
- "variant_display"
17361
+ "variant_display",
17362
+ "variant_show_attributes",
17363
+ "variant_pick_action"
17360
17364
  ]
17361
17365
  },
17362
17366
  {
@@ -17452,6 +17456,8 @@ export const ELEMENTS = {
17452
17456
  "displayType",
17453
17457
  "defaultVariant",
17454
17458
  "variant_display",
17459
+ "variant_show_attributes",
17460
+ "variant_pick_action",
17455
17461
  "variant_label",
17456
17462
  "variant_option",
17457
17463
  "width_select",
@@ -17483,6 +17489,10 @@ export const ELEMENTS = {
17483
17489
  "Seed config.attributes with { name, values } objects — one per product attribute",
17484
17490
  "Use specials.displayType: \"select\" for a dropdown, \"image_label\" for image+label buttons, or \"image\" for image swatches",
17485
17491
  "Use specials.defaultVariant.enabled + values to pre-select a value per attribute",
17492
+ "A product CARD in a list (product-list / dataset card) should usually show only the colour axis: set config.showAttributes to that one attribute name (e.g. [\"Color\"] or [\"Màu sắc\"]) and leave Size for the product page buy box, which keeps showAttributes empty (= every attribute)",
17493
+ "config.showAttributes matches attribute names trimmed and case-insensitively, keeps the product order, and drops a name the product does not have",
17494
+ "config.pickAction: \"add_to_cart\" turns every value into a quick-add button — clicking a size selects it AND adds that variant (quantity 1) to the cart, keeping any colour already picked elsewhere on the card. Use it for a product-CARD quick add (showAttributes [\"Size\"], specials.displayType \"image_label\"), usually inside a flex-block overlay with config.revealOnHover true; keep the default \"select\" on a product page buy box, where an Add to cart button does the adding",
17495
+ "Sold-out values are crossed out automatically on the published page (both modes); in \"add_to_cart\" mode they cannot be clicked. Do not hand-style or hide them",
17486
17496
  "Style the attribute labels through the product-variant-label satellite and the options through the product-variant-option satellite",
17487
17497
  "Do not add children — the blocks, labels and options are rendered internally"
17488
17498
  ],
@@ -27854,8 +27864,10 @@ export const ELEMENTS = {
27854
27864
  "specials": {
27855
27865
  "mode": "percent",
27856
27866
  "text": "Sale",
27867
+ "tag": "",
27857
27868
  "boundPriceCents": "",
27858
- "boundCompareCents": ""
27869
+ "boundCompareCents": "",
27870
+ "boundTags": ""
27859
27871
  },
27860
27872
  "style": {
27861
27873
  "display": "inline-flex",
@@ -27887,6 +27899,11 @@ export const ELEMENTS = {
27887
27899
  "source": "product.compareAtCents",
27888
27900
  "field": "specials.boundCompareCents"
27889
27901
  },
27902
+ {
27903
+ "id": "bind-tags",
27904
+ "source": "product.tags",
27905
+ "field": "specials.boundTags"
27906
+ },
27890
27907
  {
27891
27908
  "id": "bind-product-id",
27892
27909
  "source": "product.id",
@@ -27911,6 +27928,11 @@ export const ELEMENTS = {
27911
27928
  "source": "product.compareAtCents",
27912
27929
  "field": "specials.boundCompareCents"
27913
27930
  },
27931
+ {
27932
+ "id": "bind-tags",
27933
+ "source": "product.tags",
27934
+ "field": "specials.boundTags"
27935
+ },
27914
27936
  {
27915
27937
  "id": "bind-product-id",
27916
27938
  "source": "product.id",
@@ -27933,6 +27955,11 @@ export const ELEMENTS = {
27933
27955
  "source": "product.compareAtCents",
27934
27956
  "field": "specials.boundCompareCents"
27935
27957
  },
27958
+ {
27959
+ "id": "bind-tags",
27960
+ "source": "product.tags",
27961
+ "field": "specials.boundTags"
27962
+ },
27936
27963
  {
27937
27964
  "id": "bind-product-id",
27938
27965
  "source": "product.id",
@@ -27955,6 +27982,11 @@ export const ELEMENTS = {
27955
27982
  "source": "product.compareAtCents",
27956
27983
  "field": "specials.boundCompareCents"
27957
27984
  },
27985
+ {
27986
+ "id": "bind-tags",
27987
+ "source": "product.tags",
27988
+ "field": "specials.boundTags"
27989
+ },
27958
27990
  {
27959
27991
  "id": "bind-product-id",
27960
27992
  "source": "product.id",
@@ -27977,6 +28009,11 @@ export const ELEMENTS = {
27977
28009
  "source": "product.compareAtCents",
27978
28010
  "field": "specials.boundCompareCents"
27979
28011
  },
28012
+ {
28013
+ "id": "bind-tags",
28014
+ "source": "product.tags",
28015
+ "field": "specials.boundTags"
28016
+ },
27980
28017
  {
27981
28018
  "id": "bind-product-id",
27982
28019
  "source": "product.id",
@@ -27999,6 +28036,11 @@ export const ELEMENTS = {
27999
28036
  "source": "product.compareAtCents",
28000
28037
  "field": "specials.boundCompareCents"
28001
28038
  },
28039
+ {
28040
+ "id": "bind-tags",
28041
+ "source": "product.tags",
28042
+ "field": "specials.boundTags"
28043
+ },
28002
28044
  {
28003
28045
  "id": "bind-product-id",
28004
28046
  "source": "product.id",
@@ -28021,6 +28063,11 @@ export const ELEMENTS = {
28021
28063
  "source": "product.compareAtCents",
28022
28064
  "field": "specials.boundCompareCents"
28023
28065
  },
28066
+ {
28067
+ "id": "bind-tags",
28068
+ "source": "product.tags",
28069
+ "field": "specials.boundTags"
28070
+ },
28024
28071
  {
28025
28072
  "id": "bind-product-id",
28026
28073
  "source": "product.id",
@@ -28043,6 +28090,11 @@ export const ELEMENTS = {
28043
28090
  "source": "product.compareAtCents",
28044
28091
  "field": "specials.boundCompareCents"
28045
28092
  },
28093
+ {
28094
+ "id": "bind-tags",
28095
+ "source": "product.tags",
28096
+ "field": "specials.boundTags"
28097
+ },
28046
28098
  {
28047
28099
  "id": "bind-product-id",
28048
28100
  "source": "product.id",
@@ -28065,6 +28117,11 @@ export const ELEMENTS = {
28065
28117
  "source": "product.compareAtCents",
28066
28118
  "field": "specials.boundCompareCents"
28067
28119
  },
28120
+ {
28121
+ "id": "bind-tags",
28122
+ "source": "product.tags",
28123
+ "field": "specials.boundTags"
28124
+ },
28068
28125
  {
28069
28126
  "id": "bind-product-id",
28070
28127
  "source": "product.id",
@@ -28084,7 +28141,8 @@ export const ELEMENTS = {
28084
28141
  "product",
28085
28142
  "productId",
28086
28143
  "boundPriceCents",
28087
- "boundCompareCents"
28144
+ "boundCompareCents",
28145
+ "boundTags"
28088
28146
  ]
28089
28147
  },
28090
28148
  {
@@ -28092,7 +28150,8 @@ export const ELEMENTS = {
28092
28150
  "label": "Content",
28093
28151
  "controls": [
28094
28152
  "sale_badge_mode",
28095
- "sale_badge_text"
28153
+ "sale_badge_text",
28154
+ "sale_badge_tag"
28096
28155
  ]
28097
28156
  },
28098
28157
  {
@@ -28186,8 +28245,10 @@ export const ELEMENTS = {
28186
28245
  "productId",
28187
28246
  "boundPriceCents",
28188
28247
  "boundCompareCents",
28248
+ "boundTags",
28189
28249
  "sale_badge_mode",
28190
28250
  "sale_badge_text",
28251
+ "sale_badge_tag",
28191
28252
  "width_select",
28192
28253
  "height_select",
28193
28254
  "size_bounds",
@@ -28207,18 +28268,21 @@ export const ELEMENTS = {
28207
28268
  "animation",
28208
28269
  "class_css"
28209
28270
  ],
28210
- "description": "A small \"−20%\" / \"Sale\" pill for a product card or product page, computed at render time from the bound product's price and compare-at cents. Purely static — no island, no runtime module. Two content modes: specials.mode \"percent\" shows a computed \"−N%\"; \"text\" shows an authored word (default \"Sale\"). Renders nothing at all when the product has no real saving (no compare-at price, or compare-at at or below price) — it never invents a discount.",
28271
+ "description": "A small pill for a product card or product page: \"−20%\" / \"Sale\" computed from the bound product's price and compare-at cents, or a merchandising label like \"NEW\" / \"BÁN CHẠY\" driven by the product's tags. Purely static — no island, no runtime module. Three content modes: specials.mode \"percent\" shows a computed \"−N%\"; \"text\" shows an authored word (default \"Sale\"); \"tag\" shows specials.text only when the bound product carries the tag in specials.tag (trimmed, case-insensitive). percent/text render nothing when the product has no real saving (no compare-at price, or compare-at at or below price) — it never invents a discount; tag mode renders nothing when the product lacks the tag.",
28211
28272
  "useWhen": [
28212
28273
  "A product card or product page needs a quick visual flag that the item is on sale",
28213
- "Beside a pricing-dataset price display, to draw attention to the struck-through compare-at"
28274
+ "Beside a pricing-dataset price display, to draw attention to the struck-through compare-at",
28275
+ "A product card needs a NEW / BEST SELLER / BÁN CHẠY pill on only the products the merchant tagged — use specials.mode \"tag\""
28214
28276
  ],
28215
28277
  "avoidWhen": [
28216
28278
  "The exact amount saved needs to show in money (\"tiết kiệm 50.000₫\") — this element only shows a percentage or a fixed word, never a formatted amount",
28217
- "The badge should show on every product regardless of a real discount — that is authored text, not this element"
28279
+ "The badge should show on every product regardless of a real discount or tag — that is authored text, not this element"
28218
28280
  ],
28219
28281
  "contentTips": [
28220
28282
  "Leave specials.mode as \"percent\" for a computed \"−N%\"; set it to \"text\" for a generic word like \"Sale\" instead",
28221
- "The percentage and the visibility both come from the bound product — nothing to seed here beyond the mode/text choice"
28283
+ "The percentage and the visibility both come from the bound product — nothing to seed here beyond the mode/text choice",
28284
+ "For a NEW / BEST SELLER pill set specials.mode \"tag\", specials.tag to the product tag to match (e.g. \"new\", \"ban-chay\") and specials.text to the word shown (e.g. \"NEW\", \"BÁN CHẠY\"); one badge per tag — stack two badges for two pills",
28285
+ "Tag mode reads specials.boundTags, filled by the binding {\"id\":\"bind-tags\",\"source\":\"product.tags\",\"field\":\"specials.boundTags\"} that the editor adds on drop. A badge authored OUTSIDE the editor (sb page source, MCP sb_add) must carry that binding — or be bound with sb_bind product.tags → specials.boundTags — or it renders nothing"
28222
28286
  ],
28223
28287
  "semantics": [
28224
28288
  "product",
@@ -28227,7 +28291,10 @@ export const ELEMENTS = {
28227
28291
  "ecommerce",
28228
28292
  "price",
28229
28293
  "badge",
28230
- "promotion"
28294
+ "promotion",
28295
+ "tag",
28296
+ "new",
28297
+ "bestseller"
28231
28298
  ]
28232
28299
  },
28233
28300
  "flash-sale-price": {
@@ -29387,6 +29454,7 @@ export const ELEMENTS = {
29387
29454
  "specials": {
29388
29455
  "htmlTag": "p",
29389
29456
  "moreButtonEnabled": false,
29457
+ "countFormat": "",
29390
29458
  "stylePreset": "text-dataset-default"
29391
29459
  },
29392
29460
  "bindings": [
@@ -32687,6 +32755,31 @@ export const ELEMENTS = {
32687
32755
  "record_format"
32688
32756
  ]
32689
32757
  },
32758
+ {
32759
+ "key": "result_count",
32760
+ "label": "Result count",
32761
+ "controls": [
32762
+ "count_format",
32763
+ "kind",
32764
+ "productId",
32765
+ "categoryId",
32766
+ "datasetSource",
32767
+ "recordField",
32768
+ "recordFieldType",
32769
+ "recordFormat",
32770
+ "textValue",
32771
+ "descriptionDisplayType",
32772
+ "descriptionLines",
32773
+ "clampTitle",
32774
+ "moreText",
32775
+ "lessText",
32776
+ "moreButtonColor",
32777
+ "icon",
32778
+ "textGlobalStyle",
32779
+ "htmlTag",
32780
+ "moreButtonEnabled"
32781
+ ]
32782
+ },
32690
32783
  {
32691
32784
  "key": "description_display",
32692
32785
  "label": "Description display",
@@ -32820,6 +32913,7 @@ export const ELEMENTS = {
32820
32913
  "article",
32821
32914
  "record_field",
32822
32915
  "record_format",
32916
+ "count_format",
32823
32917
  "description_display",
32824
32918
  "width_select",
32825
32919
  "height_select",
@@ -32849,7 +32943,8 @@ export const ELEMENTS = {
32849
32943
  "useWhen": [
32850
32944
  "Product title, vendor, short summary, or description text in a product layout",
32851
32945
  "A long product description that should collapse to a few lines with a \"show more\" toggle",
32852
- "Product text that needs hover/active styling"
32946
+ "Product text that needs hover/active styling",
32947
+ "A result count beside a product grid (\"24 sản phẩm\") — config.datasetSource \"list\", kind \"count\""
32853
32948
  ],
32854
32949
  "avoidWhen": [
32855
32950
  "Generic static copy not tied to a product — use text or heading",
@@ -32861,7 +32956,8 @@ export const ELEMENTS = {
32861
32956
  "For a description, set config.descriptionDisplayType to \"Compact\" and config.descriptionLines to clamp it; enable specials.moreButtonEnabled for the toggle",
32862
32957
  "Customise config.moreText / config.lessText and config.icon (the chevron) for the toggle",
32863
32958
  "Style per state (default / hover / active) via the state switcher",
32864
- "In a record list on a number/integer field, set config.recordFormat to \"money\" to print it in the site currency (record.money.<fieldId>)"
32959
+ "In a record list on a number/integer field, set config.recordFormat to \"money\" to print it in the site currency (record.money.<fieldId>)",
32960
+ "RESULT COUNT: config.datasetSource \"list\" + config.kind \"count\" prints specials.countFormat with \"{count}\" replaced by how many products the PAGE's product list holds (the first product list on the page; filters and the category page narrow it). Place it outside the list, e.g. beside the sort select; no bindings"
32865
32961
  ],
32866
32962
  "semantics": [
32867
32963
  "product",
@@ -36729,7 +36825,8 @@ export const BOUND_SPECIALS = {
36729
36825
  ],
36730
36826
  "sale-badge": [
36731
36827
  "boundCompareCents",
36732
- "boundPriceCents"
36828
+ "boundPriceCents",
36829
+ "boundTags"
36733
36830
  ],
36734
36831
  "spline-scene": [
36735
36832
  "boundModel"
@@ -38804,6 +38901,17 @@ export const TRAIT_WRITES = {
38804
38901
  }
38805
38902
  ]
38806
38903
  },
38904
+ "sale_badge_tag": {
38905
+ "key": "sale_badge_tag",
38906
+ "label": "Tag",
38907
+ "writes": [
38908
+ {
38909
+ "target": "specials",
38910
+ "writeKey": "tag",
38911
+ "type": "string"
38912
+ }
38913
+ ]
38914
+ },
38807
38915
  "flash_sale_show_percent": {
38808
38916
  "key": "flash_sale_show_percent",
38809
38917
  "label": "Show −X%",
@@ -41410,7 +41518,8 @@ export const ELEMENT_VALUES = {
41410
41518
  "writeKey": "mode",
41411
41519
  "values": [
41412
41520
  "percent",
41413
- "text"
41521
+ "text",
41522
+ "tag"
41414
41523
  ],
41415
41524
  "readBy": "sale_badge_mode (editor picker)"
41416
41525
  }
@@ -41481,6 +41590,8 @@ export const BASE_ONLY_CONFIG = [
41481
41590
  "backgroundSceneModelUrl",
41482
41591
  "rowLimit",
41483
41592
  "clampTitle",
41593
+ "showAttributes",
41594
+ "pickAction",
41484
41595
  "optionSource",
41485
41596
  "recordAggregates",
41486
41597
  "recordCollectionId",
@@ -377,6 +377,7 @@ export const OVERLAY_SEEDS = {
377
377
  "specials": {
378
378
  "htmlTag": "h4",
379
379
  "moreButtonEnabled": false,
380
+ "countFormat": "",
380
381
  "stylePreset": "text-dataset-default"
381
382
  },
382
383
  "responsive": {},
@@ -1369,6 +1370,7 @@ export const OVERLAY_SEEDS = {
1369
1370
  "specials": {
1370
1371
  "htmlTag": "h3",
1371
1372
  "moreButtonEnabled": false,
1373
+ "countFormat": "",
1372
1374
  "stylePreset": "text-dataset-default"
1373
1375
  },
1374
1376
  "responsive": {},
@@ -1631,6 +1633,8 @@ export const OVERLAY_SEEDS = {
1631
1633
  "gap": 8
1632
1634
  },
1633
1635
  "optionGap": "",
1636
+ "showAttributes": [],
1637
+ "pickAction": "select",
1634
1638
  "variantLabelId": "qv_12",
1635
1639
  "variantOptionId": "qv_13"
1636
1640
  },
@@ -1785,6 +1789,7 @@ export const OVERLAY_SEEDS = {
1785
1789
  "specials": {
1786
1790
  "htmlTag": "p",
1787
1791
  "moreButtonEnabled": true,
1792
+ "countFormat": "",
1788
1793
  "stylePreset": "text-dataset-default"
1789
1794
  },
1790
1795
  "responsive": {},
@@ -2427,6 +2432,7 @@ export const CART_SEEDS = {
2427
2432
  "specials": {
2428
2433
  "htmlTag": "h4",
2429
2434
  "moreButtonEnabled": false,
2435
+ "countFormat": "",
2430
2436
  "stylePreset": "text-dataset-default"
2431
2437
  },
2432
2438
  "responsive": {},
@@ -3265,6 +3271,7 @@ export const CART_SEEDS = {
3265
3271
  "specials": {
3266
3272
  "htmlTag": "h4",
3267
3273
  "moreButtonEnabled": false,
3274
+ "countFormat": "",
3268
3275
  "stylePreset": "text-dataset-default"
3269
3276
  },
3270
3277
  "responsive": {},
@@ -1,10 +1,10 @@
1
1
  export const SHAPE_SOURCE = {
2
- "writeOperations": 464,
3
- "shaped": 373,
4
- "fromHandlers": 362,
5
- "fromSwaggerOnly": 11,
2
+ "writeOperations": 466,
3
+ "shaped": 375,
4
+ "fromHandlers": 363,
5
+ "fromSwaggerOnly": 12,
6
6
  "withReadOnly": 29,
7
- "structsRead": 3847
7
+ "structsRead": 3871
8
8
  };
9
9
  export const REQUEST_SHAPES = {
10
10
  "post:/api/ai/credits": {
@@ -10288,6 +10288,24 @@ export const REQUEST_SHAPES = {
10288
10288
  "source": "go",
10289
10289
  "goType": "CodeComponentInput"
10290
10290
  },
10291
+ "post:/api/v1/code-components/preview": {
10292
+ "fields": [
10293
+ {
10294
+ "name": "ssrBundle",
10295
+ "type": "string"
10296
+ },
10297
+ {
10298
+ "name": "propsSchema",
10299
+ "type": "object"
10300
+ },
10301
+ {
10302
+ "name": "props",
10303
+ "type": "{ [string]: any }"
10304
+ }
10305
+ ],
10306
+ "source": "go",
10307
+ "goType": "CodeComponentPreviewInput"
10308
+ },
10291
10309
  "post:/api/v1/code-files": {
10292
10310
  "fields": [
10293
10311
  {
@@ -1,7 +1,7 @@
1
1
  // GENERATED by scripts/gen-catalog.ts — do not edit by hand.
2
2
  // The platform commit every other generated file here describes.
3
3
  export const PLATFORM_SOURCE = {
4
- "commit": "c02808e3c94b32379162c8436bcaf0c7a4b5a6a5",
5
- "committedAt": "2026-11-19T01:55:26+07:00",
4
+ "commit": "26df875d58484c33707c936fb88cb9fca2e3f54b",
5
+ "committedAt": "2026-11-19T22:16:47+07:00",
6
6
  "dirty": false
7
7
  };
@@ -897,6 +897,7 @@ export const PAGE_LAYOUT_SEEDS = {
897
897
  "specials": {
898
898
  "htmlTag": "h4",
899
899
  "moreButtonEnabled": false,
900
+ "countFormat": "",
900
901
  "stylePreset": "text-dataset-default"
901
902
  },
902
903
  "responsive": {},
@@ -943,6 +944,7 @@ export const PAGE_LAYOUT_SEEDS = {
943
944
  "specials": {
944
945
  "htmlTag": "p",
945
946
  "moreButtonEnabled": false,
947
+ "countFormat": "",
946
948
  "stylePreset": "text-dataset-default"
947
949
  },
948
950
  "responsive": {},
@@ -989,6 +991,7 @@ export const PAGE_LAYOUT_SEEDS = {
989
991
  "specials": {
990
992
  "htmlTag": "p",
991
993
  "moreButtonEnabled": false,
994
+ "countFormat": "",
992
995
  "stylePreset": "text-dataset-default"
993
996
  },
994
997
  "responsive": {},
@@ -2082,6 +2085,7 @@ export const STORE_PAGE_SEEDS = {
2082
2085
  "specials": {
2083
2086
  "htmlTag": "h3",
2084
2087
  "moreButtonEnabled": false,
2088
+ "countFormat": "",
2085
2089
  "stylePreset": "text-dataset-default"
2086
2090
  },
2087
2091
  "responsive": {},
@@ -2344,6 +2348,8 @@ export const STORE_PAGE_SEEDS = {
2344
2348
  "gap": 8
2345
2349
  },
2346
2350
  "optionGap": "",
2351
+ "showAttributes": [],
2352
+ "pickAction": "select",
2347
2353
  "variantLabelId": "sppro_12",
2348
2354
  "variantOptionId": "sppro_13"
2349
2355
  },
@@ -2498,6 +2504,7 @@ export const STORE_PAGE_SEEDS = {
2498
2504
  "specials": {
2499
2505
  "htmlTag": "p",
2500
2506
  "moreButtonEnabled": true,
2507
+ "countFormat": "",
2501
2508
  "stylePreset": "text-dataset-default"
2502
2509
  },
2503
2510
  "responsive": {},
@@ -2927,6 +2934,7 @@ export const STORE_PAGE_SEEDS = {
2927
2934
  "specials": {
2928
2935
  "htmlTag": "h3",
2929
2936
  "moreButtonEnabled": false,
2937
+ "countFormat": "",
2930
2938
  "stylePreset": "text-dataset-default"
2931
2939
  },
2932
2940
  "responsive": {},
@@ -3364,6 +3372,7 @@ export const STORE_PAGE_SEEDS = {
3364
3372
  "specials": {
3365
3373
  "htmlTag": "h4",
3366
3374
  "moreButtonEnabled": false,
3375
+ "countFormat": "",
3367
3376
  "stylePreset": "text-dataset-default"
3368
3377
  },
3369
3378
  "responsive": {},
@@ -4086,6 +4095,7 @@ export const STORE_PAGE_SEEDS = {
4086
4095
  "specials": {
4087
4096
  "htmlTag": "h4",
4088
4097
  "moreButtonEnabled": false,
4098
+ "countFormat": "",
4089
4099
  "stylePreset": "text-dataset-default"
4090
4100
  },
4091
4101
  "responsive": {},
@@ -4381,6 +4391,7 @@ export const STORE_PAGE_SEEDS = {
4381
4391
  "specials": {
4382
4392
  "htmlTag": "h3",
4383
4393
  "moreButtonEnabled": false,
4394
+ "countFormat": "",
4384
4395
  "stylePreset": "text-dataset-default"
4385
4396
  },
4386
4397
  "responsive": {},
@@ -4643,6 +4654,7 @@ export const STORE_PAGE_SEEDS = {
4643
4654
  "specials": {
4644
4655
  "htmlTag": "h4",
4645
4656
  "moreButtonEnabled": false,
4657
+ "countFormat": "",
4646
4658
  "stylePreset": "text-dataset-default"
4647
4659
  },
4648
4660
  "responsive": {},
@@ -4689,6 +4701,7 @@ export const STORE_PAGE_SEEDS = {
4689
4701
  "specials": {
4690
4702
  "htmlTag": "p",
4691
4703
  "moreButtonEnabled": false,
4704
+ "countFormat": "",
4692
4705
  "stylePreset": "text-dataset-default"
4693
4706
  },
4694
4707
  "responsive": {},
@@ -4735,6 +4748,7 @@ export const STORE_PAGE_SEEDS = {
4735
4748
  "specials": {
4736
4749
  "htmlTag": "p",
4737
4750
  "moreButtonEnabled": false,
4751
+ "countFormat": "",
4738
4752
  "stylePreset": "text-dataset-default"
4739
4753
  },
4740
4754
  "responsive": {},
@@ -5007,6 +5021,7 @@ export const STORE_PAGE_SEEDS = {
5007
5021
  "specials": {
5008
5022
  "htmlTag": "h3",
5009
5023
  "moreButtonEnabled": false,
5024
+ "countFormat": "",
5010
5025
  "stylePreset": "text-dataset-default"
5011
5026
  },
5012
5027
  "responsive": {},
@@ -5053,6 +5068,7 @@ export const STORE_PAGE_SEEDS = {
5053
5068
  "specials": {
5054
5069
  "htmlTag": "p",
5055
5070
  "moreButtonEnabled": false,
5071
+ "countFormat": "",
5056
5072
  "stylePreset": "text-dataset-default"
5057
5073
  },
5058
5074
  "responsive": {},
@@ -5099,6 +5115,7 @@ export const STORE_PAGE_SEEDS = {
5099
5115
  "specials": {
5100
5116
  "htmlTag": "p",
5101
5117
  "moreButtonEnabled": true,
5118
+ "countFormat": "",
5102
5119
  "stylePreset": "text-dataset-default"
5103
5120
  },
5104
5121
  "responsive": {},
@@ -1,9 +1,9 @@
1
1
  // GENERATED by scripts/gen-catalog.ts — do not edit by hand.
2
2
  // Source: <WB_REPO>/schema/src/elements/translatableFields.ts
3
3
  export const TRANSLATION_SOURCE = {
4
- "elements": 68,
5
- "pairs": 190,
6
- "neverKeys": 188,
4
+ "elements": 69,
5
+ "pairs": 191,
6
+ "neverKeys": 192,
7
7
  "entityTypes": 12
8
8
  };
9
9
  /** Every entity type a translation record can name, including "node". */
@@ -32,6 +32,9 @@ export const TRANSLATABLE_SPECIALS = {
32
32
  "popup": [
33
33
  "closeLabel"
34
34
  ],
35
+ "text-dataset": [
36
+ "countFormat"
37
+ ],
35
38
  "select": [
36
39
  "placeholder",
37
40
  "filterValues"
@@ -384,10 +387,12 @@ export const NEVER_TRANSLATED = [
384
387
  "boundCompareCents",
385
388
  "boundHref",
386
389
  "boundHrefLabel",
390
+ "boundImage",
387
391
  "boundModel",
388
392
  "boundMoneyOverride",
389
393
  "boundPriceCents",
390
394
  "boundProductURL",
395
+ "boundTags",
391
396
  "boundValue",
392
397
  "breakEnd",
393
398
  "breakStart",
@@ -446,6 +451,7 @@ export const NEVER_TRANSLATED = [
446
451
  "hrefParams",
447
452
  "html",
448
453
  "htmlTag",
454
+ "hydrateProps",
449
455
  "icon",
450
456
  "iconEnabled",
451
457
  "iconName",
@@ -544,6 +550,7 @@ export const NEVER_TRANSLATED = [
544
550
  "stepMode",
545
551
  "stylePreset",
546
552
  "symbolChar",
553
+ "tag",
547
554
  "target",
548
555
  "thresholdCents",
549
556
  "trackUrl",
@@ -560,6 +567,15 @@ export const TRANSLATABLE_FIELDS = {
560
567
  "key": "closeLabel"
561
568
  }
562
569
  ],
570
+ "text-dataset": [
571
+ {
572
+ "key": "countFormat",
573
+ "when": {
574
+ "key": "datasetSource",
575
+ "equals": "list"
576
+ }
577
+ }
578
+ ],
563
579
  "select": [
564
580
  {
565
581
  "key": "placeholder"
package/dist/core/tree.js CHANGED
@@ -186,3 +186,31 @@ export function appBlockRoot(doc, id) {
186
186
  return a;
187
187
  return null;
188
188
  }
189
+ /**
190
+ * Every row of a menu snapshot, depth first — the editor's `findRow`
191
+ * (features/menus/megaPanel.ts) and `findRowByPanelId` both walk this way.
192
+ */
193
+ export function menuRows(raw, out = []) {
194
+ if (!Array.isArray(raw))
195
+ return out;
196
+ for (const r of raw) {
197
+ if (!r || typeof r !== 'object')
198
+ continue;
199
+ out.push(r);
200
+ menuRows(r.items, out);
201
+ }
202
+ return out;
203
+ }
204
+ /**
205
+ * A row's mega panel, resolved the way the renderers do (menu/html.go
206
+ * panelChild, the store's menuRowPanel): the id must name a `menu-panel` that
207
+ * really is a CHILD of this menu. A dangling id reads as no panel.
208
+ */
209
+ export function rowPanel(doc, menuId, row) {
210
+ const pid = row.panelId;
211
+ if (typeof pid !== 'string' || pid === '')
212
+ return null;
213
+ if (!doc.nodes[menuId]?.data.nodes.includes(pid))
214
+ return null;
215
+ return doc.nodes[pid]?.data.type === 'menu-panel' ? pid : null;
216
+ }
@@ -1,4 +1,4 @@
1
- import { isOverlay, subtreeIds, ancestors, appBlockRoot, SPEC_GLOBAL_ID, SPEC_GLOBAL_KIND, SPEC_GLOBAL_REF, } from '../../core/tree.js';
1
+ import { isOverlay, subtreeIds, ancestors, appBlockRoot, menuRows, rowPanel, SPEC_GLOBAL_ID, SPEC_GLOBAL_KIND, SPEC_GLOBAL_REF, } from '../../core/tree.js';
2
2
  import { ELEMENTS, ELEMENT_SEEDS, SATELLITE_RULES } from '../../catalog/elements.generated.js';
3
3
  import { bindingsForConfig, createNode, mintSatellites, seedFor } from './node.js';
4
4
  import { refuseSecondTemplate } from './traps.js';
@@ -44,9 +44,40 @@ function isPriceLeaf(parentType, parentKind, child) {
44
44
  }
45
45
  function requireContainer(parentType, parentId, parentKind, child) {
46
46
  if (!ELEMENTS[parentType]?.isContainer && !isPriceLeaf(parentType, parentKind, child)) {
47
- throw new Error(`sbuilder: ${parentId} is a ${parentType}, which is not a container — it cannot hold children.`);
47
+ // The one child a menu holds is a MEGA PANEL, and it is only ever born
48
+ // bound to a row — so the refusal names the call that makes one.
49
+ const mega = parentType === 'menu' && child?.type === 'menu-panel'
50
+ ? ` A mega panel is added on its own: sb_add parent_id ${parentId} with menu_item_id ` +
51
+ '(the row id from its specials.menuItems) and spec {type:"menu-panel"}.'
52
+ : '';
53
+ throw new Error(`sbuilder: ${parentId} is a ${parentType}, which is not a container — it cannot hold children.${mega}`);
48
54
  }
49
55
  }
56
+ /**
57
+ * A MEGA PANEL for one menu row — the editor's convertMenuRowToPanel
58
+ * (stores/node.ts): the panel is appended to the MENU's `data.nodes`, and the
59
+ * row (matched by id at any depth) gets `panelId` in the same save. Returns the
60
+ * cloned snapshot whose matching row the caller points at the minted panel.
61
+ */
62
+ function megaPanelRows(doc, menuId, menuItemId) {
63
+ const menu = doc.node(menuId);
64
+ const rows = structuredClone(menu.specials?.menuItems ?? []);
65
+ const all = menuRows(rows);
66
+ const row = all.find((r) => r.id === menuItemId);
67
+ if (!row) {
68
+ const known = all.map((r) => r.id).filter((x) => typeof x === 'string' && x !== '');
69
+ throw new Error(`sbuilder: the menu ${menuId} has no row "${menuItemId}". Its rows: ` +
70
+ (known.length ? known.join(', ') : 'none (bind it first with sb_store action:"menu")') +
71
+ '.');
72
+ }
73
+ const existing = rowPanel(doc.doc, menuId, row);
74
+ if (existing) {
75
+ throw new Error(`sbuilder: row "${menuItemId}" of ${menuId} already has a mega panel (${existing}). Add ` +
76
+ `content into it with sb_add parent_id ${existing}, restyle it with sb_set, or sb_remove ` +
77
+ `${existing} to put the row back on its link list.`);
78
+ }
79
+ return { rows, row };
80
+ }
50
81
  function requireAllowed(parentType, childType, g) {
51
82
  const child = ELEMENTS[childType];
52
83
  if (!child) {
@@ -130,9 +161,14 @@ function seeded(spec, rule, owner) {
130
161
  * patches come out flat in CREATION ORDER, so a peer applying them left to right
131
162
  * never sees a child referenced before the node exists.
132
163
  */
133
- export function addSubtree(doc, parentId, spec, index, guard) {
164
+ export function addSubtree(doc, parentId, spec, index, guard, menuItemId) {
134
165
  const parent = doc.node(parentId);
135
166
  soft(guard, () => refuseAppBlockParent(doc, parentId, 'adding'));
167
+ if (menuItemId !== undefined && !(parent.data.type === 'menu' && spec.type === 'menu-panel')) {
168
+ throw new Error(`sbuilder: menu_item_id names the menu row a mega panel serves, so it applies only to a ` +
169
+ `menu-panel added directly under a menu — not to a ${spec.type} under a ${parent.data.type}.`);
170
+ }
171
+ const mega = menuItemId !== undefined ? megaPanelRows(doc, parentId, menuItemId) : undefined;
136
172
  // A SATELLITE the parent declares (`icon` → `cart-count` as `cartCountId`) is
137
173
  // attached the way the editor's `addDetachedNode` does: `data.parent` = the
138
174
  // host, NOT in its `data.nodes`, and the host points at it from base config.
@@ -149,7 +185,7 @@ export function addSubtree(doc, parentId, spec, index, guard) {
149
185
  // A DOCUMENT'S OWN ROOT always holds children — including a FORM document's,
150
186
  // whose root is a `form`: a leaf on a page (its meta says isContainer:false,
151
187
  // because the fields live elsewhere) and the field list in its own document.
152
- if (parentId !== doc.doc.root_node_id)
188
+ if (parentId !== doc.doc.root_node_id && !mega)
153
189
  requireContainer(parent.data.type, parentId, parent.config?.kind, spec);
154
190
  requireAllowed(parent.data.type, spec.type, guard);
155
191
  soft(guard, () => refuseBesideSegments(doc, parentId, spec.type));
@@ -269,6 +305,10 @@ export function addSubtree(doc, parentId, spec, index, guard) {
269
305
  }
270
306
  const at = index ?? indexBeforeFormBar(doc, parentId, spec.type);
271
307
  patches.push({ op: 'insert', path: ['nodes', parentId, 'data', 'nodes'], index: at, value: rootId });
308
+ if (mega) {
309
+ mega.row.panelId = rootId;
310
+ patches.push({ op: 'set', path: ['nodes', parentId, 'specials', 'menuItems'], value: mega.rows });
311
+ }
272
312
  return { patches, ids, idOf };
273
313
  }
274
314
  /**
@@ -616,6 +656,7 @@ function rebindPatch(doc, id, keys) {
616
656
  * (not part of this document at all).
617
657
  */
618
658
  export function duplicateNode(doc, id, guard) {
659
+ refuseMenuPanel(doc, id, 'Duplicating', 'a copy would be named by no row and render nowhere. Give another row its own panel with sb_add parent_id <menu> menu_item_id <row id>');
619
660
  const parentId = doc.has(id) ? doc.node(id).data.parent : null;
620
661
  const at = parentId && doc.has(parentId) ? doc.node(parentId).data.nodes.indexOf(id) : -1;
621
662
  return copyNodeInto(doc, id, doc, parentId ?? '', at < 0 ? APPEND : at + 1, guard);
@@ -718,8 +759,21 @@ export function copyNodeInto(src, id, target, parentId, index, guard) {
718
759
  patches.push({ op: 'insert', path: ['nodes', parentId, 'data', 'nodes'], index, value: rootId });
719
760
  return { patches, ids, map };
720
761
  }
762
+ /**
763
+ * A MENU'S MEGA PANEL lives only where its row points: moved out, the row names
764
+ * a node the menu no longer holds (the dropdown silently falls back to links);
765
+ * duplicated, the copy is named by no row. Both are refused.
766
+ */
767
+ function refuseMenuPanel(doc, id, verb, why) {
768
+ const n = doc.doc.nodes[id];
769
+ const parent = n?.data.parent ? doc.doc.nodes[n.data.parent] : undefined;
770
+ if (n?.data.type !== 'menu-panel' || parent?.data.type !== 'menu')
771
+ return;
772
+ throw new Error(`sbuilder: ${id} is the mega panel of a row of the menu ${n.data.parent}. ${verb} it is refused: ${why}.`);
773
+ }
721
774
  export function moveNode(doc, id, newParentId, index, guard) {
722
775
  const n = doc.node(id);
776
+ refuseMenuPanel(doc, id, 'Moving', `its row would still point at it while the menu no longer holds it. To take the panel away, sb_remove ${id} (the row goes back to its link list in the same save)`);
723
777
  refuseOverlay(doc, id, 'moving');
724
778
  soft(guard, () => refuseAppBlockInterior(doc, id, 'moving'));
725
779
  const newParent = doc.node(newParentId);
@@ -775,6 +829,16 @@ export function removeNode(doc, id, guard) {
775
829
  patches.push({ op: 'set', path: ['nodes', parentId, 'config', rule.configKey], value: '' });
776
830
  }
777
831
  }
832
+ // A MEGA PANEL: its row goes back on the plain link list in the same save,
833
+ // as the editor's removeMenuRowPanel does — never a row naming a gone node.
834
+ if (parent.data.type === 'menu' && n.data.type === 'menu-panel') {
835
+ const rows = structuredClone(parent.specials?.menuItems ?? []);
836
+ const hits = menuRows(rows).filter((r) => r.panelId === id);
837
+ for (const r of hits)
838
+ delete r.panelId;
839
+ if (hits.length)
840
+ patches.push({ op: 'set', path: ['nodes', parentId, 'specials', 'menuItems'], value: rows });
841
+ }
778
842
  }
779
843
  // Unset the whole subtree AND everything hanging off it — a node left behind
780
844
  // is an orphan the save check rejects, and the agent would never guess why.
@@ -1,5 +1,5 @@
1
1
  import { applyPatches } from '../../core/patch.js';
2
- import { childrenOf, isOverlay, appBlockRoot } from '../../core/tree.js';
2
+ import { childrenOf, isOverlay, appBlockRoot, menuRows, rowPanel } from '../../core/tree.js';
3
3
  import { bandOf, isGlobal } from './traps.js';
4
4
  import { SATELLITE_RULES } from '../../catalog/elements.generated.js';
5
5
  /**
@@ -204,6 +204,14 @@ export class PageDoc {
204
204
  const label = n.specials?.label;
205
205
  if ((n.data.type === 'accordion-content' || n.data.type === 'tab-content') && typeof label === 'string' && label)
206
206
  out.label = label;
207
+ const menuId = n.data.parent;
208
+ if (n.data.type === 'menu-panel' && menuId && this.doc.nodes[menuId]?.data.type === 'menu') {
209
+ const row = menuRows(this.doc.nodes[menuId].specials?.menuItems).find((r) => rowPanel(this.doc, menuId, r) === id);
210
+ if (typeof row?.id === 'string')
211
+ out.menu_item = row.id;
212
+ if (typeof row?.label === 'string' && row.label)
213
+ out.label = row.label;
214
+ }
207
215
  if (level === 0) {
208
216
  if (isOverlay(this.doc, id))
209
217
  out.overlay = true;
@@ -244,15 +244,17 @@ export const INERT_ON_ADD = {
244
244
  'beside it.',
245
245
  host: 'hamburger-menu',
246
246
  },
247
- // `menu` itself cannot hold children at all (isContainer: false), so a
248
- // menu-panel is wired from the MENU ENTRY's own configuration, never from
249
- // the page tree — yet any ordinary container on a page will accept one.
247
+ // A menu-panel renders only as a MENU's child that one row of the menu's
248
+ // specials.menuItems names through `panelId` — the one way to place it is
249
+ // sb_add with menu_item_id (which writes both halves), so under a menu it is
250
+ // hosted and silent. Any ordinary container on a page also accepts one.
250
251
  'menu-panel': {
251
- note: 'A menu-panel is a mega-menu surface behind ONE entry of a site menu, wired from that ' +
252
- "entry's own configuration — not from the page tree, since a menu node cannot hold " +
253
- 'children at all. Placed loose on a page it is accepted by any ordinary container and, per ' +
254
- 'its own AVOID, "only renders inside its owning menu entry" — never on its own. Reference ' +
255
- 'it from the menu entry it belongs to (Manage menu), not by adding it to a page.',
252
+ note: 'A menu-panel is a mega-menu surface behind ONE entry of a site menu: it renders only as ' +
253
+ "the menu's own child that the entry's row names (specials.menuItems[].panelId). Placed " +
254
+ 'loose on a page it is accepted by any ordinary container and, per its own AVOID, "only ' +
255
+ 'renders inside its owning menu entry" — never on its own. Add it with sb_add parent_id ' +
256
+ '<menu> menu_item_id <row id>, which appends it and points the row at it in one save.',
257
+ host: 'menu',
256
258
  },
257
259
  };
258
260
  /** The hint for a type, or null. */
@@ -116,10 +116,10 @@ export function saveRefusal(d, patches) {
116
116
  * button) is right. Shared with sb_store action:"form" + node_id, which
117
117
  * appended after the footer and stored a stray form.
118
118
  */
119
- export function addPlaced(d, parentId, spec, index, guard) {
119
+ export function addPlaced(d, parentId, spec, index, guard, menuItemId) {
120
120
  const rootKids = d.doc.nodes[d.doc.root_node_id]?.data.nodes.length ?? 0;
121
121
  const mid = parentId === d.doc.root_node_id ? middleEnd(d.doc) : rootKids;
122
- return addSubtree(d, parentId, spec, index ?? (mid < rootKids ? mid : undefined), guard);
122
+ return addSubtree(d, parentId, spec, index ?? (mid < rootKids ? mid : undefined), guard, menuItemId);
123
123
  }
124
124
  /** `once` for a real write, `peek` for a dry run — the same notes, spent once. */
125
125
  function noticeFor(ctx, dryRun) {
@@ -1587,11 +1587,16 @@ export function registerPageTools(server, ctx) {
1587
1587
  parent_id: z.string(),
1588
1588
  spec: specSchema,
1589
1589
  index: z.number().int().min(0).optional(),
1590
+ menu_item_id: z
1591
+ .string()
1592
+ .min(1)
1593
+ .optional()
1594
+ .describe('Mega panel: the menuItems row id whose dropdown it becomes (menu parent, menu-panel spec)'),
1590
1595
  dry_run: z.boolean().optional(),
1591
1596
  force: z.boolean().optional().describe('Override a render-inference guard; reported as forced'),
1592
1597
  },
1593
1598
  annotations: { readOnlyHint: false, destructiveHint: false },
1594
- }, async ({ parent_id, spec, index, dry_run, force }) => {
1599
+ }, async ({ parent_id, spec, index, menu_item_id, dry_run, force }) => {
1595
1600
  const d = session.current();
1596
1601
  // A CODE COMPONENT IS CHECKED AGAINST WHAT THE SITE PUSHED before anything
1597
1602
  // is placed: an unknown name, version or prop stores a blank box, and only
@@ -1616,7 +1621,7 @@ export function registerPageTools(server, ctx) {
1616
1621
  }
1617
1622
  const derived = ccDropped.size ? { derived: derivedNote([...ccDropped]) } : {};
1618
1623
  const guard = { force, forced: [] };
1619
- const { patches, ids, idOf } = addPlaced(d, parent_id, spec, index, guard);
1624
+ const { patches, ids, idOf } = addPlaced(d, parent_id, spec, index, guard, menu_item_id);
1620
1625
  const forced = guard.forced.length ? { forced: guard.forced } : {};
1621
1626
  // THE SEED COPY IN THE SITE'S LANGUAGE (TTG gap #46): an empty state minted
1622
1627
  // here said "No products yet" on a Vietnamese store, while sb_page_create
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbuilder-mcp",
3
- "version": "0.110.0",
3
+ "version": "0.110.2",
4
4
  "description": "MCP server that designs and operates a Store Builder site — pages, data, theme and publish — through the platform's own API and live-edit protocol.",
5
5
  "mcpName": "io.github.vuluu2k/sbuilder-mcp",
6
6
  "type": "module",