reifyui 0.10.0 → 0.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reifyui",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "The open-source rendering & interaction layer for agentic applications. Stream and render any agent's output as polished, application-native UI \u2014 model-agnostic, framework-agnostic, design-system-native. The foundation for building generative-UI and agent products.",
5
5
  "keywords": [
6
6
  "react",
package/src/index.d.ts CHANGED
@@ -679,8 +679,12 @@ export interface TimelineClip {
679
679
  label?: string;
680
680
  /** Tooltip. Falls back to `label`. */
681
681
  title?: string;
682
- /** Artwork filling the block — a poster frame, a waveform. */
682
+ /** Artwork filling the block, tiled at a fixed tile size — a poster frame, a waveform. */
683
683
  poster?: string;
684
+ /** A playable file. Used only when there is no `poster`: its FIRST FRAME is shown, which is a
685
+ * real frame of the real clip rather than a stand-in. Loaded with preload="metadata", so the
686
+ * whole file is not fetched to paint one frame. */
687
+ video?: string;
684
688
  /** Shown centred when there is no poster. */
685
689
  glyph?: ReactNode;
686
690
  /** Small pill at the top left, e.g. an index. */
@@ -551,12 +551,21 @@ function Clip({ l, track, pps, selected, drag, onSelect, beginGesture, onTrim, o
551
551
  onPointerDown={startMove}
552
552
  onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onSelect(); } }}
553
553
  >
554
- {clip.poster
555
- ? <span className="rui-tl-strip" style={{
556
- backgroundImage: `url("${String(clip.poster).replace(/"/g, '\\"')}")`,
557
- backgroundSize: `${tileW}px 100%`,
558
- }} />
559
- : <span className="rui-tl-blank" aria-hidden="true">{clip.glyph}</span>}
554
+ {/* A poster tiles as a strip. With no poster but a playable file, the FILE's own first
555
+ frame is shown — `preload="metadata"` paints it without fetching the whole clip, and it
556
+ is a real frame of the real thing rather than a stand-in. Only when there is neither
557
+ does the block fall back to a glyph, which claims nothing. */}
558
+ {clip.poster ? (
559
+ <span className="rui-tl-strip" style={{
560
+ backgroundImage: `url("${String(clip.poster).replace(/"/g, '\\"')}")`,
561
+ backgroundSize: `${tileW}px 100%`,
562
+ }} />
563
+ ) : clip.video ? (
564
+ <video className="rui-tl-frame" src={clip.video} preload="metadata" muted playsInline
565
+ tabIndex={-1} aria-hidden="true" />
566
+ ) : (
567
+ <span className="rui-tl-blank" aria-hidden="true">{clip.glyph}</span>
568
+ )}
560
569
 
561
570
  {clip.badge && <span className="rui-tl-badge">{clip.badge}</span>}
562
571
  {known && width > 46 && <span className="rui-tl-dur">{durationLabel(clip.duration)}</span>}
@@ -73,6 +73,12 @@
73
73
  .rui-tl-strip {
74
74
  position: absolute; inset: 0; background-repeat: repeat-x; background-position: left center;
75
75
  }
76
+ /* The file's own first frame, when there is no poster. Pointer events off: the clip is the
77
+ target, and a <video> would otherwise swallow the drag that trims it. */
78
+ .rui-tl-frame {
79
+ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
80
+ pointer-events: none; background: #0B0D12;
81
+ }
76
82
  .rui-tl-blank {
77
83
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
78
84
  color: var(--uic-mute-2, #8E9199);