webcake-landing-mcp 1.16.0 → 1.16.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.
@@ -1,4 +1,11 @@
1
1
  [
2
+ {
3
+ "v": "1.16.1",
4
+ "d": "25/11/2026",
5
+ "type": "Fixed",
6
+ "en": "validate_page's text height estimate now matches the renderer's actual line-height: 1.5 default (previously assumed 1.4), so a text-block with no…",
7
+ "vi": "Công thức ước lượng chiều cao chữ của validate_page nay khớp với giá trị line-height: 1.5 thật của renderer (trước đó giả định 1.4), nên một…"
8
+ },
2
9
  {
3
10
  "v": "1.16.0",
4
11
  "d": "25/11/2026",
@@ -33,12 +40,5 @@
33
40
  "type": "Fixed",
34
41
  "en": "update_page/patch_page no longer compute a sections-only diff against a page that has two elements sharing the same id (something the Webcake editor…",
35
42
  "vi": "update_page/patch_page nay không còn tính diff theo từng section với một trang có hai element dùng chung id (điều mà chính editor Webcake vẫn cho…"
36
- },
37
- {
38
- "v": "1.13.5",
39
- "d": "20/11/2026",
40
- "type": "Fixed",
41
- "en": "update_page/patch_page no longer block on a click event the Webcake editor itself saved with action:null (an event added via the editor's EventTrait…",
42
- "vi": "update_page/patch_page không còn bị chặn bởi một event click mà chính editor Webcake đã lưu với action:null (một event được thêm qua picker…"
43
43
  }
44
44
  ]
@@ -53,8 +53,8 @@ CENTERING & ALIGNMENT (do the math — do NOT eyeball \`left\`; off-center layou
53
53
 
54
54
  TEXT HEIGHT MATH (the #2 layout defect — wrapped text overlapping the element below; do the math, don't eyeball)
55
55
  - On the live page a text-block's height is AUTO: text that wraps to more lines than you assumed spills DOWN and overlaps whatever you placed below it (classic symptom: a 2-line card title overlapping the card body, or a name line clipping the card's bottom edge).
56
- - Estimate BEFORE placing the next element: lines ≈ ceil(chars × fontSize × 0.55 / width) — count the longest run between explicit <br>s; bold/heading glyphs are wider (use 0.6), and ALL-CAPS/uppercase headings are wider still (use 0.7 — UPPERCASE wraps to more lines than it looks). Needed height ≈ lines × fontSize × 1.4. validate_page re-checks this with REAL per-character font metrics (fontWeight/letterSpacing/textTransform aware), so an under-sized box WILL be flagged — size it right the first time.
57
- - BADGE/PILL ("background hugs a label" — do the math, the #1 misaligned-detail defect): build it as TWO elements — a rounded rectangle (the pill) + a single-line text-block layered on top. NEVER give the text-block itself a styles.background to fake the pill: on text-blocks background is the GRADIENT-TEXT-FILL mode (the renderer adds -webkit-text-fill-color:transparent), so the glyphs go invisible instead of gaining a backdrop. Size the pill to the text: pill.width ≈ textWidth + 32 (textWidth ≈ chars × fontSize × 0.6; caps 0.7) and pill.height ≈ fontSize×1.4 + 12–16. Then center the LINE BOX, not your declared height — the renderer draws text-blocks height:AUTO from \`top\` (declared height is IGNORED), so: text.top = pill.top + (pill.height − fontSize×1.4)/2, text box same center-x as the pill with textAlign "center". validate_page re-checks both axes with real font metrics and reports the exact corrected top/left when off.
56
+ - Estimate BEFORE placing the next element: lines ≈ ceil(chars × fontSize × 0.55 / width) — count the longest run between explicit <br>s; bold/heading glyphs are wider (use 0.6), and ALL-CAPS/uppercase headings are wider still (use 0.7 — UPPERCASE wraps to more lines than it looks). Needed height ≈ lines × fontSize × lineHeight (the renderer default is 1.5 — html{line-height:1.5} — when styles.lineHeight is unset). validate_page re-checks this with REAL per-character font metrics (fontWeight/letterSpacing/textTransform aware), so an under-sized box WILL be flagged — size it right the first time.
57
+ - BADGE/PILL ("background hugs a label" — do the math, the #1 misaligned-detail defect): build it as TWO elements — a rounded rectangle (the pill) + a single-line text-block layered on top. NEVER give the text-block itself a styles.background to fake the pill: on text-blocks background is the GRADIENT-TEXT-FILL mode (the renderer adds -webkit-text-fill-color:transparent), so the glyphs go invisible instead of gaining a backdrop. Size the pill to the text: pill.width ≈ textWidth + 32 (textWidth ≈ chars × fontSize × 0.6; caps 0.7) and pill.height ≈ fontSize×1.5 + 12–16. Then center the LINE BOX, not your declared height — the renderer draws text-blocks height:AUTO from \`top\` (declared height is IGNORED), so: text.top = pill.top + (pill.height − fontSize×1.5)/2, text box same center-x as the pill with textAlign "center". validate_page re-checks both axes with real font metrics and reports the exact corrected top/left when off.
58
58
  - Set the text-block's height to that estimate, and place the NEXT element's top ≥ this element's top + height + gap (≥8px).
59
59
  - EQUAL CARDS: if ANY card's title wraps to 2 lines, give EVERY card in the row the 2-line title height so all bodies start at the same top — never let one card's body ride up under its title.
60
60
  - COMPOSED VALUES: render "2.400+" / "94%" / a number with its suffix as ONE string in ONE text-block — never split the number and its suffix/icon into separately positioned elements (they drift apart and the suffix orphans onto its own line).
@@ -16,7 +16,7 @@ const METRICS = JSON.parse(readFileSync(new URL("./font-metrics.json", import.me
16
16
  const CHAR_INDEX = new Map();
17
17
  [...METRICS.chars].forEach((ch, i) => CHAR_INDEX.set(ch, i));
18
18
  const DEFAULT_FAMILY = "roboto";
19
- const DEFAULT_LINE_HEIGHT = 1.4; // matches the renderer default the guide documents
19
+ const DEFAULT_LINE_HEIGHT = 1.5; // the renderer's html{line-height:1.5} (landing_page_build app_css), inherited by every text-block with no styles.lineHeight — measured in Chrome
20
20
  const EMOJI_RE = /\p{Extended_Pictographic}/u;
21
21
  /** First family of a CSS font-family stack: `'Be Vietnam Pro', sans-serif` → `be vietnam pro`. */
22
22
  function normalizeFamily(stack) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webcake-landing-mcp",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "description": "MCP server exposing Webcake landing-page element schemas + AI usage hints, and persisting LLM-generated page sources to a Webcake backend.",
5
5
  "mcpName": "io.github.vuluu2k/webcake-landing-mcp",
6
6
  "type": "module",