stitch2 0.9.0 → 0.9.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 +11 -0
  2. package/package.json +1 -1
package/dist/audit.js CHANGED
@@ -149,6 +149,17 @@ export async function audit(opts) {
149
149
  if (hit)
150
150
  push('error', 'fixed-overlap', b, `Overlaps another fixed bar (“${text(a).slice(0, 30)}”): move one clear of the other`);
151
151
  }
152
+ // 3c. A fixed bar shows all of itself: a row of it pushed past the bottom (or top) of the screen is unreachable.
153
+ for (const bar of fixedBars)
154
+ for (const e of [bar, ...bar.querySelectorAll('*')]) {
155
+ if (!shown(e) || inSvg(e) || !(ownText(e) || e.matches('svg, img, button, a, input')))
156
+ continue;
157
+ const r = e.getBoundingClientRect();
158
+ if (r.bottom > window.innerHeight + 1 || r.top < -1) {
159
+ push('error', 'overflow', e, 'Part of a fixed bar is cut off by the screen edge: it lays out on more rows than the bar shows');
160
+ break;
161
+ }
162
+ }
152
163
  await covered('bottom');
153
164
  await covered('top');
154
165
  window.scrollTo(0, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitch2",
3
- "version": "0.9.0",
3
+ "version": "0.9.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",