@ashley-shrok/viewmodel-shell 3.0.0 → 3.0.2

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/dist/browser.js CHANGED
@@ -116,7 +116,12 @@ export class BrowserAdapter {
116
116
  el.scrollLeft = left;
117
117
  }
118
118
  });
119
- window.scrollTo(winScrollX, winScrollY);
119
+ // Only restore window scroll when the page was actually scrolled — restoring
120
+ // to (0,0) is a no-op, and skipping it avoids jsdom's noisy "Not implemented:
121
+ // window.scrollTo" virtual-console log in unit tests (jsdom never scrolls, so
122
+ // the captured offsets are 0). Mirrors the `el.scrollTop !== 0` guard above.
123
+ if (winScrollX !== 0 || winScrollY !== 0)
124
+ window.scrollTo(winScrollX, winScrollY);
120
125
  // 1.2.0 — restore collapsible-section open state after node() rebuild +
121
126
  // after focus/scroll restore. Keys absent from the new tree are
122
127
  // naturally dropped (querySelectorAll just doesn't find them); new
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ashley-shrok/viewmodel-shell",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "A server-driven UI framework where the wire format is structured enough that agents can build full-stack apps without ever opening a browser and all UI tests are pure unit tests with no browser runtime. Server returns a JSON tree of typed nodes; a thin TypeScript adapter renders it to DOM. Backend-agnostic — a .NET reference backend ships with the repo, but any language can produce the JSON contract.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -61,6 +61,13 @@
61
61
  --vms-text-lg: 1.125rem;
62
62
  --vms-text-xl: 1.5rem;
63
63
  --vms-text-2xl: 2.25rem;
64
+ /* Shared line-box height for the default-size form controls + buttons. An
65
+ ABSOLUTE value (not a font-relative ratio) so an input (--vms-text-md) and a
66
+ button (--vms-text-base) — which intentionally differ in font size — compute
67
+ to the SAME height when their padding + border match, and therefore line up
68
+ pixel-for-pixel in a filter/toolbar row. Size variants (.vms-button--sm/lg)
69
+ and compact icon buttons set their own line-height. */
70
+ --vms-control-line: 1.5rem;
64
71
  /* Page shell (D-12) — additive override seam (issue #13); host/theme-retunable
65
72
  via a single :root{} override imported after the theme. The two width
66
73
  ratchets — --vms-page-max-wide (1440px default) and --vms-page-max-full
@@ -434,6 +441,7 @@ body {
434
441
  color: var(--vms-text);
435
442
  font-family: var(--vms-font-body);
436
443
  font-size: var(--vms-text-md);
444
+ line-height: var(--vms-control-line);
437
445
  padding: var(--vms-space-sm) var(--vms-space-md);
438
446
  outline: none;
439
447
  transition: border-color var(--vms-t), box-shadow var(--vms-t);
@@ -526,6 +534,7 @@ select.vms-field__input { cursor: pointer; padding-right: var(--vms-space-xl);
526
534
  cursor: pointer;
527
535
  font-family: var(--vms-font-body);
528
536
  font-size: var(--vms-text-base);
537
+ line-height: var(--vms-control-line);
529
538
  padding: var(--vms-space-sm) var(--vms-space-md);
530
539
  align-self: flex-start;
531
540
  transition: background var(--vms-t), border-color var(--vms-t), transform var(--vms-t);
@@ -555,9 +564,11 @@ select.vms-field__input { cursor: pointer; padding-right: var(--vms-space-xl);
555
564
  }
556
565
  .vms-button--secondary:hover { background: var(--vms-accent-glow); }
557
566
 
558
- /* size — the ONLY axis that touches box metrics (md = base, no class). */
559
- .vms-button--sm { padding: var(--vms-space-2xs) var(--vms-space-sm); font-size: var(--vms-text-sm); }
560
- .vms-button--lg { padding: var(--vms-space-sm) var(--vms-space-lg); font-size: var(--vms-text-lg); }
567
+ /* size — the ONLY axis that touches box metrics (md = base, no class). Each size
568
+ sets its own line-box so sm stays compact and lg reads larger (the default-size
569
+ control line lives on the base rule + --vms-control-line). */
570
+ .vms-button--sm { padding: var(--vms-space-2xs) var(--vms-space-sm); font-size: var(--vms-text-sm); line-height: 1.125rem; }
571
+ .vms-button--lg { padding: var(--vms-space-sm) var(--vms-space-lg); font-size: var(--vms-text-lg); line-height: 1.75rem; }
561
572
 
562
573
  /* ── Pending state (0.8.0 / issue #11) ──
563
574
  Applied by BrowserAdapter when a ButtonNode with `pendingLabel` is clicked.
@@ -578,6 +589,9 @@ select.vms-field__input { cursor: pointer; padding-right: var(--vms-space-xl);
578
589
  color: var(--vms-text-muted);
579
590
  opacity: 0;
580
591
  padding: var(--vms-space-2xs) var(--vms-space-xs);
592
+ /* compact inline icon affordance — opt out of the standardized control line so
593
+ the row's delete-X stays small, not control-height. */
594
+ line-height: 1.25rem;
581
595
  border-radius: var(--vms-radius-sm);
582
596
  transition: opacity var(--vms-t), color var(--vms-t), background var(--vms-t);
583
597
  }