domotion-svg 0.13.0 → 0.13.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.
@@ -514,9 +514,15 @@ function renderTypingOverlay(overlay, frameIdx, frameStart, frameEnd, totalDurat
514
514
  cumChars += line.length;
515
515
  parts.push(` <defs><clipPath id="${clipId}"><rect class="${id}-rev${li}" x="${overlay.x}" y="${lineY - fontSize}" width="0" height="${textHeight}" /></clipPath></defs>`);
516
516
  parts.push(` <text class="${id}-text" x="${overlay.x}" y="${lineY}" fill="${color}" font-size="${fontSize}" font-family="'SF Mono', Menlo, Monaco, monospace" clip-path="url(#${clipId})">${escapeHtml(line)}</text>`);
517
+ // DM-1204: the reveal clip MUST sweep linearly so its right edge tracks the
518
+ // caret (whose position track is `linear`). Without an explicit timing
519
+ // function the width animation defaults to CSS `ease`, which races ~80%
520
+ // through the sweep at the time-midpoint while the linear caret is only at
521
+ // 50% — that desync read as the caret lagging ~10–20 chars behind the
522
+ // revealed text mid-type, even though the endpoints (parked state) matched.
517
523
  cssRules.push(`
518
524
  @keyframes ${id}-rev${li} { 0%, ${lineStartPct} { width: 0; } ${lineEndPct} { width: ${lineWidth}px; } ${holdEndPct} { width: ${lineWidth}px; } ${disappearPct}, 100% { width: 0; } }
519
- .${id}-rev${li} { animation: ${id}-rev${li} ${totalSec.toFixed(2)}s infinite; }`);
525
+ .${id}-rev${li} { animation: ${id}-rev${li} ${totalSec.toFixed(2)}s linear infinite; }`);
520
526
  });
521
527
  // Whole-overlay visibility — shared by every line's <text>.
522
528
  const typeStartPct = pct(typeStartMs, totalDuration);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domotion-svg",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "DOM-to-animated-SVG renderer. Captures HTML/CSS via Playwright Chromium and converts it to self-contained SVG with CSS animations — pixel-faithful demos that scale crisply and load lazily.",
5
5
  "license": "MIT",
6
6
  "author": "Brian Westphal",