sbuilder-mcp 0.98.1 → 0.98.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 +19 -0
- package/CHANGELOG.vi.md +19 -0
- package/dist/catalog/deadkeys.generated.js +2 -2
- package/dist/catalog/richtext.generated.js +52 -0
- package/dist/catalog/source.generated.js +2 -2
- package/dist/domains/site/inert.js +67 -4
- package/dist/domains/site/review.js +27 -7
- package/dist/domains/site/writecheck.js +59 -0
- package/dist/tools/page.js +17 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,25 @@ 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.98.3] - 2026-10-28
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- `sb_review` reports `no_data_context` for a cart-item only when it sits outside a cart-order or binds keys a cart line does not fill, because a cart line supplies just `product.title`, `product.image`, `product.price` and `product.priceCents`.
|
|
13
|
+
- `sb_review` no longer reports `no_data_context` for pricing or media seed keys inside a cart line that also binds a key the line fills.
|
|
14
|
+
- `sb_review` and `sb_add` report `rich_dropped` for `specials.textHtml` containing `javascript:` or non-image `data:` URLs, entity-encoded colons, comments and doctypes, and tags hidden behind `>` inside quoted attribute values.
|
|
15
|
+
|
|
16
|
+
## [0.98.2] - 2026-10-28
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- `sb_review` and `sb_add` report `rich_dropped` when `specials.textHtml` contains tags or attributes outside the platform's inline allowlist, because the platform drops the whole value and renders plain escaped `text`.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- `sb_add` and `sb_set` explain `base_only` once and list the affected keys instead of repeating the explanation per key.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- `sb_review` no longer reports `no_data_context` for `product.*` bindings inside a cart-item, because each cart line supplies its own product keys.
|
|
26
|
+
- `sb_add` no longer shows position-dependent inert hints (accordion-content, menu-drawer, satellite) when the parent is already the owning node.
|
|
27
|
+
|
|
9
28
|
## [0.98.1] - 2026-10-28
|
|
10
29
|
|
|
11
30
|
### Fixed
|
package/CHANGELOG.vi.md
CHANGED
|
@@ -6,6 +6,25 @@ 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.98.3] - 2026-10-28
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- `sb_review` chỉ báo `no_data_context` cho cart-item khi nó nằm ngoài cart-order hoặc gắn các key mà dòng giỏ hàng không điền, vì dòng giỏ hàng chỉ cung cấp `product.title`, `product.image`, `product.price` và `product.priceCents`.
|
|
13
|
+
- `sb_review` không còn báo `no_data_context` cho các key seed của pricing hoặc media trong dòng giỏ hàng có gắn thêm một key mà dòng đó điền.
|
|
14
|
+
- `sb_review` và `sb_add` báo `rich_dropped` cho `specials.textHtml` chứa URL `javascript:` hoặc `data:` không phải ảnh, dấu `:` mã hóa thực thể, comment và doctype, cùng thẻ ẩn sau `>` trong giá trị thuộc tính có ngoặc.
|
|
15
|
+
|
|
16
|
+
## [0.98.2] - 2026-10-28
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- `sb_review` và `sb_add` báo `rich_dropped` khi `specials.textHtml` chứa thẻ hoặc thuộc tính ngoài allowlist inline của nền tảng, vì nền tảng bỏ nguyên giá trị và hiển thị `text` thường đã escape.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- `sb_add` và `sb_set` giải thích `base_only` một lần và liệt kê các key bị ảnh hưởng thay vì lặp lại lời giải thích cho từng key.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- `sb_review` không còn báo `no_data_context` cho binding `product.*` trong cart-item, vì mỗi dòng giỏ hàng tự cung cấp các key product.
|
|
26
|
+
- `sb_add` không còn hiện gợi ý inert phụ thuộc vị trí (accordion-content, menu-drawer, satellite) khi cha đã là node chủ.
|
|
27
|
+
|
|
9
28
|
## [0.98.1] - 2026-10-28
|
|
10
29
|
|
|
11
30
|
### Fixed
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-catalog.ts — do not edit by hand.
|
|
2
|
+
// Source: <WB_REPO>/server/pkg/sanitize/inline.go (InlineRichSpecials) and
|
|
3
|
+
// server/pkg/sanitize/sanitize.go (inlineTags, globalAttrs, tagAttrs), the
|
|
4
|
+
// allowlists sanitize.IsInlineRepresentable checks for scope.GateInlineRichSpecials.
|
|
5
|
+
/**
|
|
6
|
+
* A rich special (`specials.<key>`) holding a tag or attribute outside these
|
|
7
|
+
* lists is DELETED at render, whole, and the node shows its escaped plain text.
|
|
8
|
+
*/
|
|
9
|
+
export const INLINE_RICH = {
|
|
10
|
+
"specials": [
|
|
11
|
+
"textHtml"
|
|
12
|
+
],
|
|
13
|
+
"tags": [
|
|
14
|
+
"strong",
|
|
15
|
+
"b",
|
|
16
|
+
"em",
|
|
17
|
+
"i",
|
|
18
|
+
"u",
|
|
19
|
+
"s",
|
|
20
|
+
"sup",
|
|
21
|
+
"sub",
|
|
22
|
+
"mark",
|
|
23
|
+
"span",
|
|
24
|
+
"a",
|
|
25
|
+
"br"
|
|
26
|
+
],
|
|
27
|
+
"globalAttrs": [
|
|
28
|
+
"title",
|
|
29
|
+
"style"
|
|
30
|
+
],
|
|
31
|
+
"tagAttrs": {
|
|
32
|
+
"a": [
|
|
33
|
+
"href",
|
|
34
|
+
"target",
|
|
35
|
+
"rel"
|
|
36
|
+
],
|
|
37
|
+
"img": [
|
|
38
|
+
"src",
|
|
39
|
+
"alt",
|
|
40
|
+
"width",
|
|
41
|
+
"height"
|
|
42
|
+
],
|
|
43
|
+
"td": [
|
|
44
|
+
"colspan",
|
|
45
|
+
"rowspan"
|
|
46
|
+
],
|
|
47
|
+
"th": [
|
|
48
|
+
"colspan",
|
|
49
|
+
"rowspan"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
};
|
|
@@ -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": "ffe952be6a095440ae6498761718e4fcb9cac336",
|
|
5
|
+
"committedAt": "2026-10-28T17:25:38+07:00",
|
|
6
6
|
"dirty": false
|
|
7
7
|
};
|
|
@@ -1,3 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ELEMENTS THAT RENDER CONVINCINGLY WHILE DOING NOTHING.
|
|
3
|
+
*
|
|
4
|
+
* The ordinary silent failure in this platform is a value stored where nothing
|
|
5
|
+
* reads it. This is the other shape: the element renders, looks finished, and is
|
|
6
|
+
* wired to nothing — so neither `sb_review` (which reads the tree, and the tree
|
|
7
|
+
* is correct) nor `sb_look` (which photographs the page, and the page looks
|
|
8
|
+
* right) can see it. The only moment the fact is cheap to deliver is the moment
|
|
9
|
+
* the element is ADDED, which is what this table is for.
|
|
10
|
+
*
|
|
11
|
+
* Each entry names what the element still NEEDS, because in every case the first
|
|
12
|
+
* write — dropping it on the page — succeeds completely. For most that is a
|
|
13
|
+
* second WRITE: a config key to point at a host, an id to reference, a setting
|
|
14
|
+
* to turn on. For a few it is a CONDITION the agent cannot write at all —
|
|
15
|
+
* `rating-stars` renders zero pixels until the store has published reviews, and
|
|
16
|
+
* says so rather than offering a fix that does not exist. Both shapes belong;
|
|
17
|
+
* the header used to promise only the first, which stopped being true the day
|
|
18
|
+
* the table was audited from three entries to twenty.
|
|
19
|
+
*
|
|
20
|
+
* NOT every element that can render empty belongs here. A list with no products
|
|
21
|
+
* yet is a CORRECT list waiting for data — it shows its own honest empty state,
|
|
22
|
+
* and the catalogue check already reports it. What belongs is narrower: a
|
|
23
|
+
* competent author who did the first, obvious thing would be SURPRISED, because
|
|
24
|
+
* nothing anywhere — not the tree, not the screenshot, not an error — says so.
|
|
25
|
+
*
|
|
26
|
+
* This table is hand-kept, and it will go stale on the next platform release —
|
|
27
|
+
* `quickview` was the proof once already: it arrived with the element, and this
|
|
28
|
+
* table did not know. It cannot be generated today. Fourteen of the eighteen
|
|
29
|
+
* element types that appear in some parent's `childAllows` genuinely need one
|
|
30
|
+
* (`tab-content`, `list-item`, …) and four are just general elements a permissive
|
|
31
|
+
* parent happens to accept (`heading` inside `search-input`, `image` inside
|
|
32
|
+
* `image-marquee`) — nothing on the meta separates the two. `locked` is true for
|
|
33
|
+
* only some of the entries below and false on others that belong just as much
|
|
34
|
+
* (`bundle-items`, `chat-widget`); `hideInLayer` is false on all of them; and
|
|
35
|
+
* `category` puts a real trap (`accordion-content`) in the same bucket as
|
|
36
|
+
* ordinary content (`heading`) that is not one. The durable fix is upstream: a
|
|
37
|
+
* flag on the element meta saying it renders only through a host, or only once
|
|
38
|
+
* a named condition (an app, a locale count, a signed grant) is met — until the
|
|
39
|
+
* platform declares that, this table is the only place the fact lives.
|
|
40
|
+
*
|
|
41
|
+
* The staleness is DETECTED now, even though the table still cannot be
|
|
42
|
+
* generated: `scripts/inert-drift.ts` runs on every codegen and every
|
|
43
|
+
* `codegen:check`, matching each element's own prose against the render language
|
|
44
|
+
* every kept entry here uses ("only renders inside/through/as"), and warning
|
|
45
|
+
* about any that is in neither this table nor its `AUDIT_REJECTED` ledger. It
|
|
46
|
+
* catches 15 of the 21 below — enough to warn, nowhere near enough to generate —
|
|
47
|
+
* and it would have caught `quickview`. An element REJECTED after being read
|
|
48
|
+
* against the criterion above belongs in that ledger with its reason, not here.
|
|
49
|
+
*/
|
|
50
|
+
import { SATELLITE_RULES } from '../../catalog/elements.generated.js';
|
|
1
51
|
export const INERT_ON_ADD = {
|
|
2
52
|
// `localeSwitchPayload` returns "" below two languages, and the renderer's
|
|
3
53
|
// fallback is a FABRICATED chip — `sample = {Code: "VI", Name: "Tiếng Việt",
|
|
@@ -181,6 +231,7 @@ export const INERT_ON_ADD = {
|
|
|
181
231
|
'other container it is accepted (nothing refuses it) and, per its own AVOID, does not ' +
|
|
182
232
|
'render there. Add it only as a child of an accordion; for a standalone section use ' +
|
|
183
233
|
'flex-section instead.',
|
|
234
|
+
host: 'accordion',
|
|
184
235
|
},
|
|
185
236
|
// hamburger-menu is a container with NO childAllows restriction, so it
|
|
186
237
|
// accepts a menu-drawer anywhere in the page just as readily as inside
|
|
@@ -191,6 +242,7 @@ export const INERT_ON_ADD = {
|
|
|
191
242
|
'drawer placed elsewhere on the page, and per its own AVOID it then "only renders as that ' +
|
|
192
243
|
"element's panel,\" i.e. never. Add it under the hamburger-menu it should belong to, not " +
|
|
193
244
|
'beside it.',
|
|
245
|
+
host: 'hamburger-menu',
|
|
194
246
|
},
|
|
195
247
|
// `menu` itself cannot hold children at all (isContainer: false), so a
|
|
196
248
|
// menu-panel is wired from the MENU ENTRY's own configuration, never from
|
|
@@ -207,12 +259,23 @@ export const INERT_ON_ADD = {
|
|
|
207
259
|
export function inertHint(type) {
|
|
208
260
|
return INERT_ON_ADD[type]?.note ?? null;
|
|
209
261
|
}
|
|
210
|
-
/**
|
|
211
|
-
|
|
262
|
+
/** Does `type` render under a parent of `parent`'s type (its host, or a satellite owner)? */
|
|
263
|
+
function hosted(type, parent) {
|
|
264
|
+
if (!parent)
|
|
265
|
+
return false;
|
|
266
|
+
return INERT_ON_ADD[type]?.host === parent || !!SATELLITE_RULES[parent]?.some((r) => r.type === type);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Every distinct hint for the nodes of a subtree spec, deduped, in add order.
|
|
270
|
+
* A node may carry its parent's TYPE, which silences a hint about placement
|
|
271
|
+
* when the placement is the right one.
|
|
272
|
+
*/
|
|
273
|
+
export function inertHintsFor(placed) {
|
|
212
274
|
const seen = new Set();
|
|
213
275
|
const out = [];
|
|
214
|
-
for (const
|
|
215
|
-
|
|
276
|
+
for (const p of placed) {
|
|
277
|
+
const { type: t, parent } = typeof p === 'string' ? { type: p, parent: undefined } : p;
|
|
278
|
+
if (seen.has(t) || hosted(t, parent))
|
|
216
279
|
continue;
|
|
217
280
|
const note = inertHint(t);
|
|
218
281
|
if (!note)
|
|
@@ -187,6 +187,13 @@ function contrast(a, b) {
|
|
|
187
187
|
const RECORD_ENTITIES = new Set(['product', 'category', 'course', 'article', 'blogCategory', 'brand', 'cartLine']);
|
|
188
188
|
/** A record only one element type's rows supply, which is not a dataset repeater. */
|
|
189
189
|
const ROW_SUPPLIER = { cartLine: 'cart-order' };
|
|
190
|
+
/**
|
|
191
|
+
* The product keys a cart line fills (scope.CartLineContext). Only cart-order
|
|
192
|
+
* paints its row with one (cart-order/html.go: kids[0] + PlaceholderCartLine),
|
|
193
|
+
* and the row drives just these plus the stepper (rowDirectiveFor) — any other
|
|
194
|
+
* product.* there renders the same empty value on every line.
|
|
195
|
+
*/
|
|
196
|
+
const CART_LINE_KEYS = new Set(['product.title', 'product.image', 'product.price', 'product.priceCents']);
|
|
190
197
|
/** Does this node sit inside an element of `type`? */
|
|
191
198
|
function insideType(d, id, type) {
|
|
192
199
|
for (let x = d.nodes[id]?.data.parent; x && d.nodes[x]; x = d.nodes[x].data.parent) {
|
|
@@ -605,19 +612,32 @@ opts = {}) {
|
|
|
605
612
|
// Overlays are skipped: one drawer serves every page type.
|
|
606
613
|
if (opts.pageType !== undefined && !inRepeater.get(id) && !inOverlay.has(id)) {
|
|
607
614
|
const entities = PAGE_ENTITIES[opts.pageType] ?? [];
|
|
608
|
-
const
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
615
|
+
const sources = (n.bindings ?? []).map((b) => String(b?.source ?? ''));
|
|
616
|
+
// A CART LINE FILLS SOME PRODUCT KEYS: `scope.CartLineContext` writes
|
|
617
|
+
// product.title/image/price/priceCents per line rather than a cartLine.*
|
|
618
|
+
// twin. A node the line drives (one of those, or the row's own stepper)
|
|
619
|
+
// is supplied; its seeded extras (compareAtPrice, product.id) render
|
|
620
|
+
// empty in a line, which is what the platform's own drawer seed ships.
|
|
621
|
+
const inLine = insideType(d, id, 'cart-item') && insideType(d, id, 'cart-order');
|
|
622
|
+
const lineDriven = inLine && (type === 'quantity-dataset' || sources.some((s) => CART_LINE_KEYS.has(s)));
|
|
623
|
+
const missing = sources
|
|
624
|
+
.map((s) => s.split('.')[0])
|
|
625
|
+
.find((e) => RECORD_ENTITIES.has(e) &&
|
|
626
|
+
!entities.includes(e) &&
|
|
627
|
+
!(e === 'product' && lineDriven) &&
|
|
628
|
+
!(ROW_SUPPLIER[e] && insideType(d, id, ROW_SUPPLIER[e])));
|
|
629
|
+
if (missing && !pinnedAbove(d, id)) {
|
|
613
630
|
out.push({
|
|
614
631
|
code: 'no_data_context',
|
|
615
632
|
nodeId: id,
|
|
616
633
|
type,
|
|
617
634
|
problem: (ROW_SUPPLIER[missing]
|
|
618
635
|
? `Bound to a ${missing} field, but it sits outside any ${ROW_SUPPLIER[missing]} — only its line rows supply one, so it renders its placeholder on the published page.`
|
|
619
|
-
:
|
|
620
|
-
'
|
|
636
|
+
: missing === 'product' && inLine
|
|
637
|
+
? 'Bound to a product field a cart line does not fill — a line supplies only ' +
|
|
638
|
+
`${[...CART_LINE_KEYS].join(', ')}, so it renders the same empty value on every line.`
|
|
639
|
+
: `Bound to a ${missing} record, but it sits in no repeater and a "${opts.pageType}" ` +
|
|
640
|
+
'page supplies none — it renders its placeholder on the published page.'),
|
|
621
641
|
key: missing,
|
|
622
642
|
fix: fill('no_data_context', { id, key: missing }),
|
|
623
643
|
});
|
|
@@ -5,6 +5,7 @@ import { fill } from './findings.js';
|
|
|
5
5
|
import { collectsValue, formFieldFindings, formFields, nameFromLabel } from './formdoc.js';
|
|
6
6
|
import { ICON_KEYS } from '../../catalog/icons.generated.js';
|
|
7
7
|
import { TRANSLATABLE_SPECIALS } from '../../catalog/translations.generated.js';
|
|
8
|
+
import { INLINE_RICH } from '../../catalog/richtext.generated.js';
|
|
8
9
|
import { iconNote } from './icons.js';
|
|
9
10
|
import { animationNote, deadKeyNote, preconditionNotes, unknownValueNote, unknownWriteNote, unsupportedSettingNote, } from './vocabulary.js';
|
|
10
11
|
/**
|
|
@@ -117,6 +118,53 @@ export function bindableFields(type) {
|
|
|
117
118
|
}
|
|
118
119
|
/** A tag a writer means as formatting, not a stray `<` in copy ("Giá < 100k"). */
|
|
119
120
|
const MARKUP = /<\/?(?:b|strong|i|em|u|s|span|br|a|p|div|small|mark|sup|sub|h[1-6])(?:\s[^>]*)?\/?>/i;
|
|
121
|
+
/**
|
|
122
|
+
* What in a gated rich special `sanitize.IsInlineRepresentable` refuses: a tag
|
|
123
|
+
* outside the editor schema's inline vocabulary, or an attribute outside the
|
|
124
|
+
* global/per-tag allowlists, an href whose scheme can run script, or a
|
|
125
|
+
* comment/doctype. Any one and `GateInlineRichSpecials` deletes the WHOLE value.
|
|
126
|
+
* Held to the platform's shared fixture by test/storefront-defects-1028.
|
|
127
|
+
*/
|
|
128
|
+
function richOffenders(v) {
|
|
129
|
+
const out = new Set();
|
|
130
|
+
const tags = INLINE_RICH.tags;
|
|
131
|
+
const globalAttrs = INLINE_RICH.globalAttrs;
|
|
132
|
+
const tagAttrs = INLINE_RICH.tagAttrs;
|
|
133
|
+
if (/<[!?]/.test(v))
|
|
134
|
+
out.add('<!-- -->');
|
|
135
|
+
for (const m of v.matchAll(/<\/?([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^"'>])*)>/g)) {
|
|
136
|
+
const tag = m[1].toLowerCase();
|
|
137
|
+
if (!tags.includes(tag)) {
|
|
138
|
+
out.add(`<${tag}>`);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
for (const a of m[2].matchAll(/([^\s=/>"']+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)) {
|
|
142
|
+
const name = a[1].toLowerCase();
|
|
143
|
+
const val = a[2] ?? a[3] ?? a[4] ?? '';
|
|
144
|
+
if (!globalAttrs.includes(name) && !tagAttrs[tag]?.includes(name))
|
|
145
|
+
out.add(`<${tag} ${name}>`);
|
|
146
|
+
else if (name === 'href' && !safeURL(val))
|
|
147
|
+
out.add(`<${tag} href="${val.split(':')[0].trim()}:…">`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return [...out];
|
|
151
|
+
}
|
|
152
|
+
/** server/pkg/sanitize safeURL: relative, http(s), mailto, tel, or data:image/. */
|
|
153
|
+
function safeURL(raw) {
|
|
154
|
+
// The Go tokenizer unescapes attribute values first; an encoded colon is the
|
|
155
|
+
// one entity that changes the verdict.
|
|
156
|
+
const t = raw.replace(/&(?:colon|#0*58|#x0*3a);?/gi, ':').trim();
|
|
157
|
+
const colon = t.indexOf(':');
|
|
158
|
+
if (colon < 0)
|
|
159
|
+
return true;
|
|
160
|
+
const i = t.search(/[/?#]/);
|
|
161
|
+
if (i >= 0 && i < colon)
|
|
162
|
+
return true;
|
|
163
|
+
const scheme = t.slice(0, colon).toLowerCase();
|
|
164
|
+
if (['http', 'https', 'mailto', 'tel'].includes(scheme))
|
|
165
|
+
return true;
|
|
166
|
+
return scheme === 'data' && t.toLowerCase().startsWith('data:image/');
|
|
167
|
+
}
|
|
120
168
|
/**
|
|
121
169
|
* Check one write. `specials` is the node's specials AS THEY WILL BE after the
|
|
122
170
|
* write, for the precondition question (a pair is legal or not together).
|
|
@@ -166,6 +214,17 @@ export function writeCheck(type, namespace, keys, opts = {}) {
|
|
|
166
214
|
if (namespace === 'specials' && typeof v === 'string' && MARKUP.test(v) && TRANSLATABLE_SPECIALS[type]?.includes(`${k}Html`)) {
|
|
167
215
|
push(`text-markup:${type}.${k}`, 'text_markup', k, `specials.${k} holds HTML tags, and ${type} renders it ESCAPED — the tags show as literal text on the page.`, `Write the markup to specials.${k}Html (the renderer prefers it) and keep a plain specials.${k} without tags beside it.`);
|
|
168
216
|
}
|
|
217
|
+
// A RICH SPECIAL THE RENDER GATE DROPS WHOLE (scope.GateInlineRichSpecials):
|
|
218
|
+
// one block tag and the node shows its escaped plain text — measured live
|
|
219
|
+
// with <p> in textHtml, every bit of formatting gone and no error anywhere.
|
|
220
|
+
const rich = INLINE_RICH.specials;
|
|
221
|
+
const bad = namespace === 'specials' && typeof v === 'string' && rich.includes(k) ? richOffenders(v) : [];
|
|
222
|
+
if (bad.length) {
|
|
223
|
+
push(`rich-dropped:${type}.${k}:${bad.join(',')}`, 'rich_dropped', k, `specials.${k} holds ${bad.join(', ')}, which the editor's inline rich-text schema cannot produce — so the ` +
|
|
224
|
+
`platform DROPS the whole value at render and shows the escaped plain specials.${k.replace(/Html$/, '')} instead, with no error.`, `Keep to ${INLINE_RICH.tags.map((t) => `<${t}>`).join(' ')}; break a paragraph with <br> (or <br><br>), ` +
|
|
225
|
+
'never <p>/<div>, and put a separate block in its own node. A link goes to http(s), mailto, tel or a ' +
|
|
226
|
+
'relative path; no comments.');
|
|
227
|
+
}
|
|
169
228
|
if (namespace === 'specials') {
|
|
170
229
|
const un = unsupportedSettingNote(type, k, v);
|
|
171
230
|
if (un)
|
package/dist/tools/page.js
CHANGED
|
@@ -1468,17 +1468,20 @@ export function registerPageTools(server, ctx) {
|
|
|
1468
1468
|
// right, so neither sb_review nor sb_look can see the gap — the moment
|
|
1469
1469
|
// the element is added is the only cheap place to say it. In the dry run
|
|
1470
1470
|
// too, so the caller is not told after committing.
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1471
|
+
// Each node with its PARENT's type, so a hint about placement stays silent
|
|
1472
|
+
// when the placement is right (accordion-content under an accordion).
|
|
1473
|
+
const placed = [];
|
|
1474
|
+
const walkSpec = (n, parent) => {
|
|
1475
|
+
placed.push({ type: n.type, parent });
|
|
1474
1476
|
for (const c of n.children ?? [])
|
|
1475
|
-
walkSpec(c);
|
|
1477
|
+
walkSpec(c, n.type);
|
|
1476
1478
|
};
|
|
1477
|
-
walkSpec(spec);
|
|
1479
|
+
walkSpec(spec, d.doc.nodes[parent_id]?.data.type);
|
|
1480
|
+
const types = placed.map((p) => p.type);
|
|
1478
1481
|
// A DRY RUN PEEKS: it must show what the real write will show, and the
|
|
1479
1482
|
// real write must still have it to show.
|
|
1480
1483
|
const say = noticeFor(ctx, dry_run);
|
|
1481
|
-
const inert = inertHintsFor(
|
|
1484
|
+
const inert = inertHintsFor(placed)
|
|
1482
1485
|
.map((h) => say(`inert:${h.type}`, h.note))
|
|
1483
1486
|
.filter((n) => !!n)
|
|
1484
1487
|
.join(' ');
|
|
@@ -1499,8 +1502,11 @@ export function registerPageTools(server, ctx) {
|
|
|
1499
1502
|
walkMoved(c);
|
|
1500
1503
|
};
|
|
1501
1504
|
walkMoved(spec);
|
|
1502
|
-
|
|
1503
|
-
const
|
|
1505
|
+
// Still once per KEY per process, but ONE explanation listing the new keys.
|
|
1506
|
+
const fresh = [...movedKeys].filter(([k]) => say(`base-only:${k}`, k));
|
|
1507
|
+
const base_only = fresh.length
|
|
1508
|
+
? { base_only: baseOnlyNote(fresh.map(([k]) => k), [...new Set(fresh.map(([, bp]) => bp))].join('", "')) }
|
|
1509
|
+
: {};
|
|
1504
1510
|
// A FILTER'S ROWS ARE WHAT IT RENDERS, and the editor writes them on save
|
|
1505
1511
|
// from the facet read — so a filter added here was an empty box. Gated on
|
|
1506
1512
|
// the spec naming a filter type, so no other add pays for the preview or
|
|
@@ -1641,10 +1647,9 @@ export function registerPageTools(server, ctx) {
|
|
|
1641
1647
|
for (const k of baseOnlyKeys(d, e.id, e.keys, e))
|
|
1642
1648
|
movedToBase.add(k);
|
|
1643
1649
|
}
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
.join(' ');
|
|
1650
|
+
// Spent per key, said ONCE: three keys used to carry the paragraph three times.
|
|
1651
|
+
const freshBase = [...movedToBase].filter((k) => say(`base-only:${k}`, k));
|
|
1652
|
+
const baseNote = freshBase.length ? baseOnlyNote(freshBase, batch[0].breakpoint ?? 'desktop') : '';
|
|
1648
1653
|
// A LITERAL OVER A PRESET DETACHES THE NODE FROM THE THEME, permanently.
|
|
1649
1654
|
// The node's own slot outranks its preset, so this is how one button
|
|
1650
1655
|
// differs from the rest — an ordinary, correct thing to do. What is not
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sbuilder-mcp",
|
|
3
|
-
"version": "0.98.
|
|
3
|
+
"version": "0.98.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",
|