stitch2 0.12.0 → 0.12.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.
Files changed (2) hide show
  1. package/dist/audit.js +9 -0
  2. package/package.json +1 -1
package/dist/audit.js CHANGED
@@ -80,6 +80,15 @@ export async function audit(opts) {
80
80
  for (const el of all) {
81
81
  if (!isLabel(el) || text(el).length > 40 || el.querySelector('p, div, li, ul, br'))
82
82
  continue;
83
+ // A control whose text sits in two or more elements (a list row's title and its meta line) is a composite
84
+ // control, not a label: its lines are laid out on purpose.
85
+ const holders = new Set();
86
+ const textWalker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT);
87
+ for (let n = textWalker.nextNode(); n; n = textWalker.nextNode())
88
+ if (n.textContent.trim() && n.parentElement)
89
+ holders.add(n.parentElement);
90
+ if (holders.size > 1)
91
+ continue;
83
92
  // A wrap is one text node breaking across lines; an icon above its label is layout, not a wrap.
84
93
  const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT);
85
94
  for (let n = walker.nextNode(); n; n = walker.nextNode()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitch2",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "A design canvas, layout and type checks, component consistency and screen versioning for agent-built UI, on Google's DESIGN.md format.",
5
5
  "license": "MIT",
6
6
  "author": "ifokeev",