sbuilder-mcp 0.100.6 → 0.101.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.
- package/CHANGELOG.md +36 -0
- package/CHANGELOG.vi.md +36 -0
- package/dist/catalog/deadkeys.generated.js +2 -2
- package/dist/catalog/element-search.js +38 -4
- package/dist/catalog/elements.generated.js +6 -0
- package/dist/catalog/search.js +26 -1
- package/dist/catalog/shapes.generated.js +44 -23
- package/dist/catalog/source.generated.js +2 -2
- package/dist/catalog/storepages.generated.js +8 -4
- package/dist/domains/site/findings.js +5 -0
- package/dist/domains/site/importmap.js +36 -15
- package/dist/domains/site/pagestate.js +56 -5
- package/dist/domains/site/patterns.js +6 -1
- package/dist/domains/site/readiness.js +5 -3
- package/dist/domains/site/review.js +39 -18
- package/dist/domains/site/seedcopy.js +6 -0
- package/dist/domains/site/storepage.js +21 -1
- package/dist/domains/site/theme.js +27 -2
- package/dist/domains/site/traps.js +16 -3
- package/dist/domains/site/vocabulary.js +4 -0
- package/dist/tools/api.js +5 -0
- package/dist/tools/live.js +50 -5
- package/dist/tools/overlay.js +17 -1
- package/dist/tools/page.js +166 -49
- package/dist/tools/undo.js +15 -1
- package/dist/vision/measure.js +41 -0
- package/dist/vision/shoot.js +33 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,42 @@ 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.101.1] - 2026-10-29
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- `sb_set` writes `clampTitle` to the base config at the default breakpoint, so turning off title clamping reaches the published page without `base: true`.
|
|
13
|
+
|
|
14
|
+
## [0.101.0] - 2026-10-29
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- `sb_publish` with `dry_run` previews the pages a publish will cascade to as `would_cascade`, and lists unpublished shared masters as `shared_unpublished` with a `shared_warning` at the top of the result.
|
|
18
|
+
- `sb_look` measurements report `low_contrast` for text under 3:1 contrast against the nearest opaque background, and skip text over images.
|
|
19
|
+
- `sb_template_use` returns an `ids` map of `{id: type}` and its satellites, as `sb_add` does, and carries `template_id` in its summary.
|
|
20
|
+
- `sb_page_create` returns the `route` of the new page.
|
|
21
|
+
- `sb_review` reports `placeholder_link` for links whose `href` is `#`.
|
|
22
|
+
- `sb_event` with `open_page` accepts a bare `pageId` and builds the `{linkType, id, label, url}` link from the page list.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- `sb_duplicate` to another page returns the same `copies` map as a duplicate on the open page.
|
|
26
|
+
- `sb_undo` lists entries more compactly, without repeating `operationId`, `path` and `fields` for the open page.
|
|
27
|
+
- `sb_template_use` and `overlay_attach` write seed text in Vietnamese on Vietnamese sites.
|
|
28
|
+
- `sb_api_find` ranks the resource at the start of the path higher and prefers the shorter path on a tie, so "list products" finds the right operation, and `pick` names a field that no record carries.
|
|
29
|
+
- `sb_traits_for` keeps the allowed values when it narrows a control, and suggests config keys such as `triggerType`, `Delay` and `Freq` for `popup_trigger` instead of pointing at CSS.
|
|
30
|
+
- `sb_review` reports a finding inside a global section with `global: true` and says it once per process, so a shared header no longer repeats under FIX THESE.
|
|
31
|
+
- `sb_review` reads preset backgrounds and treats image, scene and video backgrounds as dark, and `sb_import` reads band width from the section's own container.
|
|
32
|
+
- `sb_api_find` and `sb_traits_for` read named string types as unions of their values, such as `ArticleStatus` and `ProductStatus`, with their predicates.
|
|
33
|
+
- The catalog is regenerated from the latest platform, so a page's own title is no longer clamped to two lines and "View all" on a product shelf links to `/search`.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
- Blog pages are treated as the `/blog-categories/{slug}` entity template, so `sb_review` no longer misreports their SEO or reachability, and `sb_publish` verifies a real entity address.
|
|
37
|
+
- `sb_publish` no longer blames the cascade when live runs ahead of the draft after an ordinary publish.
|
|
38
|
+
- `sb_look` with the `url` of another page no longer carries over the findings of the open page.
|
|
39
|
+
- `sb_review` no longer reports a dead desktop cell whose value equals base as an error when the render shows maintenance.
|
|
40
|
+
- Theme variable values such as `var(--wb-…)` are no longer flagged as detached from the theme.
|
|
41
|
+
- An edit inside a pop-up states that it applies only to the pages the pop-up is attached to, and no longer reads as site-wide.
|
|
42
|
+
- Disabling an animation with `{active:false}` no longer triggers a warning.
|
|
43
|
+
- The cascade preview in `sb_publish` no longer leaves an unhandled rejection when credentials are missing.
|
|
44
|
+
|
|
9
45
|
## [0.100.6] - 2026-10-29
|
|
10
46
|
|
|
11
47
|
### Added
|
package/CHANGELOG.vi.md
CHANGED
|
@@ -6,6 +6,42 @@ 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.101.1] - 2026-10-29
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- `sb_set` ghi `clampTitle` vào config base ở breakpoint mặc định, nên việc tắt kẹp tiêu đề có hiệu lực trên trang đã xuất bản mà không cần `base: true`.
|
|
13
|
+
|
|
14
|
+
## [0.101.0] - 2026-10-29
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- `sb_publish` với `dry_run` xem trước các trang sẽ lan tới khi publish dưới dạng `would_cascade`, và liệt kê bản master dùng chung chưa xuất bản trong `shared_unpublished` cùng `shared_warning` ở đầu kết quả.
|
|
18
|
+
- Phép đo của `sb_look` báo `low_contrast` cho chữ có tương phản dưới 3:1 so với nền đục gần nhất, và bỏ qua chữ nằm trên ảnh.
|
|
19
|
+
- `sb_template_use` trả về bản đồ `ids` dạng `{id: type}` cùng các satellite như `sb_add`, và mang `template_id` trong summary.
|
|
20
|
+
- `sb_page_create` trả về `route` của trang mới.
|
|
21
|
+
- `sb_review` báo `placeholder_link` cho liên kết có `href` là `#`.
|
|
22
|
+
- `sb_event` với `open_page` nhận `pageId` trần và tự dựng liên kết `{linkType, id, label, url}` từ danh sách trang.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- `sb_duplicate` sang trang khác trả về cùng bản đồ `copies` như khi nhân bản trên trang đang mở.
|
|
26
|
+
- `sb_undo` liệt kê gọn hơn, không lặp `operationId`, `path` và `fields` cho trang đang mở.
|
|
27
|
+
- `sb_template_use` và `overlay_attach` ghi chữ seed bằng tiếng Việt trên site tiếng Việt.
|
|
28
|
+
- `sb_api_find` cộng điểm cho tài nguyên đầu đường dẫn và ưu tiên đường ngắn hơn khi hòa điểm, nên "list products" ra đúng operation, và `pick` nêu trường mà không bản ghi nào mang.
|
|
29
|
+
- `sb_traits_for` giữ các giá trị cho phép khi thu hẹp một control, và gợi ý các khóa config như `triggerType`, `Delay`, `Freq` cho `popup_trigger` thay vì chỉ sang CSS.
|
|
30
|
+
- `sb_review` báo finding trong global section với `global: true` và chỉ nói một lần mỗi tiến trình, nên header dùng chung không còn lặp dưới FIX THESE.
|
|
31
|
+
- `sb_review` đọc nền preset và coi nền ảnh, scene, video là nền tối, còn `sb_import` đọc độ rộng band từ container của chính section.
|
|
32
|
+
- `sb_api_find` và `sb_traits_for` đọc các kiểu chuỗi có tên như `ArticleStatus` và `ProductStatus` thành union các giá trị, kèm vị từ của chúng.
|
|
33
|
+
- Catalog được tái sinh theo platform mới nhất, nên tiêu đề của chính trang không còn bị kẹp hai dòng và "Xem tất cả" trên kệ sản phẩm dẫn tới `/search`.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
- Trang blog được coi là template thực thể `/blog-categories/{slug}`, nên `sb_review` không còn báo sai SEO hay khả năng truy cập của chúng, và `sb_publish` kiểm một địa chỉ thực thể thật.
|
|
37
|
+
- `sb_publish` không còn đổ cho cascade khi live đi trước bản nháp sau một lần publish thường.
|
|
38
|
+
- `sb_look` với `url` của trang khác không còn mang findings của trang đang mở.
|
|
39
|
+
- `sb_review` không còn báo lỗi cho ô desktop chết có giá trị trùng base khi render cho thấy đang bảo trì.
|
|
40
|
+
- Giá trị biến theme như `var(--wb-…)` không còn bị cảnh báo là tách khỏi theme.
|
|
41
|
+
- Sửa trong pop-up nói rõ chỉ áp dụng cho các trang được gắn pop-up, không còn bị hiểu là toàn site.
|
|
42
|
+
- Tắt hoạt ảnh bằng `{active:false}` không còn bị cảnh báo.
|
|
43
|
+
- Bản xem trước cascade của `sb_publish` không còn để lại rejection không xử lý khi thiếu credential.
|
|
44
|
+
|
|
9
45
|
## [0.100.6] - 2026-10-29
|
|
10
46
|
|
|
11
47
|
### Added
|
|
@@ -255,8 +255,8 @@ export const STYLE_NOTE = 'The `style` namespace is OPEN CSS: any camelCase key
|
|
|
255
255
|
'whether or not a control exists for it. `config` and `specials` are NOT open — they are ' +
|
|
256
256
|
"per-element, and this element's `defaults` name the keys it actually uses.";
|
|
257
257
|
const UNDECLARED_NOTE = 'Controls not listed under `declared` build their write in a Vue widget the platform does ' +
|
|
258
|
-
'not describe. Read a node that already uses one with sb_node_read
|
|
259
|
-
'
|
|
258
|
+
'not describe. Read a node that already uses one with sb_node_read; a VISUAL one can be set as ' +
|
|
259
|
+
'CSS (style is open), a behaviour lives in config (see defaults.config). Pass control:"<name>" to read one control.';
|
|
260
260
|
/**
|
|
261
261
|
* The inspector as NAMES, plus the declared writes in full.
|
|
262
262
|
*
|
|
@@ -279,7 +279,9 @@ export function traitsFor(type, control) {
|
|
|
279
279
|
// "writes: null" while the key, its values and its fallback sat in the
|
|
280
280
|
// generated vocabulary (TTG gap #47). Joined on the element's own config.
|
|
281
281
|
if (desc.writes === null) {
|
|
282
|
-
|
|
282
|
+
// …or in the shared write vocabulary (`articleSourceType`, TTG gap #73).
|
|
283
|
+
const vocab = ({ ...sharedVocabularies(el.defaults ?? {}), ...elementVocabularies(el.type) }[control] ??
|
|
284
|
+
vocabulariesForWrites([control])[control]);
|
|
283
285
|
if (vocab || control in (el.defaults?.config ?? {})) {
|
|
284
286
|
const { target = 'config', writeKey = control, ...values } = vocab ?? {};
|
|
285
287
|
return {
|
|
@@ -291,7 +293,39 @@ export function traitsFor(type, control) {
|
|
|
291
293
|
};
|
|
292
294
|
}
|
|
293
295
|
}
|
|
294
|
-
|
|
296
|
+
// THE VALUES RIDE WITH THE NARROWED ANSWER TOO (TTG gap #73): `control:
|
|
297
|
+
// "articleSourceType"` answered `{writes}` while the unscoped call carried
|
|
298
|
+
// `config_values.articleSourceType.values`.
|
|
299
|
+
const writes = (desc.writes ?? []);
|
|
300
|
+
if (writes.length) {
|
|
301
|
+
const own = { ...sharedVocabularies(el.defaults ?? {}), ...elementVocabularies(el.type) };
|
|
302
|
+
const shared = vocabulariesForWrites(writes.map((w) => w.writeKey));
|
|
303
|
+
const v = writes.map((w) => own[w.writeKey] ?? shared[w.writeKey]).find(Boolean);
|
|
304
|
+
if (v) {
|
|
305
|
+
const { target: _t, writeKey: _w, ...values } = v;
|
|
306
|
+
void _t, _w;
|
|
307
|
+
return { type, control, ...desc, ...values };
|
|
308
|
+
}
|
|
309
|
+
return { type, control, ...desc };
|
|
310
|
+
}
|
|
311
|
+
// AN UNDECLARED CONTROL IS NOT ALWAYS CSS (TTG gap #73): popup_trigger is
|
|
312
|
+
// config.triggerType (delay|scroll|guest), and "set the CSS property" sent
|
|
313
|
+
// callers to style for a behaviour. The element's own seeded keys that share
|
|
314
|
+
// a word with the control name are the likeliest answer.
|
|
315
|
+
const words = control.toLowerCase().split(/[_-]/).map((w) => (w === 'bg' ? 'background' : w)).filter((w) => w.length > 2 && w !== el.type);
|
|
316
|
+
const likely = ['config', 'specials', 'style'].flatMap((ns) => Object.keys(el.defaults?.[ns] ?? {})
|
|
317
|
+
.filter((k) => words.length > 0 && words.every((w) => k.toLowerCase().includes(w)))
|
|
318
|
+
.map((k) => `${ns}.${k}`));
|
|
319
|
+
return {
|
|
320
|
+
type,
|
|
321
|
+
control,
|
|
322
|
+
writes: null,
|
|
323
|
+
...(likely.length ? { likely_keys: likely } : {}),
|
|
324
|
+
note: 'The platform does not declare what this control writes (its widget builds the binding in Vue). ' +
|
|
325
|
+
(likely.length ? 'likely_keys are this element\'s seeded keys sharing its words. ' : '') +
|
|
326
|
+
'Read a node that already uses it with sb_node_read. Only a VISUAL control maps to open CSS in style ' +
|
|
327
|
+
'(e.g. a section background picture is style.backgroundImage) — a behaviour lives in config.',
|
|
328
|
+
};
|
|
295
329
|
}
|
|
296
330
|
// Read from base only whatever breakpoint is asked for — sb_set routes them
|
|
297
331
|
// there, so a "tablet-only" value of one of these is the desktop value too.
|
|
@@ -32398,6 +32398,7 @@ export const ELEMENTS = {
|
|
|
32398
32398
|
"textValue",
|
|
32399
32399
|
"descriptionDisplayType",
|
|
32400
32400
|
"descriptionLines",
|
|
32401
|
+
"clampTitle",
|
|
32401
32402
|
"moreText",
|
|
32402
32403
|
"lessText",
|
|
32403
32404
|
"moreButtonColor",
|
|
@@ -32423,6 +32424,7 @@ export const ELEMENTS = {
|
|
|
32423
32424
|
"textValue",
|
|
32424
32425
|
"descriptionDisplayType",
|
|
32425
32426
|
"descriptionLines",
|
|
32427
|
+
"clampTitle",
|
|
32426
32428
|
"moreText",
|
|
32427
32429
|
"lessText",
|
|
32428
32430
|
"moreButtonColor",
|
|
@@ -32448,6 +32450,7 @@ export const ELEMENTS = {
|
|
|
32448
32450
|
"textValue",
|
|
32449
32451
|
"descriptionDisplayType",
|
|
32450
32452
|
"descriptionLines",
|
|
32453
|
+
"clampTitle",
|
|
32451
32454
|
"moreText",
|
|
32452
32455
|
"lessText",
|
|
32453
32456
|
"moreButtonColor",
|
|
@@ -32472,6 +32475,7 @@ export const ELEMENTS = {
|
|
|
32472
32475
|
"textValue",
|
|
32473
32476
|
"descriptionDisplayType",
|
|
32474
32477
|
"descriptionLines",
|
|
32478
|
+
"clampTitle",
|
|
32475
32479
|
"moreText",
|
|
32476
32480
|
"lessText",
|
|
32477
32481
|
"moreButtonColor",
|
|
@@ -32610,6 +32614,7 @@ export const ELEMENTS = {
|
|
|
32610
32614
|
"textValue",
|
|
32611
32615
|
"descriptionDisplayType",
|
|
32612
32616
|
"descriptionLines",
|
|
32617
|
+
"clampTitle",
|
|
32613
32618
|
"moreText",
|
|
32614
32619
|
"lessText",
|
|
32615
32620
|
"moreButtonColor",
|
|
@@ -41247,6 +41252,7 @@ export const BASE_ONLY_CONFIG = [
|
|
|
41247
41252
|
"backgroundSceneUrl",
|
|
41248
41253
|
"backgroundSceneModelUrl",
|
|
41249
41254
|
"rowLimit",
|
|
41255
|
+
"clampTitle",
|
|
41250
41256
|
"optionSource",
|
|
41251
41257
|
"recordAggregates",
|
|
41252
41258
|
"recordCollectionId",
|
package/dist/catalog/search.js
CHANGED
|
@@ -11,6 +11,20 @@ import { translationCallSheet } from '../domains/site/translate.js';
|
|
|
11
11
|
* a ranker whose output shuffles between calls is one nobody can debug.
|
|
12
12
|
*/
|
|
13
13
|
const WEIGHT = { tag: 5, path: 3, summary: 2 };
|
|
14
|
+
/** Query words that name an HTTP method. */
|
|
15
|
+
const VERB_METHODS = {
|
|
16
|
+
list: ['get'],
|
|
17
|
+
get: ['get'],
|
|
18
|
+
read: ['get'],
|
|
19
|
+
show: ['get'],
|
|
20
|
+
find: ['get'],
|
|
21
|
+
create: ['post'],
|
|
22
|
+
add: ['post'],
|
|
23
|
+
update: ['put', 'patch'],
|
|
24
|
+
edit: ['put', 'patch'],
|
|
25
|
+
delete: ['delete'],
|
|
26
|
+
remove: ['delete'],
|
|
27
|
+
};
|
|
14
28
|
/** Eight is enough to choose from; twelve was measured at 44 KB once the schemas rode along. */
|
|
15
29
|
export const DEFAULT_FIND_LIMIT = 8;
|
|
16
30
|
/**
|
|
@@ -65,10 +79,21 @@ export function searchOperations(query, opts = {}) {
|
|
|
65
79
|
if (hit(summary, t))
|
|
66
80
|
score += WEIGHT.summary;
|
|
67
81
|
}
|
|
82
|
+
// A VERB NAMES A METHOD (TTG gap #81): "list products" ranked the four
|
|
83
|
+
// product-categories/{id}/products routes, every method, above GET /products.
|
|
84
|
+
if (score > 0 && terms.some((t) => VERB_METHODS[t]?.includes(op.method.toLowerCase())))
|
|
85
|
+
score += WEIGHT.summary;
|
|
86
|
+
// …and the resource the path IS — its first segment past the site/v1 scope —
|
|
87
|
+
// outranks one that merely ends in the same word.
|
|
88
|
+
const resource = /^\/api\/(?:sites\/\{siteId\}|v1)\/([^/]+)/.exec(op.path)?.[1];
|
|
89
|
+
if (score > 0 && resource && terms.some((t) => resource === t || resource === `${t}s`))
|
|
90
|
+
score += WEIGHT.path;
|
|
68
91
|
if (score > 0)
|
|
69
92
|
scored.push({ op, score });
|
|
70
93
|
}
|
|
71
|
-
|
|
94
|
+
// On a tie the SHORTER path is the resource itself, not something nested under another.
|
|
95
|
+
const depth = (o) => o.path.split('/').length;
|
|
96
|
+
scored.sort((a, b) => b.score - a.score || depth(a.op) - depth(b.op) || a.op.id.localeCompare(b.op.id));
|
|
72
97
|
return scored.slice(0, limit).map((s) => s.op);
|
|
73
98
|
}
|
|
74
99
|
/**
|
|
@@ -874,7 +874,8 @@ export const REQUEST_SHAPES = {
|
|
|
874
874
|
},
|
|
875
875
|
{
|
|
876
876
|
"name": "bodyType",
|
|
877
|
-
"type": "
|
|
877
|
+
"type": "\"richtext\" | \"page\"",
|
|
878
|
+
"note": "ArticleBodyType: its declared constants (no write validator); BodyTypeRenders() is true only for \"richtext\""
|
|
878
879
|
},
|
|
879
880
|
{
|
|
880
881
|
"name": "content",
|
|
@@ -890,7 +891,8 @@ export const REQUEST_SHAPES = {
|
|
|
890
891
|
},
|
|
891
892
|
{
|
|
892
893
|
"name": "status",
|
|
893
|
-
"type": "
|
|
894
|
+
"type": "\"draft\" | \"published\" | \"archived\"",
|
|
895
|
+
"note": "ArticleStatus: its declared constants (no write validator); StorefrontVisible() is true only for \"published\""
|
|
894
896
|
},
|
|
895
897
|
{
|
|
896
898
|
"name": "categoryIds",
|
|
@@ -996,7 +998,8 @@ export const REQUEST_SHAPES = {
|
|
|
996
998
|
},
|
|
997
999
|
{
|
|
998
1000
|
"name": "bodyType",
|
|
999
|
-
"type": "
|
|
1001
|
+
"type": "\"richtext\" | \"page\"",
|
|
1002
|
+
"note": "ArticleBodyType: its declared constants (no write validator); BodyTypeRenders() is true only for \"richtext\""
|
|
1000
1003
|
},
|
|
1001
1004
|
{
|
|
1002
1005
|
"name": "content",
|
|
@@ -1012,7 +1015,8 @@ export const REQUEST_SHAPES = {
|
|
|
1012
1015
|
},
|
|
1013
1016
|
{
|
|
1014
1017
|
"name": "status",
|
|
1015
|
-
"type": "
|
|
1018
|
+
"type": "\"draft\" | \"published\" | \"archived\"",
|
|
1019
|
+
"note": "ArticleStatus: its declared constants (no write validator); StorefrontVisible() is true only for \"published\""
|
|
1016
1020
|
},
|
|
1017
1021
|
{
|
|
1018
1022
|
"name": "categoryIds",
|
|
@@ -1754,7 +1758,8 @@ export const REQUEST_SHAPES = {
|
|
|
1754
1758
|
},
|
|
1755
1759
|
{
|
|
1756
1760
|
"name": "status",
|
|
1757
|
-
"type": "\"draft\" | \"active\" | \"archived\" | \"review\""
|
|
1761
|
+
"type": "\"draft\" | \"active\" | \"archived\" | \"review\"",
|
|
1762
|
+
"note": "StorefrontVisible() is true only for \"active\""
|
|
1758
1763
|
},
|
|
1759
1764
|
{
|
|
1760
1765
|
"name": "level",
|
|
@@ -1961,7 +1966,8 @@ export const REQUEST_SHAPES = {
|
|
|
1961
1966
|
},
|
|
1962
1967
|
{
|
|
1963
1968
|
"name": "status",
|
|
1964
|
-
"type": "\"draft\" | \"active\" | \"archived\" | \"review\""
|
|
1969
|
+
"type": "\"draft\" | \"active\" | \"archived\" | \"review\"",
|
|
1970
|
+
"note": "StorefrontVisible() is true only for \"active\""
|
|
1965
1971
|
},
|
|
1966
1972
|
{
|
|
1967
1973
|
"name": "level",
|
|
@@ -2396,7 +2402,8 @@ export const REQUEST_SHAPES = {
|
|
|
2396
2402
|
},
|
|
2397
2403
|
{
|
|
2398
2404
|
"name": "status",
|
|
2399
|
-
"type": "\"draft\" | \"active\" | \"archived\" | \"review\""
|
|
2405
|
+
"type": "\"draft\" | \"active\" | \"archived\" | \"review\"",
|
|
2406
|
+
"note": "StorefrontVisible() is true only for \"active\""
|
|
2400
2407
|
},
|
|
2401
2408
|
{
|
|
2402
2409
|
"name": "level",
|
|
@@ -2603,7 +2610,8 @@ export const REQUEST_SHAPES = {
|
|
|
2603
2610
|
},
|
|
2604
2611
|
{
|
|
2605
2612
|
"name": "status",
|
|
2606
|
-
"type": "\"draft\" | \"active\" | \"archived\" | \"review\""
|
|
2613
|
+
"type": "\"draft\" | \"active\" | \"archived\" | \"review\"",
|
|
2614
|
+
"note": "StorefrontVisible() is true only for \"active\""
|
|
2607
2615
|
},
|
|
2608
2616
|
{
|
|
2609
2617
|
"name": "level",
|
|
@@ -4721,7 +4729,8 @@ export const REQUEST_SHAPES = {
|
|
|
4721
4729
|
},
|
|
4722
4730
|
{
|
|
4723
4731
|
"name": "type",
|
|
4724
|
-
"type": "
|
|
4732
|
+
"type": "\"custom\" | \"contact\" | \"subscribe\" | \"order\" | \"booking\" | \"review\" | \"login\" | \"register\" | \"forgot\" | \"reset\" | \"verify\"",
|
|
4733
|
+
"note": "Type: its declared constants (no write validator); ConfirmationEligible() is true only for \"contact\" | \"subscribe\"; IsAuth() is true only for \"login\" | \"register\" | \"forgot\" | \"reset\" | \"verify\""
|
|
4725
4734
|
},
|
|
4726
4735
|
{
|
|
4727
4736
|
"name": "version",
|
|
@@ -4824,7 +4833,8 @@ export const REQUEST_SHAPES = {
|
|
|
4824
4833
|
},
|
|
4825
4834
|
{
|
|
4826
4835
|
"name": "type",
|
|
4827
|
-
"type": "
|
|
4836
|
+
"type": "\"custom\" | \"contact\" | \"subscribe\" | \"order\" | \"booking\" | \"review\" | \"login\" | \"register\" | \"forgot\" | \"reset\" | \"verify\"",
|
|
4837
|
+
"note": "Type: its declared constants (no write validator); ConfirmationEligible() is true only for \"contact\" | \"subscribe\"; IsAuth() is true only for \"login\" | \"register\" | \"forgot\" | \"reset\" | \"verify\""
|
|
4828
4838
|
},
|
|
4829
4839
|
{
|
|
4830
4840
|
"name": "version",
|
|
@@ -4919,8 +4929,8 @@ export const REQUEST_SHAPES = {
|
|
|
4919
4929
|
},
|
|
4920
4930
|
{
|
|
4921
4931
|
"name": "type",
|
|
4922
|
-
"type": "
|
|
4923
|
-
"note": "Type, when present, changes the form's type in the SAME write."
|
|
4932
|
+
"type": "\"custom\" | \"contact\" | \"subscribe\" | \"order\" | \"booking\" | \"review\" | \"login\" | \"register\" | \"forgot\" | \"reset\" | \"verify\"",
|
|
4933
|
+
"note": "Type, when present, changes the form's type in the SAME write. Type: its declared constants (no write validator); ConfirmationEligible() is true only for \"contact\" | \"subscribe\"; IsAuth() is true only for \"login\" | \"register\" | \"forgot\" | \"reset\" | \"verify\""
|
|
4924
4934
|
},
|
|
4925
4935
|
{
|
|
4926
4936
|
"name": "settings",
|
|
@@ -4999,7 +5009,8 @@ export const REQUEST_SHAPES = {
|
|
|
4999
5009
|
"fields": [
|
|
5000
5010
|
{
|
|
5001
5011
|
"name": "status",
|
|
5002
|
-
"type": "
|
|
5012
|
+
"type": "\"complete\" | \"draft\" | \"spam\" | \"cancelled\" | \"confirmed\" | \"no_show\" | \"awaiting_deposit\"",
|
|
5013
|
+
"note": "SubmissionStatus: its declared constants (no write validator); HoldsSeat() is true only for \"complete\" | \"confirmed\" | \"awaiting_deposit\""
|
|
5003
5014
|
},
|
|
5004
5015
|
{
|
|
5005
5016
|
"name": "deposit",
|
|
@@ -6548,7 +6559,8 @@ export const REQUEST_SHAPES = {
|
|
|
6548
6559
|
},
|
|
6549
6560
|
{
|
|
6550
6561
|
"name": "role",
|
|
6551
|
-
"type": "\"owner\" | \"admin\" | \"member\""
|
|
6562
|
+
"type": "\"owner\" | \"admin\" | \"member\"",
|
|
6563
|
+
"note": "Assignable() is true only for \"admin\" | \"member\"; MayManageSites() is true only for \"owner\" | \"admin\"; MayManageMembers() is true only for \"owner\"; MayReviewTemplates() is true only for \"owner\" | \"admin\""
|
|
6552
6564
|
}
|
|
6553
6565
|
],
|
|
6554
6566
|
"source": "go",
|
|
@@ -6558,7 +6570,8 @@ export const REQUEST_SHAPES = {
|
|
|
6558
6570
|
"fields": [
|
|
6559
6571
|
{
|
|
6560
6572
|
"name": "role",
|
|
6561
|
-
"type": "\"owner\" | \"admin\" | \"member\""
|
|
6573
|
+
"type": "\"owner\" | \"admin\" | \"member\"",
|
|
6574
|
+
"note": "Assignable() is true only for \"admin\" | \"member\"; MayManageSites() is true only for \"owner\" | \"admin\"; MayManageMembers() is true only for \"owner\"; MayReviewTemplates() is true only for \"owner\" | \"admin\""
|
|
6562
6575
|
}
|
|
6563
6576
|
],
|
|
6564
6577
|
"source": "go",
|
|
@@ -8607,7 +8620,8 @@ export const REQUEST_SHAPES = {
|
|
|
8607
8620
|
},
|
|
8608
8621
|
{
|
|
8609
8622
|
"name": "status",
|
|
8610
|
-
"type": "
|
|
8623
|
+
"type": "\"draft\" | \"active\" | \"archived\"",
|
|
8624
|
+
"note": "ProductStatus: its declared constants (no write validator); StorefrontVisible() is true only for \"active\""
|
|
8611
8625
|
},
|
|
8612
8626
|
{
|
|
8613
8627
|
"name": "tags",
|
|
@@ -8960,7 +8974,8 @@ export const REQUEST_SHAPES = {
|
|
|
8960
8974
|
},
|
|
8961
8975
|
{
|
|
8962
8976
|
"name": "status",
|
|
8963
|
-
"type": "
|
|
8977
|
+
"type": "\"draft\" | \"active\" | \"archived\"",
|
|
8978
|
+
"note": "ProductStatus: its declared constants (no write validator); StorefrontVisible() is true only for \"active\""
|
|
8964
8979
|
},
|
|
8965
8980
|
{
|
|
8966
8981
|
"name": "tags",
|
|
@@ -10595,11 +10610,13 @@ export const REQUEST_SHAPES = {
|
|
|
10595
10610
|
},
|
|
10596
10611
|
{
|
|
10597
10612
|
"name": "status",
|
|
10598
|
-
"type": "
|
|
10613
|
+
"type": "\"requested\" | \"approved\" | \"rejected\" | \"received\" | \"refunded\" | \"cancelled\"",
|
|
10614
|
+
"note": "Status: its declared constants (no write validator); Open() is true only for \"requested\" | \"approved\" | \"received\""
|
|
10599
10615
|
},
|
|
10600
10616
|
{
|
|
10601
10617
|
"name": "reason",
|
|
10602
|
-
"type": "
|
|
10618
|
+
"type": "\"damaged\" | \"wrong_item\" | \"not_as_described\" | \"size_fit\" | \"changed_mind\" | \"other\"",
|
|
10619
|
+
"note": "Reason: its declared constants (no write validator); MerchantFault() is true only for \"damaged\" | \"wrong_item\" | \"not_as_described\""
|
|
10603
10620
|
},
|
|
10604
10621
|
{
|
|
10605
10622
|
"name": "comment",
|
|
@@ -10704,11 +10721,13 @@ export const REQUEST_SHAPES = {
|
|
|
10704
10721
|
},
|
|
10705
10722
|
{
|
|
10706
10723
|
"name": "status",
|
|
10707
|
-
"type": "
|
|
10724
|
+
"type": "\"requested\" | \"approved\" | \"rejected\" | \"received\" | \"refunded\" | \"cancelled\"",
|
|
10725
|
+
"note": "Status: its declared constants (no write validator); Open() is true only for \"requested\" | \"approved\" | \"received\""
|
|
10708
10726
|
},
|
|
10709
10727
|
{
|
|
10710
10728
|
"name": "reason",
|
|
10711
|
-
"type": "
|
|
10729
|
+
"type": "\"damaged\" | \"wrong_item\" | \"not_as_described\" | \"size_fit\" | \"changed_mind\" | \"other\"",
|
|
10730
|
+
"note": "Reason: its declared constants (no write validator); MerchantFault() is true only for \"damaged\" | \"wrong_item\" | \"not_as_described\""
|
|
10712
10731
|
},
|
|
10713
10732
|
{
|
|
10714
10733
|
"name": "comment",
|
|
@@ -10832,7 +10851,8 @@ export const REQUEST_SHAPES = {
|
|
|
10832
10851
|
},
|
|
10833
10852
|
{
|
|
10834
10853
|
"name": "status",
|
|
10835
|
-
"type": "
|
|
10854
|
+
"type": "\"pending\" | \"published\" | \"rejected\"",
|
|
10855
|
+
"note": "Status: its declared constants (no write validator); Counts() is true only for \"published\""
|
|
10836
10856
|
},
|
|
10837
10857
|
{
|
|
10838
10858
|
"name": "reply",
|
|
@@ -10896,7 +10916,8 @@ export const REQUEST_SHAPES = {
|
|
|
10896
10916
|
},
|
|
10897
10917
|
{
|
|
10898
10918
|
"name": "status",
|
|
10899
|
-
"type": "
|
|
10919
|
+
"type": "\"pending\" | \"published\" | \"rejected\"",
|
|
10920
|
+
"note": "Status: its declared constants (no write validator); Counts() is true only for \"published\""
|
|
10900
10921
|
},
|
|
10901
10922
|
{
|
|
10902
10923
|
"name": "reply",
|
|
@@ -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": "
|
|
5
|
-
"committedAt": "2026-10-
|
|
4
|
+
"commit": "efacb346e41db65b9450504e34c5a5dd8a9f01a1",
|
|
5
|
+
"committedAt": "2026-10-30T00:07:45+07:00",
|
|
6
6
|
"dirty": false
|
|
7
7
|
};
|
|
@@ -2076,7 +2076,8 @@ export const STORE_PAGE_SEEDS = {
|
|
|
2076
2076
|
"lessText": "Show less",
|
|
2077
2077
|
"icon": true,
|
|
2078
2078
|
"moreButtonColor": "#000000",
|
|
2079
|
-
"textGlobalStyle": "heading-3"
|
|
2079
|
+
"textGlobalStyle": "heading-3",
|
|
2080
|
+
"clampTitle": false
|
|
2080
2081
|
},
|
|
2081
2082
|
"specials": {
|
|
2082
2083
|
"htmlTag": "h3",
|
|
@@ -2920,7 +2921,8 @@ export const STORE_PAGE_SEEDS = {
|
|
|
2920
2921
|
"lessText": "Show less",
|
|
2921
2922
|
"icon": true,
|
|
2922
2923
|
"moreButtonColor": "#000000",
|
|
2923
|
-
"textGlobalStyle": "heading-3"
|
|
2924
|
+
"textGlobalStyle": "heading-3",
|
|
2925
|
+
"clampTitle": false
|
|
2924
2926
|
},
|
|
2925
2927
|
"specials": {
|
|
2926
2928
|
"htmlTag": "h3",
|
|
@@ -4373,7 +4375,8 @@ export const STORE_PAGE_SEEDS = {
|
|
|
4373
4375
|
"lessText": "Show less",
|
|
4374
4376
|
"icon": true,
|
|
4375
4377
|
"moreButtonColor": "#000000",
|
|
4376
|
-
"textGlobalStyle": "heading-3"
|
|
4378
|
+
"textGlobalStyle": "heading-3",
|
|
4379
|
+
"clampTitle": false
|
|
4377
4380
|
},
|
|
4378
4381
|
"specials": {
|
|
4379
4382
|
"htmlTag": "h3",
|
|
@@ -4998,7 +5001,8 @@ export const STORE_PAGE_SEEDS = {
|
|
|
4998
5001
|
"lessText": "Show less",
|
|
4999
5002
|
"icon": true,
|
|
5000
5003
|
"moreButtonColor": "#000000",
|
|
5001
|
-
"textGlobalStyle": "heading-3"
|
|
5004
|
+
"textGlobalStyle": "heading-3",
|
|
5005
|
+
"clampTitle": false
|
|
5002
5006
|
},
|
|
5003
5007
|
"specials": {
|
|
5004
5008
|
"htmlTag": "h3",
|
|
@@ -26,6 +26,11 @@ export const FIX = {
|
|
|
26
26
|
'Products WITH options still show their own (the binding wins); products without show no picker.',
|
|
27
27
|
invisible_text: 'Give it a colour that reads on its ground: sb_set id "<id>", namespace style, keys { "color": … } ' +
|
|
28
28
|
'(or unset "color" so the theme decides). For a button, change its fill or its text — not both to the same.',
|
|
29
|
+
placeholder_link: 'Point it at a real destination: sb_event id "<id>" action "open_page" (a page id) or "go_to_url" ' +
|
|
30
|
+
'{ "url": "/path" } — that writes the href too — or remove the button.',
|
|
31
|
+
low_contrast: 'Darken the type or lighten its ground until it reads at 4.5:1 for body copy (3:1 for large ' +
|
|
32
|
+
'headings): sb_set id "<id>", namespace style, keys { "color": … } — a theme colour ' +
|
|
33
|
+
'(var(--wb-color-heading) / var(--wb-color-text)) keeps it following the palette.',
|
|
29
34
|
example_copy: 'Write this shop\'s own words: sb_set id "<id>", namespace specials, keys { "<key>": … }. ' +
|
|
30
35
|
'A figure, a delivery or return promise, or a customer quote must be TRUE for this shop — ' +
|
|
31
36
|
'if you do not know it, remove the element (sb_remove) rather than guess.',
|
|
@@ -4,6 +4,7 @@ import { stickySeeds } from './sticky.js';
|
|
|
4
4
|
import { TEXT_STYLE_KEYS } from '../../catalog/elements.generated.js';
|
|
5
5
|
import { normalizeUrl } from './discover.js';
|
|
6
6
|
import { ICON_NAMES } from '../../catalog/icons.generated.js';
|
|
7
|
+
import { groundOf } from './theme.js';
|
|
7
8
|
/**
|
|
8
9
|
* THE FOUR FIELDS A SUCCESSFUL THEME WRITE ALREADY COVERS.
|
|
9
10
|
*
|
|
@@ -54,12 +55,11 @@ const str = (v) => typeof v === 'string' && v.trim() !== '' ? v : undefined;
|
|
|
54
55
|
* when they open a page and look at what a heading is. Nothing is averaged: an
|
|
55
56
|
* average of two accents is a third colour that appears nowhere on the site.
|
|
56
57
|
*/
|
|
57
|
-
export function tokensFromPage(doc) {
|
|
58
|
+
export function tokensFromPage(doc, theme) {
|
|
58
59
|
let heading;
|
|
59
60
|
let text;
|
|
60
61
|
let button;
|
|
61
62
|
let section;
|
|
62
|
-
let block;
|
|
63
63
|
// THE PAGE'S OWN BANDS ONLY. A shared header is usually dark with white type
|
|
64
64
|
// and no padding, so reading it first dressed an inserted band in white text
|
|
65
65
|
// on the page's light background.
|
|
@@ -76,8 +76,6 @@ export function tokensFromPage(doc) {
|
|
|
76
76
|
}
|
|
77
77
|
else if (!section && t === 'flex-section')
|
|
78
78
|
section = n;
|
|
79
|
-
else if (!block && t === 'flex-block')
|
|
80
|
-
block = n;
|
|
81
79
|
};
|
|
82
80
|
// NOT FROM A BAND ON A DARK OR COLOURED GROUND. Its type and buttons are
|
|
83
81
|
// inverted on purpose, so they say nothing about the page's own. Measured: a
|
|
@@ -92,21 +90,40 @@ export function tokensFromPage(doc) {
|
|
|
92
90
|
return;
|
|
93
91
|
seen.add(id);
|
|
94
92
|
const t = n.data.type;
|
|
95
|
-
|
|
93
|
+
// A PICTURE IS AN INVERTED GROUND TOO (TTG gap #64): a hero whose dark
|
|
94
|
+
// ground is a background image carried no backgroundColor, read as light,
|
|
95
|
+
// and its white h1 became the ink of every later pattern — white on #f7f9fb.
|
|
96
|
+
const dark = onDark || ((t === 'flex-section' || t === 'flex-block') && !lightGround(groundOf(n, theme)));
|
|
96
97
|
if (!dark)
|
|
97
98
|
visit(n);
|
|
98
99
|
for (const k of n.data.nodes ?? [])
|
|
99
100
|
read(k, dark, seen);
|
|
100
101
|
};
|
|
101
102
|
const seen = new Set();
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
// THE BAND'S CONTENT WIDTH IS ITS OWN CONTAINER'S — a page-level section's
|
|
104
|
+
// DIRECT flex-block, on a light ground — never the first flex-block anywhere:
|
|
105
|
+
// that was a hero's 620px copy column, and it capped a 4-card shelf at 620.
|
|
106
|
+
// The WIDEST such container wins; a narrower one is a deliberate text band.
|
|
107
|
+
const widths = [];
|
|
108
|
+
for (const id of pageChildren(doc)) {
|
|
109
|
+
if (isGlobal(doc, id))
|
|
110
|
+
continue;
|
|
111
|
+
read(id, false, seen);
|
|
112
|
+
const s = doc.nodes[id];
|
|
113
|
+
if (s?.data.type !== 'flex-section' || !lightGround(groundOf(s, theme)))
|
|
114
|
+
continue;
|
|
115
|
+
for (const k of s.data.nodes ?? []) {
|
|
116
|
+
const w = doc.nodes[k]?.data.type === 'flex-block' ? str(styleOf(doc.nodes[k]).maxWidth) : undefined;
|
|
117
|
+
if (w)
|
|
118
|
+
widths.push(w);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const px = widths.filter((w) => /^\d+(\.\d+)?px$/.test(w)).sort((a, b) => parseFloat(b) - parseFloat(a));
|
|
122
|
+
const maxWidth = px[0] ?? widths[0];
|
|
105
123
|
const h = styleOf(heading);
|
|
106
124
|
const p = styleOf(text);
|
|
107
125
|
const b = styleOf(button);
|
|
108
126
|
const s = styleOf(section);
|
|
109
|
-
const bl = styleOf(block);
|
|
110
127
|
return {
|
|
111
128
|
...(str(h.color) ? { headingColor: str(h.color) } : {}),
|
|
112
129
|
...(str(h.fontWeight) ? { headingWeight: str(h.fontWeight) } : {}),
|
|
@@ -116,17 +133,21 @@ export function tokensFromPage(doc) {
|
|
|
116
133
|
...(str(b.color) ? { buttonColor: str(b.color) } : {}),
|
|
117
134
|
...(str(b.borderRadius) ? { buttonRadius: str(b.borderRadius) } : {}),
|
|
118
135
|
...(str(s.padding) ? { sectionPadding: str(s.padding) } : {}),
|
|
119
|
-
...(
|
|
136
|
+
...(maxWidth ? { sectionMaxWidth: maxWidth } : {}),
|
|
120
137
|
};
|
|
121
138
|
}
|
|
122
139
|
/**
|
|
123
140
|
* Is this a ground ordinary type reads on? Unset, transparent, white, the
|
|
124
|
-
* theme's own background token, or a
|
|
125
|
-
*
|
|
126
|
-
* inverted band, which only ever costs a token read, never a wrong one.
|
|
141
|
+
* theme's own background token, or a colour light enough. Anything else — a
|
|
142
|
+
* picture, a dark or saturated colour, an unresolved theme var — is treated as
|
|
143
|
+
* an inverted band, which only ever costs a token read, never a wrong one.
|
|
127
144
|
*/
|
|
128
|
-
function lightGround(
|
|
129
|
-
|
|
145
|
+
function lightGround(ground) {
|
|
146
|
+
if (!ground)
|
|
147
|
+
return true;
|
|
148
|
+
if ('picture' in ground)
|
|
149
|
+
return false;
|
|
150
|
+
const v = ground.color.trim().toLowerCase();
|
|
130
151
|
if (!v || v === 'transparent' || v === 'white' || v === 'var(--wb-color-background)')
|
|
131
152
|
return true;
|
|
132
153
|
let rgb = null;
|