sbuilder-mcp 0.100.2 → 0.100.3
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 +10 -0
- package/CHANGELOG.vi.md +10 -0
- package/dist/catalog/deadkeys.generated.js +2 -2
- package/dist/catalog/elements.generated.js +10 -9
- package/dist/catalog/overlays.generated.js +7 -4
- package/dist/catalog/source.generated.js +2 -2
- package/dist/catalog/storepages.generated.js +5 -5
- package/dist/catalog/theme.generated.js +4 -4
- package/dist/domains/site/findings.js +3 -3
- package/dist/domains/site/review.js +14 -11
- package/dist/domains/site/writecheck.js +11 -8
- package/dist/tools/page.js +11 -9
- package/dist/tools/theme.js +7 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@ 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.100.3] - 2026-10-29
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Element seeds, the starter theme presets and the `sb_store` overlay seeds now use `var(--wb-ts-<slug>-family, Inter)` instead of a hard-coded "Inter", following platform v1.0.187.
|
|
13
|
+
- The cart drawer seed now sets `maxWidth: "100%"`, including in the cart overlay seeds.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- `sb_review` reports `link_colour` only for buttons, because links in text and heading elements now inherit the text colour and are underlined.
|
|
17
|
+
- `sb_review` reports `default_font` for nodes that still hold the old seeded "Inter" fallback, compared with the font family of the element's own text style, and never for `var()` values.
|
|
18
|
+
|
|
9
19
|
## [0.100.2] - 2026-10-29
|
|
10
20
|
|
|
11
21
|
### Changed
|
package/CHANGELOG.vi.md
CHANGED
|
@@ -6,6 +6,16 @@ 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.100.3] - 2026-10-29
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Seed của element, preset theme khởi đầu và seed overlay của `sb_store` nay dùng `var(--wb-ts-<slug>-family, Inter)` thay cho "Inter" cứng, theo platform v1.0.187.
|
|
13
|
+
- Seed cart drawer nay đặt `maxWidth: "100%"`, kể cả trong seed overlay giỏ hàng.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- `sb_review` chỉ báo `link_colour` cho button, vì link trong text và heading nay kế thừa màu chữ và có gạch chân.
|
|
17
|
+
- `sb_review` báo `default_font` cho node còn giữ font gieo cũ "Inter" làm fallback, so với họ font của text style của chính element, và không bao giờ báo với giá trị `var()`.
|
|
18
|
+
|
|
9
19
|
## [0.100.2] - 2026-10-29
|
|
10
20
|
|
|
11
21
|
### Changed
|
|
@@ -4080,7 +4080,7 @@ export const ELEMENTS = {
|
|
|
4080
4080
|
"width": "fit-content",
|
|
4081
4081
|
"height": "fit-content",
|
|
4082
4082
|
"padding": "8px 16px",
|
|
4083
|
-
"fontFamily": "Inter",
|
|
4083
|
+
"fontFamily": "var(--wb-ts-heading-4-family, Inter)",
|
|
4084
4084
|
"color": "#000000"
|
|
4085
4085
|
},
|
|
4086
4086
|
"specials": {
|
|
@@ -10980,7 +10980,7 @@ export const ELEMENTS = {
|
|
|
10980
10980
|
"width": "100%",
|
|
10981
10981
|
"height": "fit-content",
|
|
10982
10982
|
"textAlign": "left",
|
|
10983
|
-
"fontFamily": "Inter",
|
|
10983
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)",
|
|
10984
10984
|
"gap": "16px",
|
|
10985
10985
|
"padding": "0px",
|
|
10986
10986
|
"margin": "0px",
|
|
@@ -12069,7 +12069,7 @@ export const ELEMENTS = {
|
|
|
12069
12069
|
"backgroundColor": "var(--wb-sc-border, #f5f5f5)",
|
|
12070
12070
|
"color": "var(--wb-sc-heading, #171717)",
|
|
12071
12071
|
"textAlign": "left",
|
|
12072
|
-
"fontFamily": "Inter",
|
|
12072
|
+
"fontFamily": "var(--wb-ts-text-2-family, Inter)",
|
|
12073
12073
|
"fontSize": "14px",
|
|
12074
12074
|
"padding": "12px 16px"
|
|
12075
12075
|
},
|
|
@@ -12239,7 +12239,7 @@ export const ELEMENTS = {
|
|
|
12239
12239
|
"width": "100%",
|
|
12240
12240
|
"height": "fit-content",
|
|
12241
12241
|
"textAlign": "left",
|
|
12242
|
-
"fontFamily": "Inter",
|
|
12242
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)",
|
|
12243
12243
|
"lineHeight": "140%",
|
|
12244
12244
|
"gap": "8px",
|
|
12245
12245
|
"color": "#111111",
|
|
@@ -13061,6 +13061,7 @@ export const ELEMENTS = {
|
|
|
13061
13061
|
"display": "flex",
|
|
13062
13062
|
"flexDirection": "column",
|
|
13063
13063
|
"width": "400px",
|
|
13064
|
+
"maxWidth": "100%",
|
|
13064
13065
|
"gap": "8px",
|
|
13065
13066
|
"padding": "20px 24px",
|
|
13066
13067
|
"backgroundColor": "#ffffff",
|
|
@@ -17265,7 +17266,7 @@ export const ELEMENTS = {
|
|
|
17265
17266
|
"childAllows": [],
|
|
17266
17267
|
"defaults": {
|
|
17267
17268
|
"style": {
|
|
17268
|
-
"fontFamily": "Inter",
|
|
17269
|
+
"fontFamily": "var(--wb-ts-heading-6-family, Inter)",
|
|
17269
17270
|
"color": "var(--wb-sc-heading, #000000)",
|
|
17270
17271
|
"lineHeight": "1.3",
|
|
17271
17272
|
"fontWeight": "700",
|
|
@@ -17389,7 +17390,7 @@ export const ELEMENTS = {
|
|
|
17389
17390
|
}
|
|
17390
17391
|
},
|
|
17391
17392
|
"style": {
|
|
17392
|
-
"fontFamily": "Inter",
|
|
17393
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)",
|
|
17393
17394
|
"fontSize": "16px",
|
|
17394
17395
|
"color": "var(--wb-sc-link, #171717)",
|
|
17395
17396
|
"lineHeight": "1.3",
|
|
@@ -33839,7 +33840,7 @@ export const ELEMENTS = {
|
|
|
33839
33840
|
"color": "#111111",
|
|
33840
33841
|
"fontSize": "16px",
|
|
33841
33842
|
"textAlign": "left",
|
|
33842
|
-
"fontFamily": "Inter",
|
|
33843
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)",
|
|
33843
33844
|
"--wb-cl-cols": "3",
|
|
33844
33845
|
"--wb-cl-gap": "24px",
|
|
33845
33846
|
"--wb-cl-grow": "0"
|
|
@@ -39776,7 +39777,7 @@ export const ELEMENT_SEEDS = {
|
|
|
39776
39777
|
"fontSize": "16px",
|
|
39777
39778
|
"lineHeight": "140%",
|
|
39778
39779
|
"textAlign": "left",
|
|
39779
|
-
"fontFamily": "Inter"
|
|
39780
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)"
|
|
39780
39781
|
},
|
|
39781
39782
|
"config": {
|
|
39782
39783
|
"kind": "price"
|
|
@@ -39789,7 +39790,7 @@ export const ELEMENT_SEEDS = {
|
|
|
39789
39790
|
"fontSize": "16px",
|
|
39790
39791
|
"lineHeight": "140%",
|
|
39791
39792
|
"textAlign": "left",
|
|
39792
|
-
"fontFamily": "Inter"
|
|
39793
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)"
|
|
39793
39794
|
},
|
|
39794
39795
|
"config": {
|
|
39795
39796
|
"kind": "compare_price"
|
|
@@ -31,6 +31,7 @@ export const OVERLAY_SEEDS = {
|
|
|
31
31
|
"display": "flex",
|
|
32
32
|
"flexDirection": "column",
|
|
33
33
|
"width": "400px",
|
|
34
|
+
"maxWidth": "100%",
|
|
34
35
|
"gap": "8px",
|
|
35
36
|
"padding": "20px 24px",
|
|
36
37
|
"backgroundColor": "#ffffff",
|
|
@@ -1470,7 +1471,7 @@ export const OVERLAY_SEEDS = {
|
|
|
1470
1471
|
"fontSize": "16px",
|
|
1471
1472
|
"lineHeight": "140%",
|
|
1472
1473
|
"textAlign": "left",
|
|
1473
|
-
"fontFamily": "Inter"
|
|
1474
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)"
|
|
1474
1475
|
},
|
|
1475
1476
|
"config": {
|
|
1476
1477
|
"kind": "price",
|
|
@@ -1538,7 +1539,7 @@ export const OVERLAY_SEEDS = {
|
|
|
1538
1539
|
"fontSize": "16px",
|
|
1539
1540
|
"lineHeight": "140%",
|
|
1540
1541
|
"textAlign": "left",
|
|
1541
|
-
"fontFamily": "Inter"
|
|
1542
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)"
|
|
1542
1543
|
},
|
|
1543
1544
|
"config": {
|
|
1544
1545
|
"kind": "compare_price",
|
|
@@ -1682,7 +1683,7 @@ export const OVERLAY_SEEDS = {
|
|
|
1682
1683
|
"custom": {}
|
|
1683
1684
|
},
|
|
1684
1685
|
"style": {
|
|
1685
|
-
"fontFamily": "Inter",
|
|
1686
|
+
"fontFamily": "var(--wb-ts-heading-6-family, Inter)",
|
|
1686
1687
|
"color": "var(--wb-sc-heading, #000000)",
|
|
1687
1688
|
"lineHeight": "1.3",
|
|
1688
1689
|
"fontWeight": "700",
|
|
@@ -1707,7 +1708,7 @@ export const OVERLAY_SEEDS = {
|
|
|
1707
1708
|
"custom": {}
|
|
1708
1709
|
},
|
|
1709
1710
|
"style": {
|
|
1710
|
-
"fontFamily": "Inter",
|
|
1711
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)",
|
|
1711
1712
|
"fontSize": "16px",
|
|
1712
1713
|
"color": "var(--wb-sc-link, #171717)",
|
|
1713
1714
|
"lineHeight": "1.3",
|
|
@@ -2080,6 +2081,7 @@ export const CART_SEEDS = {
|
|
|
2080
2081
|
"display": "flex",
|
|
2081
2082
|
"flexDirection": "column",
|
|
2082
2083
|
"width": "400px",
|
|
2084
|
+
"maxWidth": "100%",
|
|
2083
2085
|
"gap": "8px",
|
|
2084
2086
|
"padding": "20px 24px",
|
|
2085
2087
|
"backgroundColor": "#ffffff",
|
|
@@ -2917,6 +2919,7 @@ export const CART_SEEDS = {
|
|
|
2917
2919
|
"display": "flex",
|
|
2918
2920
|
"flexDirection": "column",
|
|
2919
2921
|
"width": "400px",
|
|
2922
|
+
"maxWidth": "100%",
|
|
2920
2923
|
"gap": "8px",
|
|
2921
2924
|
"padding": "20px 24px",
|
|
2922
2925
|
"backgroundColor": "#ffffff",
|
|
@@ -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": "ab273ce14722dcc17f81176e01415a1892e5d878",
|
|
5
|
+
"committedAt": "2026-10-29T18:33:35+07:00",
|
|
6
6
|
"dirty": false
|
|
7
7
|
};
|
|
@@ -531,7 +531,7 @@ export const PAGE_LAYOUT_SEEDS = {
|
|
|
531
531
|
"backgroundColor": "var(--wb-sc-border, #f5f5f5)",
|
|
532
532
|
"color": "var(--wb-sc-heading, #171717)",
|
|
533
533
|
"textAlign": "left",
|
|
534
|
-
"fontFamily": "Inter",
|
|
534
|
+
"fontFamily": "var(--wb-ts-text-2-family, Inter)",
|
|
535
535
|
"fontSize": "14px",
|
|
536
536
|
"padding": "12px 16px"
|
|
537
537
|
},
|
|
@@ -2183,7 +2183,7 @@ export const STORE_PAGE_SEEDS = {
|
|
|
2183
2183
|
"fontSize": "16px",
|
|
2184
2184
|
"lineHeight": "140%",
|
|
2185
2185
|
"textAlign": "left",
|
|
2186
|
-
"fontFamily": "Inter"
|
|
2186
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)"
|
|
2187
2187
|
},
|
|
2188
2188
|
"config": {
|
|
2189
2189
|
"kind": "price",
|
|
@@ -2251,7 +2251,7 @@ export const STORE_PAGE_SEEDS = {
|
|
|
2251
2251
|
"fontSize": "16px",
|
|
2252
2252
|
"lineHeight": "140%",
|
|
2253
2253
|
"textAlign": "left",
|
|
2254
|
-
"fontFamily": "Inter"
|
|
2254
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)"
|
|
2255
2255
|
},
|
|
2256
2256
|
"config": {
|
|
2257
2257
|
"kind": "compare_price",
|
|
@@ -2395,7 +2395,7 @@ export const STORE_PAGE_SEEDS = {
|
|
|
2395
2395
|
"custom": {}
|
|
2396
2396
|
},
|
|
2397
2397
|
"style": {
|
|
2398
|
-
"fontFamily": "Inter",
|
|
2398
|
+
"fontFamily": "var(--wb-ts-heading-6-family, Inter)",
|
|
2399
2399
|
"color": "var(--wb-sc-heading, #000000)",
|
|
2400
2400
|
"lineHeight": "1.3",
|
|
2401
2401
|
"fontWeight": "700",
|
|
@@ -2420,7 +2420,7 @@ export const STORE_PAGE_SEEDS = {
|
|
|
2420
2420
|
"custom": {}
|
|
2421
2421
|
},
|
|
2422
2422
|
"style": {
|
|
2423
|
-
"fontFamily": "Inter",
|
|
2423
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)",
|
|
2424
2424
|
"fontSize": "16px",
|
|
2425
2425
|
"color": "var(--wb-sc-link, #171717)",
|
|
2426
2426
|
"lineHeight": "1.3",
|
|
@@ -263,7 +263,7 @@ export const STARTER_THEME = {
|
|
|
263
263
|
"padding": "10px 24px",
|
|
264
264
|
"textAlign": "center",
|
|
265
265
|
"fontSize": "14px",
|
|
266
|
-
"fontFamily": "Inter",
|
|
266
|
+
"fontFamily": "var(--wb-ts-text-2-family, Inter)",
|
|
267
267
|
"lineHeight": "20px"
|
|
268
268
|
},
|
|
269
269
|
"responsive": {
|
|
@@ -556,7 +556,7 @@ export const STARTER_THEME = {
|
|
|
556
556
|
"base": {
|
|
557
557
|
"textAlign": "left",
|
|
558
558
|
"lineHeight": "130%",
|
|
559
|
-
"fontFamily": "Inter",
|
|
559
|
+
"fontFamily": "var(--wb-ts-heading-1-family, Inter)",
|
|
560
560
|
"fontSize": "48px",
|
|
561
561
|
"color": "var(--wb-sc-heading, var(--wb-color-heading))"
|
|
562
562
|
},
|
|
@@ -642,7 +642,7 @@ export const STARTER_THEME = {
|
|
|
642
642
|
"base": {
|
|
643
643
|
"textAlign": "left",
|
|
644
644
|
"lineHeight": "140%",
|
|
645
|
-
"fontFamily": "Inter",
|
|
645
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)",
|
|
646
646
|
"fontSize": "16px",
|
|
647
647
|
"color": "var(--wb-sc-text, var(--wb-color-text))"
|
|
648
648
|
}
|
|
@@ -654,7 +654,7 @@ export const STARTER_THEME = {
|
|
|
654
654
|
"base": {
|
|
655
655
|
"textAlign": "left",
|
|
656
656
|
"lineHeight": "140%",
|
|
657
|
-
"fontFamily": "Inter",
|
|
657
|
+
"fontFamily": "var(--wb-ts-text-1-family, Inter)",
|
|
658
658
|
"fontSize": "16px",
|
|
659
659
|
"color": "var(--wb-sc-text, var(--wb-color-text))"
|
|
660
660
|
}
|
|
@@ -30,9 +30,9 @@ export const FIX = {
|
|
|
30
30
|
'A figure, a delivery or return promise, or a customer quote must be TRUE for this shop — ' +
|
|
31
31
|
'if you do not know it, remove the element (sb_remove) rather than guess.',
|
|
32
32
|
link_colour: 'Colour each link inline: sb_set id "<id>", namespace specials, keys { "textHtml": … } with ' +
|
|
33
|
-
'<a href="…" style="color:inherit">
|
|
34
|
-
default_font: 'Wear the
|
|
35
|
-
'
|
|
33
|
+
'<a href="…" style="color:inherit"> — or drop the inner link and give the button its own href.',
|
|
34
|
+
default_font: 'Wear the theme\'s font again: sb_set id "<id>", namespace style, base true, keys { "fontFamily": ' +
|
|
35
|
+
'<the var(--wb-ts-…) the problem names> } — the element\'s seed today, so it follows the theme.',
|
|
36
36
|
default_seed_copy: 'Write it in the shop\'s own language and ink: sb_set id "<id>", namespace specials, ' +
|
|
37
37
|
'keys { "<key>": … }. It is a seeded satellite (an empty state, an element\'s chrome), ' +
|
|
38
38
|
'so it only appears when the list is empty or the control is idle — sb_outline lists it ' +
|
|
@@ -12,7 +12,7 @@ import { formFieldFindings, isFormDocument } from './formdoc.js';
|
|
|
12
12
|
import { deadNavigation, hasPurchaseBinding, liveEventTable, PAYLOAD_NEEDS, PRODUCT_ACTION_BINDING_ID, soleNavigationClick } from './navhref.js';
|
|
13
13
|
import { unknownValueNote, unknownWriteNote, vocabularyFor, vocabularyForWrite } from './vocabulary.js';
|
|
14
14
|
import { iconNote } from './icons.js';
|
|
15
|
-
import { LINK_COLOUR, unstyledLinks } from './writecheck.js';
|
|
15
|
+
import { LINK_COLOUR, LINK_INHERITS, unstyledLinks } from './writecheck.js';
|
|
16
16
|
/**
|
|
17
17
|
* A defect somebody looking at the page would see.
|
|
18
18
|
*
|
|
@@ -529,27 +529,30 @@ opts = {}) {
|
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
// A LINK IN RICH TEXT IS THE BROWSER'S BLUE — see writecheck LINK_COLOUR
|
|
532
|
+
// A LINK IN A BUTTON'S RICH TEXT IS THE BROWSER'S BLUE — see writecheck LINK_COLOUR.
|
|
533
533
|
const html = (n.specials ?? {}).textHtml;
|
|
534
|
-
if (typeof html === 'string' && unstyledLinks(html)) {
|
|
534
|
+
if (typeof html === 'string' && !LINK_INHERITS.has(type) && unstyledLinks(html)) {
|
|
535
535
|
out.push({ code: 'link_colour', nodeId: id, type, key: 'textHtml', problem: LINK_COLOUR.problem, fix: fill('link_colour', { id }) });
|
|
536
536
|
}
|
|
537
|
-
//
|
|
538
|
-
//
|
|
539
|
-
//
|
|
540
|
-
//
|
|
541
|
-
//
|
|
542
|
-
//
|
|
537
|
+
// A NODE STILL ON THE OLD LITERAL SEED FONT (TTG gap #51). Until web_builder
|
|
538
|
+
// v1.0.187 (e8900e4d9) a few elements seeded a LITERAL "Inter"; they now seed
|
|
539
|
+
// `var(--wb-ts-<slug>-family, Inter)`. A node created before that still holds
|
|
540
|
+
// the bare fallback, so on a site set in Be Vietnam Pro it renders in Inter.
|
|
541
|
+
// Flag only that exact residue — the stored value equals the fallback of the
|
|
542
|
+
// element's own seed var — against the family of the text style that var
|
|
543
|
+
// names. A var() is never flagged; a deliberate literal is the author's.
|
|
543
544
|
const ff = n.style?.fontFamily;
|
|
544
545
|
const seedFont = meta.defaults.style?.fontFamily;
|
|
546
|
+
const seed = typeof seedFont === 'string' ? /^var\(--wb-ts-([a-z0-9-]+)-family,\s*(.+)\)$/.exec(seedFont) : null;
|
|
547
|
+
const themed = seed ? opts.fonts?.[seed[1]] : undefined;
|
|
545
548
|
// A family set at any breakpoint is the author's answer too.
|
|
546
549
|
const perBp = Object.values(n.responsive ?? {}).some((r) => r?.style?.fontFamily !== undefined);
|
|
547
|
-
if (
|
|
550
|
+
if (seed && themed && !perBp && typeof ff === 'string' && family(ff) === family(seed[2]) && !ff.includes('var(') && family(ff) !== family(themed)) {
|
|
548
551
|
out.push({
|
|
549
552
|
code: 'default_font',
|
|
550
553
|
nodeId: id,
|
|
551
554
|
type,
|
|
552
|
-
problem: `Still the element's
|
|
555
|
+
problem: `Still the element's old literal seed font "${ff}", while the site's ${seed[1]} text style is "${family(themed, true)}" — it renders in a typeface nothing else on the page uses. The element now seeds ${seedFont}.`,
|
|
553
556
|
fix: fill('default_font', { id }),
|
|
554
557
|
});
|
|
555
558
|
}
|
|
@@ -273,11 +273,12 @@ export function writeCheck(type, namespace, keys, opts = {}) {
|
|
|
273
273
|
'never <p>/<div>, and put a separate block in its own node. A link goes to http(s), mailto, tel or a ' +
|
|
274
274
|
'relative path; no comments.');
|
|
275
275
|
}
|
|
276
|
-
// A LINK IN RICH TEXT IS THE BROWSER'S BLUE.
|
|
277
|
-
//
|
|
278
|
-
//
|
|
279
|
-
//
|
|
280
|
-
|
|
276
|
+
// A LINK IN A BUTTON'S RICH TEXT IS THE BROWSER'S BLUE. Since web_builder
|
|
277
|
+
// v1.0.187 (a8097f59e) `.wb-text a` / `.wb-heading a` inherit the text
|
|
278
|
+
// colour, underlined — TTG gap #50 is closed there. `button` renders
|
|
279
|
+
// textHtml too (nodes.RichText) and its static CSS styles no `a`, so an <a>
|
|
280
|
+
// with no colour of its own still paints rgb(0,0,238) inside one.
|
|
281
|
+
if (namespace === 'specials' && typeof v === 'string' && rich.includes(k) && !bad.length && !LINK_INHERITS.has(type) && unstyledLinks(v)) {
|
|
281
282
|
push(`link-colour:${type}.${k}`, 'link_colour', k, LINK_COLOUR.problem, LINK_COLOUR.fix);
|
|
282
283
|
}
|
|
283
284
|
if (namespace === 'specials') {
|
|
@@ -303,10 +304,12 @@ export function writeCheck(type, namespace, keys, opts = {}) {
|
|
|
303
304
|
export function unstyledLinks(html) {
|
|
304
305
|
return (html.match(/<a\b[^>]*>/gi) ?? []).filter((tag) => !/style\s*=\s*["'](?:[^"']*[;\s])?color\s*:/i.test(tag)).length;
|
|
305
306
|
}
|
|
307
|
+
/** Elements whose static CSS gives an <a> in textHtml the text's own colour (web_builder a8097f59e). */
|
|
308
|
+
export const LINK_INHERITS = new Set(['heading', 'text']);
|
|
306
309
|
export const LINK_COLOUR = {
|
|
307
|
-
problem: "A link in this rich text has no colour of its own, so it renders in the browser's default link blue " +
|
|
308
|
-
'(rgb(0,0,238))
|
|
309
|
-
fix: 'Give each <a> its colour inline: <a href="…" style="color:inherit"
|
|
310
|
+
problem: "A link in this button's rich text has no colour of its own, so it renders in the browser's default link blue " +
|
|
311
|
+
'(rgb(0,0,238)) — text and heading make a link inherit their colour; a button styles no <a>.',
|
|
312
|
+
fix: 'Give each <a> its colour inline: <a href="…" style="color:inherit">, or drop the inner link and give the button its own href.',
|
|
310
313
|
};
|
|
311
314
|
/**
|
|
312
315
|
* `specials.formRules` on a form root, judged against the open form document.
|
package/dist/tools/page.js
CHANGED
|
@@ -49,8 +49,8 @@ import { FILTER_VALUE_TYPES, RESOURCE_KEYS, filterPatches, wantsRows } from '../
|
|
|
49
49
|
* copies of a directive is how one of them quietly loses it. The fix for each
|
|
50
50
|
* KIND is sent once under `fixes`, and the directive once per process.
|
|
51
51
|
*/
|
|
52
|
-
export function reviewField(ctx, doc, formTypes, pageType, formDocType, formRedirects, siteLocale,
|
|
53
|
-
const all = reviewDesign(doc, { formTypes, pageType, formDocType, formRedirects, siteLocale,
|
|
52
|
+
export function reviewField(ctx, doc, formTypes, pageType, formDocType, formRedirects, siteLocale, fonts) {
|
|
53
|
+
const all = reviewDesign(doc, { formTypes, pageType, formDocType, formRedirects, siteLocale, fonts });
|
|
54
54
|
if (all.length === 0)
|
|
55
55
|
return {};
|
|
56
56
|
// MAINTENANCE IS ADVICE, kept out of `findings`: it works for a visitor, so
|
|
@@ -2041,19 +2041,21 @@ export function registerPageTools(server, ctx) {
|
|
|
2041
2041
|
catch {
|
|
2042
2042
|
// Readiness is additional information, never the reason a review fails.
|
|
2043
2043
|
}
|
|
2044
|
-
// The site's
|
|
2045
|
-
// is set in Inter, so it can never disagree with an
|
|
2046
|
-
|
|
2044
|
+
// The site's font per text style, for `default_font` — a SITE theme only: the
|
|
2045
|
+
// starter is set in Inter, so it can never disagree with an old literal Inter.
|
|
2046
|
+
const fonts = {};
|
|
2047
2047
|
try {
|
|
2048
2048
|
const { theme, from } = await siteTheme(ctx, session.site());
|
|
2049
|
-
const
|
|
2050
|
-
|
|
2051
|
-
|
|
2049
|
+
for (const t of from === 'site' ? theme.textStyles : []) {
|
|
2050
|
+
const f = t.base?.fontFamily;
|
|
2051
|
+
if (typeof f === 'string' && f && !f.includes('var('))
|
|
2052
|
+
fonts[t.slug] = f;
|
|
2053
|
+
}
|
|
2052
2054
|
}
|
|
2053
2055
|
catch {
|
|
2054
2056
|
// A theme that cannot be read is a finding nobody gets, never a failed review.
|
|
2055
2057
|
}
|
|
2056
|
-
const field = reviewField(ctx, doc, formTypes, pageType, session.formType(), formRedirects, siteLocale,
|
|
2058
|
+
const field = reviewField(ctx, doc, formTypes, pageType, session.formType(), formRedirects, siteLocale, fonts);
|
|
2057
2059
|
// Clean = no finding a visitor meets; `advice` (maintenance) rides beside the verdict.
|
|
2058
2060
|
const clean = !field.findings;
|
|
2059
2061
|
return text({
|
package/dist/tools/theme.js
CHANGED
|
@@ -278,11 +278,13 @@ export function registerThemeTools(server, ctx) {
|
|
|
278
278
|
for (const [id, decls] of Object.entries(presets ?? {})) {
|
|
279
279
|
patchLayers(theme.presets.find((p) => p.id === id), decls, `presets.${id}`, changes);
|
|
280
280
|
}
|
|
281
|
-
// A FAMILY ON A TEXT STYLE REACHES NOTHING A PRESET PINS.
|
|
282
|
-
//
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
//
|
|
281
|
+
// A FAMILY ON A TEXT STYLE REACHES NOTHING A PRESET PINS. A site theme saved
|
|
282
|
+
// before web_builder v1.0.187 carries a literal `fontFamily: "Inter"` on
|
|
283
|
+
// heading-default, text-default, text-dataset-default and button-default
|
|
284
|
+
// (the starter now seeds `var(--wb-ts-…-family, Inter)`), so changing the
|
|
285
|
+
// style's family changed nothing on headings or buttons — measured on a
|
|
286
|
+
// live storefront. Named, not fixed: which presets should follow is the
|
|
287
|
+
// caller's design decision.
|
|
286
288
|
const families = new Set(Object.values(text_styles ?? {})
|
|
287
289
|
.map((d) => d.fontFamily)
|
|
288
290
|
.filter((f) => typeof f === 'string'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sbuilder-mcp",
|
|
3
|
-
"version": "0.100.
|
|
3
|
+
"version": "0.100.3",
|
|
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",
|